Ejemplo n.º 1
0
        /// <summary>
        /// Create a new Webhook for the Service
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </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 Create(string pathServiceSid,
                                             string friendlyName,
                                             List <string> eventTypes,
                                             string webhookUrl,
                                             WebhookResource.StatusEnum status = null,
                                             ITwilioRestClient client          = null)
        {
            var options = new CreateWebhookOptions(pathServiceSid, friendlyName, eventTypes, webhookUrl)
            {
                Status = status
            };

            return(Create(options, client));
        }
Ejemplo n.º 2
0
        /// <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));
        }
Ejemplo n.º 3
0
        /// <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));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a new Webhook for the Service
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </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> CreateAsync(string pathServiceSid,
                                                                                      string friendlyName,
                                                                                      List <string> eventTypes,
                                                                                      string webhookUrl,
                                                                                      WebhookResource.StatusEnum status = null,
                                                                                      ITwilioRestClient client          = null)
        {
            var options = new CreateWebhookOptions(pathServiceSid, friendlyName, eventTypes, webhookUrl)
            {
                Status = status
            };

            return(await CreateAsync(options, client));
        }