/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemple #2
0
 private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Chat,
                "/v2/Services/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="defaultServiceRoleSid"> The default_service_role_sid </param>
        /// <param name="defaultChannelRoleSid"> The default_channel_role_sid </param>
        /// <param name="defaultChannelCreatorRoleSid"> The default_channel_creator_role_sid </param>
        /// <param name="readStatusEnabled"> The read_status_enabled </param>
        /// <param name="reachabilityEnabled"> The reachability_enabled </param>
        /// <param name="typingIndicatorTimeout"> The typing_indicator_timeout </param>
        /// <param name="consumptionReportInterval"> The consumption_report_interval </param>
        /// <param name="notificationsNewMessageEnabled"> The notifications.new_message.enabled </param>
        /// <param name="notificationsNewMessageTemplate"> The notifications.new_message.template </param>
        /// <param name="notificationsNewMessageSound"> The notifications.new_message.sound </param>
        /// <param name="notificationsNewMessageBadgeCountEnabled"> The notifications.new_message.badge_count_enabled </param>
        /// <param name="notificationsAddedToChannelEnabled"> The notifications.added_to_channel.enabled </param>
        /// <param name="notificationsAddedToChannelTemplate"> The notifications.added_to_channel.template </param>
        /// <param name="notificationsAddedToChannelSound"> The notifications.added_to_channel.sound </param>
        /// <param name="notificationsRemovedFromChannelEnabled"> The notifications.removed_from_channel.enabled </param>
        /// <param name="notificationsRemovedFromChannelTemplate"> The notifications.removed_from_channel.template </param>
        /// <param name="notificationsRemovedFromChannelSound"> The notifications.removed_from_channel.sound </param>
        /// <param name="notificationsInvitedToChannelEnabled"> The notifications.invited_to_channel.enabled </param>
        /// <param name="notificationsInvitedToChannelTemplate"> The notifications.invited_to_channel.template </param>
        /// <param name="notificationsInvitedToChannelSound"> The notifications.invited_to_channel.sound </param>
        /// <param name="preWebhookUrl"> The pre_webhook_url </param>
        /// <param name="postWebhookUrl"> The post_webhook_url </param>
        /// <param name="webhookMethod"> The webhook_method </param>
        /// <param name="webhookFilters"> The webhook_filters </param>
        /// <param name="limitsChannelMembers"> The limits.channel_members </param>
        /// <param name="limitsUserChannels"> The limits.user_channels </param>
        /// <param name="mediaCompatibilityMessage"> The media.compatibility_message </param>
        /// <param name="preWebhookRetryCount"> The pre_webhook_retry_count </param>
        /// <param name="postWebhookRetryCount"> The post_webhook_retry_count </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid, string friendlyName = null, string defaultServiceRoleSid = null, string defaultChannelRoleSid = null, string defaultChannelCreatorRoleSid = null, bool?readStatusEnabled = null, bool?reachabilityEnabled = null, int?typingIndicatorTimeout = null, int?consumptionReportInterval = null, bool?notificationsNewMessageEnabled = null, string notificationsNewMessageTemplate = null, string notificationsNewMessageSound = null, bool?notificationsNewMessageBadgeCountEnabled = null, bool?notificationsAddedToChannelEnabled = null, string notificationsAddedToChannelTemplate = null, string notificationsAddedToChannelSound = null, bool?notificationsRemovedFromChannelEnabled = null, string notificationsRemovedFromChannelTemplate = null, string notificationsRemovedFromChannelSound = null, bool?notificationsInvitedToChannelEnabled = null, string notificationsInvitedToChannelTemplate = null, string notificationsInvitedToChannelSound = null, Uri preWebhookUrl = null, Uri postWebhookUrl = null, Twilio.Http.HttpMethod webhookMethod = null, List <string> webhookFilters = null, int?limitsChannelMembers = null, int?limitsUserChannels = null, string mediaCompatibilityMessage = null, int?preWebhookRetryCount = null, int?postWebhookRetryCount = null, ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, DefaultServiceRoleSid = defaultServiceRoleSid, DefaultChannelRoleSid = defaultChannelRoleSid, DefaultChannelCreatorRoleSid = defaultChannelCreatorRoleSid, ReadStatusEnabled = readStatusEnabled, ReachabilityEnabled = reachabilityEnabled, TypingIndicatorTimeout = typingIndicatorTimeout, ConsumptionReportInterval = consumptionReportInterval, NotificationsNewMessageEnabled = notificationsNewMessageEnabled, NotificationsNewMessageTemplate = notificationsNewMessageTemplate, NotificationsNewMessageSound = notificationsNewMessageSound, NotificationsNewMessageBadgeCountEnabled = notificationsNewMessageBadgeCountEnabled, NotificationsAddedToChannelEnabled = notificationsAddedToChannelEnabled, NotificationsAddedToChannelTemplate = notificationsAddedToChannelTemplate, NotificationsAddedToChannelSound = notificationsAddedToChannelSound, NotificationsRemovedFromChannelEnabled = notificationsRemovedFromChannelEnabled, NotificationsRemovedFromChannelTemplate = notificationsRemovedFromChannelTemplate, NotificationsRemovedFromChannelSound = notificationsRemovedFromChannelSound, NotificationsInvitedToChannelEnabled = notificationsInvitedToChannelEnabled, NotificationsInvitedToChannelTemplate = notificationsInvitedToChannelTemplate, NotificationsInvitedToChannelSound = notificationsInvitedToChannelSound, PreWebhookUrl = preWebhookUrl, PostWebhookUrl = postWebhookUrl, WebhookMethod = webhookMethod, WebhookFilters = webhookFilters, LimitsChannelMembers = limitsChannelMembers, LimitsUserChannels = limitsUserChannels, MediaCompatibilityMessage = mediaCompatibilityMessage, PreWebhookRetryCount = preWebhookRetryCount, PostWebhookRetryCount = postWebhookRetryCount
            };

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

            return(FromJson(response.Content));
        }