/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="options"> Create CustomerProfilesChannelEndpointAssignment parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of CustomerProfilesChannelEndpointAssignment </returns> public static CustomerProfilesChannelEndpointAssignmentResource Create(CreateCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="pathCustomerProfileSid"> The unique string that identifies the resource. </param> /// <param name="channelEndpointType"> The type of channel endpoint </param> /// <param name="channelEndpointSid"> The sid of an channel endpoint </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment </returns> public static async System.Threading.Tasks.Task <CustomerProfilesChannelEndpointAssignmentResource> CreateAsync(string pathCustomerProfileSid, string channelEndpointType, string channelEndpointSid, ITwilioRestClient client = null) { var options = new CreateCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid, channelEndpointType, channelEndpointSid); return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="pathCustomerProfileSid"> The unique string that identifies the resource. </param> /// <param name="channelEndpointType"> The type of channel endpoint </param> /// <param name="channelEndpointSid"> The sid of an channel endpoint </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of CustomerProfilesChannelEndpointAssignment </returns> public static CustomerProfilesChannelEndpointAssignmentResource Create(string pathCustomerProfileSid, string channelEndpointType, string channelEndpointSid, ITwilioRestClient client = null) { var options = new CreateCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid, channelEndpointType, channelEndpointSid); return(Create(options, client)); }
private static Request BuildCreateRequest(CreateCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Trusthub, "/v1/CustomerProfiles/" + options.PathCustomerProfileSid + "/ChannelEndpointAssignments", postParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="options"> Create CustomerProfilesChannelEndpointAssignment parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment </returns> public static async System.Threading.Tasks.Task <CustomerProfilesChannelEndpointAssignmentResource> CreateAsync(CreateCustomerProfilesChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }