forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_oauthclient.go
49 lines (38 loc) · 1.39 KB
/
fake_oauthclient.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
package testclient
import (
kapi "k8s.io/kubernetes/pkg/api"
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/watch"
oauthapi "github.com/openshift/origin/pkg/oauth/api"
)
type FakeOAuthClient struct {
Fake *Fake
}
func (c *FakeOAuthClient) Get(name string) (*oauthapi.OAuthClient, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootGetAction("oauthclients", name), &oauthapi.OAuthClient{})
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthClient), err
}
func (c *FakeOAuthClient) List(opts kapi.ListOptions) (*oauthapi.OAuthClientList, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootListAction("oauthclients", opts), &oauthapi.OAuthClientList{})
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthClientList), err
}
func (c *FakeOAuthClient) Create(inObj *oauthapi.OAuthClient) (*oauthapi.OAuthClient, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootCreateAction("oauthclients", inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*oauthapi.OAuthClient), err
}
func (c *FakeOAuthClient) Delete(name string) error {
_, err := c.Fake.Invokes(ktestclient.NewRootDeleteAction("oauthclients", name), &oauthapi.OAuthClient{})
return err
}
func (c *FakeOAuthClient) Watch(opts kapi.ListOptions) (watch.Interface, error) {
return c.Fake.InvokesWatch(ktestclient.NewRootWatchAction("oauthclients", opts))
}