Skip to content

Commit 5fcf9bf

Browse files
authored
Rename find_app_installations and find_user_installations (#1721)
1 parent 6e55ef3 commit 5fcf9bf

File tree

7 files changed

+436
-16
lines changed

7 files changed

+436
-16
lines changed

lib/octokit/client/apps.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,32 @@ def app(options = {})
1515
get 'app', options
1616
end
1717

18-
# Find all installations that belong to an App
18+
# List all installations that belong to an App
1919
#
2020
# @param options [Hash] A customizable set of options
2121
#
2222
# @see https://docs.github.com/en/rest/apps/apps#list-installations-for-the-authenticated-app
2323
#
2424
# @return [Array<Sawyer::Resource>] the total_count and an array of installations
25-
def find_app_installations(options = {})
25+
def list_app_installations(options = {})
2626
paginate 'app/installations', options
2727
end
28-
alias find_installations find_app_installations
28+
alias find_installations list_app_installations
29+
alias find_app_installations list_app_installations
2930

30-
# Find all installations that are accessible to the authenticated user
31+
# List all installations that are accessible to the authenticated user
3132
#
3233
# @param options [Hash] A customizable set of options
3334
#
3435
# @see https://docs.github.com/en/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token
3536
#
3637
# @return [Sawyer::Resource] the total_count and an array of installations
37-
def find_user_installations(options = {})
38+
def list_user_installations(options = {})
3839
paginate('user/installations', options) do |data, last_response|
3940
data.installations.concat last_response.data.installations
4041
end
4142
end
43+
alias find_user_installations list_user_installations
4244

4345
# Get a single installation
4446
#

spec/cassettes/Octokit_Client_Apps/_find_user_installations/allows_auto_pagination.json

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
{
2+
"http_interactions": [
3+
{
4+
"request": {
5+
"method": "get",
6+
"uri": "https://api.github.com/app/installations?per_page=1",
7+
"body": {
8+
"encoding": "US-ASCII",
9+
"base64_string": ""
10+
},
11+
"headers": {
12+
"Accept": [
13+
"application/vnd.github.v3+json"
14+
],
15+
"User-Agent": [
16+
"Octokit Ruby Gem 9.2.0"
17+
],
18+
"Content-Type": [
19+
"application/json"
20+
],
21+
"Authorization": [
22+
"token <<ACCESS_TOKEN>>"
23+
],
24+
"Accept-Encoding": [
25+
"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
26+
]
27+
}
28+
},
29+
"response": {
30+
"status": {
31+
"code": 200,
32+
"message": "OK"
33+
},
34+
"headers": {
35+
"Date": [
36+
"Thu, 17 Oct 2024 01:57:11 GMT"
37+
],
38+
"Content-Type": [
39+
"application/json; charset=utf-8"
40+
],
41+
"X-Github-Media-Type": [
42+
"github.v3; format=json"
43+
],
44+
"Link": [
45+
"<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\""
46+
],
47+
"Access-Control-Expose-Headers": [
48+
"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"
49+
],
50+
"Access-Control-Allow-Origin": [
51+
"*"
52+
],
53+
"Strict-Transport-Security": [
54+
"max-age=31536000; includeSubdomains; preload"
55+
],
56+
"X-Frame-Options": [
57+
"deny"
58+
],
59+
"X-Content-Type-Options": [
60+
"nosniff"
61+
],
62+
"X-Xss-Protection": [
63+
"0"
64+
],
65+
"Referrer-Policy": [
66+
"origin-when-cross-origin, strict-origin-when-cross-origin"
67+
],
68+
"Content-Security-Policy": [
69+
"default-src 'none'"
70+
],
71+
"Vary": [
72+
"Accept-Encoding, Accept, X-Requested-With"
73+
],
74+
"Server": [
75+
"github.com"
76+
],
77+
"X-Github-Request-Id": [
78+
"1197:1ED524:1D2A98:1D6C43:67106EF7"
79+
]
80+
},
81+
"body": {
82+
"encoding": "UTF-8",
83+
"base64_string": "W3siaWQiOjxHSVRIVUJfVEVTVF9J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cGkuZ2l0aHVi\nLmNvbS91c2Vycy88R0lUSFVCX1RFU1RfT1JHQU5JWkFUSU9OPi9vcmdzIiwi\ncmVwb3NfdXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy88R0lU\nSFVCX1RFU1RfT1JHQU5JWkFUSU9OPi9yZXBvcyIsImV2ZW50c191cmwiOiJo\ndHRwczovL2FwaS5naXRodWIuY29tL3VzZXJzLzxHSVRIVUJfVEVTVF9PUkdB\nTklaQVRJT04+L2V2ZW50c3svcHJpdmFjeX0iLCJyZWNlaXZlZF9ldmVudHNf\ndXJsIjoiaHR0cHM6Ly9hcGkuZ2l0aHViLmNvbS91c2Vycy88R0lUSFVCX1RF\nU1RfT1JHQU5JWkFUSU9OPi9yZWNlaXZlZF9ldmVudHMiLCJ0eXBlIjoiT3Jn\nYW5pemF0aW9uIiwic2l0ZV9hZG1pbiI6ZmFsc2V9LCJhY2Nlc3NfdG9rZW5z\nX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1Yi5jb20vaW5zdGFsbGF0aW9ucy88\nR0lUSFVCX1RFU1RfSU5URUdSQVRJT05fSU5TVEFMTEFUSU9OPi9hY2Nlc3Nf\ndG9rZW5zIiwicmVwb3NpdG9yaWVzX3VybCI6Imh0dHBzOi8vYXBpLmdpdGh1\nYi5jb20vaW5zdGFsbGF0aW9uL3JlcG9zaXRvcmllcyIsImh0bWxfdXJsIjoi\naHR0cHM6Ly9naXRodWIuY29tL29yZ2FuaXphdGlvbnMvPEdJVEhVQl9URVNU\nX09SR0FOSVpBVElPTj4vc2V0dGluZ3MvaW5zdGFsbGF0aW9ucy88R0lUSFVC\nX1RFU1RfSU5URUdSQVRJT05fSU5TVEFMTEFUSU9OPiJ9XQ==\n"
84+
}
85+
},
86+
"recorded_at": "Thu, 17 Oct 2024 01:57:11 GMT"
87+
},
88+
{
89+
"request": {
90+
"method": "get",
91+
"uri": "https://api.github.com/app/installations?page=2&per_page=1",
92+
"body": {
93+
"encoding": "US-ASCII",
94+
"base64_string": ""
95+
},
96+
"headers": {
97+
"Accept": [
98+
"application/vnd.github.v3+json"
99+
],
100+
"User-Agent": [
101+
"Octokit Ruby Gem 9.2.0"
102+
],
103+
"Content-Type": [
104+
"application/json"
105+
],
106+
"Authorization": [
107+
"token <<ACCESS_TOKEN>>"
108+
],
109+
"Accept-Encoding": [
110+
"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
111+
]
112+
}
113+
},
114+
"response": {
115+
"status": {
116+
"code": 200,
117+
"message": "OK"
118+
},
119+
"headers": {
120+
"Date": [
121+
"Thu, 17 Oct 2024 01:57:11 GMT"
122+
],
123+
"Content-Type": [
124+
"application/json; charset=utf-8"
125+
],
126+
"X-Github-Media-Type": [
127+
"github.v3; format=json"
128+
],
129+
"Link": [
130+
"<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\""
131+
],
132+
"Access-Control-Expose-Headers": [
133+
"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"
134+
],
135+
"Access-Control-Allow-Origin": [
136+
"*"
137+
],
138+
"Strict-Transport-Security": [
139+
"max-age=31536000; includeSubdomains; preload"
140+
],
141+
"X-Frame-Options": [
142+
"deny"
143+
],
144+
"X-Content-Type-Options": [
145+
"nosniff"
146+
],
147+
"X-Xss-Protection": [
148+
"0"
149+
],
150+
"Referrer-Policy": [
151+
"origin-when-cross-origin, strict-origin-when-cross-origin"
152+
],
153+
"Content-Security-Policy": [
154+
"default-src 'none'"
155+
],
156+
"Vary": [
157+
"Accept-Encoding, Accept, X-Requested-With"
158+
],
159+
"Server": [
160+
"github.com"
161+
],
162+
"X-Github-Request-Id": [
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