/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="options"> Create TrustProductsChannelEndpointAssignment parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of TrustProductsChannelEndpointAssignment </returns> public static TrustProductsChannelEndpointAssignmentResource Create(CreateTrustProductsChannelEndpointAssignmentOptions 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="pathTrustProductSid"> 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 TrustProductsChannelEndpointAssignment </returns> public static async System.Threading.Tasks.Task <TrustProductsChannelEndpointAssignmentResource> CreateAsync(string pathTrustProductSid, string channelEndpointType, string channelEndpointSid, ITwilioRestClient client = null) { var options = new CreateTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid, channelEndpointType, channelEndpointSid); return(await CreateAsync(options, client)); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="pathTrustProductSid"> 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 TrustProductsChannelEndpointAssignment </returns> public static TrustProductsChannelEndpointAssignmentResource Create(string pathTrustProductSid, string channelEndpointType, string channelEndpointSid, ITwilioRestClient client = null) { var options = new CreateTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid, channelEndpointType, channelEndpointSid); return(Create(options, client)); }
private static Request BuildCreateRequest(CreateTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Trusthub, "/v1/TrustProducts/" + options.PathTrustProductSid + "/ChannelEndpointAssignments", postParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Create a new Assigned Item. /// </summary> /// <param name="options"> Create TrustProductsChannelEndpointAssignment parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of TrustProductsChannelEndpointAssignment </returns> public static async System.Threading.Tasks.Task <TrustProductsChannelEndpointAssignmentResource> CreateAsync(CreateTrustProductsChannelEndpointAssignmentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }