/// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete TaskChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskChannel </returns>
        public static bool Delete(DeleteTaskChannelOptions 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="pathWorkspaceSid"> The unique ID of the Workspace that this TaskChannel belongs to. </param>
        /// <param name="pathSid"> The unique ID for this TaskChannel. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskChannel </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathWorkspaceSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteTaskChannelOptions(pathWorkspaceSid, pathSid);

            return(await DeleteAsync(options, client));
        }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete TaskChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskChannel </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(DeleteTaskChannelOptions options,
                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Esempio n. 4
0
 private static Request BuildDeleteRequest(DeleteTaskChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/TaskChannels/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathWorkspaceSid"> The unique ID of the Workspace that this TaskChannel belongs to. </param>
        /// <param name="pathSid"> The unique ID for this TaskChannel. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskChannel </returns>
        public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteTaskChannelOptions(pathWorkspaceSid, pathSid);

            return(Delete(options, client));
        }