/// <summary> /// Add a Short Code to the Proxy Number Pool for this Service. /// </summary> /// <param name="options"> Create ShortCode parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ShortCode </returns> public static ShortCodeResource Create(CreateShortCodeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// Add a Short Code to the Proxy Number Pool for this Service. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="sid"> A string that uniquely identifies this Short Code. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ShortCode </returns> public static async System.Threading.Tasks.Task <ShortCodeResource> CreateAsync(string pathServiceSid, string sid, ITwilioRestClient client = null) { var options = new CreateShortCodeOptions(pathServiceSid, sid); return(await CreateAsync(options, client)); }
private static Request BuildCreateRequest(CreateShortCodeOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Proxy, "/v1/Services/" + options.PathServiceSid + "/ShortCodes", postParams: options.GetParams() )); }
/// <summary> /// Add a Short Code to the Proxy Number Pool for this Service. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="sid"> A string that uniquely identifies this Short Code. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ShortCode </returns> public static ShortCodeResource Create(string pathServiceSid, string sid, ITwilioRestClient client = null) { var options = new CreateShortCodeOptions(pathServiceSid, sid); return(Create(options, client)); }
/// <summary> /// Add a Short Code to the Proxy Number Pool for this Service. /// </summary> /// <param name="options"> Create ShortCode parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of ShortCode </returns> public static async System.Threading.Tasks.Task <ShortCodeResource> CreateAsync(CreateShortCodeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }