/// <summary>
        /// Retrieve a specific Function Version resource.
        /// </summary>
        /// <param name="options"> Fetch FunctionVersion parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FunctionVersion </returns>
        public static FunctionVersionResource Fetch(FetchFunctionVersionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Retrieve a specific Function Version resource.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the Function Version resource from </param>
        /// <param name="pathFunctionSid"> The SID of the function that is the parent of the Function Version resource to fetch
        ///                       </param>
        /// <param name="pathSid"> The SID that identifies the Function Version resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of FunctionVersion </returns>
        public static async System.Threading.Tasks.Task <FunctionVersionResource> FetchAsync(string pathServiceSid,
                                                                                             string pathFunctionSid,
                                                                                             string pathSid,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new FetchFunctionVersionOptions(pathServiceSid, pathFunctionSid, pathSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// Retrieve a specific Function Version resource.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the Function Version resource from </param>
        /// <param name="pathFunctionSid"> The SID of the function that is the parent of the Function Version resource to fetch
        ///                       </param>
        /// <param name="pathSid"> The SID that identifies the Function Version resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FunctionVersion </returns>
        public static FunctionVersionResource Fetch(string pathServiceSid,
                                                    string pathFunctionSid,
                                                    string pathSid,
                                                    ITwilioRestClient client = null)
        {
            var options = new FetchFunctionVersionOptions(pathServiceSid, pathFunctionSid, pathSid);

            return(Fetch(options, client));
        }
 private static Request BuildFetchRequest(FetchFunctionVersionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Functions/" + options.PathFunctionSid + "/Versions/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a specific Function Version resource.
        /// </summary>
        /// <param name="options"> Fetch FunctionVersion parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of FunctionVersion </returns>
        public static async System.Threading.Tasks.Task <FunctionVersionResource> FetchAsync(FetchFunctionVersionOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }