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

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// Fetch an instance of an Extension for the Installed Add-on.
        /// </summary>
        /// <param name="pathInstalledAddOnSid"> The SID of the InstalledAddOn resource with the extension to fetch </param>
        /// <param name="pathSid"> The SID of the InstalledAddOn Extension resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of InstalledAddOnExtension </returns>
        public static InstalledAddOnExtensionResource Fetch(string pathInstalledAddOnSid,
                                                            string pathSid,
                                                            ITwilioRestClient client = null)
        {
            var options = new FetchInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid);

            return(Fetch(options, client));
        }
示例#3
0
        /// <summary>
        /// Fetch an instance of an Extension for the Installed Add-on.
        /// </summary>
        /// <param name="pathInstalledAddOnSid"> The SID of the InstalledAddOn resource with the extension to fetch </param>
        /// <param name="pathSid"> The SID of the InstalledAddOn Extension resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of InstalledAddOnExtension </returns>
        public static async System.Threading.Tasks.Task <InstalledAddOnExtensionResource> FetchAsync(string pathInstalledAddOnSid,
                                                                                                     string pathSid,
                                                                                                     ITwilioRestClient client = null)
        {
            var options = new FetchInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid);

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

            return(FromJson(response.Content));
        }