/// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> The string that you assigned to describe the webhook </param>
        /// <param name="eventTypes"> The array of events that this Webhook is subscribed to. </param>
        /// <param name="webhookUrl"> The URL associated with this Webhook. </param>
        /// <param name="status"> The webhook status </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Webhook </returns>
        public static WebhookResource Update(string pathServiceSid,
                                             string pathSid,
                                             string friendlyName               = null,
                                             List <string> eventTypes          = null,
                                             string webhookUrl                 = null,
                                             WebhookResource.StatusEnum status = null,
                                             ITwilioRestClient client          = null)
        {
            var options = new UpdateWebhookOptions(pathServiceSid, pathSid)
            {
                FriendlyName = friendlyName, EventTypes = eventTypes, WebhookUrl = webhookUrl, Status = status
            };

            return(Update(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> The string that you assigned to describe the webhook </param>
        /// <param name="eventTypes"> The array of events that this Webhook is subscribed to. </param>
        /// <param name="webhookUrl"> The URL associated with this Webhook. </param>
        /// <param name="status"> The webhook status </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 pathServiceSid,
                                                                                      string pathSid,
                                                                                      string friendlyName               = null,
                                                                                      List <string> eventTypes          = null,
                                                                                      string webhookUrl                 = null,
                                                                                      WebhookResource.StatusEnum status = null,
                                                                                      ITwilioRestClient client          = null)
        {
            var options = new UpdateWebhookOptions(pathServiceSid, pathSid)
            {
                FriendlyName = friendlyName, EventTypes = eventTypes, WebhookUrl = webhookUrl, Status = status
            };

            return(await UpdateAsync(options, client));
        }
        /// <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));
        }