// CreateContact adds a contact target to an existing user.
769966
func (cs *UserService) CreateContact(userID int, contact Contact) (*CreateUserContactResponse, error) {
	if err := contact.ValidContact(); err != nil {
		return nil, err
	}

	req, err := cs.client.NewRequest("POST", "/users/"+strconv.Itoa(userID), contact.PostContactParams())
	if err != nil {
		return nil, err
	}

	m := &createUserContactJSONResponse{}
	_, err = cs.client.Do(req, m)
	if err != nil {
		return nil, err
	}
	return m.Contact, err
}
1071521
func (u *UsersClient) Create(ctx context.Context, userObj *envelope.User,
	signup apitypes.Signup) (envelope.UserInf, error) {

	v := &url.Values{}
	if signup.InviteCode != "" {
		v.Set("code", signup.InviteCode)
	}
	if signup.OrgInvite && signup.OrgName != "" {
		v.Set("org", signup.OrgName)
	}
	if signup.Email != "" {
		v.Set("email", signup.Email)
	}

	e := envelope.Unsigned{}
	err := u.client.RoundTrip(ctx, "POST", "/users", v, &userObj, &e)
	if err != nil {
		return nil, err
	}

	return envelope.ConvertUser(&e)
}
114955
func (api *Client) CreateConference(data *CreateConferenceData) (string, error) {
	_, headers, err := api.makeRequest(http.MethodPost, api.concatUserPath(conferencesPath), nil, data)
	if err != nil {
		return "", err
	}
	return getIDFromLocationHeader(headers), nil
}
1069052
func (r Account_Reports_Request) GetAccountContact() (resp datatypes.Account_Contact, err error) {
	err = r.Session.DoRequest("SoftLayer_Account_Reports_Request", "getAccountContact", nil, &r.Options, &resp)
	return
}
536220
func (s *PutInvitationConfigurationInput) SetContactEmail(v string) *PutInvitationConfigurationInput {
	s.ContactEmail = &v
	return s
}
1018526
func (d *FakeNetEpDriver) CreateHostAccPort(id, a string, nw int) (string, error) {
	return "", core.Errorf("Not implemented")
}
1229802
func (s *StopContactInput) SetContactId(v string) *StopContactInput {
	s.ContactId = &v
	return s
}
225346
func (s *GetDomainDetailOutput) SetTechContact(v *ContactDetail) *GetDomainDetailOutput {
	s.TechContact = v
	return s
}
477152
func createHttpClient() *http.Client {
	tr := util.Transport(services.Config().GetString(util.ConfigfwdProxyPortURL))
	tr.MaxIdleConnsPerHost = maxIdleConnsPerHost
	client := &http.Client{
		Transport: tr,
		Timeout:   httpTimeout,
		CheckRedirect: func(req *http.Request, _ []*http.Request) error {
			req.Header.Set("Authorization", "Bearer "+services.Config().GetString(configBearerToken))
			return nil
		},
	}
	return client
}
1019341
func (s *TransferDomainInput) SetAdminContact(v *ContactDetail) *TransferDomainInput {
	s.AdminContact = v
	return s
}
710684
func Contact(dsl func()) {
	contact := new(design.ContactDefinition)
	if !dslengine.Execute(dsl, contact) {
		return
	}
	if a, ok := apiDefinition(); ok {
		a.Contact = contact
	}
}
396156
func (cli *OpsGenieClient) Contact() (*OpsGenieContactClient, error) {
	cli.makeHTTPTransportSettings()

	contactClient := new(OpsGenieContactClient)
	contactClient.SetOpsGenieClient(*cli)

	if cli.opsGenieAPIURL == "" {
		contactClient.SetOpsGenieAPIUrl(endpointURL)
	}

	return contactClient, nil
}
1210337
func (c ClaimsClient) Create(ctx context.Context, claim *envelope.Claim) (*envelope.Claim, error) {
	resp := &envelope.Claim{}
	err := c.client.RoundTrip(ctx, "POST", "/claims", nil, claim, &resp)
	return resp, err
}
1260292
func (s *GetDomainDetailOutput) SetAbuseContactEmail(v string) *GetDomainDetailOutput {
	s.AbuseContactEmail = &v
	return s
}
230355
func (c *Comm) createRemoteContext(stub *Stub, channel string) func() (*RemoteContext, error) {
	return func() (*RemoteContext, error) {
		cert, err := x509.ParseCertificate(stub.ServerTLSCert)
		if err != nil {
			pemString := string(pem.EncodeToMemory(&pem.Block{Bytes: stub.ServerTLSCert}))
			c.Logger.Errorf("Invalid DER for channel %s, endpoint %s, ID %d: %v", channel, stub.Endpoint, stub.ID, pemString)
			return nil, errors.Wrap(err, "invalid certificate DER")
		}

		c.Logger.Debug("Connecting to", stub.RemoteNode, "for channel", channel)

		conn, err := c.Connections.Connection(stub.Endpoint, stub.ServerTLSCert)
		if err != nil {
			c.Logger.Warningf("Unable to obtain connection to %d(%s) (channel %s): %v", stub.ID, stub.Endpoint, channel, err)
			return nil, err
		}

		probeConnection := func(conn *grpc.ClientConn) error {
			connState := conn.GetState()
			if connState == connectivity.Connecting {
				return errors.Errorf("connection to %d(%s) is in state %s", stub.ID, stub.Endpoint, connState)
			}
			return nil
		}

		clusterClient := orderer.NewClusterClient(conn)

		workerCountReporter := workerCountReporter{
			channel: channel,
		}

		rc := &RemoteContext{
			expiresAt:                        cert.NotAfter,
			minimumExpirationWarningInterval: c.MinimumExpirationWarningInterval,
			certExpWarningThreshold:          c.CertExpWarningThreshold,
			workerCountReporter:              workerCountReporter,
			Channel:                          channel,
			Metrics:                          c.Metrics,
			SendBuffSize:                     c.SendBufferSize,
			shutdownSignal:                   c.shutdownSignal,
			endpoint:                         stub.Endpoint,
			Logger:                           c.Logger,
			ProbeConn:                        probeConnection,
			conn:                             conn,
			Client:                           clusterClient,
		}
		return rc, nil
	}
}
599906
func (o *UplinkConnection) CreateCustomProperty(child *CustomProperty) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
915738
func (s *ContactsService) UpdateContact(accountID string, contactID int64, contactAttributes Contact) (*contactResponse, error) {
	path := versioned(contactPath(accountID, contactID))
	contactResponse := &contactResponse{}

	resp, err := s.client.patch(path, contactAttributes, contactResponse)
	if err != nil {
		return nil, err
	}

	contactResponse.HttpResponse = resp
	return contactResponse, nil
}