Exemple #1
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Task parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Task </returns>
        public static bool Delete(DeleteTaskOptions 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="pathAssistantSid"> The SID of the Assistant that is the parent of the resources to delete </param>
 /// <param name="pathSid"> The unique string that identifies the resource to delete </param>
 /// <param name="client"> Client to make requests to Twilio </param>
 /// <returns> Task that resolves to A single instance of Task </returns> 
 public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathAssistantSid, 
                                                                   string pathSid, 
                                                                   ITwilioRestClient client = null)
 {
     var options = new DeleteTaskOptions(pathAssistantSid, pathSid);
     return await DeleteAsync(options, client);
 }
Exemple #3
0
 /// <summary>
 /// delete
 /// </summary>
 /// <param name="options"> Delete Task parameters </param>
 /// <param name="client"> Client to make requests to Twilio </param>
 /// <returns> Task that resolves to A single instance of Task </returns> 
 public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteTaskOptions options, 
                                                                   ITwilioRestClient client = null)
 {
     client = client ?? TwilioClient.GetRestClient();
     var response = await client.RequestAsync(BuildDeleteRequest(options, client));
     return response.StatusCode == System.Net.HttpStatusCode.NoContent;
 }
Exemple #4
0
 private static Request BuildDeleteRequest(DeleteTaskOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Autopilot,
                "/v1/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Exemple #5
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the resources to delete </param>
        /// <param name="pathSid"> The unique string that identifies the resource to delete </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Task </returns>
        public static bool Delete(string pathAssistantSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteTaskOptions(pathAssistantSid, pathSid);

            return(Delete(options, client));
        }