Esempio n. 1
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);
        }
Esempio n. 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 (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 (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 (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 (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 (WebhooksOnMessageSendUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageSend.Url", Serializers.Url(WebhooksOnMessageSendUrl)));
            }

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

            if (WebhooksOnMessageSendFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageSend.Format", WebhooksOnMessageSendFormat));
            }

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

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

            if (WebhooksOnMessageUpdateFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageUpdate.Format", WebhooksOnMessageUpdateFormat));
            }

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

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

            if (WebhooksOnMessageRemoveFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageRemove.Format", WebhooksOnMessageRemoveFormat));
            }

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

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

            if (WebhooksOnChannelAddFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnChannelAdd.Format", WebhooksOnChannelAddFormat));
            }

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

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

            if (WebhooksOnChannelDestroyFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnChannelDestroy.Format", WebhooksOnChannelDestroyFormat));
            }

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

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

            if (WebhooksOnChannelUpdateFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnChannelUpdate.Format", WebhooksOnChannelUpdateFormat));
            }

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

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

            if (WebhooksOnMemberAddFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMemberAdd.Format", WebhooksOnMemberAddFormat));
            }

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

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

            if (WebhooksOnMemberRemoveFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMemberRemove.Format", WebhooksOnMemberRemoveFormat));
            }

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

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

            if (WebhooksOnMessageSentFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageSent.Format", WebhooksOnMessageSentFormat));
            }

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

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

            if (WebhooksOnMessageUpdatedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageUpdated.Format", WebhooksOnMessageUpdatedFormat));
            }

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

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

            if (WebhooksOnMessageRemovedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMessageRemoved.Format", WebhooksOnMessageRemovedFormat));
            }

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

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

            if (WebhooksOnChannelAddedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnChannelAdded.Format", WebhooksOnChannelAddedFormat));
            }

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

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

            if (WebhooksOnChannelDestroyedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnChannelDestroyed.Format", WebhooksOnChannelDestroyedFormat));
            }

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

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

            if (WebhooksOnChannelUpdatedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnChannelUpdated.Format", WebhooksOnChannelUpdatedFormat));
            }

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

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

            if (WebhooksOnMemberAddedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMemberAdded.Format", WebhooksOnMemberAddedFormat));
            }

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

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

            if (WebhooksOnMemberRemovedFormat != null)
            {
                p.Add(new KeyValuePair <string, string>("Webhooks.OnMemberRemoved.Format", WebhooksOnMemberRemovedFormat));
            }

            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()));
            }

            return(p);
        }