forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_oauthaccesstoken.go
50 lines (39 loc) · 1.7 KB
/
fake_oauthaccesstoken.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
package testclient
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/testing/core"
oauthapi "github.com/openshift/origin/pkg/oauth/api"
)
// FakeOAuthAccessTokens implements OAuthAccessTokenInterface. Meant to be embedded into a struct to get a default
// implementation. This makes faking out just the methods you want to test easier.
type FakeOAuthAccessTokens struct {
Fake *Fake
}
var oAuthAccessTokensResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "oauthaccesstokens"}
func (c *FakeOAuthAccessTokens) Delete(name string) error {
_, err := c.Fake.Invokes(core.NewRootDeleteAction(oAuthAccessTokensResource, name), &oauthapi.OAuthAccessToken{})
return err
}
func (c *FakeOAuthAccessTokens) Create(inObj *oauthapi.OAuthAccessToken) (*oauthapi.OAuthAccessToken, error) {
obj, err := c.Fake.Invokes(core.NewRootCreateAction(oAuthAccessTokensResource, inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthAccessToken), err
}
// Get returns information about a particular image and error if one occurs.
func (c *FakeOAuthAccessTokens) Get(name string) (*oauthapi.OAuthAccessToken, error) {
obj, err := c.Fake.Invokes(core.NewRootGetAction(oAuthAccessTokensResource, name), &oauthapi.OAuthAccessToken{})
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthAccessToken), err
}
func (c *FakeOAuthAccessTokens) List(opts kapi.ListOptions) (*oauthapi.OAuthAccessTokenList, error) {
obj, err := c.Fake.Invokes(core.NewRootListAction(oAuthAccessTokensResource, opts), &oauthapi.OAuthAccessTokenList{})
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthAccessTokenList), err
}