/// <summary>
        /// delete
        /// </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);
        }
示例#2
0
        /// <summary>
        /// delete
        /// </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);
        }
示例#3
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </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));
        }
示例#4
0
 private static Request BuildDeleteRequest(DeleteShortCodeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Messaging,
                "/v1/Services/" + options.PathServiceSid + "/ShortCodes/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
示例#5
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </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));
        }