-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcheck_repo_grep.go
29 lines (26 loc) · 1.17 KB
/
check_repo_grep.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 RepositoryGrepCheckFragment struct {
DirectorySearch bool `graphql:"directorySearch"` // Whether the check looks for the existence of a directory instead of a file.
FileContentsPredicate Predicate `graphql:"fileContentsPredicate"` // Condition to match the file content.
Filepaths []string `graphql:"filePaths"` // Restrict the search to certain file paths.
}
func (client *Client) CreateCheckRepositoryGrep(input CheckRepositoryGrepCreateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkRepositoryGrepCreate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckRepositoryGrepCreate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}
func (client *Client) UpdateCheckRepositoryGrep(input CheckRepositoryGrepUpdateInput) (*Check, error) {
var m struct {
Payload CheckResponsePayload `graphql:"checkRepositoryGrepUpdate(input: $input)"`
}
v := PayloadVariables{
"input": input,
}
err := client.Mutate(&m, v, WithName("CheckRepositoryGrepUpdate"))
return &m.Payload.Check, HandleErrors(err, m.Payload.Errors)
}