-
Notifications
You must be signed in to change notification settings - Fork 12
/
check_custom_event.go
31 lines (28 loc) · 1.07 KB
/
check_custom_event.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
package opslevel
type CustomEventCheckFragment struct {
Integration IntegrationId `graphql:"integration"`
PassPending bool `graphql:"passPending"`
ResultMessage string `graphql:"resultMessage"`
ServiceSelector string `graphql:"serviceSelector"`
SuccessCondition string `graphql:"successCondition"`
}
func (client *Client) CreateCheckCustomEvent(input CheckCustomEventCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkCustomEventCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckCustomEventCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckCustomEvent(input CheckCustomEventUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkCustomEventUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckCustomEventUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}