forked from OpsLevel/opslevel-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_tag_defined.go
42 lines (35 loc) · 1.21 KB
/
check_tag_defined.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 TagDefinedCheckFragment struct {
TagKey string `graphql:"tagKey"`
TagPredicate *Predicate `graphql:"tagPredicate"`
}
type CheckTagDefinedCreateInput struct {
CheckCreateInput
TagKey string `json:"tagKey"`
TagPredicate *PredicateInput `json:"tagPredicate,omitempty"`
}
type CheckTagDefinedUpdateInput struct {
CheckUpdateInput
TagKey string `json:"tagKey,omitempty"`
TagPredicate *PredicateInput `json:"tagPredicate,omitempty"`
}
func (client *Client) CreateCheckTagDefined(input CheckTagDefinedCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkTagDefinedCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckTagDefinedCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckTagDefined(input CheckTagDefinedUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkTagDefinedUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckTagDefinedUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}