forked from rancher/go-machine-service
/
generated_compose_config_input.go
62 lines (50 loc) · 1.96 KB
/
generated_compose_config_input.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 (
COMPOSE_CONFIG_INPUT_TYPE = "composeConfigInput"
)
type ComposeConfigInput struct {
Resource
ServiceIds []string `json:"serviceIds,omitempty" yaml:"service_ids,omitempty"`
}
type ComposeConfigInputCollection struct {
Collection
Data []ComposeConfigInput `json:"data,omitempty"`
}
type ComposeConfigInputClient struct {
rancherClient *RancherClient
}
type ComposeConfigInputOperations interface {
List(opts *ListOpts) (*ComposeConfigInputCollection, error)
Create(opts *ComposeConfigInput) (*ComposeConfigInput, error)
Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error)
ById(id string) (*ComposeConfigInput, error)
Delete(container *ComposeConfigInput) error
}
func newComposeConfigInputClient(rancherClient *RancherClient) *ComposeConfigInputClient {
return &ComposeConfigInputClient{
rancherClient: rancherClient,
}
}
func (c *ComposeConfigInputClient) Create(container *ComposeConfigInput) (*ComposeConfigInput, error) {
resp := &ComposeConfigInput{}
err := c.rancherClient.doCreate(COMPOSE_CONFIG_INPUT_TYPE, container, resp)
return resp, err
}
func (c *ComposeConfigInputClient) Update(existing *ComposeConfigInput, updates interface{}) (*ComposeConfigInput, error) {
resp := &ComposeConfigInput{}
err := c.rancherClient.doUpdate(COMPOSE_CONFIG_INPUT_TYPE, &existing.Resource, updates, resp)
return resp, err
}
func (c *ComposeConfigInputClient) List(opts *ListOpts) (*ComposeConfigInputCollection, error) {
resp := &ComposeConfigInputCollection{}
err := c.rancherClient.doList(COMPOSE_CONFIG_INPUT_TYPE, opts, resp)
return resp, err
}
func (c *ComposeConfigInputClient) ById(id string) (*ComposeConfigInput, error) {
resp := &ComposeConfigInput{}
err := c.rancherClient.doById(COMPOSE_CONFIG_INPUT_TYPE, id, resp)
return resp, err
}
func (c *ComposeConfigInputClient) Delete(container *ComposeConfigInput) error {
return c.rancherClient.doResourceDelete(COMPOSE_CONFIG_INPUT_TYPE, &container.Resource)
}