/// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathTaskSid"> The task_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 Reservation </returns>
        public static async System.Threading.Tasks.Task <ReservationResource> FetchAsync(string pathWorkspaceSid,
                                                                                         string pathTaskSid,
                                                                                         string pathSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="pathTaskSid"> The task_sid </param>
        /// <param name="pathSid"> The sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Reservation </returns>
        public static ReservationResource Fetch(string pathWorkspaceSid,
                                                string pathTaskSid,
                                                string pathSid,
                                                ITwilioRestClient client = null)
        {
            var options = new FetchReservationOptions(pathWorkspaceSid, pathTaskSid, pathSid);

            return(Fetch(options, client));
        }
 private static Request BuildFetchRequest(FetchReservationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Tasks/" + options.PathTaskSid + "/Reservations/" + options.PathSid + "",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch Reservation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Reservation </returns>
        public static async System.Threading.Tasks.Task <ReservationResource> FetchAsync(FetchReservationOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }