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

Invitation endpoint #360

Closed

Conversation

sajidanower23
Copy link
Contributor

  • Adds a new type for RepoInvitation (some of the collaborator endpoints don't have to ignore the JSON returned by Github anymore)
  • Adds a module for the Invitations endpoint

@@ -78,6 +78,6 @@ addCollaboratorR
:: Name Owner -- ^ Repository owner
-> Name Repo -- ^ Repository name
-> Name User -- ^ Collaborator to add
-> GenRequest 'MtUnit 'RW ()
-> GenRequest 'MtJSON 'RW RepoInvitation
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@sajidanower23 sajidanower23 May 2, 2019

Choose a reason for hiding this comment

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

is there value in returning invitation?

I think so. We wrote a tool to automate some Github work for our project, and a part of it was inviting some users to a repo and then send the invitation id to the user for them to accept.
For automated work, the information returned from API calls can be valuable, as it saves a subsequent API call.

It's true that it will fail when user is a collaborator. Perhaps it should be a Maybe RepoInvitation?

src/GitHub/Endpoints/Repos/Invitations.hs Show resolved Hide resolved
src/GitHub/Data/Repos.hs Show resolved Hide resolved
@phadej
Copy link
Contributor

phadej commented May 30, 2019

Squashed in #374

@phadej phadej closed this May 30, 2019
@sajidanower23 sajidanower23 deleted the invitation-endpoint branch July 8, 2021 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants