Пример #1
0
        /// <summary>
        /// Delete a specific Entity.
        /// </summary>
        /// <param name="options"> Delete Entity parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Entity </returns>
        public static bool Delete(DeleteEntityOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Пример #2
0
        /// <summary>
        /// Delete a specific Entity.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique external identifier of the Entity </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Entity </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathIdentity,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteEntityOptions(pathServiceSid, pathIdentity);

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

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Пример #4
0
 private static Request BuildDeleteRequest(DeleteEntityOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "",
                queryParams: options.GetParams()
                ));
 }
Пример #5
0
        /// <summary>
        /// Delete a specific Entity.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique external identifier of the Entity </param>
        /// <param name="twilioSandboxMode"> The Twilio-Sandbox-Mode HTTP request header </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Entity </returns>
        public static bool Delete(string pathServiceSid,
                                  string pathIdentity,
                                  string twilioSandboxMode = null,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteEntityOptions(pathServiceSid, pathIdentity)
            {
                TwilioSandboxMode = twilioSandboxMode
            };

            return(Delete(options, client));
        }