/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update WorkerChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of WorkerChannel </returns>
        public static WorkerChannelResource Update(UpdateWorkerChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathWorkerSid"> The worker_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="capacity"> The capacity </param>
        /// <param name="available"> The available </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of WorkerChannel </returns>
        public static WorkerChannelResource Update(string pathWorkspaceSid, string pathWorkerSid, string pathSid, int?capacity = null, bool?available = null, ITwilioRestClient client = null)
        {
            var options = new UpdateWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid)
            {
                Capacity = capacity, Available = available
            };

            return(Update(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathWorkerSid"> The worker_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="capacity"> The capacity </param>
        /// <param name="available"> The available </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of WorkerChannel </returns>
        public static async System.Threading.Tasks.Task <WorkerChannelResource> UpdateAsync(string pathWorkspaceSid, string pathWorkerSid, string pathSid, int?capacity = null, bool?available = null, ITwilioRestClient client = null)
        {
            var options = new UpdateWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid)
            {
                Capacity = capacity, Available = available
            };

            return(await UpdateAsync(options, client));
        }
 private static Request BuildUpdateRequest(UpdateWorkerChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workers/" + options.PathWorkerSid + "/Channels/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update WorkerChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of WorkerChannel </returns>
        public static async System.Threading.Tasks.Task <WorkerChannelResource> UpdateAsync(UpdateWorkerChannelOptions options,
                                                                                            ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }