Skip to content

Commit

Permalink
Remove app methods that have been deprecated since v4.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pbstriker38 committed Oct 17, 2024
1 parent 664b02d commit 41494e8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 121 deletions.
78 changes: 14 additions & 64 deletions lib/octokit/client/apps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Apps
#
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#get-the-authenticated-app
# @see https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app
#
# @return [Sawyer::Resource] App information
def app(options = {})
Expand All @@ -19,29 +19,19 @@ def app(options = {})
#
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#list-installations
# @see https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app
#
# @return [Array<Sawyer::Resource>] the total_count and an array of installations
def find_app_installations(options = {})
paginate 'app/installations', options
end
alias find_installations find_app_installations

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

# Find all installations that are accessible to the authenticated user
#
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/installations/#list-installations-for-a-user
# @see https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token
#
# @return [Sawyer::Resource] the total_count and an array of installations
def find_user_installations(options = {})
Expand All @@ -54,7 +44,7 @@ def find_user_installations(options = {})
#
# @param id [Integer] Installation id
#
# @see https://developer.github.com/v3/apps/#get-an-installation
# @see https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app
#
# @return [Sawyer::Resource] Installation information
def installation(id, options = {})
Expand All @@ -66,30 +56,20 @@ def installation(id, options = {})
# @param installation [Integer] The id of a GitHub App Installation
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#create-a-new-installation-token
# @see https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app
#
# @return [<Sawyer::Resource>] An installation token
def create_app_installation_access_token(installation, options = {})
post "app/installations/#{installation}/access_tokens", options
end
alias create_installation_access_token create_app_installation_access_token

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

# Enables an app to find the organization's installation information.
#
# @param organization [String] Organization GitHub login
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#get-an-organization-installation
# @see https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app
#
# @return [Sawyer::Resource] Installation information
def find_organization_installation(organization, options = {})
Expand All @@ -101,7 +81,7 @@ def find_organization_installation(organization, options = {})
# @param repo [String] A GitHub repository
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#get-a-repository-installation
# @see https://docs.github.com/en/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app
#
# @return [Sawyer::Resource] Installation information
def find_repository_installation(repo, options = {})
Expand All @@ -113,7 +93,7 @@ def find_repository_installation(repo, options = {})
# @param user [String] GitHub user login
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#get-a-user-installation
# @see https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app
#
# @return [Sawyer::Resource] Installation information
def find_user_installation(user, options = {})
Expand All @@ -124,7 +104,7 @@ def find_user_installation(user, options = {})
#
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/installations/#list-repositories
# @see https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-app-installation
#
# @return [Sawyer::Resource] the total_count and an array of repositories
def list_app_installation_repositories(options = {})
Expand All @@ -134,70 +114,40 @@ def list_app_installation_repositories(options = {})
end
alias list_installation_repos list_app_installation_repositories

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

# Add a single repository to an installation
#
# @param installation [Integer] The id of a GitHub App Installation
# @param repo [Integer] The id of the GitHub repository
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/installations/#add-repository-to-installation
# @see https://docs.github.com/en/rest/apps/installations#add-a-repository-to-an-app-installation
#
# @return [Boolean] Success
def add_repository_to_app_installation(installation, repo, options = {})
boolean_from_response :put, "user/installations/#{installation}/repositories/#{repo}", options
end
alias add_repo_to_installation add_repository_to_app_installation

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

# Remove a single repository to an installation
#
# @param installation [Integer] The id of a GitHub App Installation
# @param repo [Integer] The id of the GitHub repository
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/installations/#remove-repository-from-installation
# @see https://docs.github.com/en/rest/apps/installations#remove-a-repository-from-an-app-installation
#
# @return [Boolean] Success
def remove_repository_from_app_installation(installation, repo, options = {})
boolean_from_response :delete, "user/installations/#{installation}/repositories/#{repo}", options
end
alias remove_repo_from_installation remove_repository_from_app_installation

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

# List repositories accessible to the user for an installation
#
# @param installation [Integer] The id of a GitHub App Installation
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation
# @see https://docs.github.com/en/rest/apps/installations#list-repositories-accessible-to-the-user-access-token
#
# @return [Sawyer::Resource] the total_count and an array of repositories
def find_installation_repositories_for_user(installation, options = {})
Expand All @@ -211,7 +161,7 @@ def find_installation_repositories_for_user(installation, options = {})
# @param installation [Integer] The id of a GitHub App Installation
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#delete-an-installation
# @see https://docs.github.com/en/rest/apps/apps#delete-an-installation-for-the-authenticated-app
#
# @return [Boolean] Success
def delete_installation(installation, options = {})
Expand Down Expand Up @@ -248,7 +198,7 @@ def app_hook_delivery(delivery_id, options = {})
# @param delivery_id [Integer] The id of a GitHub App Hook Delivery
# @param options [Hash] A customizable set of options
#
# @see https://developer.github.com/v3/apps/#redeliver-a-delivery-for-an-app-webhook
# @see https://docs.github.com/en/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook
#
# @return [Boolean] Success
def deliver_app_hook(delivery_id, options = {})
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 41494e8

Please sign in to comment.