/// <summary> /// Delete a specific Short Code from a Service. /// </summary> /// <param name="options"> Delete ShortCode parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of ShortCode </returns> public static bool Delete(DeleteShortCodeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildDeleteRequest(options, client)); return(response.StatusCode == System.Net.HttpStatusCode.NoContent); }
/// <summary> /// Delete a specific Short Code. /// </summary> /// /// <param name="options"> Delete 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 <bool> DeleteAsync(DeleteShortCodeOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildDeleteRequest(options, client)); return(response.StatusCode == System.Net.HttpStatusCode.NoContent); }
/// <summary> /// Delete a specific Short Code from a Service. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSid"> 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 <bool> DeleteAsync(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteShortCodeOptions(pathServiceSid, pathSid); return(await DeleteAsync(options, client)); }
private static Request BuildDeleteRequest(DeleteShortCodeOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Proxy, "/v1/Services/" + options.PathServiceSid + "/ShortCodes/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// Delete a specific Short Code from a Service. /// </summary> /// <param name="pathServiceSid"> Service Sid. </param> /// <param name="pathSid"> 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 bool Delete(string pathServiceSid, string pathSid, ITwilioRestClient client = null) { var options = new DeleteShortCodeOptions(pathServiceSid, pathSid); return(Delete(options, client)); }