/// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Field parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Field </returns>
        public static bool Delete(DeleteFieldOptions 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 Field parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Field </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteFieldOptions 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="pathAssistantSid"> The SID of the Assistant that is the parent of the Task associated with the
        ///                        resources to delete </param>
        /// <param name="pathTaskSid"> The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource
        ///                   associated with the Field 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 Field </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathAssistantSid,
                                                                           string pathTaskSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteFieldOptions(pathAssistantSid, pathTaskSid, pathSid);

            return(await DeleteAsync(options, client));
        }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathAssistantSid"> The SID of the Assistant that is the parent of the Task associated with the
        ///                        resources to delete </param>
        /// <param name="pathTaskSid"> The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource
        ///                   associated with the Field 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 Field </returns>
        public static bool Delete(string pathAssistantSid,
                                  string pathTaskSid,
                                  string pathSid,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteFieldOptions(pathAssistantSid, pathTaskSid, pathSid);

            return(Delete(options, client));
        }
Exemple #5
0
 private static Request BuildDeleteRequest(DeleteFieldOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Autopilot,
                "/v1/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathTaskSid + "/Fields/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }