-
Notifications
You must be signed in to change notification settings - Fork 13
/
check_repo_file.go
48 lines (41 loc) · 1.71 KB
/
check_repo_file.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
43
44
45
46
47
48
package opslevel
type RepositoryFileCheckFragment struct {
DirectorySearch bool `graphql:"directorySearch"`
Filepaths []string `graphql:"filePaths"`
FileContentsPredicate *Predicate `graphql:"fileContentsPredicate"`
UseAbsoluteRoot bool `graphql:"useAbsoluteRoot"`
}
type CheckRepositoryFileCreateInput struct {
CheckCreateInput
DirectorySearch bool `json:"directorySearch"`
Filepaths []string `json:"filePaths"`
FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
UseAbsoluteRoot bool `json:"useAbsoluteRoot"`
}
type CheckRepositoryFileUpdateInput struct {
CheckUpdateInput
DirectorySearch bool `json:"directorySearch"`
Filepaths []string `json:"filePaths,omitempty"`
FileContentsPredicate *PredicateInput `json:"fileContentsPredicate,omitempty"`
UseAbsoluteRoot bool `json:"useAbsoluteRoot"`
}
func (client *Client) CreateCheckRepositoryFile(input CheckRepositoryFileCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkRepositoryFileCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckRepositoryFileCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckRepositoryFile(input CheckRepositoryFileUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkRepositoryFileUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckRepositoryFileUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}