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
83 84 85 86 |
# File 'lib/octokit/client/repository_invitations.rb', line 83 def accept_repository_invitation(invitation_id, = {}) = ensure_api_media_type(:repository_invitations, ) 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
96 97 98 99 |
# File 'lib/octokit/client/repository_invitations.rb', line 96 def decline_repository_invitation(invitation_id, = {}) = ensure_api_media_type(:repository_invitations, ) 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
44 45 46 47 |
# File 'lib/octokit/client/repository_invitations.rb', line 44 def delete_repository_invitation(repo, invitation_id, = {}) = ensure_api_media_type(:repository_invitations, ) 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 20 |
# File 'lib/octokit/client/repository_invitations.rb', line 17 def invite_user_to_repository(repo, user, = {}) = ensure_api_media_type(:repository_invitations, ) 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
30 31 32 33 |
# File 'lib/octokit/client/repository_invitations.rb', line 30 def repository_invitations(repo, = {}) = ensure_api_media_type(:repository_invitations, ) 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
58 59 60 61 |
# File 'lib/octokit/client/repository_invitations.rb', line 58 def update_repository_invitation(repo, invitation_id, = {}) = ensure_api_media_type(:repository_invitations, ) 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
70 71 72 73 |
# File 'lib/octokit/client/repository_invitations.rb', line 70 def user_repository_invitations( = {}) = ensure_api_media_type(:repository_invitations, ) paginate "/user/repository_invitations", end |