// CreateOIDCConnector creates SAML connector
191681
func (c *Client) CreateSAMLConnector(connector services.SAMLConnector) error {
	data, err := services.GetSAMLConnectorMarshaler().MarshalSAMLConnector(connector)
	if err != nil {
		return trace.Wrap(err)
	}
	_, err = c.PostJSON(c.Endpoint("saml", "connectors"), &createSAMLConnectorRawReq{
		Connector: data,
	})
	if err != nil {
		return trace.Wrap(err)
	}
	return nil
}
903933
func (c *Client) DeleteSAMLConnector(connectorID string) error {
	if connectorID == "" {
		return trace.BadParameter("missing connector id")
	}
	_, err := c.Delete(c.Endpoint("saml", "connectors", connectorID))
	return trace.Wrap(err)
}
1009462
func NewDeviceInformationDriver(a BLEConnector) *DeviceInformationDriver {
	n := &DeviceInformationDriver{
		name:       gobot.DefaultName("DeviceInformation"),
		connection: a,
		Eventer:    gobot.NewEventer(),
	}

	return n
}
421498
func (vrsConnection *VRSConnection) CreatePort(name string, attributes port.Attributes,
	metadata map[port.MetadataKey]string) error {

	portMetadata := make(map[string]string)

	for k, v := range metadata {
		portMetadata[string(k)] = v
	}

	nuagePortRow := ovsdb.NuagePortTableRow{
		Name:             name,
		Mac:              attributes.MAC,
		Bridge:           attributes.Bridge,
		NuageDomain:      metadata[port.MetadataKeyDomain],
		NuageNetwork:     metadata[port.MetadataKeyNetwork],
		NuageNetworkType: metadata[port.MetadataKeyNetworkType],
		NuageZone:        metadata[port.MetadataKeyZone],
		VMDomain:         attributes.Platform,
		Metadata:         portMetadata,
	}

	if err := vrsConnection.portTable.InsertRow(vrsConnection.ovsdbClient, &nuagePortRow); err != nil {
		return fmt.Errorf("Problem adding port info to VRS %v", err)
	}

	return nil
}
810087
func (s *Service) VPNConnectionCreate(ctx context.Context, spaceIdentity string, o VPNConnectionCreateOpts) (*VPNConnection, error) {
	var vpnConnection VPNConnection
	return &vpnConnection, s.Post(ctx, &vpnConnection, fmt.Sprintf("/spaces/%v/vpn-connections", spaceIdentity), o)
}
981024
func (o *Enterprise) CreateDomain(child *Domain) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
458545
func (s *IdentityService) UpsertOIDCConnector(connector services.OIDCConnector) error {
	if err := connector.Check(); err != nil {
		return trace.Wrap(err)
	}
	value, err := services.GetOIDCConnectorMarshaler().MarshalOIDCConnector(connector)
	if err != nil {
		return trace.Wrap(err)
	}
	item := backend.Item{
		Key:     backend.Key(webPrefix, connectorsPrefix, oidcPrefix, connectorsPrefix, connector.GetName()),
		Value:   value,
		Expires: connector.Expiry(),
		ID:      connector.GetResourceID(),
	}
	_, err = s.Put(context.TODO(), item)
	if err != nil {
		return trace.Wrap(err)
	}
	return nil
}
1150395
func (c *Transport) createConnection() (*Connection, error) {
	conn, err := dial(c.Version, c.hostAddr, c.tlsConfig)
	if err != nil {
		return nil, driver.WithStack(err)
	}

	// Record connection
	c.connMutex.Lock()
	c.connections = append(c.connections, conn)
	startCleanup := len(c.connections) == 1
	c.connMutex.Unlock()

	if startCleanup {
		// TODO enable cleanup
		go c.cleanup()
	}

	return conn, nil
}
331557
func (s *IdentityService) GetSAMLConnectors(withSecrets bool) ([]services.SAMLConnector, error) {
	startKey := backend.Key(webPrefix, connectorsPrefix, samlPrefix, connectorsPrefix)
	result, err := s.GetRange(context.TODO(), startKey, backend.RangeEnd(startKey), backend.NoLimit)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	connectors := make([]services.SAMLConnector, len(result.Items))
	for i, item := range result.Items {
		conn, err := services.GetSAMLConnectorMarshaler().UnmarshalSAMLConnector(
			item.Value, services.WithExpires(item.Expires))
		if err != nil {
			return nil, trace.Wrap(err)
		}
		if !withSecrets {
			keyPair := conn.GetSigningKeyPair()
			if keyPair != nil {
				keyPair.PrivateKey = ""
				conn.SetSigningKeyPair(keyPair)
			}
		}
		connectors[i] = conn
	}
	return connectors, nil
}
1205337
func (c *Client) CreateOIDCAuthRequest(req services.OIDCAuthRequest) (*services.OIDCAuthRequest, error) {
	out, err := c.PostJSON(c.Endpoint("oidc", "requests", "create"), createOIDCAuthRequestReq{
		Req: req,
	})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var response *services.OIDCAuthRequest
	if err := json.Unmarshal(out.Bytes(), &response); err != nil {
		return nil, trace.Wrap(err)
	}
	return response, nil
}
381947
func NewConnector(cfg Config, connectorMap map[string]dosa.Connector) *Connector {
	return &Connector{
		connectors: connectorMap,
		config:     cfg,
	}
}
390842
func NewConnector(svrAddr string, opts ...ClientOption) IOSession {
	sopts := &clientOptions{}
	for _, opt := range opts {
		opt(sopts)
	}
	sopts.adjust()

	return &connector{
		addr:  svrAddr,
		in:    NewByteBuf(sopts.readBufSize),
		out:   NewByteBuf(sopts.writeBufSize),
		opts:  sopts,
		attrs: make(map[string]interface{}),
	}
}
743764
func (o *NSGateway) CreateWirelessPort(child *WirelessPort) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
642057
func MustCreateTunnelConnection(name string, spec TunnelConnectionSpecV2) TunnelConnection {
	conn, err := NewTunnelConnection(name, spec)
	if err != nil {
		panic(err)
	}
	return conn
}
847267
func (o *VsgRedundantPort) CreateVLAN(child *VLAN) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
468984
func (fw *Framework) NewConnector(ctx context.Context, servers func() ([]srvcache.Server, error), name string, logger *log.Entry) (conn Connector, err error) {
	if name == "" {
		name = fw.Config.Identity
	}

	conn = &Connection{
		name:              name,
		servers:           servers,
		logger:            logger.WithField("connection", name),
		choria:            fw,
		config:            fw.Config,
		subscriptions:     make(map[string]*nats.Subscription),
		chanSubscriptions: make(map[string]*channelSubscription),
		outbox:            make(chan *nats.Msg, 1000),
	}

	err = conn.Connect(ctx)

	return conn, err
}
463127
func (r Account_Link_OpenStack) CreateOSDomain(request *datatypes.Account_Link_OpenStack_LinkRequest) (resp datatypes.Account_Link_OpenStack_DomainCreationDetails, err error) {
	params := []interface{}{
		request,
	}
	err = r.Session.DoRequest("SoftLayer_Account_Link_OpenStack", "createOSDomain", params, &r.Options, &resp)
	return
}