Skip to content

Commit e1ea99c

Browse files
committed
NO-ISSUE Merge branch 'master' into unified-client
2 parents 2312ea5 + f34f596 commit e1ea99c

8 files changed

Lines changed: 395 additions & 3 deletions

File tree

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AllCops:
22
TargetRubyVersion: 2.4
33
Exclude:
44
- 'examples/**/*'
5-
- 'generator/target/**/*'
5+
- 'generator/**/*'
66
- 'lib/line/bot/v2/channel_access_token/**/*'
77
- 'lib/line/bot/v2/insight/**/*'
88
- 'lib/line/bot/v2/liff/**/*'

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ module Line
5454
end
5555
{%- for op in operations.operation %}
5656

57+
{% if op.nickname == "issue_stateless_channel_token" -%}
58+
# @deprecated
59+
# This is deprecated.
60+
# Please use {{ '{' }}#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {{ '{' }}#issue_stateless_channel_token_by_client_secret_with_http_info} instead.
61+
#
62+
{% endif -%}
5763
# {{ op.notes }}
5864
# This requests to <code>{{ op.httpMethod }} {{ endpoint(operations.classname) }}{{ op.path }}</code>
5965
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -132,6 +138,12 @@ module Line
132138
end
133139
end
134140

141+
{% if op.nickname == "issue_stateless_channel_token" -%}
142+
# @deprecated
143+
# This is deprecated.
144+
# Please use {{ '{' }}#issue_stateless_channel_token_by_jwt_assertion} or {{ '{' }}#issue_stateless_channel_token_by_client_secret} instead.
145+
#
146+
{% endif -%}
135147
# {{ op.notes }}
136148
# This requests to <code>{{ op.httpMethod }} {{ endpoint(operations.classname) }}{{ op.path }}</code>
137149
# When you want to get HTTP status code or response headers, use {{ '{#' }}{{op.nickname}}_with_http_info} instead of this.
@@ -160,13 +172,17 @@ module Line
160172
{{param.paramName}}:{{ param.required ? '' : ' nil' }}{{ loop.last ? '' : ',' -}}
161173
{% endfor %}
162174
)
163-
response_body, _status_code, _headers = {{op.nickname}}_with_http_info({% for param in op.allParams %}
175+
response_body, _status_code, _headers = {{op.nickname}}_with_http_info({% if op.nickname == "issue_stateless_channel_token" %} # steep:ignore DeprecatedReference{% endif %}{% for param in op.allParams %}
164176
{{param.paramName}}: {{param.paramName}}{{ loop.last ? '' : ',' -}}
165177
{% endfor %}
166178
)
167179

168180
response_body
169181
end{% endfor %}
182+
{%- if ["ChannelAccessTokenClient"] contains operations.classname %}
183+
184+
{% include "./body/api/" + operations.classname + ".rb" %}
185+
{%- endif %}
170186
end
171187
end
172188
end
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Issues a new stateless channel access token by JWT assertion, 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.
2+
# This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication.
3+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
4+
# When you want to get HTTP status code or response headers, use {{ '{#' }}issue_stateless_channel_token_by_jwt_assertion_with_http_info} instead of this.
5+
#
6+
# @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.
7+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
8+
# @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200
9+
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
10+
def issue_stateless_channel_token_by_jwt_assertion(
11+
client_assertion:
12+
)
13+
issue_stateless_channel_token( # steep:ignore DeprecatedReference
14+
grant_type: 'client_credentials',
15+
client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
16+
client_assertion: client_assertion
17+
)
18+
end
19+
20+
# Issues a new stateless channel access token by client secret, 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.
21+
# This is a convenience wrapper that only requires the parameters needed for client secret authentication.
22+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
23+
# When you want to get HTTP status code or response headers, use {{ '{#' }}issue_stateless_channel_token_by_client_secret_with_http_info} instead of this.
24+
#
25+
# @param client_id [String] Channel ID.
26+
# @param client_secret [String] Channel secret.
27+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
28+
# @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200
29+
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
30+
def issue_stateless_channel_token_by_client_secret(
31+
client_id:,
32+
client_secret:
33+
)
34+
issue_stateless_channel_token( # steep:ignore DeprecatedReference
35+
grant_type: 'client_credentials',
36+
client_id: client_id,
37+
client_secret: client_secret
38+
)
39+
end
40+
41+
# Issues a new stateless channel access token by JWT assertion, 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.
42+
# This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication.
43+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
44+
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
45+
#
46+
# @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.
47+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
48+
# @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200
49+
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
50+
def issue_stateless_channel_token_by_jwt_assertion_with_http_info(
51+
client_assertion:
52+
)
53+
issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference
54+
grant_type: 'client_credentials',
55+
client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
56+
client_assertion: client_assertion
57+
)
58+
end
59+
60+
# Issues a new stateless channel access token by client secret, 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.
61+
# This is a convenience wrapper that only requires the parameters needed for client secret authentication.
62+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
63+
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
64+
#
65+
# @param client_id [String] Channel ID.
66+
# @param client_secret [String] Channel secret.
67+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
68+
# @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200
69+
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
70+
def issue_stateless_channel_token_by_client_secret_with_http_info(
71+
client_id:,
72+
client_secret:
73+
)
74+
issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference
75+
grant_type: 'client_credentials',
76+
client_id: client_id,
77+
client_secret: client_secret
78+
)
79+
end

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ module Line
7373
{%- endif %}
7474
{%- endfor %}
7575
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
76+
{% if op.nickname == "issue_stateless_channel_token" -%}
77+
%a{deprecated: Use #issue_stateless_channel_token_by_jwt_assertion_with_http_info or #issue_stateless_channel_token_by_client_secret_with_http_info instead}
78+
{% endif -%}
7679
def {{op.nickname}}_with_http_info: (
7780
{%- for param in op.allParams %}
7881
{{ param.required ? '' : '?' }}{{param.paramName}}: {{ formatDataType(param) }}{{ param.required ? '' : '?' }}{{ loop.last ? '' : ', ' -}}
@@ -108,6 +111,9 @@ module Line
108111
{%- endif %}
109112
{%- endfor %}
110113
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
114+
{% if op.nickname == "issue_stateless_channel_token" -%}
115+
%a{deprecated: Use #issue_stateless_channel_token_by_jwt_assertion or #issue_stateless_channel_token_by_client_secret instead}
116+
{% endif -%}
111117
def {{op.nickname}}: (
112118
{%- for param in op.allParams %}
113119
{{ param.required ? '' : '?' }}{{param.paramName}}: {{ formatDataType(param) }}{{ param.required ? '' : '?' }}{{ loop.last ? '' : ', ' -}}
@@ -119,6 +125,10 @@ module Line
119125
| String? # otherwise
120126
)
121127
{%- endfor %}
128+
{%- if ["ChannelAccessTokenClient"] contains operations.classname %}
129+
130+
{% include "./body/api/" + operations.classname + ".rbs" %}
131+
{%- endif %}
122132
end
123133
end
124134
end
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Issues a new stateless channel access token by JWT assertion, 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.
2+
# This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication.
3+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
4+
# When you want to get HTTP status code or response headers, use {{ '{#' }}issue_stateless_channel_token_by_jwt_assertion_with_http_info} instead of this.
5+
#
6+
# @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.
7+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
8+
# @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200
9+
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
10+
def issue_stateless_channel_token_by_jwt_assertion: (
11+
client_assertion: String
12+
) -> (
13+
IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200
14+
| String? # otherwise
15+
)
16+
17+
# Issues a new stateless channel access token by client secret, 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.
18+
# This is a convenience wrapper that only requires the parameters needed for client secret authentication.
19+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
20+
# When you want to get HTTP status code or response headers, use {{ '{#' }}issue_stateless_channel_token_by_client_secret_with_http_info} instead of this.
21+
#
22+
# @param client_id [String] Channel ID.
23+
# @param client_secret [String] Channel secret.
24+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
25+
# @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200
26+
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
27+
def issue_stateless_channel_token_by_client_secret: (
28+
client_id: String,
29+
client_secret: String
30+
) -> (
31+
IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200
32+
| String? # otherwise
33+
)
34+
35+
# Issues a new stateless channel access token by JWT assertion, 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.
36+
# This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication.
37+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
38+
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
39+
#
40+
# @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key.
41+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
42+
# @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200
43+
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
44+
def issue_stateless_channel_token_by_jwt_assertion_with_http_info: (
45+
client_assertion: String
46+
) -> (
47+
[IssueStatelessChannelAccessTokenResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200
48+
| [String?, Integer, Hash[untyped, untyped]] # otherwise
49+
)
50+
51+
# Issues a new stateless channel access token by client secret, 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.
52+
# This is a convenience wrapper that only requires the parameters needed for client secret authentication.
53+
# This requests to <code>POST https://api.line.me/oauth2/v3/token</code>
54+
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
55+
#
56+
# @param client_id [String] Channel ID.
57+
# @param client_secret [String] Channel secret.
58+
# @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token
59+
# @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200
60+
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
61+
def issue_stateless_channel_token_by_client_secret_with_http_info: (
62+
client_id: String,
63+
client_secret: String
64+
) -> (
65+
[IssueStatelessChannelAccessTokenResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200
66+
| [String?, Integer, Hash[untyped, untyped]] # otherwise
67+
)

0 commit comments

Comments
 (0)