Add Pagination Options for List Requests #205
|
@ -31,11 +31,11 @@ type ListAccessTokensOptions struct {
|
||||||
ListOptions
|
ListOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListAccessTokensOptions lists all the access tokens of user
|
// ListAccessTokens lists all the access tokens of user
|
||||||
func (c *Client) ListAccessTokens(user, pass string, opt ListAccessTokensOptions) ([]*AccessToken, error) {
|
func (c *Client) ListAccessTokens(user, pass string, opts ListAccessTokensOptions) ([]*AccessToken, error) {
|
||||||
opt.setDefaults()
|
opts.setDefaults()
|
||||||
tokens := make([]*AccessToken, 0, opt.PageSize)
|
tokens := make([]*AccessToken, 0, opts.PageSize)
|
||||||
return tokens, c.getParsedResponse("GET", fmt.Sprintf("/users/%s/tokens?%s", user, opt.getURLQuery().Encode()),
|
return tokens, c.getParsedResponse("GET", fmt.Sprintf("/users/%s/tokens?%s", user, opts.getURLQuery().Encode()),
|
||||||
http.Header{"Authorization": []string{"Basic " + basicAuthEncode(user, pass)}}, nil, &tokens)
|
http.Header{"Authorization": []string{"Basic " + basicAuthEncode(user, pass)}}, nil, &tokens)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user