/// <summary>
        /// Fetch an instance of an Extension for the Available Add-on.
        /// </summary>
        ///
        /// <param name="options"> Fetch AvailableAddOnExtension parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AvailableAddOnExtension </returns>
        public static AvailableAddOnExtensionResource Fetch(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
        /// <summary>
        /// Fetch an instance of an Extension for the Available Add-on.
        /// </summary>
        /// <param name="pathAvailableAddOnSid"> The SID of the AvailableAddOn resource with the extension to fetch </param>
        /// <param name="pathSid"> The SID of the AvailableAddOn Extension resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AvailableAddOnExtension </returns>
        public static async System.Threading.Tasks.Task <AvailableAddOnExtensionResource> FetchAsync(string pathAvailableAddOnSid,
                                                                                                     string pathSid,
                                                                                                     ITwilioRestClient client = null)
        {
            var options = new FetchAvailableAddOnExtensionOptions(pathAvailableAddOnSid, pathSid);

            return(await FetchAsync(options, client));
        }
Exemple #3
0
        /// <summary>
        /// Fetch an instance of an Extension for the Available Add-on.
        /// </summary>
        /// <param name="pathAvailableAddOnSid"> The SID of the AvailableAddOn resource with the extension to fetch </param>
        /// <param name="pathSid"> The SID of the AvailableAddOn Extension resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AvailableAddOnExtension </returns>
        public static AvailableAddOnExtensionResource Fetch(string pathAvailableAddOnSid,
                                                            string pathSid,
                                                            ITwilioRestClient client = null)
        {
            var options = new FetchAvailableAddOnExtensionOptions(pathAvailableAddOnSid, pathSid);

            return(Fetch(options, client));
        }
Exemple #4
0
 private static Request BuildFetchRequest(FetchAvailableAddOnExtensionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/marketplace/AvailableAddOns/" + options.PathAvailableAddOnSid + "/Extensions/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Exemple #5
0
        /// <summary>
        /// Fetch an instance of an Extension for the Available Add-on.
        /// </summary>
        /// <param name="options"> Fetch AvailableAddOnExtension parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AvailableAddOnExtension </returns>
        public static async System.Threading.Tasks.Task <AvailableAddOnExtensionResource> FetchAsync(FetchAvailableAddOnExtensionOptions options,
                                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }