-
Notifications
You must be signed in to change notification settings - Fork 13
/
check_tool_usage.go
30 lines (27 loc) · 1.28 KB
/
check_tool_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
package opslevel
type ToolUsageCheckFragment struct {
EnvironmentPredicate *Predicate `graphql:"environmentPredicate"` // The condition that the environment should satisfy to be evaluated.
ToolCategory ToolCategory `graphql:"toolCategory"` // The category that the tool belongs to.
ToolNamePredicate *Predicate `graphql:"toolNamePredicate"` // The condition that the tool name should satisfy to be evaluated.
ToolUrlPredicate *Predicate `graphql:"toolUrlPredicate"` // The condition that the tool url should satisfy to be evaluated.
}
func (client *Client) CreateCheckToolUsage(input CheckToolUsageCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkToolUsageCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckToolUsageCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckToolUsage(input CheckToolUsageUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkToolUsageUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckToolUsageUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}