Пример #1
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (WebhookMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("WebhookMethod", WebhookMethod));
            }

            if (WebhookFilters != null)
            {
                p.AddRange(WebhookFilters.Select(prop => new KeyValuePair <string, string>("WebhookFilters", prop)));
            }

            if (PreWebhookUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("PreWebhookUrl", PreWebhookUrl));
            }

            if (PostWebhookUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("PostWebhookUrl", PostWebhookUrl));
            }

            if (PreWebhookRetryCount != null)
            {
                p.Add(new KeyValuePair <string, string>("PreWebhookRetryCount", PreWebhookRetryCount.ToString()));
            }

            if (PostWebhookRetryCount != null)
            {
                p.Add(new KeyValuePair <string, string>("PostWebhookRetryCount", PostWebhookRetryCount.ToString()));
            }

            if (Target != null)
            {
                p.Add(new KeyValuePair <string, string>("Target", Target.ToString()));
            }

            return(p);
        }
Пример #2
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (FriendlyName != null)
            {
                p.Add(new KeyValuePair <string, string>("FriendlyName", FriendlyName));
            }

            if (DefaultServiceRoleSid != null)
            {
                p.Add(new KeyValuePair <string, string>("DefaultServiceRoleSid", DefaultServiceRoleSid.ToString()));
            }

            if (DefaultChannelRoleSid != null)
            {
                p.Add(new KeyValuePair <string, string>("DefaultChannelRoleSid", DefaultChannelRoleSid.ToString()));
            }

            if (DefaultChannelCreatorRoleSid != null)
            {
                p.Add(new KeyValuePair <string, string>("DefaultChannelCreatorRoleSid", DefaultChannelCreatorRoleSid.ToString()));
            }

            if (ReadStatusEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("ReadStatusEnabled", ReadStatusEnabled.Value.ToString().ToLower()));
            }

            if (ReachabilityEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("ReachabilityEnabled", ReachabilityEnabled.Value.ToString().ToLower()));
            }

            if (TypingIndicatorTimeout != null)
            {
                p.Add(new KeyValuePair <string, string>("TypingIndicatorTimeout", TypingIndicatorTimeout.ToString()));
            }

            if (ConsumptionReportInterval != null)
            {
                p.Add(new KeyValuePair <string, string>("ConsumptionReportInterval", ConsumptionReportInterval.ToString()));
            }

            if (NotificationsNewMessageEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.NewMessage.Enabled", NotificationsNewMessageEnabled.Value.ToString().ToLower()));
            }

            if (NotificationsNewMessageTemplate != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.NewMessage.Template", NotificationsNewMessageTemplate));
            }

            if (NotificationsNewMessageSound != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.NewMessage.Sound", NotificationsNewMessageSound));
            }

            if (NotificationsNewMessageBadgeCountEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.NewMessage.BadgeCountEnabled", NotificationsNewMessageBadgeCountEnabled.Value.ToString().ToLower()));
            }

            if (NotificationsAddedToChannelEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.AddedToChannel.Enabled", NotificationsAddedToChannelEnabled.Value.ToString().ToLower()));
            }

            if (NotificationsAddedToChannelTemplate != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.AddedToChannel.Template", NotificationsAddedToChannelTemplate));
            }

            if (NotificationsAddedToChannelSound != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.AddedToChannel.Sound", NotificationsAddedToChannelSound));
            }

            if (NotificationsRemovedFromChannelEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.RemovedFromChannel.Enabled", NotificationsRemovedFromChannelEnabled.Value.ToString().ToLower()));
            }

            if (NotificationsRemovedFromChannelTemplate != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.RemovedFromChannel.Template", NotificationsRemovedFromChannelTemplate));
            }

            if (NotificationsRemovedFromChannelSound != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.RemovedFromChannel.Sound", NotificationsRemovedFromChannelSound));
            }

            if (NotificationsInvitedToChannelEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.InvitedToChannel.Enabled", NotificationsInvitedToChannelEnabled.Value.ToString().ToLower()));
            }

            if (NotificationsInvitedToChannelTemplate != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.InvitedToChannel.Template", NotificationsInvitedToChannelTemplate));
            }

            if (NotificationsInvitedToChannelSound != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.InvitedToChannel.Sound", NotificationsInvitedToChannelSound));
            }

            if (PreWebhookUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("PreWebhookUrl", Serializers.Url(PreWebhookUrl)));
            }

            if (PostWebhookUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("PostWebhookUrl", Serializers.Url(PostWebhookUrl)));
            }

            if (WebhookMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("WebhookMethod", WebhookMethod.ToString()));
            }

            if (WebhookFilters != null)
            {
                p.AddRange(WebhookFilters.Select(prop => new KeyValuePair <string, string>("WebhookFilters", prop)));
            }

            if (LimitsChannelMembers != null)
            {
                p.Add(new KeyValuePair <string, string>("Limits.ChannelMembers", LimitsChannelMembers.ToString()));
            }

            if (LimitsUserChannels != null)
            {
                p.Add(new KeyValuePair <string, string>("Limits.UserChannels", LimitsUserChannels.ToString()));
            }

            if (MediaCompatibilityMessage != null)
            {
                p.Add(new KeyValuePair <string, string>("Media.CompatibilityMessage", MediaCompatibilityMessage));
            }

            if (PreWebhookRetryCount != null)
            {
                p.Add(new KeyValuePair <string, string>("PreWebhookRetryCount", PreWebhookRetryCount.ToString()));
            }

            if (PostWebhookRetryCount != null)
            {
                p.Add(new KeyValuePair <string, string>("PostWebhookRetryCount", PostWebhookRetryCount.ToString()));
            }

            if (NotificationsLogEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Notifications.LogEnabled", NotificationsLogEnabled.Value.ToString().ToLower()));
            }

            return(p);
        }