-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcheck_service_property.go
29 lines (26 loc) · 1.21 KB
/
check_service_property.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
package opslevel
type ServicePropertyCheckFragment struct {
Property ServicePropertyTypeEnum `graphql:"serviceProperty"` // The property of the service that the check will verify.
PropertyDefinition *PropertyDefinition `graphql:"propertyDefinition"` // The definition of a property.
Predicate *Predicate `graphql:"propertyValuePredicate"` // The condition that should be satisfied by the service property value.
}
func (client *Client) CreateCheckServiceProperty(input CheckServicePropertyCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkServicePropertyCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckServicePropertyCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckServiceProperty(input CheckServicePropertyUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkServicePropertyUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckServicePropertyUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}