Ejemplo n.º 1
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="webhookMethod"> The HTTP method to be used when sending a webhook request. </param>
        /// <param name="webhookFilters"> The list of webhook event triggers that are enabled for this Service. </param>
        /// <param name="preWebhookUrl"> The absolute url the pre-event webhook request should be sent to. </param>
        /// <param name="postWebhookUrl"> The absolute url the post-event webhook request should be sent to. </param>
        /// <param name="preWebhookRetryCount"> The number of retries in case of pre-event webhook request failures. </param>
        /// <param name="postWebhookRetryCount"> The number of retries in case of post-event webhook request failures. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Webhook </returns>
        public static async System.Threading.Tasks.Task <WebhookResource> UpdateAsync(string webhookMethod         = null,
                                                                                      List <string> webhookFilters = null,
                                                                                      string preWebhookUrl         = null,
                                                                                      string postWebhookUrl        = null,
                                                                                      int?preWebhookRetryCount     = null,
                                                                                      int?postWebhookRetryCount    = null,
                                                                                      ITwilioRestClient client     = null)
        {
            var options = new UpdateWebhookOptions()
            {
                WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount
            };

            return(await UpdateAsync(options, client));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="webhookMethod"> The HTTP method to be used when sending a webhook request. </param>
        /// <param name="webhookFilters"> The list of webhook event triggers that are enabled for this Service. </param>
        /// <param name="preWebhookUrl"> The absolute url the pre-event webhook request should be sent to. </param>
        /// <param name="postWebhookUrl"> The absolute url the post-event webhook request should be sent to. </param>
        /// <param name="preWebhookRetryCount"> The number of retries in case of pre-event webhook request failures. </param>
        /// <param name="postWebhookRetryCount"> The number of retries in case of post-event webhook request failures. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Webhook </returns>
        public static WebhookResource Update(string webhookMethod         = null,
                                             List <string> webhookFilters = null,
                                             string preWebhookUrl         = null,
                                             string postWebhookUrl        = null,
                                             int?preWebhookRetryCount     = null,
                                             int?postWebhookRetryCount    = null,
                                             ITwilioRestClient client     = null)
        {
            var options = new UpdateWebhookOptions()
            {
                WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount
            };

            return(Update(options, client));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Webhook parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Webhook </returns>
        public static async System.Threading.Tasks.Task <WebhookResource> UpdateAsync(UpdateWebhookOptions options,
                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }