Ejemplo n.º 1
0
 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()
                ));
 }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
 /// <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;
 }