forked from rancher/go-machine-service
/
generated_field_documentation.go
62 lines (50 loc) · 1.96 KB
/
generated_field_documentation.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package client
const (
FIELD_DOCUMENTATION_TYPE = "fieldDocumentation"
)
type FieldDocumentation struct {
Resource
Description string `json:"description,omitempty" yaml:"description,omitempty"`
}
type FieldDocumentationCollection struct {
Collection
Data []FieldDocumentation `json:"data,omitempty"`
}
type FieldDocumentationClient struct {
rancherClient *RancherClient
}
type FieldDocumentationOperations interface {
List(opts *ListOpts) (*FieldDocumentationCollection, error)
Create(opts *FieldDocumentation) (*FieldDocumentation, error)
Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error)
ById(id string) (*FieldDocumentation, error)
Delete(container *FieldDocumentation) error
}
func newFieldDocumentationClient(rancherClient *RancherClient) *FieldDocumentationClient {
return &FieldDocumentationClient{
rancherClient: rancherClient,
}
}
func (c *FieldDocumentationClient) Create(container *FieldDocumentation) (*FieldDocumentation, error) {
resp := &FieldDocumentation{}
err := c.rancherClient.doCreate(FIELD_DOCUMENTATION_TYPE, container, resp)
return resp, err
}
func (c *FieldDocumentationClient) Update(existing *FieldDocumentation, updates interface{}) (*FieldDocumentation, error) {
resp := &FieldDocumentation{}
err := c.rancherClient.doUpdate(FIELD_DOCUMENTATION_TYPE, &existing.Resource, updates, resp)
return resp, err
}
func (c *FieldDocumentationClient) List(opts *ListOpts) (*FieldDocumentationCollection, error) {
resp := &FieldDocumentationCollection{}
err := c.rancherClient.doList(FIELD_DOCUMENTATION_TYPE, opts, resp)
return resp, err
}
func (c *FieldDocumentationClient) ById(id string) (*FieldDocumentation, error) {
resp := &FieldDocumentation{}
err := c.rancherClient.doById(FIELD_DOCUMENTATION_TYPE, id, resp)
return resp, err
}
func (c *FieldDocumentationClient) Delete(container *FieldDocumentation) error {
return c.rancherClient.doResourceDelete(FIELD_DOCUMENTATION_TYPE, &container.Resource)
}