|
| 1 | +// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +package software.aws.toolkits.jetbrains.core.notifications |
| 5 | + |
| 6 | +import com.fasterxml.jackson.annotation.JsonProperty |
| 7 | + |
| 8 | +data class NotificationsList( |
| 9 | + @JsonProperty("schema") |
| 10 | + val schema: Schema, |
| 11 | + @JsonProperty("notifications") |
| 12 | + val notifications: List<NotificationData>, |
| 13 | +) |
| 14 | + |
| 15 | +data class Schema( |
| 16 | + @JsonProperty("version") |
| 17 | + val version: String, |
| 18 | +) |
| 19 | + |
| 20 | +data class NotificationData( |
| 21 | + @JsonProperty("id") |
| 22 | + val id: String, |
| 23 | + @JsonProperty("schedule") |
| 24 | + val schedule: NotificationSchedule, |
| 25 | + @JsonProperty("severity") |
| 26 | + val severity: String, |
| 27 | + @JsonProperty("condition") |
| 28 | + val condition: NotificationDisplayCondition?, |
| 29 | + @JsonProperty("content") |
| 30 | + val content: NotificationContentDescriptionLocale, |
| 31 | + @JsonProperty("actions") |
| 32 | + val actions: List<NotificationFollowupActions>? = emptyList(), |
| 33 | +) |
| 34 | + |
| 35 | +data class NotificationSchedule( |
| 36 | + @JsonProperty("type") |
| 37 | + val type: String, |
| 38 | +) |
| 39 | + |
| 40 | +enum class NotificationSeverity { |
| 41 | + INFO, |
| 42 | + WARNING, |
| 43 | + CRITICAL, |
| 44 | +} |
| 45 | + |
| 46 | +data class NotificationContentDescriptionLocale( |
| 47 | + @JsonProperty("en-US") |
| 48 | + val locale: NotificationContentDescription, |
| 49 | +) |
| 50 | + |
| 51 | +data class NotificationContentDescription( |
| 52 | + @JsonProperty("title") |
| 53 | + val title: String, |
| 54 | + @JsonProperty("description") |
| 55 | + val description: String, |
| 56 | +) |
| 57 | + |
| 58 | +data class NotificationFollowupActions( |
| 59 | + @JsonProperty("type") |
| 60 | + val type: String, |
| 61 | + @JsonProperty("content") |
| 62 | + val content: NotificationFollowupActionsContent, |
| 63 | +) |
| 64 | + |
| 65 | +data class NotificationFollowupActionsContent( |
| 66 | + @JsonProperty("en-US") |
| 67 | + val locale: NotificationActionDescription, |
| 68 | +) |
| 69 | + |
| 70 | +data class NotificationActionDescription( |
| 71 | + @JsonProperty("title") |
| 72 | + val title: String, |
| 73 | + @JsonProperty("url") |
| 74 | + val url: String?, |
| 75 | +) |
| 76 | + |
| 77 | +data class NotificationDisplayCondition( |
| 78 | + @JsonProperty("compute") |
| 79 | + val compute: ComputeType?, |
| 80 | + @JsonProperty("os") |
| 81 | + val os: SystemType?, |
| 82 | + @JsonProperty("ide") |
| 83 | + val ide: SystemType?, |
| 84 | + @JsonProperty("extension") |
| 85 | + val extension: List<ExtensionType>?, |
| 86 | + @JsonProperty("authx") |
| 87 | + val authx: List<AuthxType>, |
| 88 | +) |
| 89 | + |
| 90 | +data class ComputeType( |
| 91 | + @JsonProperty("type") |
| 92 | + val type: NotificationExpression?, |
| 93 | + @JsonProperty("architecture") |
| 94 | + val architecture: NotificationExpression?, |
| 95 | +) |
| 96 | + |
| 97 | +data class SystemType( |
| 98 | + @JsonProperty("type") |
| 99 | + val type: NotificationExpression?, |
| 100 | + @JsonProperty("version") |
| 101 | + val version: NotificationExpression?, |
| 102 | +) |
| 103 | + |
| 104 | +data class ExtensionType( |
| 105 | + @JsonProperty("id") |
| 106 | + val id: String?, |
| 107 | + @JsonProperty("version") |
| 108 | + val version: NotificationExpression?, |
| 109 | +) |
| 110 | + |
| 111 | +open class NotificationExpression |
| 112 | + |
| 113 | +open class NotificationOperation : NotificationExpression() |
| 114 | + |
| 115 | +data class NotCondition( |
| 116 | + @JsonProperty("not") |
| 117 | + val expectedValue: NotificationExpression, |
| 118 | +) : NotificationExpression() |
| 119 | + |
| 120 | +data class OrCondition( |
| 121 | + @JsonProperty("or") |
| 122 | + val expectedValueList: List<NotificationExpression>, |
| 123 | +) : NotificationExpression() |
| 124 | + |
| 125 | +data class AndCondition( |
| 126 | + @JsonProperty("and") |
| 127 | + val expectedValueList: List<NotificationExpression>, |
| 128 | +) : NotificationExpression() |
| 129 | + |
| 130 | +data class AuthxType( |
| 131 | + @JsonProperty("feature") |
| 132 | + val feature: String, |
| 133 | + @JsonProperty("type") |
| 134 | + val type: NotificationExpression?, |
| 135 | + @JsonProperty("region") |
| 136 | + val region: NotificationExpression?, |
| 137 | + @JsonProperty("connectionState") |
| 138 | + val connectionState: NotificationExpression?, |
| 139 | + @JsonProperty("ssoscopes") |
| 140 | + val ssoScopes: NotificationExpression?, |
| 141 | +) |
| 142 | + |
| 143 | +data class ComparisonCondition( |
| 144 | + @JsonProperty("==") |
| 145 | + val expectedValue: String, |
| 146 | +) : NotificationOperation() |
| 147 | + |
| 148 | +data class NotEqualsCondition( |
| 149 | + @JsonProperty("!=") |
| 150 | + val expectedValue: String, |
| 151 | +) : NotificationOperation() |
| 152 | + |
| 153 | +data class GreaterThanCondition( |
| 154 | + @JsonProperty(">") |
| 155 | + val expectedValue: String, |
| 156 | +) : NotificationOperation() |
| 157 | + |
| 158 | +data class GreaterThanOrEqualsCondition( |
| 159 | + @JsonProperty(">=") |
| 160 | + val expectedValue: String, |
| 161 | +) : NotificationOperation() |
| 162 | + |
| 163 | +data class LessThanCondition( |
| 164 | + @JsonProperty("<") |
| 165 | + val expectedValue: String, |
| 166 | +) : NotificationOperation() |
| 167 | + |
| 168 | +data class LessThanOrEqualsCondition( |
| 169 | + @JsonProperty("<=") |
| 170 | + val expectedValue: String, |
| 171 | +) : NotificationOperation() |
| 172 | + |
| 173 | +data class InCondition( |
| 174 | + @JsonProperty("anyOf") |
| 175 | + val expectedValueList: List<String>, |
| 176 | +) : NotificationOperation() |
| 177 | + |
| 178 | +data class NotInCondition( |
| 179 | + @JsonProperty("noneOf") |
| 180 | + val expectedValueList: List<String>, |
| 181 | +) : NotificationOperation() |
0 commit comments