![]() |
VOOZH | about |
Methods for the Apps API
Add a single repository to an installation.
Create a new installation token.
Find all installations that belong to an App.
List repositories accessible to the user for an installation.
Enables an app to find the organization's installation information.
Enables an app to find the repository's installation information.
Enables an app to find the user's installation information.
Find all installations that are accessible to the authenticated user.
Get a single installation.
List repositories that are accessible to the authenticated installation.
Remove a single repository to an installation.
Add a single repository to an installation
Parameters:
The id of a GitHub App Installation
The id of the GitHub repository
A customizable set of options
Returns:
Success
See Also:
152 153 154 155 |
# File 'lib/octokit/client/apps.rb', line 152 def add_repository_to_app_installation(installation, repo, options = {}) opts = ensure_api_media_type(:integrations, options) boolean_from_response :put, "user/installations/#{installation}/repositories/#{repo}", opts end |
158 159 160 161 162 163 164 165 166 |
# File 'lib/octokit/client/apps.rb', line 158 def add_repository_to_integration_installation(installation, repo, options = {}) 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, options) end |
Create a new installation token
Parameters:
The id of a GitHub App Installation
A customizable set of options
Returns:
An installation token
See Also:
64 65 66 67 |
# File 'lib/octokit/client/apps.rb', line 64 def create_app_installation_access_token(installation, options = {}) opts = ensure_api_media_type(:integrations, options) post "app/installations/#{installation}/access_tokens", opts end |
70 71 72 73 74 75 76 77 78 |
# File 'lib/octokit/client/apps.rb', line 70 def create_integration_installation_access_token(installation, options = {}) 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, options) end |
Find all installations that belong to an App
Parameters:
A customizable set of options
Returns:
the total_count and an array of installations
See Also:
14 15 16 17 |
# File 'lib/octokit/client/apps.rb', line 14 def find_app_installations(options = {}) opts = ensure_api_media_type(:integrations, options) paginate "app/installations", opts end |
List repositories accessible to the user for an installation
Parameters:
The id of a GitHub App Installation
A customizable set of options
Returns:
the total_count and an array of repositories
See Also:
201 202 203 204 205 206 |
# File 'lib/octokit/client/apps.rb', line 201 def find_installation_repositories_for_user(installation, options = {}) opts = ensure_api_media_type(:integrations, options) paginate("user/installations/#{installation}/repositories", opts) do |data, last_response| data.repositories.concat last_response.data.repositories end end |
20 21 22 23 24 25 26 27 28 |
# File 'lib/octokit/client/apps.rb', line 20 def find_integration_installations(options = {}) 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(options) end |
Enables an app to find the organization's installation information.
Parameters:
Organization GitHub login
A customizable set of options
Returns:
Installation information
See Also:
88 89 90 91 |
# File 'lib/octokit/client/apps.rb', line 88 def find_organization_installation(organization, options = {}) opts = ensure_api_media_type(:integrations, options) get "#{Organization.path(organization)}/installation", opts end |
Enables an app to find the repository's installation information.
Parameters:
A GitHub repository
A customizable set of options
Returns:
Installation information
See Also:
101 102 103 104 |
# File 'lib/octokit/client/apps.rb', line 101 def find_repository_installation(repo, options = {}) opts = ensure_api_media_type(:integrations, options) get "#{Repository.path(repo)}/installation", opts end |
Enables an app to find the user's installation information.
Parameters:
GitHub user login
A customizable set of options
Returns:
Installation information
See Also:
114 115 116 117 |
# File 'lib/octokit/client/apps.rb', line 114 def find_user_installation(user, options = {}) opts = ensure_api_media_type(:integrations, options) get "#{User.path(user)}/installation", opts end |
Find all installations that are accessible to the authenticated user
Parameters:
A customizable set of options
Returns:
the total_count and an array of installations
See Also:
37 38 39 40 41 42 |
# File 'lib/octokit/client/apps.rb', line 37 def find_user_installations(options = {}) opts = ensure_api_media_type(:integrations, options) paginate("user/installations", opts) do |data, last_response| data.installations.concat last_response.data.installations end end |
Get a single installation
Parameters:
Installation id
Returns:
Installation information
See Also:
51 52 53 54 |
# File 'lib/octokit/client/apps.rb', line 51 def installation(id, options = {}) opts = ensure_api_media_type(:integrations, options) get "app/installations/#{id}", opts end |
List repositories that are accessible to the authenticated installation
Parameters:
A customizable set of options
Returns:
the total_count and an array of repositories
See Also:
125 126 127 128 129 130 |
# File 'lib/octokit/client/apps.rb', line 125 def list_app_installation_repositories(options = {}) opts = ensure_api_media_type(:integrations, options) paginate("installation/repositories", opts) do |data, last_response| data.repositories.concat last_response.data.repositories end end |
133 134 135 136 137 138 139 140 141 |
# File 'lib/octokit/client/apps.rb', line 133 def list_integration_installation_repositories(options = {}) 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(options) end |
Remove a single repository to an installation
Parameters:
The id of a GitHub App Installation
The id of the GitHub repository
A customizable set of options
Returns:
Success
See Also:
177 178 179 180 |
# File 'lib/octokit/client/apps.rb', line 177 def remove_repository_from_app_installation(installation, repo, options = {}) opts = ensure_api_media_type(:integrations, options) boolean_from_response :delete, "user/installations/#{installation}/repositories/#{repo}", opts end |
183 184 185 186 187 188 189 190 191 |
# File 'lib/octokit/client/apps.rb', line 183 def remove_repository_from_integration_installation(installation, repo, options = {}) 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, options) end |