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

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

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

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

            return(FromJson(response.Content));
        }