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

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// Update an Extension for an Add-on installation.
        /// </summary>
        /// <param name="pathInstalledAddOnSid"> The SID of the InstalledAddOn resource with the extension to update </param>
        /// <param name="pathSid"> The SID of the InstalledAddOn Extension resource to update </param>
        /// <param name="enabled"> Whether the Extension should be invoked </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of InstalledAddOnExtension </returns>
        public static InstalledAddOnExtensionResource Update(string pathInstalledAddOnSid,
                                                             string pathSid,
                                                             bool?enabled,
                                                             ITwilioRestClient client = null)
        {
            var options = new UpdateInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid, enabled);

            return(Update(options, client));
        }
Esempio n. 3
0
        /// <summary>
        /// Update an Extension for an Add-on installation.
        /// </summary>
        /// <param name="pathInstalledAddOnSid"> The SID of the InstalledAddOn resource with the extension to update </param>
        /// <param name="pathSid"> The SID of the InstalledAddOn Extension resource to update </param>
        /// <param name="enabled"> Whether the Extension should be invoked </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> UpdateAsync(string pathInstalledAddOnSid,
                                                                                                      string pathSid,
                                                                                                      bool?enabled,
                                                                                                      ITwilioRestClient client = null)
        {
            var options = new UpdateInstalledAddOnExtensionOptions(pathInstalledAddOnSid, pathSid, enabled);

            return(await UpdateAsync(options, client));
        }
Esempio n. 4
0
 private static Request BuildUpdateRequest(UpdateInstalledAddOnExtensionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/marketplace/InstalledAddOns/" + options.PathInstalledAddOnSid + "/Extensions/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Update an Extension for an Add-on installation.
        /// </summary>
        ///
        /// <param name="options"> Update 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> UpdateAsync(UpdateInstalledAddOnExtensionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }