Skip to content

Commit eb50ad6

Browse files
authored
Rename internal response (#433)
There is no issue with some variables conflicting, but not to confuse me, this change renames them. for example, conflict is happened here: https://github.com/line/line-bot-sdk-ruby/blob/eb6780d887916cd141cf83ff0dd50d1ca35aa22d/lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb#L192-L228
1 parent ea53876 commit eb50ad6

11 files changed

Lines changed: 428 additions & 428 deletions

File tree

generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module Line
7373
headers: header_params{% endif %}
7474
)
7575

76-
body = case response.code.to_i
76+
response_body = case response.code.to_i
7777
{%- for response in op.responses %}
7878
when {{ response.code }}
7979
{%- if response.content['application/json'].schema.complexType != null %}
@@ -89,7 +89,7 @@ module Line
8989
response.body
9090
end
9191

92-
[body, response.code.to_i, response.each_header.to_h]
92+
[response_body, response.code.to_i, response.each_header.to_h]
9393
end
9494

9595
# {{ op.notes }}
@@ -113,12 +113,12 @@ module Line
113113
{{param.paramName}}:{{ param.required ? '' : ' nil' }}{{ loop.last ? '' : ',' -}}
114114
{% endfor %}
115115
)
116-
body, _status_code, _headers = {{op.nickname}}_with_http_info({% for param in op.allParams %}
116+
response_body, _status_code, _headers = {{op.nickname}}_with_http_info({% for param in op.allParams %}
117117
{{param.paramName}}: {{param.paramName}}{{ loop.last ? '' : ',' -}}
118118
{% endfor %}
119119
)
120120

121-
body
121+
response_body
122122
end{% endfor %}
123123
end
124124
end

lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def gets_all_valid_channel_access_token_key_ids_with_http_info(
4545
query_params: query_params,
4646
)
4747

48-
body = case response.code.to_i
48+
response_body = case response.code.to_i
4949
when 200
5050
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
5151
json.transform_keys! do |key|
@@ -56,7 +56,7 @@ def gets_all_valid_channel_access_token_key_ids_with_http_info(
5656
response.body
5757
end
5858

59-
[body, response.code.to_i, response.each_header.to_h]
59+
[response_body, response.code.to_i, response.each_header.to_h]
6060
end
6161

6262
# Gets all valid channel access token key IDs.
@@ -68,12 +68,12 @@ def gets_all_valid_channel_access_token_key_ids(
6868
client_assertion_type:,
6969
client_assertion:
7070
)
71-
body, _status_code, _headers = gets_all_valid_channel_access_token_key_ids_with_http_info(
71+
response_body, _status_code, _headers = gets_all_valid_channel_access_token_key_ids_with_http_info(
7272
client_assertion_type: client_assertion_type,
7373
client_assertion: client_assertion
7474
)
7575

76-
body
76+
response_body
7777
end
7878

7979
# Issue short-lived channel access token
@@ -100,7 +100,7 @@ def issue_channel_token_with_http_info(
100100
form_params: form_params,
101101
)
102102

103-
body = case response.code.to_i
103+
response_body = case response.code.to_i
104104
when 200
105105
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
106106
json.transform_keys! do |key|
@@ -117,7 +117,7 @@ def issue_channel_token_with_http_info(
117117
response.body
118118
end
119119

120-
[body, response.code.to_i, response.each_header.to_h]
120+
[response_body, response.code.to_i, response.each_header.to_h]
121121
end
122122

123123
# Issue short-lived channel access token
@@ -131,13 +131,13 @@ def issue_channel_token(
131131
client_id:,
132132
client_secret:
133133
)
134-
body, _status_code, _headers = issue_channel_token_with_http_info(
134+
response_body, _status_code, _headers = issue_channel_token_with_http_info(
135135
grant_type: grant_type,
136136
client_id: client_id,
137137
client_secret: client_secret
138138
)
139139

140-
body
140+
response_body
141141
end
142142

143143
# Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.
@@ -164,7 +164,7 @@ def issue_channel_token_by_jwt_with_http_info(
164164
form_params: form_params,
165165
)
166166

167-
body = case response.code.to_i
167+
response_body = case response.code.to_i
168168
when 200
169169
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
170170
json.transform_keys! do |key|
@@ -175,7 +175,7 @@ def issue_channel_token_by_jwt_with_http_info(
175175
response.body
176176
end
177177

178-
[body, response.code.to_i, response.each_header.to_h]
178+
[response_body, response.code.to_i, response.each_header.to_h]
179179
end
180180

181181
# Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.
@@ -189,13 +189,13 @@ def issue_channel_token_by_jwt(
189189
client_assertion_type:,
190190
client_assertion:
191191
)
192-
body, _status_code, _headers = issue_channel_token_by_jwt_with_http_info(
192+
response_body, _status_code, _headers = issue_channel_token_by_jwt_with_http_info(
193193
grant_type: grant_type,
194194
client_assertion_type: client_assertion_type,
195195
client_assertion: client_assertion
196196
)
197197

198-
body
198+
response_body
199199
end
200200

201201
# Issues a new stateless channel access token, which doesn't have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
@@ -228,7 +228,7 @@ def issue_stateless_channel_token_with_http_info(
228228
form_params: form_params,
229229
)
230230

231-
body = case response.code.to_i
231+
response_body = case response.code.to_i
232232
when 200
233233
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
234234
json.transform_keys! do |key|
@@ -239,7 +239,7 @@ def issue_stateless_channel_token_with_http_info(
239239
response.body
240240
end
241241

242-
[body, response.code.to_i, response.each_header.to_h]
242+
[response_body, response.code.to_i, response.each_header.to_h]
243243
end
244244

245245
# Issues a new stateless channel access token, which doesn't have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
@@ -257,15 +257,15 @@ def issue_stateless_channel_token(
257257
client_id: nil,
258258
client_secret: nil
259259
)
260-
body, _status_code, _headers = issue_stateless_channel_token_with_http_info(
260+
response_body, _status_code, _headers = issue_stateless_channel_token_with_http_info(
261261
grant_type: grant_type,
262262
client_assertion_type: client_assertion_type,
263263
client_assertion: client_assertion,
264264
client_id: client_id,
265265
client_secret: client_secret
266266
)
267267

268-
body
268+
response_body
269269
end
270270

271271
# Revoke short-lived or long-lived channel access token
@@ -286,14 +286,14 @@ def revoke_channel_token_with_http_info(
286286
form_params: form_params,
287287
)
288288

289-
body = case response.code.to_i
289+
response_body = case response.code.to_i
290290
when 200
291291
response.body
292292
else
293293
response.body
294294
end
295295

296-
[body, response.code.to_i, response.each_header.to_h]
296+
[response_body, response.code.to_i, response.each_header.to_h]
297297
end
298298

299299
# Revoke short-lived or long-lived channel access token
@@ -303,11 +303,11 @@ def revoke_channel_token_with_http_info(
303303
def revoke_channel_token(
304304
access_token:
305305
)
306-
body, _status_code, _headers = revoke_channel_token_with_http_info(
306+
response_body, _status_code, _headers = revoke_channel_token_with_http_info(
307307
access_token: access_token
308308
)
309309

310-
body
310+
response_body
311311
end
312312

313313
# Revoke channel access token v2.1
@@ -334,14 +334,14 @@ def revoke_channel_token_by_jwt_with_http_info(
334334
form_params: form_params,
335335
)
336336

337-
body = case response.code.to_i
337+
response_body = case response.code.to_i
338338
when 200
339339
response.body
340340
else
341341
response.body
342342
end
343343

344-
[body, response.code.to_i, response.each_header.to_h]
344+
[response_body, response.code.to_i, response.each_header.to_h]
345345
end
346346

347347
# Revoke channel access token v2.1
@@ -355,13 +355,13 @@ def revoke_channel_token_by_jwt(
355355
client_secret:,
356356
access_token:
357357
)
358-
body, _status_code, _headers = revoke_channel_token_by_jwt_with_http_info(
358+
response_body, _status_code, _headers = revoke_channel_token_by_jwt_with_http_info(
359359
client_id: client_id,
360360
client_secret: client_secret,
361361
access_token: access_token
362362
)
363363

364-
body
364+
response_body
365365
end
366366

367367
# Verify the validity of short-lived and long-lived channel access tokens
@@ -382,7 +382,7 @@ def verify_channel_token_with_http_info(
382382
form_params: form_params,
383383
)
384384

385-
body = case response.code.to_i
385+
response_body = case response.code.to_i
386386
when 200
387387
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
388388
json.transform_keys! do |key|
@@ -393,7 +393,7 @@ def verify_channel_token_with_http_info(
393393
response.body
394394
end
395395

396-
[body, response.code.to_i, response.each_header.to_h]
396+
[response_body, response.code.to_i, response.each_header.to_h]
397397
end
398398

399399
# Verify the validity of short-lived and long-lived channel access tokens
@@ -403,11 +403,11 @@ def verify_channel_token_with_http_info(
403403
def verify_channel_token(
404404
access_token:
405405
)
406-
body, _status_code, _headers = verify_channel_token_with_http_info(
406+
response_body, _status_code, _headers = verify_channel_token_with_http_info(
407407
access_token: access_token
408408
)
409409

410-
body
410+
response_body
411411
end
412412

413413
# You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.
@@ -427,7 +427,7 @@ def verify_channel_token_by_jwt_with_http_info(
427427
query_params: query_params,
428428
)
429429

430-
body = case response.code.to_i
430+
response_body = case response.code.to_i
431431
when 200
432432
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
433433
json.transform_keys! do |key|
@@ -438,7 +438,7 @@ def verify_channel_token_by_jwt_with_http_info(
438438
response.body
439439
end
440440

441-
[body, response.code.to_i, response.each_header.to_h]
441+
[response_body, response.code.to_i, response.each_header.to_h]
442442
end
443443

444444
# You can verify whether a Channel access token with a user-specified expiration (Channel Access Token v2.1) is valid.
@@ -448,11 +448,11 @@ def verify_channel_token_by_jwt_with_http_info(
448448
def verify_channel_token_by_jwt(
449449
access_token:
450450
)
451-
body, _status_code, _headers = verify_channel_token_by_jwt_with_http_info(
451+
response_body, _status_code, _headers = verify_channel_token_by_jwt_with_http_info(
452452
access_token: access_token
453453
)
454454

455-
body
455+
response_body
456456
end
457457
end
458458
end

0 commit comments

Comments
 (0)