/
useridentitymapping.go
80 lines (71 loc) · 2.88 KB
/
useridentitymapping.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
package internalversion
import (
user "github.com/openshift/origin/pkg/user/apis/user"
scheme "github.com/openshift/origin/pkg/user/generated/internalclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
rest "k8s.io/client-go/rest"
)
// UserIdentityMappingsGetter has a method to return a UserIdentityMappingInterface.
// A group's client should implement this interface.
type UserIdentityMappingsGetter interface {
UserIdentityMappings() UserIdentityMappingInterface
}
// UserIdentityMappingInterface has methods to work with UserIdentityMapping resources.
type UserIdentityMappingInterface interface {
Create(*user.UserIdentityMapping) (*user.UserIdentityMapping, error)
Update(*user.UserIdentityMapping) (*user.UserIdentityMapping, error)
Delete(name string, options *v1.DeleteOptions) error
Get(name string, options v1.GetOptions) (*user.UserIdentityMapping, error)
UserIdentityMappingExpansion
}
// userIdentityMappings implements UserIdentityMappingInterface
type userIdentityMappings struct {
client rest.Interface
}
// newUserIdentityMappings returns a UserIdentityMappings
func newUserIdentityMappings(c *UserClient) *userIdentityMappings {
return &userIdentityMappings{
client: c.RESTClient(),
}
}
// Get takes name of the userIdentityMapping, and returns the corresponding userIdentityMapping object, and an error if there is any.
func (c *userIdentityMappings) Get(name string, options v1.GetOptions) (result *user.UserIdentityMapping, err error) {
result = &user.UserIdentityMapping{}
err = c.client.Get().
Resource("useridentitymappings").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Create takes the representation of a userIdentityMapping and creates it. Returns the server's representation of the userIdentityMapping, and an error, if there is any.
func (c *userIdentityMappings) Create(userIdentityMapping *user.UserIdentityMapping) (result *user.UserIdentityMapping, err error) {
result = &user.UserIdentityMapping{}
err = c.client.Post().
Resource("useridentitymappings").
Body(userIdentityMapping).
Do().
Into(result)
return
}
// Update takes the representation of a userIdentityMapping and updates it. Returns the server's representation of the userIdentityMapping, and an error, if there is any.
func (c *userIdentityMappings) Update(userIdentityMapping *user.UserIdentityMapping) (result *user.UserIdentityMapping, err error) {
result = &user.UserIdentityMapping{}
err = c.client.Put().
Resource("useridentitymappings").
Name(userIdentityMapping.Name).
Body(userIdentityMapping).
Do().
Into(result)
return
}
// Delete takes name of the userIdentityMapping and deletes it. Returns an error if one occurs.
func (c *userIdentityMappings) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("useridentitymappings").
Name(name).
Body(options).
Do().
Error()
}