Example #1
0
        public override JObject ToJSON(Boolean Embedded = false)

        => JSONObject.Create(

            !Embedded
                       ? new JProperty("@context", JSONLDContext.ToString())
                       : null,

            new JProperty("email", EMailAddress.ToJSON(Embedded: true)),

            Subject.IsNotNullOrEmpty()
                       ? new JProperty("subject", Subject)
                       : null,

            SubjectPrefix.IsNotNullOrEmpty()
                       ? new JProperty("subjectPrefix", SubjectPrefix)
                       : null,

            ListId.IsNotNullOrEmpty()
                       ? new JProperty("listId", ListId)
                       : null,

            NotificationMessageTypes.SafeAny()
                       ? new JProperty("messageTypes", new JArray(NotificationMessageTypes.Select(msgType => msgType.ToString())))
                       : null,

            Description.IsNotNullOrEmpty()
                       ? new JProperty("description", Description)
                       : null

            );
Example #2
0
        public override JObject ToJSON(Boolean Embedded = false)

        => JSONObject.Create(

            !Embedded
                       ? new JProperty("@context", JSONLDContext.ToString())
                       : null,

            new JProperty("groupName", GroupName),

            ChatId.HasValue
                       ? new JProperty("chatId", ChatId.Value)
                       : null,

            SharedSecret.IsNotNullOrEmpty()
                       ? new JProperty("sharedSecret", SharedSecret)
                       : null,

            TextTemplate.IsNotNullOrEmpty()
                       ? new JProperty("textTemplate", TextTemplate)
                       : null,

            NotificationMessageTypes.SafeAny()
                       ? new JProperty("messageTypes", new JArray(NotificationMessageTypes.Select(msgType => msgType.ToString())))
                       : null,

            Description.IsNotNullOrEmpty()
                       ? new JProperty("description", Description)
                       : null

            );
Example #3
0
        public void Remove(params NotificationMessageType[] NotificationMessageTypes)
        {
            if (NotificationMessageTypes.SafeAny())
            {
                var notificationMessageTypes = new HashSet <NotificationMessageType>(NotificationMessageTypes);

                foreach (var remove in notifications.Where(nmd => notificationMessageTypes.Overlaps(nmd.Messages)).ToArray())
                {
                    this.notifications.Remove(remove);
                }
            }
        }
Example #4
0
        public override JObject ToJSON(Boolean Embedded = false)

        => JSONObject.Create(

            !Embedded
                       ? new JProperty("@context", JSONLDContext.ToString())
                       : null,

            new JProperty("method", Method.ToString()),
            new JProperty("URL", URL),
            new JProperty("TCPPort", RemotePort.ToUInt16()),

            BasicAuth_Login.IsNotNullOrEmpty() &&
            BasicAuth_Password.IsNotNullOrEmpty()
                       ? new JProperty("basicAuth",
                                       new JObject(
                                           new JProperty("login", BasicAuth_Login),
                                           new JProperty("password", BasicAuth_Password)
                                           )
                                       )
                       : null,

            APIKey.IsNotNullOrEmpty()
                       ? new JProperty("APIKey", APIKey)
                       : null,

            RequestTimeout.HasValue
                       ? new JProperty("RequestTimeout", RequestTimeout.Value.TotalSeconds)
                       : null,

            NotificationMessageTypes.SafeAny()
                       ? new JProperty("messageTypes", new JArray(NotificationMessageTypes.Select(msgType => msgType.ToString())))
                       : null,

            Description.IsNotNullOrEmpty()
                       ? new JProperty("description", Description)
                       : null

            );
Example #5
0
        public override JObject ToJSON(Boolean Embedded = false)

        => JSONObject.Create(

            !Embedded
                       ? new JProperty("@context", JSONLDContext.ToString())
                       : null,

            new JProperty("phoneNumber", PhoneNumber.ToString()),

            TextTemplate.IsNotNullOrEmpty()
                       ? new JProperty("textTemplate", TextTemplate)
                       : null,

            NotificationMessageTypes.SafeAny()
                       ? new JProperty("messageTypes", new JArray(NotificationMessageTypes.Select(msgType => msgType.ToString())))
                       : null,

            Description.IsNotNullOrEmpty()
                       ? new JProperty("description", Description)
                       : null

            );