예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the Assistant. </param>
        /// <param name="pathTaskSid"> The unique ID of the Task associated with this Field. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this 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));
        }
예제 #4
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathAssistantSid"> The unique ID of the Assistant. </param>
        /// <param name="pathTaskSid"> The unique ID of the Task associated with this Field. </param>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this 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));
        }
예제 #5
0
 private static Request BuildDeleteRequest(DeleteFieldOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathTaskSid + "/Fields/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }