/
zz_generated_listen_config.go
139 lines (125 loc) · 6.45 KB
/
zz_generated_listen_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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
package client
import (
"github.com/rancher/norman/types"
)
const (
ListenConfigType = "listenConfig"
ListenConfigFieldAlgorithm = "algorithm"
ListenConfigFieldCACert = "caCert"
ListenConfigFieldCACerts = "caCerts"
ListenConfigFieldCAKey = "caKey"
ListenConfigFieldCN = "cn"
ListenConfigFieldCert = "cert"
ListenConfigFieldCertFingerprint = "certFingerprint"
ListenConfigFieldCreated = "created"
ListenConfigFieldDescription = "description"
ListenConfigFieldDisplayName = "displayName"
ListenConfigFieldDomains = "domains"
ListenConfigFieldEnabled = "enabled"
ListenConfigFieldExpiresAt = "expiresAt"
ListenConfigFieldGeneratedCerts = "generatedCerts"
ListenConfigFieldIssuedAt = "issuedAt"
ListenConfigFieldIssuer = "issuer"
ListenConfigFieldKey = "key"
ListenConfigFieldKeySize = "keySize"
ListenConfigFieldKnownIPs = "knownIps"
ListenConfigFieldLabels = "labels"
ListenConfigFieldMode = "mode"
ListenConfigFieldName = "name"
ListenConfigFieldRemoved = "removed"
ListenConfigFieldSerialNumber = "serialNumber"
ListenConfigFieldSubjectAlternativeNames = "subjectAlternativeNames"
ListenConfigFieldTOS = "tos"
ListenConfigFieldUUID = "uuid"
ListenConfigFieldVersion = "version"
)
type ListenConfig struct {
types.Resource
Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
CACert string `json:"caCert,omitempty" yaml:"caCert,omitempty"`
CACerts string `json:"caCerts,omitempty" yaml:"caCerts,omitempty"`
CAKey string `json:"caKey,omitempty" yaml:"caKey,omitempty"`
CN string `json:"cn,omitempty" yaml:"cn,omitempty"`
Cert string `json:"cert,omitempty" yaml:"cert,omitempty"`
CertFingerprint string `json:"certFingerprint,omitempty" yaml:"certFingerprint,omitempty"`
Created string `json:"created,omitempty" yaml:"created,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
Domains []string `json:"domains,omitempty" yaml:"domains,omitempty"`
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"`
GeneratedCerts map[string]string `json:"generatedCerts,omitempty" yaml:"generatedCerts,omitempty"`
IssuedAt string `json:"issuedAt,omitempty" yaml:"issuedAt,omitempty"`
Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"`
Key string `json:"key,omitempty" yaml:"key,omitempty"`
KeySize int64 `json:"keySize,omitempty" yaml:"keySize,omitempty"`
KnownIPs []string `json:"knownIps,omitempty" yaml:"knownIps,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Mode string `json:"mode,omitempty" yaml:"mode,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
SerialNumber string `json:"serialNumber,omitempty" yaml:"serialNumber,omitempty"`
SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty" yaml:"subjectAlternativeNames,omitempty"`
TOS []string `json:"tos,omitempty" yaml:"tos,omitempty"`
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
Version int64 `json:"version,omitempty" yaml:"version,omitempty"`
}
type ListenConfigCollection struct {
types.Collection
Data []ListenConfig `json:"data,omitempty"`
client *ListenConfigClient
}
type ListenConfigClient struct {
apiClient *Client
}
type ListenConfigOperations interface {
List(opts *types.ListOpts) (*ListenConfigCollection, error)
Create(opts *ListenConfig) (*ListenConfig, error)
Update(existing *ListenConfig, updates interface{}) (*ListenConfig, error)
Replace(existing *ListenConfig) (*ListenConfig, error)
ByID(id string) (*ListenConfig, error)
Delete(container *ListenConfig) error
}
func newListenConfigClient(apiClient *Client) *ListenConfigClient {
return &ListenConfigClient{
apiClient: apiClient,
}
}
func (c *ListenConfigClient) Create(container *ListenConfig) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoCreate(ListenConfigType, container, resp)
return resp, err
}
func (c *ListenConfigClient) Update(existing *ListenConfig, updates interface{}) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoUpdate(ListenConfigType, &existing.Resource, updates, resp)
return resp, err
}
func (c *ListenConfigClient) Replace(obj *ListenConfig) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoReplace(ListenConfigType, &obj.Resource, obj, resp)
return resp, err
}
func (c *ListenConfigClient) List(opts *types.ListOpts) (*ListenConfigCollection, error) {
resp := &ListenConfigCollection{}
err := c.apiClient.Ops.DoList(ListenConfigType, opts, resp)
resp.client = c
return resp, err
}
func (cc *ListenConfigCollection) Next() (*ListenConfigCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &ListenConfigCollection{}
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *ListenConfigClient) ByID(id string) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoByID(ListenConfigType, id, resp)
return resp, err
}
func (c *ListenConfigClient) Delete(container *ListenConfig) error {
return c.apiClient.Ops.DoResourceDelete(ListenConfigType, &container.Resource)
}