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.
- #add_repository_to_integration_installation(installation, repo, options = {}) ⇒ Object
-
#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.
- #create_integration_installation_access_token(installation, options = {}) ⇒ Object
-
#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_app_installations(options = {}) ⇒ Array<Sawyer::Resource>
(also: #find_installations)
Find all installations that belong to an App.
-
#find_installation_repositories_for_user(installation, options = {}) ⇒ Sawyer::Resource
List repositories accessible to the user for an installation.
- #find_integration_installations(options = {}) ⇒ Object
-
#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.
-
#find_user_installations(options = {}) ⇒ Sawyer::Resource
Find all installations that are accessible to the authenticated user.
-
#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_integration_installation_repositories(options = {}) ⇒ Object
-
#remove_repository_from_app_installation(installation, repo, options = {}) ⇒ Boolean
(also: #remove_repo_from_installation)
Remove a single repository to an installation.
- #remove_repository_from_integration_installation(installation, repo, options = {}) ⇒ Object
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
156 157 158 |
# File 'lib/octokit/client/apps.rb', line 156 def add_repository_to_app_installation(installation, repo, = {}) boolean_from_response :put, "user/installations/#{installation}/repositories/#{repo}", end |
#add_repository_to_integration_installation(installation, repo, options = {}) ⇒ Object
161 162 163 164 165 166 167 168 169 |
# File 'lib/octokit/client/apps.rb', line 161 def add_repository_to_integration_installation(installation, repo, = {}) octokit_warn( 'Deprecated: Octokit::Client::Apps#add_repository_to_integration_installation ' \ 'method is deprecated. Please update your call to use ' \ 'Octokit::Client::Apps#add_repository_to_app_installation before the next major ' \ 'Octokit version update.' ) add_repository_to_app_installation(installation, 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.
242 243 244 |
# File 'lib/octokit/client/apps.rb', line 242 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
72 73 74 |
# File 'lib/octokit/client/apps.rb', line 72 def create_app_installation_access_token(installation, = {}) post "app/installations/#{installation}/access_tokens", end |
#create_integration_installation_access_token(installation, options = {}) ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/octokit/client/apps.rb', line 77 def create_integration_installation_access_token(installation, = {}) octokit_warn( 'Deprecated: Octokit::Client::Apps#create_integration_installation_access_token ' \ 'method is deprecated. Please update your call to use ' \ 'Octokit::Client::Apps#create_app_installation_access_token before the next major ' \ 'Octokit version update.' ) create_app_installation_access_token(installation, ) end |
#delete_installation(installation, options = {}) ⇒ Boolean
Delete an installation and uninstall a GitHub App
217 218 219 |
# File 'lib/octokit/client/apps.rb', line 217 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.
254 255 256 |
# File 'lib/octokit/client/apps.rb', line 254 def deliver_app_hook(delivery_id, = {}) boolean_from_response :post, "app/hook/deliveries/#{delivery_id}/attempts", end |
#find_app_installations(options = {}) ⇒ Array<Sawyer::Resource> Also known as: find_installations
Find all installations that belong to an App
25 26 27 |
# File 'lib/octokit/client/apps.rb', line 25 def find_app_installations( = {}) paginate 'app/installations', end |
#find_installation_repositories_for_user(installation, options = {}) ⇒ Sawyer::Resource
List repositories accessible to the user for an installation
203 204 205 206 207 |
# File 'lib/octokit/client/apps.rb', line 203 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_integration_installations(options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/octokit/client/apps.rb', line 30 def find_integration_installations( = {}) octokit_warn( 'Deprecated: Octokit::Client::Apps#find_integration_installations ' \ 'method is deprecated. Please update your call to use ' \ 'Octokit::Client::Apps#find_app_installations before the next major ' \ 'Octokit version update.' ) find_app_installations() end |
#find_organization_installation(organization, options = {}) ⇒ Sawyer::Resource
Enables an app to find the organization’s installation information.
95 96 97 |
# File 'lib/octokit/client/apps.rb', line 95 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.
107 108 109 |
# File 'lib/octokit/client/apps.rb', line 107 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.
119 120 121 |
# File 'lib/octokit/client/apps.rb', line 119 def find_user_installation(user, = {}) get "#{User.path(user)}/installation", end |
#find_user_installations(options = {}) ⇒ Sawyer::Resource
Find all installations that are accessible to the authenticated user
47 48 49 50 51 |
# File 'lib/octokit/client/apps.rb', line 47 def find_user_installations( = {}) paginate('user/installations', ) do |data, last_response| data.installations.concat last_response.data.installations end end |
#installation(id, options = {}) ⇒ Sawyer::Resource
Get a single installation
60 61 62 |
# File 'lib/octokit/client/apps.rb', line 60 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.
228 229 230 231 232 |
# File 'lib/octokit/client/apps.rb', line 228 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
130 131 132 133 134 |
# File 'lib/octokit/client/apps.rb', line 130 def list_app_installation_repositories( = {}) paginate('installation/repositories', ) do |data, last_response| data.repositories.concat last_response.data.repositories end end |
#list_integration_installation_repositories(options = {}) ⇒ Object
137 138 139 140 141 142 143 144 145 |
# File 'lib/octokit/client/apps.rb', line 137 def list_integration_installation_repositories( = {}) octokit_warn( 'Deprecated: Octokit::Client::Apps#list_integration_installation_repositories ' \ 'method is deprecated. Please update your call to use ' \ 'Octokit::Client::Apps#list_app_installation_repositories before the next major ' \ 'Octokit version update.' ) list_app_installation_repositories() end |
#remove_repository_from_app_installation(installation, repo, options = {}) ⇒ Boolean Also known as: remove_repo_from_installation
Remove a single repository to an installation
180 181 182 |
# File 'lib/octokit/client/apps.rb', line 180 def remove_repository_from_app_installation(installation, repo, = {}) boolean_from_response :delete, "user/installations/#{installation}/repositories/#{repo}", end |
#remove_repository_from_integration_installation(installation, repo, options = {}) ⇒ Object
185 186 187 188 189 190 191 192 193 |
# File 'lib/octokit/client/apps.rb', line 185 def remove_repository_from_integration_installation(installation, repo, = {}) octokit_warn( 'Deprecated: Octokit::Client::Apps#remove_repository_from_integration_installation ' \ 'method is deprecated. Please update your call to use ' \ 'Octokit::Client::Apps#remove_repository_from_app_installation before the next major ' \ 'Octokit version update.' ) remove_repository_from_app_installation(installation, repo, ) end |