Exemplo n.º 1
0
        /// <summary>
        /// Delete a specific MessagingConfiguration.
        /// </summary>
        /// <param name="options"> Delete MessagingConfiguration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of MessagingConfiguration </returns>
        public static bool Delete(DeleteMessagingConfigurationOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Delete a specific MessagingConfiguration.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service that the resource is associated with </param>
        /// <param name="pathCountry"> The ISO-3166-1 country code of the country or `all`. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of MessagingConfiguration </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathCountry,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteMessagingConfigurationOptions(pathServiceSid, pathCountry);

            return(await DeleteAsync(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Delete a specific MessagingConfiguration.
        /// </summary>
        /// <param name="options"> Delete MessagingConfiguration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of MessagingConfiguration </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteMessagingConfigurationOptions options,
                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
 private static Request BuildDeleteRequest(DeleteMessagingConfigurationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathServiceSid + "/MessagingConfigurations/" + options.PathCountry + "",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Delete a specific MessagingConfiguration.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service that the resource is associated with </param>
        /// <param name="pathCountry"> The ISO-3166-1 country code of the country or `all`. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of MessagingConfiguration </returns>
        public static bool Delete(string pathServiceSid, string pathCountry, ITwilioRestClient client = null)
        {
            var options = new DeleteMessagingConfigurationOptions(pathServiceSid, pathCountry);

            return(Delete(options, client));
        }