/// <summary>
        /// Install an Add-on for the Account specified.
        /// </summary>
        /// <param name="options"> Create InstalledAddOn parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of InstalledAddOn </returns>
        public static InstalledAddOnResource Create(CreateInstalledAddOnOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Install an Add-on for the Account specified.
        /// </summary>
        ///
        /// <param name="availableAddOnSid"> A string that uniquely identifies the Add-on to install </param>
        /// <param name="acceptTermsOfService"> A boolean reflecting your acceptance of the Terms of Service </param>
        /// <param name="configuration"> The JSON object representing the configuration </param>
        /// <param name="uniqueName"> The string that uniquely identifies this Add-on installation </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of InstalledAddOn </returns>
        public static async System.Threading.Tasks.Task <InstalledAddOnResource> CreateAsync(string availableAddOnSid, bool?acceptTermsOfService, object configuration = null, string uniqueName = null, ITwilioRestClient client = null)
        {
            var options = new CreateInstalledAddOnOptions(availableAddOnSid, acceptTermsOfService)
            {
                Configuration = configuration, UniqueName = uniqueName
            };

            return(await CreateAsync(options, client));
        }
 private static Request BuildCreateRequest(CreateInstalledAddOnOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/marketplace/InstalledAddOns",
                postParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// Install an Add-on for the Account specified.
        /// </summary>
        ///
        /// <param name="availableAddOnSid"> A string that uniquely identifies the Add-on to install </param>
        /// <param name="acceptTermsOfService"> A boolean reflecting your acceptance of the Terms of Service </param>
        /// <param name="configuration"> The JSON object representing the configuration </param>
        /// <param name="uniqueName"> The string that uniquely identifies this Add-on installation </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of InstalledAddOn </returns>
        public static InstalledAddOnResource Create(string availableAddOnSid, bool?acceptTermsOfService, object configuration = null, string uniqueName = null, ITwilioRestClient client = null)
        {
            var options = new CreateInstalledAddOnOptions(availableAddOnSid, acceptTermsOfService)
            {
                Configuration = configuration, UniqueName = uniqueName
            };

            return(Create(options, client));
        }
        /// <summary>
        /// Install an Add-on for the Account specified.
        /// </summary>
        /// <param name="options"> Create InstalledAddOn parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of InstalledAddOn </returns>
        public static async System.Threading.Tasks.Task <InstalledAddOnResource> CreateAsync(CreateInstalledAddOnOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }