/// <summary> /// Fetch an instance of an Add-on currently available to be installed. /// </summary> /// <param name="pathSid"> The SID of the AvailableAddOn resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AvailableAddOn </returns> public static async System.Threading.Tasks.Task <AvailableAddOnResource> FetchAsync(string pathSid, ITwilioRestClient client = null) { var options = new FetchAvailableAddOnOptions(pathSid); return(await FetchAsync(options, client)); }
/// <summary> /// Fetch an instance of an Add-on currently available to be installed. /// </summary> /// <param name="options"> Fetch AvailableAddOn parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AvailableAddOn </returns> public static AvailableAddOnResource Fetch(FetchAvailableAddOnOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildFetchRequest(FetchAvailableAddOnOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Preview, "/marketplace/AvailableAddOns/" + options.PathSid + "", queryParams: options.GetParams() )); }
/// <summary> /// Fetch an instance of an Add-on currently available to be installed. /// </summary> /// <param name="pathSid"> The SID of the AvailableAddOn resource to fetch </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of AvailableAddOn </returns> public static AvailableAddOnResource Fetch(string pathSid, ITwilioRestClient client = null) { var options = new FetchAvailableAddOnOptions(pathSid); return(Fetch(options, client)); }
/// <summary> /// Fetch an instance of an Add-on currently available to be installed. /// </summary> /// <param name="options"> Fetch AvailableAddOn parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of AvailableAddOn </returns> public static async System.Threading.Tasks.Task <AvailableAddOnResource> FetchAsync(FetchAvailableAddOnOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildFetchRequest(options, client)); return(FromJson(response.Content)); }