Module: Octokit::Client::Apps
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/apps.rb
Overview
Methods for the Apps API
Instance Method Summary collapse
-
#add_repository_to_app_installation(installation, repo, options = {}) ⇒ Boolean
(also: #add_repo_to_installation)
Add a single repository to an installation.
-
#app(options = {}) ⇒ Sawyer::Resource
Get the authenticated App.
-
#app_hook_delivery(delivery_id, options = {}) ⇒ <Sawyer::Resource>
Returns a delivery for the webhook configured for a GitHub App.
-
#create_app_installation_access_token(installation, options = {}) ⇒ <Sawyer::Resource>
(also: #create_installation_access_token)
Create a new installation token.
-
#delete_installation(installation, options = {}) ⇒ Boolean
Delete an installation and uninstall a GitHub App.
-
#deliver_app_hook(delivery_id, options = {}) ⇒ Boolean
Redeliver a delivery for the webhook configured for a GitHub App.
-
#find_installation_repositories_for_user(installation, options = {}) ⇒ Sawyer::Resource
List repositories accessible to the user for an installation.
-
#find_organization_installation(organization, options = {}) ⇒ Sawyer::Resource
Enables an app to find the organization's installation information.
-
#find_repository_installation(repo, options = {}) ⇒ Sawyer::Resource
Enables an app to find the repository's installation information.
-
#find_user_installation(user, options = {}) ⇒ Sawyer::Resource
Enables an app to find the user's installation information.
-
#installation(id, options = {}) ⇒ Sawyer::Resource
Get a single installation.
-
#list_app_hook_deliveries(options = {}) ⇒ Array<Hash>
Returns a list of webhook deliveries for the webhook configured for a GitHub App.
-
#list_app_installation_repositories(options = {}) ⇒ Sawyer::Resource
(also: #list_installation_repos)
List repositories that are accessible to the authenticated installation.
-
#list_app_installations(options = {}) ⇒ Array<Sawyer::Resource>
(also: #find_installations, #find_app_installations)
List all installations that belong to an App.
-
#list_user_installations(options = {}) ⇒ Sawyer::Resource
(also: #find_user_installations)
List all installations that are accessible to the authenticated user.
-
#remove_repository_from_app_installation(installation, repo, options = {}) ⇒ Boolean
(also: #remove_repo_from_installation)
Remove a single repository to an installation.
Instance Method Details
#add_repository_to_app_installation(installation, repo, options = {}) ⇒ Boolean Also known as: add_repo_to_installation
Add a single repository to an installation
128 129 130 |
# File 'lib/octokit/client/apps.rb', line 128 def add_repository_to_app_installation(installation, repo, = {}) boolean_from_response :put, "user/installations/#{installation}/repositories/#{repo}", end |
#app(options = {}) ⇒ Sawyer::Resource
Get the authenticated App
14 15 16 |
# File 'lib/octokit/client/apps.rb', line 14 def app( = {}) get 'app', end |
#app_hook_delivery(delivery_id, options = {}) ⇒ <Sawyer::Resource>
Returns a delivery for the webhook configured for a GitHub App.
194 195 196 |
# File 'lib/octokit/client/apps.rb', line 194 def app_hook_delivery(delivery_id, = {}) get "/app/hook/deliveries/#{delivery_id}", end |
#create_app_installation_access_token(installation, options = {}) ⇒ <Sawyer::Resource> Also known as: create_installation_access_token
Create a new installation token
64 65 66 |
# File 'lib/octokit/client/apps.rb', line 64 def create_app_installation_access_token(installation, = {}) post "app/installations/#{installation}/access_tokens", end |
#delete_installation(installation, options = {}) ⇒ Boolean
Delete an installation and uninstall a GitHub App
169 170 171 |
# File 'lib/octokit/client/apps.rb', line 169 def delete_installation(installation, = {}) boolean_from_response :delete, "app/installations/#{installation}", end |
#deliver_app_hook(delivery_id, options = {}) ⇒ Boolean
Redeliver a delivery for the webhook configured for a GitHub App.
206 207 208 |
# File 'lib/octokit/client/apps.rb', line 206 def deliver_app_hook(delivery_id, = {}) boolean_from_response :post, "app/hook/deliveries/#{delivery_id}/attempts", end |
#find_installation_repositories_for_user(installation, options = {}) ⇒ Sawyer::Resource
List repositories accessible to the user for an installation
155 156 157 158 159 |
# File 'lib/octokit/client/apps.rb', line 155 def find_installation_repositories_for_user(installation, = {}) paginate("user/installations/#{installation}/repositories", ) do |data, last_response| data.repositories.concat last_response.data.repositories end end |
#find_organization_installation(organization, options = {}) ⇒ Sawyer::Resource
Enables an app to find the organization's installation information.
77 78 79 |
# File 'lib/octokit/client/apps.rb', line 77 def find_organization_installation(organization, = {}) get "#{Organization.path(organization)}/installation", end |
#find_repository_installation(repo, options = {}) ⇒ Sawyer::Resource
Enables an app to find the repository's installation information.
89 90 91 |
# File 'lib/octokit/client/apps.rb', line 89 def find_repository_installation(repo, = {}) get "#{Repository.path(repo)}/installation", end |
#find_user_installation(user, options = {}) ⇒ Sawyer::Resource
Enables an app to find the user's installation information.
101 102 103 |
# File 'lib/octokit/client/apps.rb', line 101 def find_user_installation(user, = {}) get "#{User.path(user)}/installation", end |
#installation(id, options = {}) ⇒ Sawyer::Resource
Get a single installation
52 53 54 |
# File 'lib/octokit/client/apps.rb', line 52 def installation(id, = {}) get "app/installations/#{id}", end |
#list_app_hook_deliveries(options = {}) ⇒ Array<Hash>
Returns a list of webhook deliveries for the webhook configured for a GitHub App.
180 181 182 183 184 |
# File 'lib/octokit/client/apps.rb', line 180 def list_app_hook_deliveries( = {}) paginate('app/hook/deliveries', ) do |data, last_response| data.concat last_response.data end end |
#list_app_installation_repositories(options = {}) ⇒ Sawyer::Resource Also known as: list_installation_repos
List repositories that are accessible to the authenticated installation
112 113 114 115 116 |
# File 'lib/octokit/client/apps.rb', line 112 def list_app_installation_repositories( = {}) paginate('installation/repositories', ) do |data, last_response| data.repositories.concat last_response.data.repositories end end |
#list_app_installations(options = {}) ⇒ Array<Sawyer::Resource> Also known as: find_installations, find_app_installations
List all installations that belong to an App
25 26 27 |
# File 'lib/octokit/client/apps.rb', line 25 def list_app_installations( = {}) paginate 'app/installations', end |
#list_user_installations(options = {}) ⇒ Sawyer::Resource Also known as: find_user_installations
List all installations that are accessible to the authenticated user
38 39 40 41 42 |
# File 'lib/octokit/client/apps.rb', line 38 def list_user_installations( = {}) paginate('user/installations', ) do |data, last_response| data.installations.concat last_response.data.installations end end |
#remove_repository_from_app_installation(installation, repo, options = {}) ⇒ Boolean Also known as: remove_repo_from_installation
Remove a single repository to an installation
142 143 144 |
# File 'lib/octokit/client/apps.rb', line 142 def remove_repository_from_app_installation(installation, repo, = {}) boolean_from_response :delete, "user/installations/#{installation}/repositories/#{repo}", end |