-
Notifications
You must be signed in to change notification settings - Fork 13
/
check_alert_source_usage.go
42 lines (35 loc) · 1.46 KB
/
check_alert_source_usage.go
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
package opslevel
type AlertSourceUsageCheckFragment struct {
AlertSourceNamePredicate Predicate `graphql:"alertSourceNamePredicate"`
AlertSourceType AlertSourceTypeEnum `graphql:"alertSourceType"`
}
type CheckAlertSourceUsageCreateInput struct {
CheckCreateInput
AlertSourceType AlertSourceTypeEnum `json:"alertSourceType,omitempty"`
AlertSourceNamePredicate *PredicateInput `json:"alertSourceNamePredicate,omitempty"`
}
type CheckAlertSourceUsageUpdateInput struct {
CheckUpdateInput
AlertSourceType AlertSourceTypeEnum `json:"alertSourceType,omitempty"`
AlertSourceNamePredicate *PredicateUpdateInput `json:"alertSourceNamePredicate,omitempty"`
}
func (client *Client) CreateCheckAlertSourceUsage(input CheckAlertSourceUsageCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkAlertSourceUsageCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckAlertSourceUsageCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckAlertSourceUsage(input CheckAlertSourceUsageUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkAlertSourceUsageUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckAlertSourceUsageUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}