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

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="options"> Delete Worker parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Worker </returns>
        public static bool Delete(DeleteWorkerOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildDeleteRequest(options, client));

            return(response.StatusCode == System.Net.HttpStatusCode.NoContent);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Worker </returns>
        public static async System.Threading.Tasks.Task <bool> DeleteAsync(string pathWorkspaceSid,
                                                                           string pathSid,
                                                                           ITwilioRestClient client = null)
        {
            var options = new DeleteWorkerOptions(pathWorkspaceSid, pathSid);

            return(await DeleteAsync(options, client));
        }
 private static Request BuildDeleteRequest(DeleteWorkerOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Delete,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workers/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 5
0
        /// <summary>
        /// delete
        /// </summary>
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Worker </returns>
        public static bool Delete(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new DeleteWorkerOptions(pathWorkspaceSid, pathSid);

            return(Delete(options, client));
        }