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

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Delete a specific fax media instance.
        /// </summary>
        /// <param name="options"> Delete FaxMedia parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FaxMedia </returns>
        public static bool Delete(DeleteFaxMediaOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Delete a specific fax media instance.
        /// </summary>
        /// <param name="pathFaxSid"> The SID of the fax with the FaxMedia resource to delete </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of FaxMedia </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathFaxSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteFaxMediaOptions(pathFaxSid, pathSid);

            return(await DeleteAsync(options, client));
        }
 private static Request BuildDeleteRequest(DeleteFaxMediaOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Fax,
                "/v1/Faxes/" + options.PathFaxSid + "/Media/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Delete a specific fax media instance.
        /// </summary>
        /// <param name="pathFaxSid"> The SID of the fax with the FaxMedia resource to delete </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FaxMedia </returns>
        public static bool Delete(string pathFaxSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteFaxMediaOptions(pathFaxSid, pathSid);

            return(Delete(options, client));
        }