-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
zz_generated_global_role_binding.go
124 lines (109 loc) · 4.61 KB
/
zz_generated_global_role_binding.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
package client
import (
"github.com/rancher/norman/types"
)
const (
GlobalRoleBindingType = "globalRoleBinding"
GlobalRoleBindingFieldAnnotations = "annotations"
GlobalRoleBindingFieldCreated = "created"
GlobalRoleBindingFieldCreatorID = "creatorId"
GlobalRoleBindingFieldGlobalRoleID = "globalRoleId"
GlobalRoleBindingFieldGroupPrincipalID = "groupPrincipalId"
GlobalRoleBindingFieldLabels = "labels"
GlobalRoleBindingFieldName = "name"
GlobalRoleBindingFieldOwnerReferences = "ownerReferences"
GlobalRoleBindingFieldRemoved = "removed"
GlobalRoleBindingFieldUUID = "uuid"
GlobalRoleBindingFieldUserID = "userId"
)
type GlobalRoleBinding struct {
types.Resource
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
Created string `json:"created,omitempty" yaml:"created,omitempty"`
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
GlobalRoleID string `json:"globalRoleId,omitempty" yaml:"globalRoleId,omitempty"`
GroupPrincipalID string `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
UserID string `json:"userId,omitempty" yaml:"userId,omitempty"`
}
type GlobalRoleBindingCollection struct {
types.Collection
Data []GlobalRoleBinding `json:"data,omitempty"`
client *GlobalRoleBindingClient
}
type GlobalRoleBindingClient struct {
apiClient *Client
}
type GlobalRoleBindingOperations interface {
List(opts *types.ListOpts) (*GlobalRoleBindingCollection, error)
ListAll(opts *types.ListOpts) (*GlobalRoleBindingCollection, error)
Create(opts *GlobalRoleBinding) (*GlobalRoleBinding, error)
Update(existing *GlobalRoleBinding, updates interface{}) (*GlobalRoleBinding, error)
Replace(existing *GlobalRoleBinding) (*GlobalRoleBinding, error)
ByID(id string) (*GlobalRoleBinding, error)
Delete(container *GlobalRoleBinding) error
}
func newGlobalRoleBindingClient(apiClient *Client) *GlobalRoleBindingClient {
return &GlobalRoleBindingClient{
apiClient: apiClient,
}
}
func (c *GlobalRoleBindingClient) Create(container *GlobalRoleBinding) (*GlobalRoleBinding, error) {
resp := &GlobalRoleBinding{}
err := c.apiClient.Ops.DoCreate(GlobalRoleBindingType, container, resp)
return resp, err
}
func (c *GlobalRoleBindingClient) Update(existing *GlobalRoleBinding, updates interface{}) (*GlobalRoleBinding, error) {
resp := &GlobalRoleBinding{}
err := c.apiClient.Ops.DoUpdate(GlobalRoleBindingType, &existing.Resource, updates, resp)
return resp, err
}
func (c *GlobalRoleBindingClient) Replace(obj *GlobalRoleBinding) (*GlobalRoleBinding, error) {
resp := &GlobalRoleBinding{}
err := c.apiClient.Ops.DoReplace(GlobalRoleBindingType, &obj.Resource, obj, resp)
return resp, err
}
func (c *GlobalRoleBindingClient) List(opts *types.ListOpts) (*GlobalRoleBindingCollection, error) {
resp := &GlobalRoleBindingCollection{}
err := c.apiClient.Ops.DoList(GlobalRoleBindingType, opts, resp)
resp.client = c
return resp, err
}
func (c *GlobalRoleBindingClient) ListAll(opts *types.ListOpts) (*GlobalRoleBindingCollection, error) {
resp := &GlobalRoleBindingCollection{}
resp, err := c.List(opts)
if err != nil {
return resp, err
}
data := resp.Data
for next, err := resp.Next(); next != nil && err == nil; next, err = next.Next() {
data = append(data, next.Data...)
resp = next
resp.Data = data
}
if err != nil {
return resp, err
}
return resp, err
}
func (cc *GlobalRoleBindingCollection) Next() (*GlobalRoleBindingCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &GlobalRoleBindingCollection{}
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *GlobalRoleBindingClient) ByID(id string) (*GlobalRoleBinding, error) {
resp := &GlobalRoleBinding{}
err := c.apiClient.Ops.DoByID(GlobalRoleBindingType, id, resp)
return resp, err
}
func (c *GlobalRoleBindingClient) Delete(container *GlobalRoleBinding) error {
return c.apiClient.Ops.DoResourceDelete(GlobalRoleBindingType, &container.Resource)
}