~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/idmclient/client_generated.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// The code in this file was automatically generated by running httprequest-generate-client.
 
2
// DO NOT EDIT
 
3
 
 
4
package idmclient
 
5
 
 
6
import (
 
7
        "github.com/juju/httprequest"
 
8
        "gopkg.in/macaroon.v1"
 
9
 
 
10
        "github.com/juju/idmclient/params"
 
11
)
 
12
 
 
13
type client struct {
 
14
        Client httprequest.Client
 
15
}
 
16
 
 
17
// QueryUsers serves the /u endpoint. See http://tinyurl.com/lu3mmr9 for
 
18
// details.
 
19
func (c *client) QueryUsers(p *params.QueryUsersRequest) ([]string, error) {
 
20
        var r []string
 
21
        err := c.Client.Call(p, &r)
 
22
        return r, err
 
23
}
 
24
 
 
25
func (c *client) SetUser(p *params.SetUserRequest) error {
 
26
        return c.Client.Call(p, nil)
 
27
}
 
28
 
 
29
// SetUserExtraInfo serves the /v1/u/:username/extra-info endpoint, see
 
30
// http://tinyurl.com/mqpynlw for details.
 
31
func (c *client) SetUserExtraInfo(p *params.SetUserExtraInfoRequest) error {
 
32
        return c.Client.Call(p, nil)
 
33
}
 
34
 
 
35
// ServeUserPutExtraInfoItem serves the /u/:username/extra-info/:item
 
36
// endpoint, see http://tinyurl.com/l5dc4r4 for details.
 
37
func (c *client) SetUserExtraInfoItem(p *params.SetUserExtraInfoItemRequest) error {
 
38
        return c.Client.Call(p, nil)
 
39
}
 
40
 
 
41
// User serves the /u/$username endpoint. See http://tinyurl.com/lrdjwmw
 
42
// for details.
 
43
func (c *client) User(p *params.UserRequest) (*params.User, error) {
 
44
        var r *params.User
 
45
        err := c.Client.Call(p, &r)
 
46
        return r, err
 
47
}
 
48
 
 
49
// UserExtraInfo serves the /v1/u/:username/extra-info endpoint, see
 
50
// http://tinyurl.com/mxo24yy for details.
 
51
func (c *client) UserExtraInfo(p *params.UserExtraInfoRequest) (map[string]interface{}, error) {
 
52
        var r map[string]interface{}
 
53
        err := c.Client.Call(p, &r)
 
54
        return r, err
 
55
}
 
56
 
 
57
// UserExtraInfoItem serves the /u/:username/extra-info/:item
 
58
// endpoint, see http://tinyurl.com/mjuu7dt for details.
 
59
func (c *client) UserExtraInfoItem(p *params.UserExtraInfoItemRequest) (interface{}, error) {
 
60
        var r interface{}
 
61
        err := c.Client.Call(p, &r)
 
62
        return r, err
 
63
}
 
64
 
 
65
// serveUserGroups serves the /u/$username/groups endpoint, and returns
 
66
// the list of groups associated with the user.
 
67
func (c *client) UserGroups(p *params.UserGroupsRequest) ([]string, error) {
 
68
        var r []string
 
69
        err := c.Client.Call(p, &r)
 
70
        return r, err
 
71
}
 
72
 
 
73
// UserIDPGroups serves the /u/$username/idpgroups endpoint, and returns
 
74
// the list of groups associated with the user. This endpoint should no longer be used
 
75
// and is maintained for backwards compatibility purposes only.
 
76
func (c *client) UserIDPGroups(p *params.UserIDPGroupsRequest) ([]string, error) {
 
77
        var r []string
 
78
        err := c.Client.Call(p, &r)
 
79
        return r, err
 
80
}
 
81
 
 
82
// UserToken serves a token, in the form of a macaroon, identifying
 
83
// the user. This token can only be generated by an administrator.
 
84
func (c *client) UserToken(p *params.UserTokenRequest) (*macaroon.Macaroon, error) {
 
85
        var r *macaroon.Macaroon
 
86
        err := c.Client.Call(p, &r)
 
87
        return r, err
 
88
}
 
89
 
 
90
func (c *client) VerifyToken(p *params.VerifyTokenRequest) (map[string]string, error) {
 
91
        var r map[string]string
 
92
        err := c.Client.Call(p, &r)
 
93
        return r, err
 
94
}