forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oauthauthorizetoken.go
35 lines (28 loc) · 956 Bytes
/
oauthauthorizetoken.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
package client
import (
oauthapi "github.com/openshift/origin/pkg/oauth/api"
)
type OAuthAuthorizeTokensInterface interface {
OAuthAuthorizeTokens() OAuthAuthorizeTokenInterface
}
type OAuthAuthorizeTokenInterface interface {
Create(token *oauthapi.OAuthAuthorizeToken) (*oauthapi.OAuthAuthorizeToken, error)
Delete(name string) error
}
type oauthAuthorizeTokenInterface struct {
r *Client
}
func newOAuthAuthorizeTokens(c *Client) *oauthAuthorizeTokenInterface {
return &oauthAuthorizeTokenInterface{
r: c,
}
}
func (c *oauthAuthorizeTokenInterface) Delete(name string) (err error) {
err = c.r.Delete().Resource("oAuthAuthorizeTokens").Name(name).Do().Error()
return
}
func (c *oauthAuthorizeTokenInterface) Create(token *oauthapi.OAuthAuthorizeToken) (result *oauthapi.OAuthAuthorizeToken, err error) {
result = &oauthapi.OAuthAuthorizeToken{}
err = c.r.Post().Resource("oAuthAuthorizeTokens").Body(token).Do().Into(result)
return
}