Exemple #1
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Document parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Document </returns>
        public static bool Delete(DeleteDocumentOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemple #2
0
        /// <summary>
        /// delete
        /// </summary>
        ///
        /// <param name="options"> Delete Document parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Document </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteDocumentOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemple #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 Document </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathServiceSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteDocumentOptions(pathServiceSid, pathSid);

            return(await DeleteAsync(options, client));
        }
Exemple #4
0
 private static Request BuildDeleteRequest(DeleteDocumentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Documents/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="ifMatch"> The If-Match HTTP request header </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Document </returns>
        public static bool Delete(string pathServiceSid,
                                  string pathSid,
                                  string ifMatch           = null,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteDocumentOptions(pathServiceSid, pathSid)
            {
                IfMatch = ifMatch
            };

            return(Delete(options, client));
        }