forked from janeczku/rancher-letsencrypt
/
generated_external_handler_process_config.go
69 lines (56 loc) · 2.49 KB
/
generated_external_handler_process_config.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
63
64
65
66
67
68
69
package client
const (
EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE = "externalHandlerProcessConfig"
)
type ExternalHandlerProcessConfig struct {
Resource
Name string `json:"name,omitempty" yaml:"name,omitempty"`
OnError string `json:"onError,omitempty" yaml:"on_error,omitempty"`
}
type ExternalHandlerProcessConfigCollection struct {
Collection
Data []ExternalHandlerProcessConfig `json:"data,omitempty"`
}
type ExternalHandlerProcessConfigClient struct {
rancherClient *RancherClient
}
type ExternalHandlerProcessConfigOperations interface {
List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error)
Create(opts *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error)
Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error)
ById(id string) (*ExternalHandlerProcessConfig, error)
Delete(container *ExternalHandlerProcessConfig) error
}
func newExternalHandlerProcessConfigClient(rancherClient *RancherClient) *ExternalHandlerProcessConfigClient {
return &ExternalHandlerProcessConfigClient{
rancherClient: rancherClient,
}
}
func (c *ExternalHandlerProcessConfigClient) Create(container *ExternalHandlerProcessConfig) (*ExternalHandlerProcessConfig, error) {
resp := &ExternalHandlerProcessConfig{}
err := c.rancherClient.doCreate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, container, resp)
return resp, err
}
func (c *ExternalHandlerProcessConfigClient) Update(existing *ExternalHandlerProcessConfig, updates interface{}) (*ExternalHandlerProcessConfig, error) {
resp := &ExternalHandlerProcessConfig{}
err := c.rancherClient.doUpdate(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &existing.Resource, updates, resp)
return resp, err
}
func (c *ExternalHandlerProcessConfigClient) List(opts *ListOpts) (*ExternalHandlerProcessConfigCollection, error) {
resp := &ExternalHandlerProcessConfigCollection{}
err := c.rancherClient.doList(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, opts, resp)
return resp, err
}
func (c *ExternalHandlerProcessConfigClient) ById(id string) (*ExternalHandlerProcessConfig, error) {
resp := &ExternalHandlerProcessConfig{}
err := c.rancherClient.doById(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, id, resp)
if apiError, ok := err.(*ApiError); ok {
if apiError.StatusCode == 404 {
return nil, nil
}
}
return resp, err
}
func (c *ExternalHandlerProcessConfigClient) Delete(container *ExternalHandlerProcessConfig) error {
return c.rancherClient.doResourceDelete(EXTERNAL_HANDLER_PROCESS_CONFIG_TYPE, &container.Resource)
}