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