Module: Octokit::Client::RepositoryInvitations
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/repository_invitations.rb
Overview
Methods for the Repository Invitations API
Instance Method Summary collapse
-
#accept_repository_invitation(invitation_id, options = {}) ⇒ Boolean
(also: #accept_repo_invitation)
Accept a repository invitation.
-
#decline_repository_invitation(invitation_id, options = {}) ⇒ Boolean
(also: #decline_invitation)
Decline a repository invitation.
-
#delete_repository_invitation(repo, invitation_id, options = {}) ⇒ Boolean
(also: #delete_repo_invitation)
Delete an invitation for a repository.
-
#invite_user_to_repository(repo, user, options = {}) ⇒ Sawyer::Resource
(also: #invite_user_to_repo)
Invite a user to a repository.
-
#repository_invitations(repo, options = {}) ⇒ Array<Sawyer::Resource>
(also: #repo_invitations)
List all invitations for a repository.
-
#update_repository_invitation(repo, invitation_id, options = {}) ⇒ Sawyer::Resource
(also: #update_repo_invitation)
Update an invitation for a repository.
-
#user_repository_invitations(options = {}) ⇒ Array<Sawyer::Resource>
(also: #user_repo_invitations)
List all repository invitations for the user.
Instance Method Details
#accept_repository_invitation(invitation_id, options = {}) ⇒ Boolean Also known as: accept_repo_invitation
Accept a repository invitation
Requires authenticated client
78 79 80 |
# File 'lib/octokit/client/repository_invitations.rb', line 78 def accept_repository_invitation(invitation_id, = {}) patch "/user/repository_invitations/#{invitation_id}", end |
#decline_repository_invitation(invitation_id, options = {}) ⇒ Boolean Also known as: decline_invitation
Decline a repository invitation
Requires authenticated client
90 91 92 |
# File 'lib/octokit/client/repository_invitations.rb', line 90 def decline_repository_invitation(invitation_id, = {}) boolean_from_response :delete, "/user/repository_invitations/#{invitation_id}", end |
#delete_repository_invitation(repo, invitation_id, options = {}) ⇒ Boolean Also known as: delete_repo_invitation
Delete an invitation for a repository
Requires authenticated client
42 43 44 |
# File 'lib/octokit/client/repository_invitations.rb', line 42 def delete_repository_invitation(repo, invitation_id, = {}) boolean_from_response :delete, "#{Repository.path repo}/invitations/#{invitation_id}", end |
#invite_user_to_repository(repo, user, options = {}) ⇒ Sawyer::Resource Also known as: invite_user_to_repo
Invite a user to a repository
Requires authenticated client
17 18 19 |
# File 'lib/octokit/client/repository_invitations.rb', line 17 def invite_user_to_repository(repo, user, = {}) put "#{Repository.path repo}/collaborators/#{user}", end |
#repository_invitations(repo, options = {}) ⇒ Array<Sawyer::Resource> Also known as: repo_invitations
List all invitations for a repository
Requires authenticated client
29 30 31 |
# File 'lib/octokit/client/repository_invitations.rb', line 29 def repository_invitations(repo, = {}) paginate "#{Repository.path repo}/invitations", end |
#update_repository_invitation(repo, invitation_id, options = {}) ⇒ Sawyer::Resource Also known as: update_repo_invitation
Update an invitation for a repository
Requires authenticated client
55 56 57 |
# File 'lib/octokit/client/repository_invitations.rb', line 55 def update_repository_invitation(repo, invitation_id, = {}) patch "#{Repository.path repo}/invitations/#{invitation_id}", end |
#user_repository_invitations(options = {}) ⇒ Array<Sawyer::Resource> Also known as: user_repo_invitations
List all repository invitations for the user
Requires authenticated client
66 67 68 |
# File 'lib/octokit/client/repository_invitations.rb', line 66 def user_repository_invitations( = {}) paginate '/user/repository_invitations', end |