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