From 938f47783961680515feff576f68eca3e2930193 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Wed, 1 Apr 2026 18:05:51 +0900 Subject: [PATCH 1/9] Implement wrapper method of issue_stateless_channel_token --- .../line-bot-sdk-ruby-generator/api.pebble | 3 + .../body/api/ChannelAccessTokenClient.rb | 31 ++++++++++ .../api.pebble | 3 + .../body/api/ChannelAccessTokenClient.rbs | 14 +++++ .../api/channel_access_token_client.rb | 32 ++++++++++ .../api/channel_access_token_client.rbs | 15 +++++ spec/line/bot/v2/misc_spec.rb | 60 +++++++++++++++++++ 7 files changed, 158 insertions(+) create mode 100644 generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb create mode 100644 generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble index a0111cbd..9518936b 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble @@ -167,6 +167,9 @@ module Line response_body end{% endfor %} + {%- if ["ChannelAccessTokenClient"] contains operations.classname %} +{% include "./body/api/" + operations.classname + ".rb" %} + {%- endif %} end end end diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb new file mode 100644 index 00000000..6940a7d6 --- /dev/null +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb @@ -0,0 +1,31 @@ + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + def issue_stateless_channel_token_by_jwt_assertion( + client_assertion: + ) + issue_stateless_channel_token( + grant_type: 'client_credentials', + client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + client_assertion: client_assertion + ) + end + + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + def issue_stateless_channel_token_by_client_secret( + client_id:, + client_secret: + ) + issue_stateless_channel_token( + grant_type: 'client_credentials', + client_id: client_id, + client_secret: client_secret + ) + end diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble index d984fa52..73ee4868 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble @@ -119,6 +119,9 @@ module Line | String? # otherwise ) {%- endfor %} + {%- if ["ChannelAccessTokenClient"] contains operations.classname %} +{% include "./body/api/" + operations.classname + ".rbs" %} + {%- endif %} end end end diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs new file mode 100644 index 00000000..db4c128d --- /dev/null +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs @@ -0,0 +1,14 @@ + def issue_stateless_channel_token_by_jwt_assertion: ( + client_assertion: String + ) -> ( + IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200 + | String? # otherwise + ) + + def issue_stateless_channel_token_by_client_secret: ( + client_id: String, + client_secret: String + ) -> ( + IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200 + | String? # otherwise + ) diff --git a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb index 3fed06a0..66065061 100644 --- a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb +++ b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb @@ -526,6 +526,38 @@ def verify_channel_token_by_jwt( response_body end + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + def issue_stateless_channel_token_by_jwt_assertion( + client_assertion: + ) + issue_stateless_channel_token( + grant_type: 'client_credentials', + client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + client_assertion: client_assertion + ) + end + + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + def issue_stateless_channel_token_by_client_secret( + client_id:, + client_secret: + ) + issue_stateless_channel_token( + grant_type: 'client_credentials', + client_id: client_id, + client_secret: client_secret + ) + end + end end end diff --git a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs index 59187fc3..3f710fe1 100644 --- a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs +++ b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs @@ -320,6 +320,21 @@ module Line VerifyChannelAccessTokenResponse # when HTTP status code is 200 | String? # otherwise ) + def issue_stateless_channel_token_by_jwt_assertion: ( + client_assertion: String + ) -> ( + IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200 + | String? # otherwise + ) + + def issue_stateless_channel_token_by_client_secret: ( + client_id: String, + client_secret: String + ) -> ( + IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200 + | String? # otherwise + ) + end end end diff --git a/spec/line/bot/v2/misc_spec.rb b/spec/line/bot/v2/misc_spec.rb index d4178f6e..47ae53e3 100644 --- a/spec/line/bot/v2/misc_spec.rb +++ b/spec/line/bot/v2/misc_spec.rb @@ -431,6 +431,66 @@ end end + describe 'issue_stateless_channel_token_by_jwt_assertion' do + let(:client) { Line::Bot::V2::ChannelAccessToken::ApiClient.new } + let(:client_assertion) { 'eyJhbGciOiJSUzI.dummy' } + let(:response_body) { { "access_token" => "test-access-token", "expires_in" => 900, "token_type" => "Bearer" }.to_json } + let(:response_code) { 200 } + + it "sends only JWT assertion parameters" do + stub_request(:post, "https://api.line.me/oauth2/v3/token") + .with( + body: { + grant_type: "client_credentials", + client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + client_assertion: client_assertion + }, + headers: { + 'Content-Type' => 'application/x-www-form-urlencoded' + } + ) + .to_return(status: response_code, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body = client.issue_stateless_channel_token_by_jwt_assertion( + client_assertion: client_assertion + ) + + expect(body.access_token).to eq('test-access-token') + expect(body.token_type).to eq('Bearer') + end + end + + describe 'issue_stateless_channel_token_by_client_secret' do + let(:client) { Line::Bot::V2::ChannelAccessToken::ApiClient.new } + let(:client_id) { 'test-client-id' } + let(:client_secret) { 'test-client-secret' } + let(:response_body) { { "access_token" => "test-access-token", "expires_in" => 900, "token_type" => "Bearer" }.to_json } + let(:response_code) { 200 } + + it "sends only client secret parameters" do + stub_request(:post, "https://api.line.me/oauth2/v3/token") + .with( + body: { + grant_type: "client_credentials", + client_id: client_id, + client_secret: client_secret + }, + headers: { + 'Content-Type' => 'application/x-www-form-urlencoded' + } + ) + .to_return(status: response_code, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body = client.issue_stateless_channel_token_by_client_secret( + client_id: client_id, + client_secret: client_secret + ) + + expect(body.access_token).to eq('test-access-token') + expect(body.token_type).to eq('Bearer') + end + end + describe 'GET /v2/bot/followers/ids' do let(:client) { Line::Bot::V2::MessagingApi::ApiClient.new(channel_access_token: 'test-channel-access-token') } let(:response_code) { 200 } From 6355d46cc59b978ff5c62be2f0ed4ecbc0cc21e3 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Wed, 1 Apr 2026 18:24:33 +0900 Subject: [PATCH 2/9] Exclude generator directory from rubocop inspection --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index 104a98d8..13dc6a9b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ AllCops: TargetRubyVersion: 2.4 Exclude: - 'examples/**/*' + - 'generator/**/*' - 'lib/line/bot/v2/channel_access_token/**/*' - 'lib/line/bot/v2/insight/**/*' - 'lib/line/bot/v2/liff/**/*' From 5c2e49c3ffcdaf960031ac4e3abfd033f29a4e8e Mon Sep 17 00:00:00 2001 From: habara keigo Date: Thu, 2 Apr 2026 19:34:18 +0900 Subject: [PATCH 3/9] Support *_with_http_info --- .../body/api/ChannelAccessTokenClient.rb | 34 +++++++++++++++++++ .../body/api/ChannelAccessTokenClient.rbs | 15 ++++++++ .../api/channel_access_token_client.rb | 34 +++++++++++++++++++ .../api/channel_access_token_client.rbs | 15 ++++++++ 4 files changed, 98 insertions(+) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb index 6940a7d6..96c814f0 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb @@ -29,3 +29,37 @@ def issue_stateless_channel_token_by_client_secret( client_secret: client_secret ) end + + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # When you want to get HTTP status code or response headers, use this instead of {{ '{#' }}issue_stateless_channel_token_by_jwt_assertion}. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + def issue_stateless_channel_token_by_jwt_assertion_with_http_info( + client_assertion: + ) + issue_stateless_channel_token_with_http_info( + grant_type: 'client_credentials', + client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + client_assertion: client_assertion + ) + end + + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # When you want to get HTTP status code or response headers, use this instead of {{ '{#' }}issue_stateless_channel_token_by_client_secret}. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + def issue_stateless_channel_token_by_client_secret_with_http_info( + client_id:, + client_secret: + ) + issue_stateless_channel_token_with_http_info( + grant_type: 'client_credentials', + client_id: client_id, + client_secret: client_secret + ) + end diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs index db4c128d..fe55d0ea 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs @@ -12,3 +12,18 @@ IssueStatelessChannelAccessTokenResponse # when HTTP status code is 200 | String? # otherwise ) + + def issue_stateless_channel_token_by_jwt_assertion_with_http_info: ( + client_assertion: String + ) -> ( + [IssueStatelessChannelAccessTokenResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200 + | [String?, Integer, Hash[untyped, untyped]] # otherwise + ) + + def issue_stateless_channel_token_by_client_secret_with_http_info: ( + client_id: String, + client_secret: String + ) -> ( + [IssueStatelessChannelAccessTokenResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200 + | [String?, Integer, Hash[untyped, untyped]] # otherwise + ) diff --git a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb index 66065061..3b74c447 100644 --- a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb +++ b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb @@ -558,6 +558,40 @@ def issue_stateless_channel_token_by_client_secret( ) end + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # When you want to get HTTP status code or response headers, use this instead of {#issue_stateless_channel_token_by_jwt_assertion}. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + def issue_stateless_channel_token_by_jwt_assertion_with_http_info( + client_assertion: + ) + issue_stateless_channel_token_with_http_info( + grant_type: 'client_credentials', + client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + client_assertion: client_assertion + ) + end + + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # When you want to get HTTP status code or response headers, use this instead of {#issue_stateless_channel_token_by_client_secret}. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + def issue_stateless_channel_token_by_client_secret_with_http_info( + client_id:, + client_secret: + ) + issue_stateless_channel_token_with_http_info( + grant_type: 'client_credentials', + client_id: client_id, + client_secret: client_secret + ) + end + end end end diff --git a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs index 3f710fe1..2b27cdc1 100644 --- a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs +++ b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs @@ -335,6 +335,21 @@ module Line | String? # otherwise ) + def issue_stateless_channel_token_by_jwt_assertion_with_http_info: ( + client_assertion: String + ) -> ( + [IssueStatelessChannelAccessTokenResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200 + | [String?, Integer, Hash[untyped, untyped]] # otherwise + ) + + def issue_stateless_channel_token_by_client_secret_with_http_info: ( + client_id: String, + client_secret: String + ) -> ( + [IssueStatelessChannelAccessTokenResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200 + | [String?, Integer, Hash[untyped, untyped]] # otherwise + ) + end end end From 286a30bb8a312c9dd7b4ba08e283973b8478b837 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Thu, 2 Apr 2026 20:26:12 +0900 Subject: [PATCH 4/9] Add in-code docs --- .../resources/line-bot-sdk-ruby-generator/api.pebble | 12 ++++++++++++ .../api/channel_access_token_client.rb | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble index 9518936b..b16a778d 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble @@ -54,6 +54,12 @@ module Line end {%- for op in operations.operation %} + {% if op.nickname == "issue_stateless_channel_token" -%} + # @deprecated + # This is deprecated. + # Please use {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret_with_http_info} instead. + # + {% endif -%} # {{ op.notes }} # This requests to {{ op.httpMethod }} {{ endpoint(operations.classname) }}{{ op.path }} # 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 end end + {% if op.nickname == "issue_stateless_channel_token" -%} + # @deprecated + # This is deprecated. + # Please use {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion} or {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret} instead. + # + {% endif -%} # {{ op.notes }} # This requests to {{ op.httpMethod }} {{ endpoint(operations.classname) }}{{ op.path }} # When you want to get HTTP status code or response headers, use {{ '{#' }}{{op.nickname}}_with_http_info} instead of this. diff --git a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb index 3b74c447..36725cb3 100644 --- a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb +++ b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb @@ -237,6 +237,10 @@ def issue_channel_token_by_jwt( response_body end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret_with_http_info} instead. + # # 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. # This requests to POST https://api.line.me/oauth2/v3/token # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. @@ -284,6 +288,10 @@ def issue_stateless_channel_token_with_http_info( # steep:ignore MethodBodyTypeM end end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion} or {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret} instead. + # # 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. # This requests to POST https://api.line.me/oauth2/v3/token # When you want to get HTTP status code or response headers, use {#issue_stateless_channel_token_with_http_info} instead of this. From 2a1500227d911bf7ffea631b11bfb3ea68d5a989 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Fri, 3 Apr 2026 16:23:29 +0900 Subject: [PATCH 5/9] Fix in-code docs --- .../src/main/resources/line-bot-sdk-ruby-generator/api.pebble | 4 ++-- .../channel_access_token/api/channel_access_token_client.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble index b16a778d..be08b367 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble @@ -57,7 +57,7 @@ module Line {% if op.nickname == "issue_stateless_channel_token" -%} # @deprecated # This is deprecated. - # Please use {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret_with_http_info} instead. + # Please use {{ '{' }}#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {{ '{' }}#issue_stateless_channel_token_by_client_secret_with_http_info} instead. # {% endif -%} # {{ op.notes }} @@ -141,7 +141,7 @@ module Line {% if op.nickname == "issue_stateless_channel_token" -%} # @deprecated # This is deprecated. - # Please use {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion} or {{ '{' }}Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret} instead. + # Please use {{ '{' }}#issue_stateless_channel_token_by_jwt_assertion} or {{ '{' }}#issue_stateless_channel_token_by_client_secret} instead. # {% endif -%} # {{ op.notes }} diff --git a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb index 36725cb3..1cf6fb4d 100644 --- a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb +++ b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb @@ -239,7 +239,7 @@ def issue_channel_token_by_jwt( # @deprecated # This is deprecated. - # Please use {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret_with_http_info} instead. + # Please use {#issue_stateless_channel_token_by_jwt_assertion_with_http_info} or {#issue_stateless_channel_token_by_client_secret_with_http_info} instead. # # 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. # This requests to POST https://api.line.me/oauth2/v3/token @@ -290,7 +290,7 @@ def issue_stateless_channel_token_with_http_info( # steep:ignore MethodBodyTypeM # @deprecated # This is deprecated. - # Please use {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_jwt_assertion} or {Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenClient#issue_stateless_channel_token_by_client_secret} instead. + # Please use {#issue_stateless_channel_token_by_jwt_assertion} or {#issue_stateless_channel_token_by_client_secret} instead. # # 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. # This requests to POST https://api.line.me/oauth2/v3/token From deea1eaca07cdf3a44048de01a906dc5313b9655 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Mon, 6 Apr 2026 15:02:11 +0900 Subject: [PATCH 6/9] Add comments to rbs files --- .../body/api/ChannelAccessTokenClient.rbs | 10 ++++++++++ .../api/channel_access_token_client.rbs | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs index fe55d0ea..5abc98a4 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs @@ -1,3 +1,5 @@ + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. def issue_stateless_channel_token_by_jwt_assertion: ( client_assertion: String ) -> ( @@ -5,6 +7,8 @@ | String? # otherwise ) + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. def issue_stateless_channel_token_by_client_secret: ( client_id: String, client_secret: String @@ -13,6 +17,9 @@ | String? # otherwise ) + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_jwt_assertion. def issue_stateless_channel_token_by_jwt_assertion_with_http_info: ( client_assertion: String ) -> ( @@ -20,6 +27,9 @@ | [String?, Integer, Hash[untyped, untyped]] # otherwise ) + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_client_secret. def issue_stateless_channel_token_by_client_secret_with_http_info: ( client_id: String, client_secret: String diff --git a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs index 2b27cdc1..4f1a94fe 100644 --- a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs +++ b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs @@ -320,6 +320,8 @@ module Line VerifyChannelAccessTokenResponse # when HTTP status code is 200 | String? # otherwise ) + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. def issue_stateless_channel_token_by_jwt_assertion: ( client_assertion: String ) -> ( @@ -327,6 +329,8 @@ module Line | String? # otherwise ) + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. def issue_stateless_channel_token_by_client_secret: ( client_id: String, client_secret: String @@ -335,6 +339,9 @@ module Line | String? # otherwise ) + # Issues a new stateless channel access token by JWT assertion. + # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_jwt_assertion. def issue_stateless_channel_token_by_jwt_assertion_with_http_info: ( client_assertion: String ) -> ( @@ -342,6 +349,9 @@ module Line | [String?, Integer, Hash[untyped, untyped]] # otherwise ) + # Issues a new stateless channel access token by client secret. + # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_client_secret. def issue_stateless_channel_token_by_client_secret_with_http_info: ( client_id: String, client_secret: String From 693fda9404196806888c4727cb1af53a05a5e73e Mon Sep 17 00:00:00 2001 From: habara keigo Date: Mon, 6 Apr 2026 16:28:55 +0900 Subject: [PATCH 7/9] Fix docs --- .../line-bot-sdk-ruby-generator/api.pebble | 5 ++- .../body/api/ChannelAccessTokenClient.rb | 34 ++++++++++----- .../api.pebble | 5 ++- .../body/api/ChannelAccessTokenClient.rbs | 40 +++++++++++++++--- .../api/channel_access_token_client.rb | 35 +++++++++++----- .../api/channel_access_token_client.rbs | 41 ++++++++++++++++--- 6 files changed, 124 insertions(+), 36 deletions(-) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble index be08b367..a0eddb1e 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble @@ -179,9 +179,10 @@ module Line response_body end{% endfor %} - {%- if ["ChannelAccessTokenClient"] contains operations.classname %} +{%- if ["ChannelAccessTokenClient"] contains operations.classname %} + {% include "./body/api/" + operations.classname + ".rb" %} - {%- endif %} +{%- endif %} end end end diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb index 96c814f0..334ee4fa 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb @@ -1,8 +1,12 @@ - # Issues a new stateless channel access token by JWT assertion. + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. # # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion( client_assertion: ) @@ -13,12 +17,16 @@ def issue_stateless_channel_token_by_jwt_assertion( ) end - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. # # @param client_id [String] Channel ID. # @param client_secret [String] Channel secret. - # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret( client_id:, client_secret: @@ -30,12 +38,15 @@ def issue_stateless_channel_token_by_client_secret( ) end - # Issues a new stateless channel access token by JWT assertion. + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. - # When you want to get HTTP status code or response headers, use this instead of {{ '{#' }}issue_stateless_channel_token_by_jwt_assertion}. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. # # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion_with_http_info( client_assertion: ) @@ -46,13 +57,16 @@ def issue_stateless_channel_token_by_jwt_assertion_with_http_info( ) end - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. - # When you want to get HTTP status code or response headers, use this instead of {{ '{#' }}issue_stateless_channel_token_by_client_secret}. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. # # @param client_id [String] Channel ID. # @param client_secret [String] Channel secret. - # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret_with_http_info( client_id:, client_secret: diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble index 73ee4868..f32f1d75 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble @@ -119,9 +119,10 @@ module Line | String? # otherwise ) {%- endfor %} - {%- if ["ChannelAccessTokenClient"] contains operations.classname %} +{%- if ["ChannelAccessTokenClient"] contains operations.classname %} + {% include "./body/api/" + operations.classname + ".rbs" %} - {%- endif %} +{%- endif %} end end end diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs index 5abc98a4..59f87267 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/body/api/ChannelAccessTokenClient.rbs @@ -1,5 +1,12 @@ - # Issues a new stateless channel access token by JWT assertion. + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion: ( client_assertion: String ) -> ( @@ -7,8 +14,16 @@ | String? # otherwise ) - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret: ( client_id: String, client_secret: String @@ -17,9 +32,15 @@ | String? # otherwise ) - # Issues a new stateless channel access token by JWT assertion. + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. - # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_jwt_assertion. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion_with_http_info: ( client_assertion: String ) -> ( @@ -27,9 +48,16 @@ | [String?, Integer, Hash[untyped, untyped]] # otherwise ) - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. - # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_client_secret. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret_with_http_info: ( client_id: String, client_secret: String diff --git a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb index 1cf6fb4d..952e49ca 100644 --- a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb +++ b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb @@ -534,11 +534,16 @@ def verify_channel_token_by_jwt( response_body end - # Issues a new stateless channel access token by JWT assertion. + + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. # # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion( client_assertion: ) @@ -549,12 +554,16 @@ def issue_stateless_channel_token_by_jwt_assertion( ) end - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. # # @param client_id [String] Channel ID. # @param client_secret [String] Channel secret. - # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret( client_id:, client_secret: @@ -566,12 +575,15 @@ def issue_stateless_channel_token_by_client_secret( ) end - # Issues a new stateless channel access token by JWT assertion. + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. - # When you want to get HTTP status code or response headers, use this instead of {#issue_stateless_channel_token_by_jwt_assertion}. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. # # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. - # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion_with_http_info( client_assertion: ) @@ -582,13 +594,16 @@ def issue_stateless_channel_token_by_jwt_assertion_with_http_info( ) end - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. - # When you want to get HTTP status code or response headers, use this instead of {#issue_stateless_channel_token_by_client_secret}. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. # # @param client_id [String] Channel ID. # @param client_secret [String] Channel secret. - # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret_with_http_info( client_id:, client_secret: diff --git a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs index 4f1a94fe..72657ecb 100644 --- a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs +++ b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs @@ -320,8 +320,16 @@ module Line VerifyChannelAccessTokenResponse # when HTTP status code is 200 | String? # otherwise ) - # Issues a new stateless channel access token by JWT assertion. + + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion: ( client_assertion: String ) -> ( @@ -329,8 +337,16 @@ module Line | String? # otherwise ) - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. + # This requests to POST https://api.line.me/oauth2/v3/token + # 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. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret: ( client_id: String, client_secret: String @@ -339,9 +355,15 @@ module Line | String? # otherwise ) - # Issues a new stateless channel access token by JWT assertion. + # 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. # This is a convenience wrapper that only requires the parameters needed for JWT assertion authentication. - # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_jwt_assertion. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param client_assertion [String] A JSON Web Token the client needs to create and sign with the private key of the Assertion Signing Key. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_jwt_assertion_with_http_info: ( client_assertion: String ) -> ( @@ -349,9 +371,16 @@ module Line | [String?, Integer, Hash[untyped, untyped]] # otherwise ) - # Issues a new stateless channel access token by client secret. + # 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. # This is a convenience wrapper that only requires the parameters needed for client secret authentication. - # When you want to get HTTP status code or response headers, use this instead of #issue_stateless_channel_token_by_client_secret. + # This requests to POST https://api.line.me/oauth2/v3/token + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param client_id [String] Channel ID. + # @param client_secret [String] Channel secret. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token + # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. def issue_stateless_channel_token_by_client_secret_with_http_info: ( client_id: String, client_secret: String From a60473d0a5a554c77b616772d27133f018fa5df2 Mon Sep 17 00:00:00 2001 From: habara keigo Date: Tue, 7 Apr 2026 10:25:27 +0900 Subject: [PATCH 8/9] Add missed comments --- .../resources/line-bot-sdk-ruby-rbs-generator/api.pebble | 6 ++++++ .../api/channel_access_token_client.rbs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble index f32f1d75..55eda201 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-rbs-generator/api.pebble @@ -73,6 +73,9 @@ module Line {%- endif %} {%- endfor %} # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + {% if op.nickname == "issue_stateless_channel_token" -%} + %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} + {% endif -%} def {{op.nickname}}_with_http_info: ( {%- for param in op.allParams %} {{ param.required ? '' : '?' }}{{param.paramName}}: {{ formatDataType(param) }}{{ param.required ? '' : '?' }}{{ loop.last ? '' : ', ' -}} @@ -108,6 +111,9 @@ module Line {%- endif %} {%- endfor %} # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + {% if op.nickname == "issue_stateless_channel_token" -%} + %a{deprecated: Use #issue_stateless_channel_token_by_jwt_assertion or #issue_stateless_channel_token_by_client_secret instead} + {% endif -%} def {{op.nickname}}: ( {%- for param in op.allParams %} {{ param.required ? '' : '?' }}{{param.paramName}}: {{ formatDataType(param) }}{{ param.required ? '' : '?' }}{{ loop.last ? '' : ', ' -}} diff --git a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs index 72657ecb..67749e14 100644 --- a/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs +++ b/sig/line/bot/v2/channel_access_token/api/channel_access_token_client.rbs @@ -159,6 +159,7 @@ module Line # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token # @return [Array(Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse, Integer, Hash{String => String})] when HTTP status code is 200 # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + %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} def issue_stateless_channel_token_with_http_info: ( ?grant_type: String?, ?client_assertion_type: String?, @@ -182,6 +183,7 @@ module Line # @see https://developers.line.biz/en/reference/messaging-api/#issue-stateless-channel-access-token # @return [Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse] when HTTP status code is 200 # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + %a{deprecated: Use #issue_stateless_channel_token_by_jwt_assertion or #issue_stateless_channel_token_by_client_secret instead} def issue_stateless_channel_token: ( ?grant_type: String?, ?client_assertion_type: String?, From d112ad45fc46c896af2b2f5c2fb71e355f6680ff Mon Sep 17 00:00:00 2001 From: habara keigo Date: Tue, 7 Apr 2026 10:53:47 +0900 Subject: [PATCH 9/9] Suppress deprecated warning --- .../resources/line-bot-sdk-ruby-generator/api.pebble | 2 +- .../body/api/ChannelAccessTokenClient.rb | 8 ++++---- .../api/channel_access_token_client.rb | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble index a0eddb1e..d711105a 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble @@ -172,7 +172,7 @@ module Line {{param.paramName}}:{{ param.required ? '' : ' nil' }}{{ loop.last ? '' : ',' -}} {% endfor %} ) - response_body, _status_code, _headers = {{op.nickname}}_with_http_info({% for param in op.allParams %} + 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 %} {{param.paramName}}: {{param.paramName}}{{ loop.last ? '' : ',' -}} {% endfor %} ) diff --git a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb index 334ee4fa..203144e9 100644 --- a/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb +++ b/generator/src/main/resources/line-bot-sdk-ruby-generator/body/api/ChannelAccessTokenClient.rb @@ -10,7 +10,7 @@ def issue_stateless_channel_token_by_jwt_assertion( client_assertion: ) - issue_stateless_channel_token( + issue_stateless_channel_token( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', client_assertion: client_assertion @@ -31,7 +31,7 @@ def issue_stateless_channel_token_by_client_secret( client_id:, client_secret: ) - issue_stateless_channel_token( + issue_stateless_channel_token( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_id: client_id, client_secret: client_secret @@ -50,7 +50,7 @@ def issue_stateless_channel_token_by_client_secret( def issue_stateless_channel_token_by_jwt_assertion_with_http_info( client_assertion: ) - issue_stateless_channel_token_with_http_info( + issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', client_assertion: client_assertion @@ -71,7 +71,7 @@ def issue_stateless_channel_token_by_client_secret_with_http_info( client_id:, client_secret: ) - issue_stateless_channel_token_with_http_info( + issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_id: client_id, client_secret: client_secret diff --git a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb index 952e49ca..73bba3a4 100644 --- a/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb +++ b/lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb @@ -311,7 +311,7 @@ def issue_stateless_channel_token( client_id: nil, client_secret: nil ) - response_body, _status_code, _headers = issue_stateless_channel_token_with_http_info( + response_body, _status_code, _headers = issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference grant_type: grant_type, client_assertion_type: client_assertion_type, client_assertion: client_assertion, @@ -547,7 +547,7 @@ def verify_channel_token_by_jwt( def issue_stateless_channel_token_by_jwt_assertion( client_assertion: ) - issue_stateless_channel_token( + issue_stateless_channel_token( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', client_assertion: client_assertion @@ -568,7 +568,7 @@ def issue_stateless_channel_token_by_client_secret( client_id:, client_secret: ) - issue_stateless_channel_token( + issue_stateless_channel_token( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_id: client_id, client_secret: client_secret @@ -587,7 +587,7 @@ def issue_stateless_channel_token_by_client_secret( def issue_stateless_channel_token_by_jwt_assertion_with_http_info( client_assertion: ) - issue_stateless_channel_token_with_http_info( + issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', client_assertion: client_assertion @@ -608,7 +608,7 @@ def issue_stateless_channel_token_by_client_secret_with_http_info( client_id:, client_secret: ) - issue_stateless_channel_token_with_http_info( + issue_stateless_channel_token_with_http_info( # steep:ignore DeprecatedReference grant_type: 'client_credentials', client_id: client_id, client_secret: client_secret