private static Request BuildDeleteRequest(DeleteMessageOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Delete, Rest.Domain.Api, "/2010-04-01/Accounts/" + (options.PathAccountSid ?? client.AccountSid) + "/Messages/" + options.PathSid + ".json", client.Region, queryParams: options.GetParams() )); }
/// <summary> /// Deletes a message record from your account /// </summary> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="pathAccountSid"> The SID of the Account that created the resources to delete </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Message </returns> public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathSid) { PathAccountSid = pathAccountSid }; return(await DeleteAsync(options, client)); }
/// <summary> /// Deletes a message record from your account /// </summary> /// <param name="pathSid"> The unique string that identifies the resource </param> /// <param name="pathAccountSid"> The SID of the Account that created the resources to delete </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Message </returns> public static bool Delete(string pathSid, string pathAccountSid = null, ITwilioRestClient client = null) { var options = new DeleteMessageOptions(pathSid){PathAccountSid = pathAccountSid}; return Delete(options, client); }
/// <summary> /// Deletes a message record from your account /// </summary> /// <param name="options"> Delete Message parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Message </returns> public static bool Delete(DeleteMessageOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildDeleteRequest(options, client)); return response.StatusCode == System.Net.HttpStatusCode.NoContent; }