forked from rancher/go-machine-service
/
generated_ldapconfig.go
100 lines (69 loc) · 3.25 KB
/
generated_ldapconfig.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
package client
const (
LDAPCONFIG_TYPE = "ldapconfig"
)
type Ldapconfig struct {
Resource
AccessMode string `json:"accessMode,omitempty" yaml:"access_mode,omitempty"`
Configured bool `json:"configured,omitempty" yaml:"configured,omitempty"`
Domain string `json:"domain,omitempty" yaml:"domain,omitempty"`
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
GroupNameField string `json:"groupNameField,omitempty" yaml:"group_name_field,omitempty"`
GroupObjectClass string `json:"groupObjectClass,omitempty" yaml:"group_object_class,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"`
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 LdapconfigCollection struct {
Collection
Data []Ldapconfig `json:"data,omitempty"`
}
type LdapconfigClient struct {
rancherClient *RancherClient
}
type LdapconfigOperations interface {
List(opts *ListOpts) (*LdapconfigCollection, error)
Create(opts *Ldapconfig) (*Ldapconfig, error)
Update(existing *Ldapconfig, updates interface{}) (*Ldapconfig, error)
ById(id string) (*Ldapconfig, error)
Delete(container *Ldapconfig) error
}
func newLdapconfigClient(rancherClient *RancherClient) *LdapconfigClient {
return &LdapconfigClient{
rancherClient: rancherClient,
}
}
func (c *LdapconfigClient) Create(container *Ldapconfig) (*Ldapconfig, error) {
resp := &Ldapconfig{}
err := c.rancherClient.doCreate(LDAPCONFIG_TYPE, container, resp)
return resp, err
}
func (c *LdapconfigClient) Update(existing *Ldapconfig, updates interface{}) (*Ldapconfig, error) {
resp := &Ldapconfig{}
err := c.rancherClient.doUpdate(LDAPCONFIG_TYPE, &existing.Resource, updates, resp)
return resp, err
}
func (c *LdapconfigClient) List(opts *ListOpts) (*LdapconfigCollection, error) {
resp := &LdapconfigCollection{}
err := c.rancherClient.doList(LDAPCONFIG_TYPE, opts, resp)
return resp, err
}
func (c *LdapconfigClient) ById(id string) (*Ldapconfig, error) {
resp := &Ldapconfig{}
err := c.rancherClient.doById(LDAPCONFIG_TYPE, id, resp)
return resp, err
}
func (c *LdapconfigClient) Delete(container *Ldapconfig) error {
return c.rancherClient.doResourceDelete(LDAPCONFIG_TYPE, &container.Resource)
}