Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename find_app_installations and find_user_installations #1721

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions lib/octokit/client/apps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,32 @@ def app(options = {})
get 'app', options
end

# Find all installations that belong to an App
# List all installations that belong to an App
#
# @param options [Hash] A customizable set of options
#
# @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 = {})
def list_app_installations(options = {})
paginate 'app/installations', options
end
alias find_installations find_app_installations
alias find_installations list_app_installations
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of aliasing, the other option is to create methods that warn of deprecation.

alias find_app_installations list_app_installations

# Find all installations that are accessible to the authenticated user
# List all installations that are accessible to the authenticated user
#
# @param options [Hash] A customizable set of options
#
# @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 = {})
def list_user_installations(options = {})
paginate('user/installations', options) do |data, last_response|
data.installations.concat last_response.data.installations
end
end
alias find_user_installations list_user_installations

# Get a single installation
#
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"http_interactions": [
{
"request": {
"method": "get",
"uri": "https://api.github.com/app/installations?per_page=1",
"body": {
"encoding": "US-ASCII",
"base64_string": ""
},
"headers": {
"Accept": [
"application/vnd.github.v3+json"
],
"User-Agent": [
"Octokit Ruby Gem 9.2.0"
],
"Content-Type": [
"application/json"
],
"Authorization": [
"token <<ACCESS_TOKEN>>"
],
"Accept-Encoding": [
"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
]
}
},
"response": {
"status": {
"code": 200,
"message": "OK"
},
"headers": {
"Date": [
"Thu, 17 Oct 2024 01:57:11 GMT"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"X-Github-Media-Type": [
"github.v3; format=json"
],
"Link": [
"<https://api.github.com/app/installations?per_page=1&page=2>; rel=\"next\", <https://api.github.com/app/installations?per_page=1&page=2>; rel=\"last\""
],
"Access-Control-Expose-Headers": [
"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"
],
"Access-Control-Allow-Origin": [
"*"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubdomains; preload"
],
"X-Frame-Options": [
"deny"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Xss-Protection": [
"0"
],
"Referrer-Policy": [
"origin-when-cross-origin, strict-origin-when-cross-origin"
],
"Content-Security-Policy": [
"default-src 'none'"
],
"Vary": [
"Accept-Encoding, Accept, X-Requested-With"
],
"Server": [
"github.com"
],
"X-Github-Request-Id": [
"1197:1ED524:1D2A98:1D6C43:67106EF7"
]
},
"body": {
"encoding": "UTF-8",
"base64_string": "W3siaWQiOjxHSVRIVUJfVEVTVF9JTlRFR1JBVElPTl9JTlNUQUxMQVRJT04+\nLCJhY2NvdW50Ijp7ImxvZ2luIjoiPEdJVEhVQl9URVNUX09SR0FOSVpBVElP\nTj4iLCJpZCI6MTc1Mjk4MTQsImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRh\ncnMwLmdpdGh1YnVzZXJjb250ZW50LmNvbS91LzE3NTI5ODE0P3Y9MyIsImdy\nYXZhdGFyX2lkIjoiIi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LzxHSVRIVUJfVEVTVF9PUkdB\nTklaQVRJT04+L2V2ZW50c3svcHJpdmFjeX0iLCJyZWNlaXZlZF9ldmVudHNf\ndXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy88R0lUSFVCX1RF\nU1RfT1JHQU5JWkFUSU9OPi9yZWNlaXZlZF9ldmVudHMiLCJ0eXBlIjoiT3Jn\nYW5pemF0aW9uIiwic2l0ZV9hZG1pbiI6ZmFsc2V9LCJhY2Nlc3NfdG9rZW5z\nX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vaW5zdGFsbGF0aW9ucy88\nR0lUSFVCX1RFU1RfSU5URUdSQVRJT05fSU5TVEFMTEFUSU9OPi9hY2Nlc3Nf\ndG9rZW5zIiwicmVwb3NpdG9yaWVzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1\nYi5jb20vaW5zdGFsbGF0aW9uL3JlcG9zaXRvcmllcyIsImh0bWxfdXJsIjoi\naHR0cHM6Ly9naXRodWIuY29tL29yZ2FuaXphdGlvbnMvPEdJVEhVQl9URVNU\nX09SR0FOSVpBVElPTj4vc2V0dGluZ3MvaW5zdGFsbGF0aW9ucy88R0lUSFVC\nX1RFU1RfSU5URUdSQVRJT05fSU5TVEFMTEFUSU9OPiJ9XQ==\n"
}
},
"recorded_at": "Thu, 17 Oct 2024 01:57:11 GMT"
},
{
"request": {
"method": "get",
"uri": "https://api.github.com/app/installations?page=2&per_page=1",
"body": {
"encoding": "US-ASCII",
"base64_string": ""
},
"headers": {
"Accept": [
"application/vnd.github.v3+json"
],
"User-Agent": [
"Octokit Ruby Gem 9.2.0"
],
"Content-Type": [
"application/json"
],
"Authorization": [
"token <<ACCESS_TOKEN>>"
],
"Accept-Encoding": [
"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
]
}
},
"response": {
"status": {
"code": 200,
"message": "OK"
},
"headers": {
"Date": [
"Thu, 17 Oct 2024 01:57:11 GMT"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"X-Github-Media-Type": [
"github.v3; format=json"
],
"Link": [
"<https://api.github.com/app/installations?per_page=1&page=1>; rel=\"prev\", <https://api.github.com/app/installations?per_page=1&page=1>; rel=\"first\""
],
"Access-Control-Expose-Headers": [
"ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"
],
"Access-Control-Allow-Origin": [
"*"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubdomains; preload"
],
"X-Frame-Options": [
"deny"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Xss-Protection": [
"0"
],
"Referrer-Policy": [
"origin-when-cross-origin, strict-origin-when-cross-origin"
],
"Content-Security-Policy": [
"default-src 'none'"
],
"Vary": [
"Accept-Encoding, Accept, X-Requested-With"
],
"Server": [
"github.com"
],
"X-Github-Request-Id": [
"1197:1ED524:1D2A98:1D6C43:67106EF7"
]
},
"body": {
"encoding": "UTF-8",
"base64_string": "W3siaWQiOjxHSVRIVUJfVEVTVF9JTlRFR1JBVElPTl9JTlNUQUxMQVRJT04+\nLCJhY2NvdW50Ijp7ImxvZ2luIjoiPEdJVEhVQl9URVNUX09SR0FOSVpBVElP\nTj4iLCJpZCI6MTc1Mjk4MTQsImF2YXRhcl91cmwiOiJodHRwczovL2F2YXRh\ncnMwLmdpdGh1YnVzZXJjb250ZW50LmNvbS91LzE3NTI5ODE0P3Y9MyIsImdy\nYXZhdGFyX2lkIjoiIiwidXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91\nc2Vycy88R0lUSFVCX1RFU1RfT1JHQU5JWkFUSU9OPiIsImh0bWxfdXJsIjoi\naHR0cHM6Ly9naXRodWIuY29tLzxHSVRIVUJfVEVTVF9PUkd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