-
Notifications
You must be signed in to change notification settings - Fork 100
/
Copy pathGetAlertsRequest.kt
72 lines (66 loc) · 2.34 KB
/
GetAlertsRequest.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package org.opensearch.commons.alerting.action
import org.opensearch.action.ActionRequest
import org.opensearch.action.ActionRequestValidationException
import org.opensearch.commons.alerting.model.Table
import org.opensearch.core.common.io.stream.StreamInput
import org.opensearch.core.common.io.stream.StreamOutput
import java.io.IOException
class GetAlertsRequest : ActionRequest {
val table: Table
val findingIds: List<String>?
val severityLevel: String
val alertState: String
val monitorId: String?
val alertIndex: String?
val monitorIds: List<String>?
val workflowIds: List<String>?
val alertIds: List<String>?
constructor(
table: Table,
findingIds: List<String>?,
severityLevel: String,
alertState: String,
monitorId: String?,
alertIndex: String?,
monitorIds: List<String>? = null,
workflowIds: List<String>? = null,
alertIds: List<String>? = null
) : super() {
this.table = table
this.findingIds = findingIds
this.severityLevel = severityLevel
this.alertState = alertState
this.monitorId = monitorId
this.alertIndex = alertIndex
this.monitorIds = monitorIds
this.workflowIds = workflowIds
this.alertIds = alertIds
}
@Throws(IOException::class)
constructor(sin: StreamInput) : this(
table = Table.readFrom(sin),
findingIds = sin.readOptionalStringList(),
severityLevel = sin.readString(),
alertState = sin.readString(),
monitorId = sin.readOptionalString(),
alertIndex = sin.readOptionalString(),
monitorIds = sin.readOptionalStringList(),
workflowIds = sin.readOptionalStringList(),
alertIds = sin.readOptionalStringList()
)
override fun validate(): ActionRequestValidationException? {
return null
}
@Throws(IOException::class)
override fun writeTo(out: StreamOutput) {
table.writeTo(out)
out.writeOptionalStringCollection(findingIds)
out.writeString(severityLevel)
out.writeString(alertState)
out.writeOptionalString(monitorId)
out.writeOptionalString(alertIndex)
out.writeOptionalStringCollection(monitorIds)
out.writeOptionalStringCollection(workflowIds)
out.writeOptionalStringCollection(alertIds)
}
}