예제 #1
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Sample parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sample </returns>
        public static bool Delete(DeleteSampleOptions 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 Sample parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sample </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteSampleOptions 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 Sample. </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 Sample </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathAssistantSid,
                                                                           string pathTaskSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteSampleOptions(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 Sample. </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 Sample </returns>
        public static bool Delete(string pathAssistantSid,
                                  string pathTaskSid,
                                  string pathSid,
                                  ITwilioRestClient client = null)
        {
            var options = new DeleteSampleOptions(pathAssistantSid, pathTaskSid, pathSid);

            return(Delete(options, client));
        }
 private static Request BuildDeleteRequest(DeleteSampleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Preview,
                "/understand/Assistants/" + options.PathAssistantSid + "/Tasks/" + options.PathTaskSid + "/Samples/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }