forked from OpsLevel/opslevel-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_has_recent_deploy.go
39 lines (32 loc) · 1.04 KB
/
check_has_recent_deploy.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
package opslevel
type HasRecentDeployCheckFragment struct {
Days int `graphql:"days"`
}
type CheckHasRecentDeployCreateInput struct {
CheckCreateInput
Days int `json:"days"`
}
type CheckHasRecentDeployUpdateInput struct {
CheckUpdateInput
Days *int `json:"days,omitempty"`
}
func (client *Client) CreateCheckHasRecentDeploy(input CheckHasRecentDeployCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkHasRecentDeployCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckHasRecentDeployCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckHasRecentDeploy(input CheckHasRecentDeployUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkHasRecentDeployUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckHasRecentDeployUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}