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

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathWorkspaceSid"> The SID of the Workspace with the WorkerChannel to fetch </param>
        /// <param name="pathWorkerSid"> The SID of the Worker with the WorkerChannel to fetch </param>
        /// <param name="pathSid"> The SID of the to fetch </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> FetchAsync(string pathWorkspaceSid,
                                                                                           string pathWorkerSid,
                                                                                           string pathSid,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new FetchWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathWorkspaceSid"> The SID of the Workspace with the WorkerChannel to fetch </param>
        /// <param name="pathWorkerSid"> The SID of the Worker with the WorkerChannel to fetch </param>
        /// <param name="pathSid"> The SID of the to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of WorkerChannel </returns>
        public static WorkerChannelResource Fetch(string pathWorkspaceSid,
                                                  string pathWorkerSid,
                                                  string pathSid,
                                                  ITwilioRestClient client = null)
        {
            var options = new FetchWorkerChannelOptions(pathWorkspaceSid, pathWorkerSid, pathSid);

            return(Fetch(options, client));
        }
 private static Request BuildFetchRequest(FetchWorkerChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workers/" + options.PathWorkerSid + "/Channels/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch 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> FetchAsync(FetchWorkerChannelOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }