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