-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add GetUsersByGroupID #291
add GetUsersByGroupID #291
Conversation
Hi @paoloromolini , please refer to this doc https://github.com/nukosuke/go-zendesk/blob/master/CBPMigration.md, Zendesk is obsoleting OBP (Offset Based Pagination), please follow the new way to create CBP (Cursor Based Pagination) iterators and starting to adopt CBP in your code base. |
f41acaf
to
7246525
Compare
Hi @JinHuangAtZen I've added a new commit following your instructions. Please let me know if it is correct. |
zendesk/user.go
Outdated
@@ -128,6 +129,8 @@ type UserAPI interface { | |||
GetOrganizationUsersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[User] | |||
GetOrganizationUsersOBP(ctx context.Context, opts *OBPOptions) ([]User, Page, error) | |||
GetOrganizationUsersCBP(ctx context.Context, opts *CBPOptions) ([]User, CursorPaginationMeta, error) | |||
GetGroupUsersOBP(ctx context.Context, opts *OBPOptions) ([]User, Page, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing the generated GetGroupUsersIterator(ctx context.Context, opts *PaginationOptions) *Iterator[User]
zendesk/user.go
Outdated
@@ -116,6 +116,7 @@ type UserAPI interface { | |||
SearchUsers(ctx context.Context, opts *SearchUsersOptions) ([]User, Page, error) | |||
GetManyUsers(ctx context.Context, opts *GetManyUsersOptions) ([]User, Page, error) | |||
GetUsers(ctx context.Context, opts *UserListOptions) ([]User, Page, error) | |||
GetUsersByGroupID(ctx context.Context, groupID int64, opts *UserListOptions) ([]User, Page, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still using the old OBP UserListOptions
and this function shouldn't be exist, it should be replaced by the newly generated GetGroupUsersIterator
function.
zendesk/user.go
Outdated
//TODO: GetUsersByGroupID, GetUsersByOrganizationID | ||
// GetUsersByGroupID get users by group ID | ||
// ref: https://developer.zendesk.com/api-reference/ticketing/users/users/#list-users | ||
func (z *Client) GetUsersByGroupID(ctx context.Context, groupID int64, opts *UserListOptions) ([]User, Page, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still using the old OBP UserListOptions and this function shouldn't be exist, it should be replaced by the newly generated GetGroupUsersIterator function.
Hi @paoloromolini , Thanks for adding the new methods, I've added some comments, basically, the new |
30c306e
to
de1473d
Compare
de1473d
to
780ad86
Compare
Adding get users by group id function.