forked from zzzkl/go-rancher
/
generated_openldapconfig.go
129 lines (91 loc) · 4.53 KB
/
generated_openldapconfig.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
package client
const (
OPENLDAPCONFIG_TYPE = "openldapconfig"
)
type Openldapconfig struct {
Resource `yaml:"-"`
AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"`
AllowedIdentities []Identity `json:"allowedIdentities,omitempty" yaml:"allowed_identities,omitempty"`
ConnectionTimeout int64 `json:"connectionTimeout,omitempty" yaml:"connection_timeout,omitempty"`
Domain string `json:"domain,omitempty" yaml:"domain,omitempty"`
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
GroupDNField string `json:"groupDNField,omitempty" yaml:"group_dnfield,omitempty"`
GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" yaml:"group_member_mapping_attribute,omitempty"`
GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" yaml:"group_member_user_attribute,omitempty"`
GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"`
GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,omitempty"`
GroupSearchDomain string `json:"groupSearchDomain,omitempty" yaml:"group_search_domain,omitempty"`
GroupSearchField string `json:"groupSearchField,omitempty" yaml:"group_search_field,omitempty"`
LoginDomain string `json:"loginDomain,omitempty" yaml:"login_domain,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Port int64 `json:"port,omitempty" yaml:"port,omitempty"`
Server string `json:"server,omitempty" yaml:"server,omitempty"`
ServiceAccountPassword string `json:"serviceAccountPassword,omitempty" yaml:"service_account_password,omitempty"`
ServiceAccountUsername string `json:"serviceAccountUsername,omitempty" yaml:"service_account_username,omitempty"`
Tls bool `json:"tls,omitempty" yaml:"tls,omitempty"`
UserDisabledBitMask int64 `json:"userDisabledBitMask,omitempty" yaml:"user_disabled_bit_mask,omitempty"`
UserEnabledAttribute string `json:"userEnabledAttribute,omitempty" yaml:"user_enabled_attribute,omitempty"`
UserLoginField string `json:"userLoginField,omitempty" yaml:"user_login_field,omitempty"`
UserMemberAttribute string `json:"userMemberAttribute,omitempty" yaml:"user_member_attribute,omitempty"`
UserNameField string `json:"userNameField,omitempty" yaml:"user_name_field,omitempty"`
UserObjectClass string `json:"userObjectClass,omitempty" yaml:"user_object_class,omitempty"`
UserSearchField string `json:"userSearchField,omitempty" yaml:"user_search_field,omitempty"`
}
type OpenldapconfigCollection struct {
Collection
Data []Openldapconfig `json:"data,omitempty"`
client *OpenldapconfigClient
}
type OpenldapconfigClient struct {
rancherClient *RancherClient
}
type OpenldapconfigOperations interface {
List(opts *ListOpts) (*OpenldapconfigCollection, error)
Create(opts *Openldapconfig) (*Openldapconfig, error)
Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error)
ById(id string) (*Openldapconfig, error)
Delete(container *Openldapconfig) error
}
func newOpenldapconfigClient(rancherClient *RancherClient) *OpenldapconfigClient {
return &OpenldapconfigClient{
rancherClient: rancherClient,
}
}
func (c *OpenldapconfigClient) Create(container *Openldapconfig) (*Openldapconfig, error) {
resp := &Openldapconfig{}
err := c.rancherClient.doCreate(OPENLDAPCONFIG_TYPE, container, resp)
return resp, err
}
func (c *OpenldapconfigClient) Update(existing *Openldapconfig, updates interface{}) (*Openldapconfig, error) {
resp := &Openldapconfig{}
err := c.rancherClient.doUpdate(OPENLDAPCONFIG_TYPE, &existing.Resource, updates, resp)
return resp, err
}
func (c *OpenldapconfigClient) List(opts *ListOpts) (*OpenldapconfigCollection, error) {
resp := &OpenldapconfigCollection{}
err := c.rancherClient.doList(OPENLDAPCONFIG_TYPE, opts, resp)
resp.client = c
return resp, err
}
func (cc *OpenldapconfigCollection) Next() (*OpenldapconfigCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &OpenldapconfigCollection{}
err := cc.client.rancherClient.doNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *OpenldapconfigClient) ById(id string) (*Openldapconfig, error) {
resp := &Openldapconfig{}
err := c.rancherClient.doById(OPENLDAPCONFIG_TYPE, id, resp)
if apiError, ok := err.(*ApiError); ok {
if apiError.StatusCode == 404 {
return nil, nil
}
}
return resp, err
}
func (c *OpenldapconfigClient) Delete(container *Openldapconfig) error {
return c.rancherClient.doResourceDelete(OPENLDAPCONFIG_TYPE, &container.Resource)
}