-
Notifications
You must be signed in to change notification settings - Fork 13
/
document.go
37 lines (33 loc) · 1.23 KB
/
document.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
package opslevel
type ServiceDocumentSource struct {
IntegrationId `graphql:"... on ApiDocIntegration"`
ServiceRepository `graphql:"... on ServiceRepository"`
}
type ServiceDocument struct {
Id ID `graphql:"id" json:"id"`
HtmlURL string `graphql:"htmlUrl" json:"htmUrl,omitempty"`
Source ServiceDocumentSource `graphql:"source" json:"source"`
Timestamps Timestamps `graphql:"timestamps" json:"timestamps"`
}
type ServiceDocumentContent struct {
ServiceDocument
Content string `graphql:"content" json:"content,omitempty"`
}
func (client *Client) ServiceApiDocSettingsUpdate(service string, docPath string, docSource *ApiDocumentSourceEnum) (*Service, error) {
var m struct {
Payload struct {
Service Service
Errors []OpsLevelErrors
} `graphql:"serviceApiDocSettingsUpdate(service: $service, apiDocumentPath: $docPath, preferredApiDocumentSource: $docSource)"`
}
v := PayloadVariables{
"service": *NewIdentifier(service),
"docPath": (*string)(nil),
"docSource": docSource,
}
if docPath != "" {
v["docPath"] = &docPath
}
err := client.Mutate(&m, v, WithName("ServiceApiDocSettingsUpdate"))
return &m.Payload.Service, HandleErrors(err, m.Payload.Errors)
}