Example #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);
        }
        /// <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);
        }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Document resource to delete </param>
        /// <param name="pathSid"> The SID of the Document resource to delete </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));
        }
 private static Request BuildDeleteRequest(DeleteDocumentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Sync,
                "/v1/Services/" + options.PathServiceSid + "/Documents/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Sync Service with the Document resource to delete </param>
        /// <param name="pathSid"> The SID of the Document resource to delete </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));
        }