Skip to content
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

Update teams_discussions with ByID and BySlug endpoints #1426

Merged
merged 3 commits into from
Feb 27, 2020

Conversation

kadern0
Copy link
Contributor

@kadern0 kadern0 commented Feb 12, 2020

Fixes #1424

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Feb 12, 2020
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @kadern0!

This is almost ready for a second review and merging, but please make the requested changes first.

Also, for future contributions, please indicate on the original issue that you are going to work on it so that others don't also start working on it and duplicating your work. Thank you!

// Authenticated user must grant read:discussion scope.
//
// GitHub API docs: https://developer.github.com/v3/teams/discussions/#list-discussions
func (s *TeamsService) ListDiscussions(ctx context.Context, teamID int64, options *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) {
u := fmt.Sprintf("teams/%v/discussions", teamID)
func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, options *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please change options to opts to match what was recently done in #1417.
Here and throughout this PR.

@@ -44,12 +44,12 @@ type DiscussionListOptions struct {
Direction string `url:"direction,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the documentation, it looks like DiscussionListOptions also needs to embed a ListOptions struct to support pagination. Please add this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct, I've updated it.

@gmlewis gmlewis requested a review from gauntface February 12, 2020 14:09
Replaced options by opts within function parameters
Added ListOptions to DiscussionListOptions

Signed-off-by: Pablo Caderno <[email protected]>
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @kadern0!
LGTM.

Awaiting second LGTM before merging.

@gmlewis gmlewis changed the title Issue 1424 Update teams_discussions with ByID and BySlug endpoints Feb 13, 2020
@gmlewis
Copy link
Collaborator

gmlewis commented Feb 22, 2020

@wesleimp - this could also be reviewed if you have time.

Copy link
Collaborator

@wesleimp wesleimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 27, 2020

Thank you, @wesleimp!
Merging.

@gmlewis gmlewis merged commit 921fbd6 into google:master Feb 27, 2020
n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update teams_discussions.go
5 participants