Skip to content

Commit c0bc35e

Browse files
committed
Merge branch 'master' into skip-parameter
* master: Groups: Add _more_groups attribute to GroupInfo Fix #92: Add pagination support for SuggestAccount
2 parents 3685df1 + ff14d06 commit c0bc35e

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

accounts.go

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ type AccountsService struct {
1212
}
1313

1414
// AccountInfo entity contains information about an account.
15+
//
16+
// TODO Add field secondary_emails
17+
// TODO Add field status
18+
// TODO Add field inactive
19+
// TODO Add field tags
20+
//
21+
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#account-info
1522
type AccountInfo struct {
16-
AccountID int `json:"_account_id,omitempty"`
17-
Name string `json:"name,omitempty"`
18-
Email string `json:"email,omitempty"`
19-
Username string `json:"username,omitempty"`
23+
AccountID int `json:"_account_id,omitempty"`
24+
Name string `json:"name,omitempty"`
25+
DisplayName string `json:"display_name,omitempty"`
26+
Email string `json:"email,omitempty"`
27+
Username string `json:"username,omitempty"`
2028

2129
// Avatars lists avatars of various sizes for the account.
2230
// This field is only populated if the avatars plugin is enabled.
@@ -27,6 +35,14 @@ type AccountInfo struct {
2735
MoreAccounts bool `json:"_more_accounts,omitempty"`
2836
}
2937

38+
// QueryAccountOptions queries accounts visible to the caller.
39+
type QueryAccountOptions struct {
40+
QueryOptions
41+
42+
// The `S` or `start` query parameter can be supplied to skip a number of accounts from the list.
43+
Start int `url:"S,omitempty"`
44+
}
45+
3046
// SSHKeyInfo entity contains information about an SSH key of a user.
3147
type SSHKeyInfo struct {
3248
Seq int `json:"seq"`
@@ -519,7 +535,7 @@ func (s *AccountsService) GetStarredChanges(accountID string) (*[]ChangeInfo, *R
519535
// Returns a list of matching AccountInfo entities.
520536
//
521537
// Gerrit API docs: https://gerrit-review.googlesource.com/Documentation/rest-api-accounts.html#query-account
522-
func (s *AccountsService) SuggestAccount(opt *QueryOptions) (*[]AccountInfo, *Response, error) {
538+
func (s *AccountsService) SuggestAccount(opt *QueryAccountOptions) (*[]AccountInfo, *Response, error) {
523539
u := "accounts/"
524540

525541
u, err := addOptions(u, opt)

groups.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type GroupInfo struct {
3131
Owner string `json:"owner,omitempty"`
3232
OwnerID string `json:"owner_id,omitempty"`
3333
CreatedOn *Timestamp `json:"created_on,omitempty"`
34+
MoreGroups bool `json:"_more_groups,omitempty"`
3435
Members []AccountInfo `json:"members,omitempty"`
3536
Includes []GroupInfo `json:"includes,omitempty"`
3637
}

0 commit comments

Comments
 (0)