diff --git a/.github/workflows/generate-code.yml b/.github/workflows/generate-code.yml index a187b466..86fccbaa 100644 --- a/.github/workflows/generate-code.yml +++ b/.github/workflows/generate-code.yml @@ -33,6 +33,10 @@ jobs: distribution: 'temurin' java-version: 17 architecture: x64 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 + with: + ruby-version: '4.0' + - run: bundle install # Generate codes - name: Generate code diff --git a/.rubocop.yml b/.rubocop.yml index 13dc6a9b..76d96fb2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,8 @@ AllCops: - 'lib/line/bot/v2/module_attach/**/*' - 'lib/line/bot/v2/shop/**/*' - 'lib/line/bot/v2/webhook/**/*' + - 'lib/line/bot/v2/line_bot_client.generated.rb' + - 'lib/line/bot/v2/line_bot_client.factory.generated.rb' NewCops: disable Gemspec/RequiredRubyVersion: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eab39cbb..92c32da4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ Thus, you can't edit almost all code under `lib/line/bot/v2/.rb` and `sig/l You need to edit the pebble template under [resources](generator/src/main/resources) instead. -After editing the templates, run `generate-code.py` to generate the code, and then commit all affected files. +After editing the templates, run `generate-code.py` to generate the code (including the unified client), and then commit all affected files. If not, CI status will be red. When you update code, be sure to check consistencies between `lib/**.rb` and `sig/**.rbs`. diff --git a/README.md b/README.md index 7ea1f405..5048f51c 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,9 @@ You can code with type support in the corresponding IDE or editor. ### Basic Usage +The unified `Line::Bot::V2::LineBotClient` wraps all individual API clients into a single object. +You no longer need to create separate clients for MessagingApi, Insight, Liff, etc. + ```ruby # app.rb require 'sinatra' @@ -62,13 +65,7 @@ require 'line-bot-api' set :environment, :production def client - @client ||= Line::Bot::V2::MessagingApi::ApiClient.new( - channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") - ) -end - -def blob_client - @blob_client ||= Line::Bot::V2::MessagingApi::ApiBlobClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") ) end @@ -109,9 +106,9 @@ post '/callback' do ) client.reply_message(reply_message_request: request) end - + when Line::Bot::V2::Webhook::ImageMessageContent, Line::Bot::V2::Webhook::VideoMessageContent - response = blob_client.get_message_content(message_id: event.message.message_id) + response = client.get_message_content(message_id: event.message.message_id) tf = Tempfile.open("content") tf.write(response) end @@ -123,6 +120,10 @@ post '/callback' do end ``` +> **Note:** You can still use the individual clients (e.g. `Line::Bot::V2::MessagingApi::ApiClient`) if you prefer. +> For channel access token operations, use `Line::Bot::V2::ChannelAccessToken::ApiClient` directly. +> For module attach operations, use `Line::Bot::V2::ModuleAttach::ApiClient` directly. + ### Main classes You may use this classes to use LINE Messaging API features. @@ -132,6 +133,26 @@ You may use this classes to use LINE Messaging API features. ### Clients +#### Unified Client (recommended) + +`Line::Bot::V2::LineBotClient` wraps all API clients below (except ChannelAccessToken and ModuleAttach) into one object. +You only need a single `channel_access_token` to call any API. + +```ruby +client = Line::Bot::V2::LineBotClient.new( + channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") +) + +# MessagingApi, Insight, Liff, ManageAudience, Module, Shop — all available: +client.push_message(push_message_request: request) +client.get_number_of_followers(date: '20240101') +client.get_message_content(message_id: '12345') +``` + +#### Individual Clients + +You can also use the individual clients directly if you need finer control. + | Class(YARD documentation) | API EndPoint | LINE Developers | |----------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------| | [Line::Bot::V2::ChannelAccessToken::ApiClient](https://line.github.io/line-bot-sdk-ruby/Line/Bot/V2/ChannelAccessToken/ApiClient.html) | https://api.line.me/** (related to oauth) | https://developers.line.biz/en/reference/messaging-api/#channel-access-token | @@ -173,7 +194,7 @@ require 'json' require 'line-bot-api' def client - @client ||= Line::Bot::V2::MessagingApi::ApiClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), ) end @@ -219,7 +240,7 @@ This is useful, for example, in migrating from v1 or building Flex Message. **But this is not recommended because you lose type checking by RBS.** ```ruby -client = Line::Bot::V2::MessagingApi::ApiClient.new( +client = Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), ) diff --git a/Steepfile b/Steepfile index e2934290..7d62fc9c 100644 --- a/Steepfile +++ b/Steepfile @@ -13,11 +13,11 @@ target :lib do end target :test do - unreferenced! # Skip type checking the `lib` code when types in `test` target is changed + unreferenced! # Skip type checking the `lib` code when types in test targets is changed signature "sig/test" # Put RBS files for tests under `sig/test` - check "test" # Type check Ruby scripts under `test` + check "test", "type-test" # Type check Ruby scripts under `test` and `type-test` - configure_code_diagnostics(D::Ruby.lenient) # Weak type checking for test code + configure_code_diagnostics(D::Ruby.strict) # Keep integration type tests meaningful in CI # library "pathname" # Standard libraries end diff --git a/examples/v2/audience/app.rb b/examples/v2/audience/app.rb index 397ade4d..00cbf8c0 100644 --- a/examples/v2/audience/app.rb +++ b/examples/v2/audience/app.rb @@ -1,19 +1,7 @@ require 'line-bot-api' def client - @client ||= Line::Bot::V2::ManageAudience::ApiClient.new( - channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), - ) -end - -def blob_client - @blob_client ||= Line::Bot::V2::ManageAudience::ApiBlobClient.new( - channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), - ) -end - -def api_client - @api_client ||= Line::Bot::V2::MessagingApi::ApiClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), ) end @@ -71,7 +59,7 @@ def add_audience_by_ids(audience_group_id:) def add_audience_by_file(audience_group_id:) # TODO: replace with your user ID in audience.txt File.open('audience.txt', 'r') do |f| - _body, status_code, _http_headers = blob_client.add_user_ids_to_audience_with_http_info( + _body, status_code, _http_headers = client.add_user_ids_to_audience_with_http_info( audience_group_id: audience_group_id, file: f ) @@ -120,7 +108,7 @@ def push_narrowcast(audience_group_id:) audience_group_id: audience_group_id, ) ) - _body, status_code, _http_headers = api_client.narrowcast_with_http_info(narrowcast_request: request) + _body, status_code, _http_headers = client.narrowcast_with_http_info(narrowcast_request: request) if status_code == 202 puts '=== Push narrowcast successfully ===' diff --git a/examples/v2/echobot/app.rb b/examples/v2/echobot/app.rb index c85ec590..ab47addd 100644 --- a/examples/v2/echobot/app.rb +++ b/examples/v2/echobot/app.rb @@ -5,7 +5,7 @@ set :app_base_url, ENV.fetch('APP_BASE_URL') def client - @client ||= Line::Bot::V2::MessagingApi::ApiClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") ) end diff --git a/examples/v2/kitchensink/app.rb b/examples/v2/kitchensink/app.rb index 4d172787..098329c8 100644 --- a/examples/v2/kitchensink/app.rb +++ b/examples/v2/kitchensink/app.rb @@ -10,7 +10,7 @@ QUICK_REPLY_ICON_URL = 'https://via.placeholder.com/64x64' def client - @client ||= Line::Bot::V2::MessagingApi::ApiClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), http_options: { open_timeout: 5, @@ -19,22 +19,6 @@ def client ) end -def blob_client - @blob_client ||= Line::Bot::V2::MessagingApi::ApiBlobClient.new( - channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), - http_options: { - open_timeout: 5, - read_timeout: 5 - } - ) -end - -def insight_client - @insight_client ||= Line::Bot::V2::Insight::ApiClient.new( - channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), - ) -end - def parser @parser ||= Line::Bot::V2::WebhookParser.new(channel_secret: ENV.fetch("LINE_CHANNEL_SECRET")) end @@ -136,7 +120,7 @@ def storeContent(message_id:, message_type:) max_retries = 10 max_retries.times do |i| - body, status_code, _headers = blob_client.get_message_content_transcoding_by_message_id_with_http_info( + body, status_code, _headers = client.get_message_content_transcoding_by_message_id_with_http_info( message_id: message_id ) @@ -165,7 +149,7 @@ def storeContent(message_id:, message_type:) end end - content, _, headers = blob_client.get_message_content_with_http_info(message_id: message_id) + content, _, headers = client.get_message_content_with_http_info(message_id: message_id) content_type = headers['content-type'] ext = case content_type when 'image/jpeg' then 'jpg' @@ -936,12 +920,12 @@ def rich_menu_request_b create_rich_menu_a_response = client.create_rich_menu(rich_menu_request: rich_menu_request_a) logger.info "Create rich menu A: #{create_rich_menu_a_response.rich_menu_id}" - a = blob_client.set_rich_menu_image(rich_menu_id: create_rich_menu_a_response.rich_menu_id, body: File.open('./richmenu/richmenu-a.png')) + a = client.set_rich_menu_image(rich_menu_id: create_rich_menu_a_response.rich_menu_id, body: File.open('./richmenu/richmenu-a.png')) logger.info "Set rich menu image A: #{a}" create_rich_menu_b_response = client.create_rich_menu(rich_menu_request: rich_menu_request_b) logger.info "Create rich menu B: #{create_rich_menu_b_response.rich_menu_id}" - a = blob_client.set_rich_menu_image(rich_menu_id: create_rich_menu_b_response.rich_menu_id, body: File.open('./richmenu/richmenu-b.png')) + a = client.set_rich_menu_image(rich_menu_id: create_rich_menu_b_response.rich_menu_id, body: File.open('./richmenu/richmenu-b.png')) logger.info "Set rich menu image B: #{a}" client.set_default_rich_menu(rich_menu_id: create_rich_menu_a_response.rich_menu_id) @@ -1057,7 +1041,7 @@ def rich_menu_request_b when /\Astats\s+(?.+)/ request_id = Regexp.last_match[:request_id] - stats = insight_client.get_message_event(request_id: request_id) + stats = client.get_message_event(request_id: request_id) reply_text(event, "[STATS]\n#{stats}") diff --git a/examples/v2/rich_menu/app.rb b/examples/v2/rich_menu/app.rb index 0facbb2c..4969df14 100644 --- a/examples/v2/rich_menu/app.rb +++ b/examples/v2/rich_menu/app.rb @@ -1,13 +1,7 @@ require 'line-bot-api' def client - @client ||= Line::Bot::V2::MessagingApi::ApiClient.new( - channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), - ) -end - -def blob_client - @blob_client ||= Line::Bot::V2::MessagingApi::ApiBlobClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN"), ) end @@ -15,11 +9,11 @@ def blob_client def main create_rich_menu_a_response = client.create_rich_menu(rich_menu_request: rich_menu_request_a) puts "created: #{create_rich_menu_a_response.rich_menu_id}" - blob_client.set_rich_menu_image(rich_menu_id: create_rich_menu_a_response.rich_menu_id, body: File.open('./public/richmenu-a.png')) + client.set_rich_menu_image(rich_menu_id: create_rich_menu_a_response.rich_menu_id, body: File.open('./public/richmenu-a.png')) create_rich_menu_b_response = client.create_rich_menu(rich_menu_request: rich_menu_request_b) puts "created: #{create_rich_menu_b_response.rich_menu_id}" - blob_client.set_rich_menu_image(rich_menu_id: create_rich_menu_b_response.rich_menu_id, body: File.open('./public/richmenu-b.png')) + client.set_rich_menu_image(rich_menu_id: create_rich_menu_b_response.rich_menu_id, body: File.open('./public/richmenu-b.png')) client.set_default_rich_menu(rich_menu_id: create_rich_menu_a_response.rich_menu_id) diff --git a/generate-code.py b/generate-code.py index 980b146a..fbd50acf 100644 --- a/generate-code.py +++ b/generate-code.py @@ -62,6 +62,10 @@ def generate_clients(): run_command("rm -rf lib/line/bot/v2/webhook/api") run_command("rm -rf sig/line/bot/v2/webhook/api") +def generate_unified_client(): + """Generate the unified client that wraps all individual API clients.""" + run_command('bundle exec ruby scripts/unified-client-generator/main.rb') + def main(): """Main function to package and generate clients.""" os.chdir("generator") @@ -69,6 +73,7 @@ def main(): os.chdir("..") generate_clients() + generate_unified_client() if __name__ == "__main__": main() diff --git a/lib/line/bot.rb b/lib/line/bot.rb index 364a21f6..22589a28 100644 --- a/lib/line/bot.rb +++ b/lib/line/bot.rb @@ -25,3 +25,4 @@ require 'line/bot/v2/module_attach/core' require 'line/bot/v2/shop/core' require 'line/bot/v2/webhook/core' +require 'line/bot/v2/line_bot_client' diff --git a/lib/line/bot/v2/line_bot_client.factory.generated.rb b/lib/line/bot/v2/line_bot_client.factory.generated.rb new file mode 100644 index 00000000..1e979688 --- /dev/null +++ b/lib/line/bot/v2/line_bot_client.factory.generated.rb @@ -0,0 +1,46 @@ +# This file is autogenerated. +# +# Generated by scripts/unified-client-generator/main.rb +# Do not edit this file directly. + +module Line + module Bot + module V2 + class LineBotClient + private + + def build_generated_delegates( + channel_access_token:, + api_base_url: nil, + data_api_base_url: nil, + http_options: {} + ) + @insight = Line::Bot::V2::Insight::ApiClient. + new(base_url: api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @liff = Line::Bot::V2::Liff::ApiClient. + new(base_url: api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @manage_audience = Line::Bot::V2::ManageAudience::ApiClient. + new(base_url: api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @manage_audience_blob = Line::Bot::V2::ManageAudience::ApiBlobClient. + new(base_url: data_api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @messaging_api = Line::Bot::V2::MessagingApi::ApiClient. + new(base_url: api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @messaging_api_blob = Line::Bot::V2::MessagingApi::ApiBlobClient. + new(base_url: data_api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @line_module = Line::Bot::V2::Module::ApiClient. + new(base_url: api_base_url, channel_access_token: channel_access_token, http_options: http_options) + + @shop = Line::Bot::V2::Shop::ApiClient. + new(base_url: api_base_url, channel_access_token: channel_access_token, http_options: http_options) + nil + end + end + end + end +end diff --git a/lib/line/bot/v2/line_bot_client.generated.rb b/lib/line/bot/v2/line_bot_client.generated.rb new file mode 100644 index 00000000..ec04a7e9 --- /dev/null +++ b/lib/line/bot/v2/line_bot_client.generated.rb @@ -0,0 +1,3392 @@ +# This file is autogenerated. +# +# Generated by scripts/unified-client-generator/main.rb +# Do not edit this file directly. + +module Line + module Bot + module V2 + class LineBotClient + # Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). + # This requests to GET https://api.line.me/v2/bot/insight/demographic + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-demographic + # @return [Array(Line::Bot::V2::Insight::GetFriendsDemographicsResponse, 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 get_friends_demographics_with_http_info + @insight.get_friends_demographics_with_http_info + end + + # Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). + # This requests to GET https://api.line.me/v2/bot/insight/demographic + # When you want to get HTTP status code or response headers, use {#get_friends_demographics_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-demographic + # @return [Line::Bot::V2::Insight::GetFriendsDemographicsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_friends_demographics + @insight.get_friends_demographics + end + + # Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param request_id [String] Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-message-event + # @return [Array(Line::Bot::V2::Insight::GetMessageEventResponse, 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 get_message_event_with_http_info( + request_id: + ) + @insight.get_message_event_with_http_info( + request_id: request_id + ) + end + + # Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event + # When you want to get HTTP status code or response headers, use {#get_message_event_with_http_info} instead of this. + # + # @param request_id [String] Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-message-event + # @return [Line::Bot::V2::Insight::GetMessageEventResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_event( + request_id: + ) + @insight.get_message_event( + request_id: request_id + ) + end + + # Returns the number of users who have added the LINE Official Account on or before a specified date. + # This requests to GET https://api.line.me/v2/bot/insight/followers + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String, nil] Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers + # @return [Array(Line::Bot::V2::Insight::GetNumberOfFollowersResponse, 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 get_number_of_followers_with_http_info( + date: nil + ) + @insight.get_number_of_followers_with_http_info( + date: date + ) + end + + # Returns the number of users who have added the LINE Official Account on or before a specified date. + # This requests to GET https://api.line.me/v2/bot/insight/followers + # When you want to get HTTP status code or response headers, use {#get_number_of_followers_with_http_info} instead of this. + # + # @param date [String, nil] Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers + # @return [Line::Bot::V2::Insight::GetNumberOfFollowersResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_followers( + date: nil + ) + @insight.get_number_of_followers( + date: date + ) + end + + # Returns the number of messages sent from LINE Official Account on a specified day. + # This requests to GET https://api.line.me/v2/bot/insight/message/delivery + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages + # @return [Array(Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, 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 get_number_of_message_deliveries_with_http_info( + date: + ) + @insight.get_number_of_message_deliveries_with_http_info( + date: date + ) + end + + # Returns the number of messages sent from LINE Official Account on a specified day. + # This requests to GET https://api.line.me/v2/bot/insight/message/delivery + # When you want to get HTTP status code or response headers, use {#get_number_of_message_deliveries_with_http_info} instead of this. + # + # @param date [String] Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages + # @return [Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_message_deliveries( + date: + ) + @insight.get_number_of_message_deliveries( + date: date + ) + end + + # You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event/aggregation + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param custom_aggregation_unit [String] Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. + # @param from [String] Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @param to [String] End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit + # @return [Array(Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, 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 get_statistics_per_unit_with_http_info( + custom_aggregation_unit:, + from:, + to: + ) + @insight.get_statistics_per_unit_with_http_info( + custom_aggregation_unit: custom_aggregation_unit, + from: from, + to: to + ) + end + + # You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event/aggregation + # When you want to get HTTP status code or response headers, use {#get_statistics_per_unit_with_http_info} instead of this. + # + # @param custom_aggregation_unit [String] Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. + # @param from [String] Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @param to [String] End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit + # @return [Line::Bot::V2::Insight::GetStatisticsPerUnitResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_statistics_per_unit( + custom_aggregation_unit:, + from:, + to: + ) + @insight.get_statistics_per_unit( + custom_aggregation_unit: custom_aggregation_unit, + from: from, + to: to + ) + end + + # Adding the LIFF app to a channel + # This requests to POST https://api.line.me/liff/v1/apps + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param add_liff_app_request [Line::Bot::V2::Liff::AddLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#add-liff-app + # @return [Array(Line::Bot::V2::Liff::AddLiffAppResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def add_liff_app_with_http_info( + add_liff_app_request: + ) + @liff.add_liff_app_with_http_info( + add_liff_app_request: add_liff_app_request + ) + end + + # Adding the LIFF app to a channel + # This requests to POST https://api.line.me/liff/v1/apps + # When you want to get HTTP status code or response headers, use {#add_liff_app_with_http_info} instead of this. + # + # @param add_liff_app_request [Line::Bot::V2::Liff::AddLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#add-liff-app + # @return [Line::Bot::V2::Liff::AddLiffAppResponse] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 400 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def add_liff_app( + add_liff_app_request: + ) + @liff.add_liff_app( + add_liff_app_request: add_liff_app_request + ) + end + + # Deletes a LIFF app from a channel. + # This requests to DELETE https://api.line.me/liff/v1/apps/{liffId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @see https://developers.line.biz/en/reference/liff-server/#delete-liff-app + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def delete_liff_app_with_http_info( + liff_id: + ) + @liff.delete_liff_app_with_http_info( + liff_id: liff_id + ) + end + + # Deletes a LIFF app from a channel. + # This requests to DELETE https://api.line.me/liff/v1/apps/{liffId} + # When you want to get HTTP status code or response headers, use {#delete_liff_app_with_http_info} instead of this. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @see https://developers.line.biz/en/reference/liff-server/#delete-liff-app + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_liff_app( + liff_id: + ) + @liff.delete_liff_app( + liff_id: liff_id + ) + end + + # Gets information on all the LIFF apps added to the channel. + # This requests to GET https://api.line.me/liff/v1/apps + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps + # @return [Array(Line::Bot::V2::Liff::GetAllLiffAppsResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_all_liff_apps_with_http_info + @liff.get_all_liff_apps_with_http_info + end + + # Gets information on all the LIFF apps added to the channel. + # This requests to GET https://api.line.me/liff/v1/apps + # When you want to get HTTP status code or response headers, use {#get_all_liff_apps_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps + # @return [Line::Bot::V2::Liff::GetAllLiffAppsResponse] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_all_liff_apps + @liff.get_all_liff_apps + end + + # Update LIFF app settings + # This requests to PUT https://api.line.me/liff/v1/apps/{liffId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @param update_liff_app_request [Line::Bot::V2::Liff::UpdateLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#update-liff-app + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def update_liff_app_with_http_info( + liff_id:, + update_liff_app_request: + ) + @liff.update_liff_app_with_http_info( + liff_id: liff_id, + update_liff_app_request: update_liff_app_request + ) + end + + # Update LIFF app settings + # This requests to PUT https://api.line.me/liff/v1/apps/{liffId} + # When you want to get HTTP status code or response headers, use {#update_liff_app_with_http_info} instead of this. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @param update_liff_app_request [Line::Bot::V2::Liff::UpdateLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#update-liff-app + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 400 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def update_liff_app( + liff_id:, + update_liff_app_request: + ) + @liff.update_liff_app( + liff_id: liff_id, + update_liff_app_request: update_liff_app_request + ) + end + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/upload + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param add_audience_to_audience_group_request [Line::Bot::V2::ManageAudience::AddAudienceToAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def add_audience_to_audience_group_with_http_info( + add_audience_to_audience_group_request: + ) + @manage_audience.add_audience_to_audience_group_with_http_info( + add_audience_to_audience_group_request: add_audience_to_audience_group_request + ) + end + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/upload + # When you want to get HTTP status code or response headers, use {#add_audience_to_audience_group_with_http_info} instead of this. + # + # @param add_audience_to_audience_group_request [Line::Bot::V2::ManageAudience::AddAudienceToAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def add_audience_to_audience_group( + add_audience_to_audience_group_request: + ) + @manage_audience.add_audience_to_audience_group( + add_audience_to_audience_group_request: add_audience_to_audience_group_request + ) + end + + # Create audience for uploading user IDs (by JSON) + # This requests to POST https://api.line.me/v2/bot/audienceGroup/upload + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_audience_group_request [Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_audience_group_with_http_info( + create_audience_group_request: + ) + @manage_audience.create_audience_group_with_http_info( + create_audience_group_request: create_audience_group_request + ) + end + + # Create audience for uploading user IDs (by JSON) + # This requests to POST https://api.line.me/v2/bot/audienceGroup/upload + # When you want to get HTTP status code or response headers, use {#create_audience_group_with_http_info} instead of this. + # + # @param create_audience_group_request [Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group + # @return [Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_audience_group( + create_audience_group_request: + ) + @manage_audience.create_audience_group( + create_audience_group_request: create_audience_group_request + ) + end + + # Create audience for click-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/click + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_click_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_click_based_audience_group_with_http_info( + create_click_based_audience_group_request: + ) + @manage_audience.create_click_based_audience_group_with_http_info( + create_click_based_audience_group_request: create_click_based_audience_group_request + ) + end + + # Create audience for click-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/click + # When you want to get HTTP status code or response headers, use {#create_click_based_audience_group_with_http_info} instead of this. + # + # @param create_click_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group + # @return [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_click_based_audience_group( + create_click_based_audience_group_request: + ) + @manage_audience.create_click_based_audience_group( + create_click_based_audience_group_request: create_click_based_audience_group_request + ) + end + + # Create audience for impression-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/imp + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_imp_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_imp_based_audience_group_with_http_info( + create_imp_based_audience_group_request: + ) + @manage_audience.create_imp_based_audience_group_with_http_info( + create_imp_based_audience_group_request: create_imp_based_audience_group_request + ) + end + + # Create audience for impression-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/imp + # When you want to get HTTP status code or response headers, use {#create_imp_based_audience_group_with_http_info} instead of this. + # + # @param create_imp_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group + # @return [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_imp_based_audience_group( + create_imp_based_audience_group_request: + ) + @manage_audience.create_imp_based_audience_group( + create_imp_based_audience_group_request: create_imp_based_audience_group_request + ) + end + + # Delete audience + # This requests to DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-audience-group + # @return [Array((String|nil), 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 delete_audience_group_with_http_info( + audience_group_id: + ) + @manage_audience.delete_audience_group_with_http_info( + audience_group_id: audience_group_id + ) + end + + # Delete audience + # This requests to DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # When you want to get HTTP status code or response headers, use {#delete_audience_group_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-audience-group + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_audience_group( + audience_group_id: + ) + @manage_audience.delete_audience_group( + audience_group_id: audience_group_id + ) + end + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::GetAudienceDataResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::ManageAudience::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_audience_data_with_http_info( + audience_group_id: + ) + @manage_audience.get_audience_data_with_http_info( + audience_group_id: audience_group_id + ) + end + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # When you want to get HTTP status code or response headers, use {#get_audience_data_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-group + # @return [Line::Bot::V2::ManageAudience::GetAudienceDataResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::ManageAudience::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_audience_data( + audience_group_id: + ) + @manage_audience.get_audience_data( + audience_group_id: audience_group_id + ) + end + + # Gets data for more than one audience. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param includes_external_public_groups [Boolean, nil] true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-groups + # @return [Array(Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse, 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 get_audience_groups_with_http_info( + page:, + description: nil, + status: nil, + size: nil, + includes_external_public_groups: nil, + create_route: nil + ) + @manage_audience.get_audience_groups_with_http_info( + page: page, + description: description, + status: status, + size: size, + includes_external_public_groups: includes_external_public_groups, + create_route: create_route + ) + end + + # Gets data for more than one audience. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/list + # When you want to get HTTP status code or response headers, use {#get_audience_groups_with_http_info} instead of this. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param includes_external_public_groups [Boolean, nil] true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-groups + # @return [Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_audience_groups( + page:, + description: nil, + status: nil, + size: nil, + includes_external_public_groups: nil, + create_route: nil + ) + @manage_audience.get_audience_groups( + page: page, + description: description, + status: status, + size: size, + includes_external_public_groups: includes_external_public_groups, + create_route: create_route + ) + end + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience + # @return [Array(Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::ManageAudience::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_shared_audience_data_with_http_info( + audience_group_id: + ) + @manage_audience.get_shared_audience_data_with_http_info( + audience_group_id: audience_group_id + ) + end + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId} + # When you want to get HTTP status code or response headers, use {#get_shared_audience_data_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience + # @return [Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::ManageAudience::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_shared_audience_data( + audience_group_id: + ) + @manage_audience.get_shared_audience_data( + audience_group_id: audience_group_id + ) + end + + # Gets data for more than one audience, including those shared by the Business Manager. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @param includes_owned_audience_groups [Boolean, nil] true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list + # @return [Array(Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse, 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 get_shared_audience_groups_with_http_info( + page:, + description: nil, + status: nil, + size: nil, + create_route: nil, + includes_owned_audience_groups: nil + ) + @manage_audience.get_shared_audience_groups_with_http_info( + page: page, + description: description, + status: status, + size: size, + create_route: create_route, + includes_owned_audience_groups: includes_owned_audience_groups + ) + end + + # Gets data for more than one audience, including those shared by the Business Manager. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/list + # When you want to get HTTP status code or response headers, use {#get_shared_audience_groups_with_http_info} instead of this. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @param includes_owned_audience_groups [Boolean, nil] true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list + # @return [Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_shared_audience_groups( + page:, + description: nil, + status: nil, + size: nil, + create_route: nil, + includes_owned_audience_groups: nil + ) + @manage_audience.get_shared_audience_groups( + page: page, + description: description, + status: status, + size: size, + create_route: create_route, + includes_owned_audience_groups: includes_owned_audience_groups + ) + end + + # Renames an existing audience. + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @param update_audience_group_description_request [Line::Bot::V2::ManageAudience::UpdateAudienceGroupDescriptionRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group + # @return [Array((String|nil), 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 update_audience_group_description_with_http_info( + audience_group_id:, + update_audience_group_description_request: + ) + @manage_audience.update_audience_group_description_with_http_info( + audience_group_id: audience_group_id, + update_audience_group_description_request: update_audience_group_description_request + ) + end + + # Renames an existing audience. + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription + # When you want to get HTTP status code or response headers, use {#update_audience_group_description_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @param update_audience_group_description_request [Line::Bot::V2::ManageAudience::UpdateAudienceGroupDescriptionRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def update_audience_group_description( + audience_group_id:, + update_audience_group_description_request: + ) + @manage_audience.update_audience_group_description( + audience_group_id: audience_group_id, + update_audience_group_description_request: update_audience_group_description_request + ) + end + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + # This requests to PUT https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param audience_group_id [Integer, nil] The audience ID. + # @param upload_description [String, nil] The description to register with the job + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group-by-file + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def add_user_ids_to_audience_with_http_info( + file:, + audience_group_id: nil, + upload_description: nil + ) + @manage_audience_blob.add_user_ids_to_audience_with_http_info( + file: file, + audience_group_id: audience_group_id, + upload_description: upload_description + ) + end + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + # This requests to PUT https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # When you want to get HTTP status code or response headers, use {#add_user_ids_to_audience_with_http_info} instead of this. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param audience_group_id [Integer, nil] The audience ID. + # @param upload_description [String, nil] The description to register with the job + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group-by-file + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def add_user_ids_to_audience( + file:, + audience_group_id: nil, + upload_description: nil + ) + @manage_audience_blob.add_user_ids_to_audience( + file: file, + audience_group_id: audience_group_id, + upload_description: upload_description + ) + end + + # Create audience for uploading user IDs (by file). + # This requests to POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param description [String, nil] The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + # @param is_ifa_audience [Boolean, nil] To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + # @param upload_description [String, nil] The description to register for the job (in `jobs[].description`). + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group-by-file + # @return [Array(Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_audience_for_uploading_user_ids_with_http_info( + file:, + description: nil, + is_ifa_audience: nil, + upload_description: nil + ) + @manage_audience_blob.create_audience_for_uploading_user_ids_with_http_info( + file: file, + description: description, + is_ifa_audience: is_ifa_audience, + upload_description: upload_description + ) + end + + # Create audience for uploading user IDs (by file). + # This requests to POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # When you want to get HTTP status code or response headers, use {#create_audience_for_uploading_user_ids_with_http_info} instead of this. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param description [String, nil] The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + # @param is_ifa_audience [Boolean, nil] To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + # @param upload_description [String, nil] The description to register for the job (in `jobs[].description`). + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group-by-file + # @return [Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_audience_for_uploading_user_ids( + file:, + description: nil, + is_ifa_audience: nil, + upload_description: nil + ) + @manage_audience_blob.create_audience_for_uploading_user_ids( + file: file, + description: description, + is_ifa_audience: is_ifa_audience, + upload_description: upload_description + ) + end + + # Sends a message to multiple users at any time. + # This requests to POST https://api.line.me/v2/bot/message/broadcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param broadcast_request [Line::Bot::V2::MessagingApi::BroadcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def broadcast_with_http_info( + broadcast_request:, + x_line_retry_key: nil + ) + @messaging_api.broadcast_with_http_info( + broadcast_request: broadcast_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Sends a message to multiple users at any time. + # This requests to POST https://api.line.me/v2/bot/message/broadcast + # When you want to get HTTP status code or response headers, use {#broadcast_with_http_info} instead of this. + # + # @param broadcast_request [Line::Bot::V2::MessagingApi::BroadcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def broadcast( + broadcast_request:, + x_line_retry_key: nil + ) + @messaging_api.broadcast( + broadcast_request: broadcast_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Cancel default rich menu + # This requests to DELETE https://api.line.me/v2/bot/user/all/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu + # @return [Array((String|nil), 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 cancel_default_rich_menu_with_http_info + @messaging_api.cancel_default_rich_menu_with_http_info + end + + # Cancel default rich menu + # This requests to DELETE https://api.line.me/v2/bot/user/all/richmenu + # When you want to get HTTP status code or response headers, use {#cancel_default_rich_menu_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def cancel_default_rich_menu + @messaging_api.cancel_default_rich_menu + end + + # Close coupon + # This requests to PUT https://api.line.me/v2/bot/coupon/{couponId}/close + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 410 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def close_coupon_with_http_info( + coupon_id: + ) + @messaging_api.close_coupon_with_http_info( + coupon_id: coupon_id + ) + end + + # Close coupon + # This requests to PUT https://api.line.me/v2/bot/coupon/{couponId}/close + # When you want to get HTTP status code or response headers, use {#close_coupon_with_http_info} instead of this. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 410 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def close_coupon( + coupon_id: + ) + @messaging_api.close_coupon( + coupon_id: coupon_id + ) + end + + # Create a new coupon. Define coupon details such as type, title, and validity period. + # This requests to POST https://api.line.me/v2/bot/coupon + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param coupon_create_request [Line::Bot::V2::MessagingApi::CouponCreateRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#create-coupon + # @return [Array(Line::Bot::V2::MessagingApi::CouponCreateResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_coupon_with_http_info( + coupon_create_request: nil + ) + @messaging_api.create_coupon_with_http_info( + coupon_create_request: coupon_create_request + ) + end + + # Create a new coupon. Define coupon details such as type, title, and validity period. + # This requests to POST https://api.line.me/v2/bot/coupon + # When you want to get HTTP status code or response headers, use {#create_coupon_with_http_info} instead of this. + # + # @param coupon_create_request [Line::Bot::V2::MessagingApi::CouponCreateRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#create-coupon + # @return [Line::Bot::V2::MessagingApi::CouponCreateResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_coupon( + coupon_create_request: nil + ) + @messaging_api.create_coupon( + coupon_create_request: coupon_create_request + ) + end + + # Create rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuIdResponse, 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 create_rich_menu_with_http_info( + rich_menu_request: + ) + @messaging_api.create_rich_menu_with_http_info( + rich_menu_request: rich_menu_request + ) + end + + # Create rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu + # When you want to get HTTP status code or response headers, use {#create_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu + # @return [Line::Bot::V2::MessagingApi::RichMenuIdResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_rich_menu( + rich_menu_request: + ) + @messaging_api.create_rich_menu( + rich_menu_request: rich_menu_request + ) + end + + # Create rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_rich_menu_alias_request [Line::Bot::V2::MessagingApi::CreateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_rich_menu_alias_with_http_info( + create_rich_menu_alias_request: + ) + @messaging_api.create_rich_menu_alias_with_http_info( + create_rich_menu_alias_request: create_rich_menu_alias_request + ) + end + + # Create rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias + # When you want to get HTTP status code or response headers, use {#create_rich_menu_alias_with_http_info} instead of this. + # + # @param create_rich_menu_alias_request [Line::Bot::V2::MessagingApi::CreateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_rich_menu_alias( + create_rich_menu_alias_request: + ) + @messaging_api.create_rich_menu_alias( + create_rich_menu_alias_request: create_rich_menu_alias_request + ) + end + + # Deletes a rich menu. + # This requests to DELETE https://api.line.me/v2/bot/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu + # @return [Array((String|nil), 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 delete_rich_menu_with_http_info( + rich_menu_id: + ) + @messaging_api.delete_rich_menu_with_http_info( + rich_menu_id: rich_menu_id + ) + end + + # Deletes a rich menu. + # This requests to DELETE https://api.line.me/v2/bot/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#delete_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_rich_menu( + rich_menu_id: + ) + @messaging_api.delete_rich_menu( + rich_menu_id: rich_menu_id + ) + end + + # Delete rich menu alias + # This requests to DELETE https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_alias_id [String] Rich menu alias ID that you want to delete. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def delete_rich_menu_alias_with_http_info( + rich_menu_alias_id: + ) + @messaging_api.delete_rich_menu_alias_with_http_info( + rich_menu_alias_id: rich_menu_alias_id + ) + end + + # Delete rich menu alias + # This requests to DELETE https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # When you want to get HTTP status code or response headers, use {#delete_rich_menu_alias_with_http_info} instead of this. + # + # @param rich_menu_alias_id [String] Rich menu alias ID that you want to delete. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_rich_menu_alias( + rich_menu_alias_id: + ) + @messaging_api.delete_rich_menu_alias( + rich_menu_alias_id: rich_menu_alias_id + ) + end + + # Get name list of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param limit [String, nil] The maximum number of aggregation units you can get per request. + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + # @see https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month + # @return [Array(Line::Bot::V2::MessagingApi::GetAggregationUnitNameListResponse, 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 get_aggregation_unit_name_list_with_http_info( + limit: nil, + start: nil + ) + @messaging_api.get_aggregation_unit_name_list_with_http_info( + limit: limit, + start: start + ) + end + + # Get name list of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/list + # When you want to get HTTP status code or response headers, use {#get_aggregation_unit_name_list_with_http_info} instead of this. + # + # @param limit [String, nil] The maximum number of aggregation units you can get per request. + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + # @see https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month + # @return [Line::Bot::V2::MessagingApi::GetAggregationUnitNameListResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_aggregation_unit_name_list( + limit: nil, + start: nil + ) + @messaging_api.get_aggregation_unit_name_list( + limit: limit, + start: start + ) + end + + # Get number of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/info + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month + # @return [Array(Line::Bot::V2::MessagingApi::GetAggregationUnitUsageResponse, 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 get_aggregation_unit_usage_with_http_info + @messaging_api.get_aggregation_unit_usage_with_http_info + end + + # Get number of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/info + # When you want to get HTTP status code or response headers, use {#get_aggregation_unit_usage_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month + # @return [Line::Bot::V2::MessagingApi::GetAggregationUnitUsageResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_aggregation_unit_usage + @messaging_api.get_aggregation_unit_usage + end + + # Get bot info + # This requests to GET https://api.line.me/v2/bot/info + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-bot-info + # @return [Array(Line::Bot::V2::MessagingApi::BotInfoResponse, 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 get_bot_info_with_http_info + @messaging_api.get_bot_info_with_http_info + end + + # Get bot info + # This requests to GET https://api.line.me/v2/bot/info + # When you want to get HTTP status code or response headers, use {#get_bot_info_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-bot-info + # @return [Line::Bot::V2::MessagingApi::BotInfoResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_bot_info + @messaging_api.get_bot_info + end + + # Get coupon detail + # This requests to GET https://api.line.me/v2/bot/coupon/{couponId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupon + # @return [Array(Line::Bot::V2::MessagingApi::CouponResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_coupon_detail_with_http_info( + coupon_id: + ) + @messaging_api.get_coupon_detail_with_http_info( + coupon_id: coupon_id + ) + end + + # Get coupon detail + # This requests to GET https://api.line.me/v2/bot/coupon/{couponId} + # When you want to get HTTP status code or response headers, use {#get_coupon_detail_with_http_info} instead of this. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupon + # @return [Line::Bot::V2::MessagingApi::CouponResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_coupon_detail( + coupon_id: + ) + @messaging_api.get_coupon_detail( + coupon_id: coupon_id + ) + end + + # Gets the ID of the default rich menu set with the Messaging API. + # This requests to GET https://api.line.me/v2/bot/user/all/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuIdResponse, 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 get_default_rich_menu_id_with_http_info + @messaging_api.get_default_rich_menu_id_with_http_info + end + + # Gets the ID of the default rich menu set with the Messaging API. + # This requests to GET https://api.line.me/v2/bot/user/all/richmenu + # When you want to get HTTP status code or response headers, use {#get_default_rich_menu_id_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id + # @return [Line::Bot::V2::MessagingApi::RichMenuIdResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_default_rich_menu_id + @messaging_api.get_default_rich_menu_id + end + + # Get a list of users who added your LINE Official Account as a friend + # This requests to GET https://api.line.me/v2/bot/followers/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + # @param limit [Integer, nil] The maximum number of user IDs to retrieve in a single request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-follower-ids + # @return [Array(Line::Bot::V2::MessagingApi::GetFollowersResponse, 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 get_followers_with_http_info( + start: nil, + limit: nil + ) + @messaging_api.get_followers_with_http_info( + start: start, + limit: limit + ) + end + + # Get a list of users who added your LINE Official Account as a friend + # This requests to GET https://api.line.me/v2/bot/followers/ids + # When you want to get HTTP status code or response headers, use {#get_followers_with_http_info} instead of this. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + # @param limit [Integer, nil] The maximum number of user IDs to retrieve in a single request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-follower-ids + # @return [Line::Bot::V2::MessagingApi::GetFollowersResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_followers( + start: nil, + limit: nil + ) + @messaging_api.get_followers( + start: start, + limit: limit + ) + end + + # Get number of users in a group chat + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/count + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-group-count + # @return [Array(Line::Bot::V2::MessagingApi::GroupMemberCountResponse, 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 get_group_member_count_with_http_info( + group_id: + ) + @messaging_api.get_group_member_count_with_http_info( + group_id: group_id + ) + end + + # Get number of users in a group chat + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/count + # When you want to get HTTP status code or response headers, use {#get_group_member_count_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-group-count + # @return [Line::Bot::V2::MessagingApi::GroupMemberCountResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_member_count( + group_id: + ) + @messaging_api.get_group_member_count( + group_id: group_id + ) + end + + # Get group chat member profile + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/member/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile + # @return [Array(Line::Bot::V2::MessagingApi::GroupUserProfileResponse, 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 get_group_member_profile_with_http_info( + group_id:, + user_id: + ) + @messaging_api.get_group_member_profile_with_http_info( + group_id: group_id, + user_id: user_id + ) + end + + # Get group chat member profile + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/member/{userId} + # When you want to get HTTP status code or response headers, use {#get_group_member_profile_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile + # @return [Line::Bot::V2::MessagingApi::GroupUserProfileResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_member_profile( + group_id:, + user_id: + ) + @messaging_api.get_group_member_profile( + group_id: group_id, + user_id: user_id + ) + end + + # Get group chat member user IDs + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids + # @return [Array(Line::Bot::V2::MessagingApi::MembersIdsResponse, 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 get_group_members_ids_with_http_info( + group_id:, + start: nil + ) + @messaging_api.get_group_members_ids_with_http_info( + group_id: group_id, + start: start + ) + end + + # Get group chat member user IDs + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/ids + # When you want to get HTTP status code or response headers, use {#get_group_members_ids_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids + # @return [Line::Bot::V2::MessagingApi::MembersIdsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_members_ids( + group_id:, + start: nil + ) + @messaging_api.get_group_members_ids( + group_id: group_id, + start: start + ) + end + + # Get group chat summary + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/summary + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-summary + # @return [Array(Line::Bot::V2::MessagingApi::GroupSummaryResponse, 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 get_group_summary_with_http_info( + group_id: + ) + @messaging_api.get_group_summary_with_http_info( + group_id: group_id + ) + end + + # Get group chat summary + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/summary + # When you want to get HTTP status code or response headers, use {#get_group_summary_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-summary + # @return [Line::Bot::V2::MessagingApi::GroupSummaryResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_summary( + group_id: + ) + @messaging_api.get_group_summary( + group_id: group_id + ) + end + + # Get a list of user IDs who joined the membership. + # This requests to GET https://api.line.me/v2/bot/membership/{membershipId}/users/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param membership_id [Integer] Membership plan ID. + # @param start [String, nil] A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + # @param limit [Integer, nil] The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-user-ids + # @return [Array(Line::Bot::V2::MessagingApi::GetJoinedMembershipUsersResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_joined_membership_users_with_http_info( + membership_id:, + start: nil, + limit: nil + ) + @messaging_api.get_joined_membership_users_with_http_info( + membership_id: membership_id, + start: start, + limit: limit + ) + end + + # Get a list of user IDs who joined the membership. + # This requests to GET https://api.line.me/v2/bot/membership/{membershipId}/users/ids + # When you want to get HTTP status code or response headers, use {#get_joined_membership_users_with_http_info} instead of this. + # + # @param membership_id [Integer] Membership plan ID. + # @param start [String, nil] A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + # @param limit [Integer, nil] The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-user-ids + # @return [Line::Bot::V2::MessagingApi::GetJoinedMembershipUsersResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_joined_membership_users( + membership_id:, + start: nil, + limit: nil + ) + @messaging_api.get_joined_membership_users( + membership_id: membership_id, + start: start, + limit: limit + ) + end + + # Get a list of memberships. + # This requests to GET https://api.line.me/v2/bot/membership/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-plans + # @return [Array(Line::Bot::V2::MessagingApi::MembershipListResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_membership_list_with_http_info + @messaging_api.get_membership_list_with_http_info + end + + # Get a list of memberships. + # This requests to GET https://api.line.me/v2/bot/membership/list + # When you want to get HTTP status code or response headers, use {#get_membership_list_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-plans + # @return [Line::Bot::V2::MessagingApi::MembershipListResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_membership_list + @messaging_api.get_membership_list + end + + # Get a user's membership subscription. + # This requests to GET https://api.line.me/v2/bot/membership/subscription/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status + # @return [Array(Line::Bot::V2::MessagingApi::GetMembershipSubscriptionResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_membership_subscription_with_http_info( + user_id: + ) + @messaging_api.get_membership_subscription_with_http_info( + user_id: user_id + ) + end + + # Get a user's membership subscription. + # This requests to GET https://api.line.me/v2/bot/membership/subscription/{userId} + # When you want to get HTTP status code or response headers, use {#get_membership_subscription_with_http_info} instead of this. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status + # @return [Line::Bot::V2::MessagingApi::GetMembershipSubscriptionResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_membership_subscription( + user_id: + ) + @messaging_api.get_membership_subscription( + user_id: user_id + ) + end + + # Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + # This requests to GET https://api.line.me/v2/bot/message/quota + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-quota + # @return [Array(Line::Bot::V2::MessagingApi::MessageQuotaResponse, 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 get_message_quota_with_http_info + @messaging_api.get_message_quota_with_http_info + end + + # Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + # This requests to GET https://api.line.me/v2/bot/message/quota + # When you want to get HTTP status code or response headers, use {#get_message_quota_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-quota + # @return [Line::Bot::V2::MessagingApi::MessageQuotaResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_quota + @messaging_api.get_message_quota + end + + # Gets the number of messages sent in the current month. + # This requests to GET https://api.line.me/v2/bot/message/quota/consumption + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-consumption + # @return [Array(Line::Bot::V2::MessagingApi::QuotaConsumptionResponse, 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 get_message_quota_consumption_with_http_info + @messaging_api.get_message_quota_consumption_with_http_info + end + + # Gets the number of messages sent in the current month. + # This requests to GET https://api.line.me/v2/bot/message/quota/consumption + # When you want to get HTTP status code or response headers, use {#get_message_quota_consumption_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-consumption + # @return [Line::Bot::V2::MessagingApi::QuotaConsumptionResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_quota_consumption + @messaging_api.get_message_quota_consumption + end + + # Gets the status of a narrowcast message. + # This requests to GET https://api.line.me/v2/bot/message/progress/narrowcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param request_id [String] The narrowcast message's request ID. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status + # @return [Array(Line::Bot::V2::MessagingApi::NarrowcastProgressResponse, 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 get_narrowcast_progress_with_http_info( + request_id: + ) + @messaging_api.get_narrowcast_progress_with_http_info( + request_id: request_id + ) + end + + # Gets the status of a narrowcast message. + # This requests to GET https://api.line.me/v2/bot/message/progress/narrowcast + # When you want to get HTTP status code or response headers, use {#get_narrowcast_progress_with_http_info} instead of this. + # + # @param request_id [String] The narrowcast message's request ID. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status + # @return [Line::Bot::V2::MessagingApi::NarrowcastProgressResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_narrowcast_progress( + request_id: + ) + @messaging_api.get_narrowcast_progress( + request_id: request_id + ) + end + + # Get number of sent broadcast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/broadcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-broadcast-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_broadcast_messages_with_http_info( + date: + ) + @messaging_api.get_number_of_sent_broadcast_messages_with_http_info( + date: date + ) + end + + # Get number of sent broadcast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/broadcast + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_broadcast_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-broadcast-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_broadcast_messages( + date: + ) + @messaging_api.get_number_of_sent_broadcast_messages( + date: date + ) + end + + # Get number of sent multicast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/multicast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-multicast-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_multicast_messages_with_http_info( + date: + ) + @messaging_api.get_number_of_sent_multicast_messages_with_http_info( + date: date + ) + end + + # Get number of sent multicast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/multicast + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_multicast_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-multicast-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_multicast_messages( + date: + ) + @messaging_api.get_number_of_sent_multicast_messages( + date: date + ) + end + + # Get number of sent push messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-push-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_push_messages_with_http_info( + date: + ) + @messaging_api.get_number_of_sent_push_messages_with_http_info( + date: date + ) + end + + # Get number of sent push messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/push + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_push_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-push-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_push_messages( + date: + ) + @messaging_api.get_number_of_sent_push_messages( + date: date + ) + end + + # Get number of sent reply messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/reply + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-reply-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_reply_messages_with_http_info( + date: + ) + @messaging_api.get_number_of_sent_reply_messages_with_http_info( + date: date + ) + end + + # Get number of sent reply messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/reply + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_reply_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-reply-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_reply_messages( + date: + ) + @messaging_api.get_number_of_sent_reply_messages( + date: date + ) + end + + # Get number of sent LINE notification messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/pnp + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_pnp_message_statistics_with_http_info( + date: + ) + @messaging_api.get_pnp_message_statistics_with_http_info( + date: date + ) + end + + # Get number of sent LINE notification messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/pnp + # When you want to get HTTP status code or response headers, use {#get_pnp_message_statistics_with_http_info} instead of this. + # + # @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_pnp_message_statistics( + date: + ) + @messaging_api.get_pnp_message_statistics( + date: date + ) + end + + # Get profile + # This requests to GET https://api.line.me/v2/bot/profile/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-profile + # @return [Array(Line::Bot::V2::MessagingApi::UserProfileResponse, 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 get_profile_with_http_info( + user_id: + ) + @messaging_api.get_profile_with_http_info( + user_id: user_id + ) + end + + # Get profile + # This requests to GET https://api.line.me/v2/bot/profile/{userId} + # When you want to get HTTP status code or response headers, use {#get_profile_with_http_info} instead of this. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-profile + # @return [Line::Bot::V2::MessagingApi::UserProfileResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_profile( + user_id: + ) + @messaging_api.get_profile( + user_id: user_id + ) + end + + # Gets a rich menu via a rich menu ID. + # This requests to GET https://api.line.me/v2/bot/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuResponse, 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 get_rich_menu_with_http_info( + rich_menu_id: + ) + @messaging_api.get_rich_menu_with_http_info( + rich_menu_id: rich_menu_id + ) + end + + # Gets a rich menu via a rich menu ID. + # This requests to GET https://api.line.me/v2/bot/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#get_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu + # @return [Line::Bot::V2::MessagingApi::RichMenuResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu( + rich_menu_id: + ) + @messaging_api.get_rich_menu( + rich_menu_id: rich_menu_id + ) + end + + # Get rich menu alias information + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_alias_id [String] The rich menu alias ID whose information you want to obtain. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuAliasResponse, 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 get_rich_menu_alias_with_http_info( + rich_menu_alias_id: + ) + @messaging_api.get_rich_menu_alias_with_http_info( + rich_menu_alias_id: rich_menu_alias_id + ) + end + + # Get rich menu alias information + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # When you want to get HTTP status code or response headers, use {#get_rich_menu_alias_with_http_info} instead of this. + # + # @param rich_menu_alias_id [String] The rich menu alias ID whose information you want to obtain. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id + # @return [Line::Bot::V2::MessagingApi::RichMenuAliasResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_alias( + rich_menu_alias_id: + ) + @messaging_api.get_rich_menu_alias( + rich_menu_alias_id: rich_menu_alias_id + ) + end + + # Get list of rich menu alias + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuAliasListResponse, 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 get_rich_menu_alias_list_with_http_info + @messaging_api.get_rich_menu_alias_list_with_http_info + end + + # Get list of rich menu alias + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/list + # When you want to get HTTP status code or response headers, use {#get_rich_menu_alias_list_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list + # @return [Line::Bot::V2::MessagingApi::RichMenuAliasListResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_alias_list + @messaging_api.get_rich_menu_alias_list + end + + # Get the status of Replace or unlink a linked rich menus in batches. + # This requests to GET https://api.line.me/v2/bot/richmenu/progress/batch + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param request_id [String] A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-batch-control-rich-menus-progress-status + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuBatchProgressResponse, 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 get_rich_menu_batch_progress_with_http_info( + request_id: + ) + @messaging_api.get_rich_menu_batch_progress_with_http_info( + request_id: request_id + ) + end + + # Get the status of Replace or unlink a linked rich menus in batches. + # This requests to GET https://api.line.me/v2/bot/richmenu/progress/batch + # When you want to get HTTP status code or response headers, use {#get_rich_menu_batch_progress_with_http_info} instead of this. + # + # @param request_id [String] A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-batch-control-rich-menus-progress-status + # @return [Line::Bot::V2::MessagingApi::RichMenuBatchProgressResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_batch_progress( + request_id: + ) + @messaging_api.get_rich_menu_batch_progress( + request_id: request_id + ) + end + + # Get rich menu ID of user + # This requests to GET https://api.line.me/v2/bot/user/{userId}/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuIdResponse, 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 get_rich_menu_id_of_user_with_http_info( + user_id: + ) + @messaging_api.get_rich_menu_id_of_user_with_http_info( + user_id: user_id + ) + end + + # Get rich menu ID of user + # This requests to GET https://api.line.me/v2/bot/user/{userId}/richmenu + # When you want to get HTTP status code or response headers, use {#get_rich_menu_id_of_user_with_http_info} instead of this. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user + # @return [Line::Bot::V2::MessagingApi::RichMenuIdResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_id_of_user( + user_id: + ) + @messaging_api.get_rich_menu_id_of_user( + user_id: user_id + ) + end + + # Get rich menu list + # This requests to GET https://api.line.me/v2/bot/richmenu/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuListResponse, 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 get_rich_menu_list_with_http_info + @messaging_api.get_rich_menu_list_with_http_info + end + + # Get rich menu list + # This requests to GET https://api.line.me/v2/bot/richmenu/list + # When you want to get HTTP status code or response headers, use {#get_rich_menu_list_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list + # @return [Line::Bot::V2::MessagingApi::RichMenuListResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_list + @messaging_api.get_rich_menu_list + end + + # Get number of users in a multi-person chat + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/count + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-room-count + # @return [Array(Line::Bot::V2::MessagingApi::RoomMemberCountResponse, 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 get_room_member_count_with_http_info( + room_id: + ) + @messaging_api.get_room_member_count_with_http_info( + room_id: room_id + ) + end + + # Get number of users in a multi-person chat + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/count + # When you want to get HTTP status code or response headers, use {#get_room_member_count_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-room-count + # @return [Line::Bot::V2::MessagingApi::RoomMemberCountResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_room_member_count( + room_id: + ) + @messaging_api.get_room_member_count( + room_id: room_id + ) + end + + # Get multi-person chat member profile + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/member/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile + # @return [Array(Line::Bot::V2::MessagingApi::RoomUserProfileResponse, 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 get_room_member_profile_with_http_info( + room_id:, + user_id: + ) + @messaging_api.get_room_member_profile_with_http_info( + room_id: room_id, + user_id: user_id + ) + end + + # Get multi-person chat member profile + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/member/{userId} + # When you want to get HTTP status code or response headers, use {#get_room_member_profile_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile + # @return [Line::Bot::V2::MessagingApi::RoomUserProfileResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_room_member_profile( + room_id:, + user_id: + ) + @messaging_api.get_room_member_profile( + room_id: room_id, + user_id: user_id + ) + end + + # Get multi-person chat member user IDs + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids + # @return [Array(Line::Bot::V2::MessagingApi::MembersIdsResponse, 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 get_room_members_ids_with_http_info( + room_id:, + start: nil + ) + @messaging_api.get_room_members_ids_with_http_info( + room_id: room_id, + start: start + ) + end + + # Get multi-person chat member user IDs + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/ids + # When you want to get HTTP status code or response headers, use {#get_room_members_ids_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids + # @return [Line::Bot::V2::MessagingApi::MembersIdsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_room_members_ids( + room_id:, + start: nil + ) + @messaging_api.get_room_members_ids( + room_id: room_id, + start: start + ) + end + + # Get webhook endpoint information + # This requests to GET https://api.line.me/v2/bot/channel/webhook/endpoint + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information + # @return [Array(Line::Bot::V2::MessagingApi::GetWebhookEndpointResponse, 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 get_webhook_endpoint_with_http_info + @messaging_api.get_webhook_endpoint_with_http_info + end + + # Get webhook endpoint information + # This requests to GET https://api.line.me/v2/bot/channel/webhook/endpoint + # When you want to get HTTP status code or response headers, use {#get_webhook_endpoint_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information + # @return [Line::Bot::V2::MessagingApi::GetWebhookEndpointResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_webhook_endpoint + @messaging_api.get_webhook_endpoint + end + + # Issue link token + # This requests to POST https://api.line.me/v2/bot/user/{userId}/linkToken + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-link-token + # @return [Array(Line::Bot::V2::MessagingApi::IssueLinkTokenResponse, 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_link_token_with_http_info( + user_id: + ) + @messaging_api.issue_link_token_with_http_info( + user_id: user_id + ) + end + + # Issue link token + # This requests to POST https://api.line.me/v2/bot/user/{userId}/linkToken + # When you want to get HTTP status code or response headers, use {#issue_link_token_with_http_info} instead of this. + # + # @param user_id [String] User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-link-token + # @return [Line::Bot::V2::MessagingApi::IssueLinkTokenResponse] 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_link_token( + user_id: + ) + @messaging_api.issue_link_token( + user_id: user_id + ) + end + + # Leave group chat + # This requests to POST https://api.line.me/v2/bot/group/{groupId}/leave + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-group + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def leave_group_with_http_info( + group_id: + ) + @messaging_api.leave_group_with_http_info( + group_id: group_id + ) + end + + # Leave group chat + # This requests to POST https://api.line.me/v2/bot/group/{groupId}/leave + # When you want to get HTTP status code or response headers, use {#leave_group_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-group + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def leave_group( + group_id: + ) + @messaging_api.leave_group( + group_id: group_id + ) + end + + # Leave multi-person chat + # This requests to POST https://api.line.me/v2/bot/room/{roomId}/leave + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-room + # @return [Array((String|nil), 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 leave_room_with_http_info( + room_id: + ) + @messaging_api.leave_room_with_http_info( + room_id: room_id + ) + end + + # Leave multi-person chat + # This requests to POST https://api.line.me/v2/bot/room/{roomId}/leave + # When you want to get HTTP status code or response headers, use {#leave_room_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-room + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def leave_room( + room_id: + ) + @messaging_api.leave_room( + room_id: room_id + ) + end + + # Link rich menu to user. + # This requests to POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user + # @return [Array((String|nil), 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 link_rich_menu_id_to_user_with_http_info( + user_id:, + rich_menu_id: + ) + @messaging_api.link_rich_menu_id_to_user_with_http_info( + user_id: user_id, + rich_menu_id: rich_menu_id + ) + end + + # Link rich menu to user. + # This requests to POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#link_rich_menu_id_to_user_with_http_info} instead of this. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def link_rich_menu_id_to_user( + user_id:, + rich_menu_id: + ) + @messaging_api.link_rich_menu_id_to_user( + user_id: user_id, + rich_menu_id: rich_menu_id + ) + end + + # Link rich menu to multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/link + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_bulk_link_request [Line::Bot::V2::MessagingApi::RichMenuBulkLinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def link_rich_menu_id_to_users_with_http_info( + rich_menu_bulk_link_request: + ) + @messaging_api.link_rich_menu_id_to_users_with_http_info( + rich_menu_bulk_link_request: rich_menu_bulk_link_request + ) + end + + # Link rich menu to multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/link + # When you want to get HTTP status code or response headers, use {#link_rich_menu_id_to_users_with_http_info} instead of this. + # + # @param rich_menu_bulk_link_request [Line::Bot::V2::MessagingApi::RichMenuBulkLinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def link_rich_menu_id_to_users( + rich_menu_bulk_link_request: + ) + @messaging_api.link_rich_menu_id_to_users( + rich_menu_bulk_link_request: rich_menu_bulk_link_request + ) + end + + # Get a paginated list of coupons. + # This requests to GET https://api.line.me/v2/bot/coupon + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param status [Array[String], nil] Filter coupons by their status. + # @param start [String, nil] Pagination token to retrieve the next page of results. + # @param limit [Integer, nil] Maximum number of coupons to return per request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupons-list + # @return [Array(Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def list_coupon_with_http_info( + status: nil, + start: nil, + limit: nil + ) + @messaging_api.list_coupon_with_http_info( + status: status, + start: start, + limit: limit + ) + end + + # Get a paginated list of coupons. + # This requests to GET https://api.line.me/v2/bot/coupon + # When you want to get HTTP status code or response headers, use {#list_coupon_with_http_info} instead of this. + # + # @param status [Array[String], nil] Filter coupons by their status. + # @param start [String, nil] Pagination token to retrieve the next page of results. + # @param limit [Integer, nil] Maximum number of coupons to return per request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupons-list + # @return [Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def list_coupon( + status: nil, + start: nil, + limit: nil + ) + @messaging_api.list_coupon( + status: status, + start: start, + limit: limit + ) + end + + # Mark messages from users as read + # This requests to POST https://api.line.me/v2/bot/message/markAsRead + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param mark_messages_as_read_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read + # @return [Array((String|nil), 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 mark_messages_as_read_with_http_info( + mark_messages_as_read_request: + ) + @messaging_api.mark_messages_as_read_with_http_info( + mark_messages_as_read_request: mark_messages_as_read_request + ) + end + + # Mark messages from users as read + # This requests to POST https://api.line.me/v2/bot/message/markAsRead + # When you want to get HTTP status code or response headers, use {#mark_messages_as_read_with_http_info} instead of this. + # + # @param mark_messages_as_read_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def mark_messages_as_read( + mark_messages_as_read_request: + ) + @messaging_api.mark_messages_as_read( + mark_messages_as_read_request: mark_messages_as_read_request + ) + end + + # Mark messages from users as read by token + # This requests to POST https://api.line.me/v2/bot/chat/markAsRead + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param mark_messages_as_read_by_token_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadByTokenRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#mark-as-read + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def mark_messages_as_read_by_token_with_http_info( + mark_messages_as_read_by_token_request: + ) + @messaging_api.mark_messages_as_read_by_token_with_http_info( + mark_messages_as_read_by_token_request: mark_messages_as_read_by_token_request + ) + end + + # Mark messages from users as read by token + # This requests to POST https://api.line.me/v2/bot/chat/markAsRead + # When you want to get HTTP status code or response headers, use {#mark_messages_as_read_by_token_with_http_info} instead of this. + # + # @param mark_messages_as_read_by_token_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadByTokenRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#mark-as-read + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def mark_messages_as_read_by_token( + mark_messages_as_read_by_token_request: + ) + @messaging_api.mark_messages_as_read_by_token( + mark_messages_as_read_by_token_request: mark_messages_as_read_by_token_request + ) + end + + # An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + # This requests to POST https://api.line.me/v2/bot/message/multicast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param multicast_request [Line::Bot::V2::MessagingApi::MulticastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-multicast-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def multicast_with_http_info( + multicast_request:, + x_line_retry_key: nil + ) + @messaging_api.multicast_with_http_info( + multicast_request: multicast_request, + x_line_retry_key: x_line_retry_key + ) + end + + # An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + # This requests to POST https://api.line.me/v2/bot/message/multicast + # When you want to get HTTP status code or response headers, use {#multicast_with_http_info} instead of this. + # + # @param multicast_request [Line::Bot::V2::MessagingApi::MulticastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-multicast-message + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def multicast( + multicast_request:, + x_line_retry_key: nil + ) + @messaging_api.multicast( + multicast_request: multicast_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Send narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/narrowcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param narrowcast_request [Line::Bot::V2::MessagingApi::NarrowcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def narrowcast_with_http_info( + narrowcast_request:, + x_line_retry_key: nil + ) + @messaging_api.narrowcast_with_http_info( + narrowcast_request: narrowcast_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Send narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/narrowcast + # When you want to get HTTP status code or response headers, use {#narrowcast_with_http_info} instead of this. + # + # @param narrowcast_request [Line::Bot::V2::MessagingApi::NarrowcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message + # @return [String, nil] when HTTP status code is 202 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def narrowcast( + narrowcast_request:, + x_line_retry_key: nil + ) + @messaging_api.narrowcast( + narrowcast_request: narrowcast_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Sends a message to a user, group chat, or multi-person chat at any time. + # This requests to POST https://api.line.me/v2/bot/message/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param push_message_request [Line::Bot::V2::MessagingApi::PushMessageRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-push-message + # @return [Array(Line::Bot::V2::MessagingApi::PushMessageResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def push_message_with_http_info( + push_message_request:, + x_line_retry_key: nil + ) + @messaging_api.push_message_with_http_info( + push_message_request: push_message_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Sends a message to a user, group chat, or multi-person chat at any time. + # This requests to POST https://api.line.me/v2/bot/message/push + # When you want to get HTTP status code or response headers, use {#push_message_with_http_info} instead of this. + # + # @param push_message_request [Line::Bot::V2::MessagingApi::PushMessageRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-push-message + # @return [Line::Bot::V2::MessagingApi::PushMessageResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def push_message( + push_message_request:, + x_line_retry_key: nil + ) + @messaging_api.push_message( + push_message_request: push_message_request, + x_line_retry_key: x_line_retry_key + ) + end + + # Send LINE notification message + # This requests to POST https://api.line.me/bot/pnp/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param pnp_messages_request [Line::Bot::V2::MessagingApi::PnpMessagesRequest] + # @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook. + # @see https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 422 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def push_messages_by_phone_with_http_info( + pnp_messages_request:, + x_line_delivery_tag: nil + ) + @messaging_api.push_messages_by_phone_with_http_info( + pnp_messages_request: pnp_messages_request, + x_line_delivery_tag: x_line_delivery_tag + ) + end + + # Send LINE notification message + # This requests to POST https://api.line.me/bot/pnp/push + # When you want to get HTTP status code or response headers, use {#push_messages_by_phone_with_http_info} instead of this. + # + # @param pnp_messages_request [Line::Bot::V2::MessagingApi::PnpMessagesRequest] + # @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook. + # @see https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 422 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def push_messages_by_phone( + pnp_messages_request:, + x_line_delivery_tag: nil + ) + @messaging_api.push_messages_by_phone( + pnp_messages_request: pnp_messages_request, + x_line_delivery_tag: x_line_delivery_tag + ) + end + + # Send reply message + # This requests to POST https://api.line.me/v2/bot/message/reply + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param reply_message_request [Line::Bot::V2::MessagingApi::ReplyMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#send-reply-message + # @return [Array(Line::Bot::V2::MessagingApi::ReplyMessageResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def reply_message_with_http_info( + reply_message_request: + ) + @messaging_api.reply_message_with_http_info( + reply_message_request: reply_message_request + ) + end + + # Send reply message + # This requests to POST https://api.line.me/v2/bot/message/reply + # When you want to get HTTP status code or response headers, use {#reply_message_with_http_info} instead of this. + # + # @param reply_message_request [Line::Bot::V2::MessagingApi::ReplyMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#send-reply-message + # @return [Line::Bot::V2::MessagingApi::ReplyMessageResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def reply_message( + reply_message_request: + ) + @messaging_api.reply_message( + reply_message_request: reply_message_request + ) + end + + # You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu/batch + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def rich_menu_batch_with_http_info( + rich_menu_batch_request: + ) + @messaging_api.rich_menu_batch_with_http_info( + rich_menu_batch_request: rich_menu_batch_request + ) + end + + # You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu/batch + # When you want to get HTTP status code or response headers, use {#rich_menu_batch_with_http_info} instead of this. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def rich_menu_batch( + rich_menu_batch_request: + ) + @messaging_api.rich_menu_batch( + rich_menu_batch_request: rich_menu_batch_request + ) + end + + # Set default rich menu + # This requests to POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu + # @return [Array((String|nil), 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 set_default_rich_menu_with_http_info( + rich_menu_id: + ) + @messaging_api.set_default_rich_menu_with_http_info( + rich_menu_id: rich_menu_id + ) + end + + # Set default rich menu + # This requests to POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#set_default_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def set_default_rich_menu( + rich_menu_id: + ) + @messaging_api.set_default_rich_menu( + rich_menu_id: rich_menu_id + ) + end + + # Set webhook endpoint URL + # This requests to PUT https://api.line.me/v2/bot/channel/webhook/endpoint + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param set_webhook_endpoint_request [Line::Bot::V2::MessagingApi::SetWebhookEndpointRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url + # @return [Array((String|nil), 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 set_webhook_endpoint_with_http_info( + set_webhook_endpoint_request: + ) + @messaging_api.set_webhook_endpoint_with_http_info( + set_webhook_endpoint_request: set_webhook_endpoint_request + ) + end + + # Set webhook endpoint URL + # This requests to PUT https://api.line.me/v2/bot/channel/webhook/endpoint + # When you want to get HTTP status code or response headers, use {#set_webhook_endpoint_with_http_info} instead of this. + # + # @param set_webhook_endpoint_request [Line::Bot::V2::MessagingApi::SetWebhookEndpointRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def set_webhook_endpoint( + set_webhook_endpoint_request: + ) + @messaging_api.set_webhook_endpoint( + set_webhook_endpoint_request: set_webhook_endpoint_request + ) + end + + # Display a loading animation in one-on-one chats between users and LINE Official Accounts. + # This requests to POST https://api.line.me/v2/bot/chat/loading/start + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param show_loading_animation_request [Line::Bot::V2::MessagingApi::ShowLoadingAnimationRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def show_loading_animation_with_http_info( + show_loading_animation_request: + ) + @messaging_api.show_loading_animation_with_http_info( + show_loading_animation_request: show_loading_animation_request + ) + end + + # Display a loading animation in one-on-one chats between users and LINE Official Accounts. + # This requests to POST https://api.line.me/v2/bot/chat/loading/start + # When you want to get HTTP status code or response headers, use {#show_loading_animation_with_http_info} instead of this. + # + # @param show_loading_animation_request [Line::Bot::V2::MessagingApi::ShowLoadingAnimationRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator + # @return [String, nil] when HTTP status code is 202 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def show_loading_animation( + show_loading_animation_request: + ) + @messaging_api.show_loading_animation( + show_loading_animation_request: show_loading_animation_request + ) + end + + # Test webhook endpoint + # This requests to POST https://api.line.me/v2/bot/channel/webhook/test + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param test_webhook_endpoint_request [Line::Bot::V2::MessagingApi::TestWebhookEndpointRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint + # @return [Array(Line::Bot::V2::MessagingApi::TestWebhookEndpointResponse, 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 test_webhook_endpoint_with_http_info( + test_webhook_endpoint_request: nil + ) + @messaging_api.test_webhook_endpoint_with_http_info( + test_webhook_endpoint_request: test_webhook_endpoint_request + ) + end + + # Test webhook endpoint + # This requests to POST https://api.line.me/v2/bot/channel/webhook/test + # When you want to get HTTP status code or response headers, use {#test_webhook_endpoint_with_http_info} instead of this. + # + # @param test_webhook_endpoint_request [Line::Bot::V2::MessagingApi::TestWebhookEndpointRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint + # @return [Line::Bot::V2::MessagingApi::TestWebhookEndpointResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def test_webhook_endpoint( + test_webhook_endpoint_request: nil + ) + @messaging_api.test_webhook_endpoint( + test_webhook_endpoint_request: test_webhook_endpoint_request + ) + end + + # Unlink rich menu from user + # This requests to DELETE https://api.line.me/v2/bot/user/{userId}/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user + # @return [Array((String|nil), 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 unlink_rich_menu_id_from_user_with_http_info( + user_id: + ) + @messaging_api.unlink_rich_menu_id_from_user_with_http_info( + user_id: user_id + ) + end + + # Unlink rich menu from user + # This requests to DELETE https://api.line.me/v2/bot/user/{userId}/richmenu + # When you want to get HTTP status code or response headers, use {#unlink_rich_menu_id_from_user_with_http_info} instead of this. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def unlink_rich_menu_id_from_user( + user_id: + ) + @messaging_api.unlink_rich_menu_id_from_user( + user_id: user_id + ) + end + + # Unlink rich menus from multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/unlink + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_bulk_unlink_request [Line::Bot::V2::MessagingApi::RichMenuBulkUnlinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def unlink_rich_menu_id_from_users_with_http_info( + rich_menu_bulk_unlink_request: + ) + @messaging_api.unlink_rich_menu_id_from_users_with_http_info( + rich_menu_bulk_unlink_request: rich_menu_bulk_unlink_request + ) + end + + # Unlink rich menus from multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/unlink + # When you want to get HTTP status code or response headers, use {#unlink_rich_menu_id_from_users_with_http_info} instead of this. + # + # @param rich_menu_bulk_unlink_request [Line::Bot::V2::MessagingApi::RichMenuBulkUnlinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def unlink_rich_menu_id_from_users( + rich_menu_bulk_unlink_request: + ) + @messaging_api.unlink_rich_menu_id_from_users( + rich_menu_bulk_unlink_request: rich_menu_bulk_unlink_request + ) + end + + # Update rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_alias_id [String] The rich menu alias ID you want to update. + # @param update_rich_menu_alias_request [Line::Bot::V2::MessagingApi::UpdateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def update_rich_menu_alias_with_http_info( + rich_menu_alias_id:, + update_rich_menu_alias_request: + ) + @messaging_api.update_rich_menu_alias_with_http_info( + rich_menu_alias_id: rich_menu_alias_id, + update_rich_menu_alias_request: update_rich_menu_alias_request + ) + end + + # Update rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # When you want to get HTTP status code or response headers, use {#update_rich_menu_alias_with_http_info} instead of this. + # + # @param rich_menu_alias_id [String] The rich menu alias ID you want to update. + # @param update_rich_menu_alias_request [Line::Bot::V2::MessagingApi::UpdateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def update_rich_menu_alias( + rich_menu_alias_id:, + update_rich_menu_alias_request: + ) + @messaging_api.update_rich_menu_alias( + rich_menu_alias_id: rich_menu_alias_id, + update_rich_menu_alias_request: update_rich_menu_alias_request + ) + end + + # Validate message objects of a broadcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/broadcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message + # @return [Array((String|nil), 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 validate_broadcast_with_http_info( + validate_message_request: + ) + @messaging_api.validate_broadcast_with_http_info( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a broadcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/broadcast + # When you want to get HTTP status code or response headers, use {#validate_broadcast_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_broadcast( + validate_message_request: + ) + @messaging_api.validate_broadcast( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a multicast message + # This requests to POST https://api.line.me/v2/bot/message/validate/multicast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message + # @return [Array((String|nil), 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 validate_multicast_with_http_info( + validate_message_request: + ) + @messaging_api.validate_multicast_with_http_info( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a multicast message + # This requests to POST https://api.line.me/v2/bot/message/validate/multicast + # When you want to get HTTP status code or response headers, use {#validate_multicast_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_multicast( + validate_message_request: + ) + @messaging_api.validate_multicast( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/narrowcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message + # @return [Array((String|nil), 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 validate_narrowcast_with_http_info( + validate_message_request: + ) + @messaging_api.validate_narrowcast_with_http_info( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/narrowcast + # When you want to get HTTP status code or response headers, use {#validate_narrowcast_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_narrowcast( + validate_message_request: + ) + @messaging_api.validate_narrowcast( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a push message + # This requests to POST https://api.line.me/v2/bot/message/validate/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message + # @return [Array((String|nil), 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 validate_push_with_http_info( + validate_message_request: + ) + @messaging_api.validate_push_with_http_info( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a push message + # This requests to POST https://api.line.me/v2/bot/message/validate/push + # When you want to get HTTP status code or response headers, use {#validate_push_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_push( + validate_message_request: + ) + @messaging_api.validate_push( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a reply message + # This requests to POST https://api.line.me/v2/bot/message/validate/reply + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message + # @return [Array((String|nil), 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 validate_reply_with_http_info( + validate_message_request: + ) + @messaging_api.validate_reply_with_http_info( + validate_message_request: validate_message_request + ) + end + + # Validate message objects of a reply message + # This requests to POST https://api.line.me/v2/bot/message/validate/reply + # When you want to get HTTP status code or response headers, use {#validate_reply_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_reply( + validate_message_request: + ) + @messaging_api.validate_reply( + validate_message_request: validate_message_request + ) + end + + # Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + # This requests to POST https://api.line.me/v2/bot/richmenu/validate/batch + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request + # @return [Array((String|nil), 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 validate_rich_menu_batch_request_with_http_info( + rich_menu_batch_request: + ) + @messaging_api.validate_rich_menu_batch_request_with_http_info( + rich_menu_batch_request: rich_menu_batch_request + ) + end + + # Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + # This requests to POST https://api.line.me/v2/bot/richmenu/validate/batch + # When you want to get HTTP status code or response headers, use {#validate_rich_menu_batch_request_with_http_info} instead of this. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_rich_menu_batch_request( + rich_menu_batch_request: + ) + @messaging_api.validate_rich_menu_batch_request( + rich_menu_batch_request: rich_menu_batch_request + ) + end + + # Validate rich menu object + # This requests to POST https://api.line.me/v2/bot/richmenu/validate + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object + # @return [Array((String|nil), 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 validate_rich_menu_object_with_http_info( + rich_menu_request: + ) + @messaging_api.validate_rich_menu_object_with_http_info( + rich_menu_request: rich_menu_request + ) + end + + # Validate rich menu object + # This requests to POST https://api.line.me/v2/bot/richmenu/validate + # When you want to get HTTP status code or response headers, use {#validate_rich_menu_object_with_http_info} instead of this. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_rich_menu_object( + rich_menu_request: + ) + @messaging_api.validate_rich_menu_object( + rich_menu_request: rich_menu_request + ) + end + + # Download image, video, and audio data sent from users. + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#get-content + # @return [Array((String|nil), 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 get_message_content_with_http_info( + message_id: + ) + @messaging_api_blob.get_message_content_with_http_info( + message_id: message_id + ) + end + + # Download image, video, and audio data sent from users. + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content + # When you want to get HTTP status code or response headers, use {#get_message_content_with_http_info} instead of this. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#get-content + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_content( + message_id: + ) + @messaging_api_blob.get_message_content( + message_id: message_id + ) + end + + # Get a preview image of the image or video + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/preview + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param message_id [String] Message ID of image or video + # @see https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview + # @return [Array((String|nil), 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 get_message_content_preview_with_http_info( + message_id: + ) + @messaging_api_blob.get_message_content_preview_with_http_info( + message_id: message_id + ) + end + + # Get a preview image of the image or video + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/preview + # When you want to get HTTP status code or response headers, use {#get_message_content_preview_with_http_info} instead of this. + # + # @param message_id [String] Message ID of image or video + # @see https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_content_preview( + message_id: + ) + @messaging_api_blob.get_message_content_preview( + message_id: message_id + ) + end + + # Verify the preparation status of a video or audio for getting + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcoding + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#verify-video-or-audio-preparation-status + # @return [Array(Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, 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 get_message_content_transcoding_by_message_id_with_http_info( + message_id: + ) + @messaging_api_blob.get_message_content_transcoding_by_message_id_with_http_info( + message_id: message_id + ) + end + + # Verify the preparation status of a video or audio for getting + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcoding + # When you want to get HTTP status code or response headers, use {#get_message_content_transcoding_by_message_id_with_http_info} instead of this. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#verify-video-or-audio-preparation-status + # @return [Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_content_transcoding_by_message_id( + message_id: + ) + @messaging_api_blob.get_message_content_transcoding_by_message_id( + message_id: message_id + ) + end + + # Download rich menu image. + # This requests to GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of the rich menu with the image to be downloaded + # @see https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image + # @return [Array((String|nil), 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 get_rich_menu_image_with_http_info( + rich_menu_id: + ) + @messaging_api_blob.get_rich_menu_image_with_http_info( + rich_menu_id: rich_menu_id + ) + end + + # Download rich menu image. + # This requests to GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # When you want to get HTTP status code or response headers, use {#get_rich_menu_image_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of the rich menu with the image to be downloaded + # @see https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_image( + rich_menu_id: + ) + @messaging_api_blob.get_rich_menu_image( + rich_menu_id: rich_menu_id + ) + end + + # Upload rich menu image + # This requests to POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] The ID of the rich menu to attach the image to + # @param body [File] + # @see https://developers.line.biz/en/reference/messaging-api/#upload-rich-menu-image + # @return [Array((String|nil), 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 set_rich_menu_image_with_http_info( + rich_menu_id:, + body: + ) + @messaging_api_blob.set_rich_menu_image_with_http_info( + rich_menu_id: rich_menu_id, + body: body + ) + end + + # Upload rich menu image + # This requests to POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # When you want to get HTTP status code or response headers, use {#set_rich_menu_image_with_http_info} instead of this. + # + # @param rich_menu_id [String] The ID of the rich menu to attach the image to + # @param body [File] + # @see https://developers.line.biz/en/reference/messaging-api/#upload-rich-menu-image + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def set_rich_menu_image( + rich_menu_id:, + body: + ) + @messaging_api_blob.set_rich_menu_image( + rich_menu_id: rich_menu_id, + body: body + ) + end + + # If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/acquire + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @param acquire_chat_control_request [Line::Bot::V2::Module::AcquireChatControlRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#acquire-control-api + # @return [Array((String|nil), 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 acquire_chat_control_with_http_info( + chat_id:, + acquire_chat_control_request: nil + ) + @line_module.acquire_chat_control_with_http_info( + chat_id: chat_id, + acquire_chat_control_request: acquire_chat_control_request + ) + end + + # If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/acquire + # When you want to get HTTP status code or response headers, use {#acquire_chat_control_with_http_info} instead of this. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @param acquire_chat_control_request [Line::Bot::V2::Module::AcquireChatControlRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#acquire-control-api + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def acquire_chat_control( + chat_id:, + acquire_chat_control_request: nil + ) + @line_module.acquire_chat_control( + chat_id: chat_id, + acquire_chat_control_request: acquire_chat_control_request + ) + end + + # The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + # This requests to POST https://api.line.me/v2/bot/channel/detach + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param detach_module_request [Line::Bot::V2::Module::DetachModuleRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#unlink-detach-module-channel-by-operation-mc-admin + # @return [Array((String|nil), 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 detach_module_with_http_info( + detach_module_request: nil + ) + @line_module.detach_module_with_http_info( + detach_module_request: detach_module_request + ) + end + + # The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + # This requests to POST https://api.line.me/v2/bot/channel/detach + # When you want to get HTTP status code or response headers, use {#detach_module_with_http_info} instead of this. + # + # @param detach_module_request [Line::Bot::V2::Module::DetachModuleRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#unlink-detach-module-channel-by-operation-mc-admin + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def detach_module( + detach_module_request: nil + ) + @line_module.detach_module( + detach_module_request: detach_module_request + ) + end + + # Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + # This requests to GET https://api.line.me/v2/bot/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + # @param limit [Integer, nil] Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + # @see https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api + # @return [Array(Line::Bot::V2::Module::GetModulesResponse, 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 get_modules_with_http_info( + start: nil, + limit: nil + ) + @line_module.get_modules_with_http_info( + start: start, + limit: limit + ) + end + + # Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + # This requests to GET https://api.line.me/v2/bot/list + # When you want to get HTTP status code or response headers, use {#get_modules_with_http_info} instead of this. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + # @param limit [Integer, nil] Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + # @see https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api + # @return [Line::Bot::V2::Module::GetModulesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_modules( + start: nil, + limit: nil + ) + @line_module.get_modules( + start: start, + limit: limit + ) + end + + # To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/release + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @see https://developers.line.biz/en/reference/partner-docs/#release-control-api + # @return [Array((String|nil), 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 release_chat_control_with_http_info( + chat_id: + ) + @line_module.release_chat_control_with_http_info( + chat_id: chat_id + ) + end + + # To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/release + # When you want to get HTTP status code or response headers, use {#release_chat_control_with_http_info} instead of this. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @see https://developers.line.biz/en/reference/partner-docs/#release-control-api + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def release_chat_control( + chat_id: + ) + @line_module.release_chat_control( + chat_id: chat_id + ) + end + + # Sends a mission sticker. + # This requests to POST https://api.line.me/shop/v3/mission + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param mission_sticker_request [Line::Bot::V2::Shop::MissionStickerRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 + # @return [Array((String|nil), 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 mission_sticker_v3_with_http_info( + mission_sticker_request: + ) + @shop.mission_sticker_v3_with_http_info( + mission_sticker_request: mission_sticker_request + ) + end + + # Sends a mission sticker. + # This requests to POST https://api.line.me/shop/v3/mission + # When you want to get HTTP status code or response headers, use {#mission_sticker_v3_with_http_info} instead of this. + # + # @param mission_sticker_request [Line::Bot::V2::Shop::MissionStickerRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def mission_sticker_v3( + mission_sticker_request: + ) + @shop.mission_sticker_v3( + mission_sticker_request: mission_sticker_request + ) + end + end + end + end +end diff --git a/lib/line/bot/v2/line_bot_client.rb b/lib/line/bot/v2/line_bot_client.rb new file mode 100644 index 00000000..b1c3e080 --- /dev/null +++ b/lib/line/bot/v2/line_bot_client.rb @@ -0,0 +1,50 @@ +# This file is intended for manual edits. +# +# Generated delegation methods live in ./line_bot_client.generated.rb. +# Generated factory helpers live in ./line_bot_client.factory.generated.rb. + +require 'line/bot/v2/insight/core' +require 'line/bot/v2/liff/core' +require 'line/bot/v2/manage_audience/core' +require 'line/bot/v2/messaging_api/core' +require 'line/bot/v2/module/core' +require 'line/bot/v2/shop/core' +require 'line/bot/v2/line_bot_client.generated' +require 'line/bot/v2/line_bot_client.factory.generated' + +module Line + module Bot + module V2 + # A single client for all LINE Bot APIs, except channel access token and module attach management. + # + # It wraps the individual generated API clients and exposes their methods directly, + # so callers can work with one object instead of juggling several client instances. + # + # For channel access token operations, use {Line::Bot::V2::ChannelAccessToken::ApiClient} directly. + # For module attach operations, use {Line::Bot::V2::ModuleAttach::ApiClient} directly. + class LineBotClient + # @param channel_access_token [String] Channel access token issued for your LINE Official Account. + # @param api_base_url [String, nil] Base URL for Messaging API style endpoints. Defaults to https://api.line.me. + # @param data_api_base_url [String, nil] Base URL for data/blob endpoints. Defaults to https://api-data.line.me. + # @param http_options [Hash{String|Symbol => untyped}] Net::HTTP options passed to all generated clients. + def initialize( + channel_access_token:, + api_base_url: nil, + data_api_base_url: nil, + http_options: {} + ) + unless channel_access_token.is_a?(String) && !channel_access_token.empty? + raise TypeError, 'channel_access_token must be a non-empty String.' + end + + build_generated_delegates( + channel_access_token: channel_access_token, + api_base_url: api_base_url, + data_api_base_url: data_api_base_url, + http_options: http_options + ) + end + end + end + end +end diff --git a/migration_from_v1_to_v2_guide.md b/migration_from_v1_to_v2_guide.md index ba9126fc..91b6cbbc 100644 --- a/migration_from_v1_to_v2_guide.md +++ b/migration_from_v1_to_v2_guide.md @@ -45,22 +45,33 @@ You can suppress the deprecation warning by setting any value to `ENV['SUPRESS_V However, it's not recommended to always use it as it could lead to migration errors. ## Clients -There are several types of API clients. -Depending on the classification of the API, there are several types of clients. -- `MessagingApi`. + +### Unified Client (recommended) +`Line::Bot::V2::LineBotClient` wraps supported API clients into a single object. ChannelAccessToken and ModuleAttach are not included; use their individual clients directly. + +```rb +client = Line::Bot::V2::LineBotClient.new( + channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") +) + +# All APIs available through a single client: +client.push_message(push_message_request: request) +client.get_number_of_followers(date: '20240101') +client.get_message_content(message_id: '12345') +``` + +### Individual Clients +You can also use individual clients directly. There are several types depending on the API classification: +- `MessagingApi` - `ManageAudience` -- `Inshight` +- `Insight` - `ChannelAccessToken` - `Liff` - `Shop` and so on. -In addition, the same `MessagingApi` is divided into `ApiBlobClient` for APIs that use https://api-data.line.me to upload and download files. - -- `Line::Bot::V2::MessagingApi::ApiClient`. -- `Line::Bot::V2::MessagingApi::ApiBlobClient`. - -These are planned to be integrated in the future, but this has not yet been accomplished. +For channel access token operations, use `Line::Bot::V2::ChannelAccessToken::ApiClient` directly (not included in the unified client). +For module attach operations, use `Line::Bot::V2::ModuleAttach::ApiClient` directly (not included in the unified client). ## Migration examples @@ -88,7 +99,7 @@ puts response.class # => Net::HTTPResponse ``` #### v2 (with class) ```rb -client = Line::Bot::V2::MessagingApi::ApiClient.new( +client = Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") ) @@ -116,7 +127,7 @@ Please use one of the above methods if possible. However, this method makes migration from v1 easier. ```rb -client = Line::Bot::V2::MessagingApi::ApiClient.new( +client = Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") ) @@ -184,7 +195,7 @@ require 'line-bot-api' set :environment, :production def client - @client ||= Line::Bot::V2::MessagingApi::ApiClient.new( + @client ||= Line::Bot::V2::LineBotClient.new( channel_access_token: ENV.fetch("LINE_CHANNEL_ACCESS_TOKEN") ) end diff --git a/scripts/unified-client-generator/main.rb b/scripts/unified-client-generator/main.rb new file mode 100644 index 00000000..058fbc94 --- /dev/null +++ b/scripts/unified-client-generator/main.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +require 'fileutils' +require 'pathname' +require 'rbs' +require 'set' + +# Generates Line::Bot::V2::LineBotClient, a single unified client that wraps all +# individual API clients (MessagingApi, Insight, Liff, ManageAudience, etc.). +# +# Without this, users must instantiate and manage multiple client objects +# themselves, choosing the right one for each API call. The unified client +# eliminates that burden: one object, one channel_access_token, every API. +module UnifiedClientGenerator + OUTPUT_RB_GENERATED = 'lib/line/bot/v2/line_bot_client.generated.rb' + OUTPUT_RB_FACTORY = 'lib/line/bot/v2/line_bot_client.factory.generated.rb' + OUTPUT_RBS = 'sig/line/bot/v2/line_bot_client.rbs' + BOT_ENTRYPOINT = 'lib/line/bot.rb' + EXCLUDED_PACKAGES = Set['channel_access_token', 'module_attach'].freeze + BUILTINS = Set['Array', 'File', 'Float', 'Hash', 'Integer', 'Object', 'String', 'Symbol'].freeze + + CLIENT_CLASS_COMMENT = <<~COMMENT + A single client for all LINE Bot APIs, except channel access token and module attach management. + + It wraps the individual generated API clients and exposes their methods directly, + so callers can work with one object instead of juggling several client instances. + + For channel access token operations, use {Line::Bot::V2::ChannelAccessToken::ApiClient} directly. + For module attach operations, use {Line::Bot::V2::ModuleAttach::ApiClient} directly. + COMMENT + + CLIENT_INITIALIZE_COMMENT = <<~COMMENT + @param channel_access_token [String] Channel access token issued for your LINE Official Account. + @param api_base_url [String, nil] Base URL for Messaging API style endpoints. Defaults to https://api.line.me. + @param data_api_base_url [String, nil] Base URL for data/blob endpoints. Defaults to https://api-data.line.me. + @param http_options [Hash{String|Symbol => untyped}] Net::HTTP options passed to all generated clients. + COMMENT + + ClientSpec = Struct.new(:package_dir, :namespace_name, :class_name, :delegate_name, + :default_base_url, :constructor_required_keywords, + :constructor_optional_keywords, :delegated_methods, :model_names, + keyword_init: true) do + def namespace_reference + "Line::Bot::V2::#{namespace_name}" + end + + def qualified_class_name + "Line::Bot::V2::#{namespace_name}::#{class_name}" + end + + def ivar_name + "@#{delegate_name}" + end + end + + MethodSpec = Struct.new(:name, :comment, :required_keywords, :optional_keywords, :return_type, + keyword_init: true) + + module_function + + def run(root_dir = File.expand_path('../..', __dir__)) + root = Pathname(root_dir) + ruby_clients = discover_clients_from_ruby(root) + rbs_clients = discover_clients_from_rbs(root) + validate_clients!(ruby_clients) + validate_rb_rbs_consistency!(ruby_clients, rbs_clients) + + write(root.join(OUTPUT_RB_GENERATED), render_generated_ruby(ruby_clients)) + write(root.join(OUTPUT_RB_FACTORY), render_factory_ruby(ruby_clients)) + write(root.join(OUTPUT_RBS), render_rbs(rbs_clients)) + patch_bot_entrypoint!(root.join(BOT_ENTRYPOINT)) + + n = ruby_clients.sum { |c| c.delegated_methods.size } + puts "Generated #{OUTPUT_RB_GENERATED}, #{OUTPUT_RB_FACTORY}, #{OUTPUT_RBS}. " \ + "#{ruby_clients.size} client classes, #{n} delegated methods." + end + + # --- Validation --- + + SUPPORTED_BASE_URLS = Set['https://api.line.me', 'https://api-data.line.me'].freeze + + def validate_clients!(clients) + raise 'No client files were found.' if clients.empty? + + check_collisions!('Delegate name', clients.map(&:delegate_name)) + check_collisions!('Method name', clients.flat_map { |c| c.delegated_methods.map(&:name) }) + + allowed = Set['base_url', 'channel_access_token', 'http_options'] + + clients.each do |c| + req = Set.new(c.constructor_required_keywords) + opt = Set.new(c.constructor_optional_keywords) + all = req | opt + + extra = all - allowed + raise "Unsupported constructor keys in #{c.qualified_class_name}: #{extra.to_a.join(', ')}" unless extra.empty? + + raise "Missing channel_access_token in #{c.qualified_class_name}" unless all.include?('channel_access_token') + + unless SUPPORTED_BASE_URLS.include?(c.default_base_url) + raise "Unsupported default_base_url #{c.default_base_url.inspect} in #{c.qualified_class_name}. " \ + "Supported: #{SUPPORTED_BASE_URLS.to_a.join(', ')}" + end + end + end + + def validate_rb_rbs_consistency!(ruby_clients, rbs_clients) + ruby_by_delegate = ruby_clients.to_h { |c| [c.delegate_name, c] } + rbs_by_delegate = rbs_clients.to_h { |c| [c.delegate_name, c] } + + missing_in_rbs = ruby_by_delegate.keys - rbs_by_delegate.keys + missing_in_ruby = rbs_by_delegate.keys - ruby_by_delegate.keys + unless missing_in_rbs.empty? && missing_in_ruby.empty? + raise "Client mismatch between rb and rbs. " \ + "missing_in_rbs=#{missing_in_rbs.sort.join(', ')}, " \ + "missing_in_ruby=#{missing_in_ruby.sort.join(', ')}" + end + + ruby_by_delegate.each do |delegate_name, ruby_client| + rbs_client = rbs_by_delegate.fetch(delegate_name) + ruby_methods = ruby_client.delegated_methods.map(&:name).sort + rbs_methods = rbs_client.delegated_methods.map(&:name).sort + next if ruby_methods == rbs_methods + + missing_in_rbs_methods = ruby_methods - rbs_methods + missing_in_ruby_methods = rbs_methods - ruby_methods + raise "Method mismatch for #{delegate_name}. " \ + "missing_in_rbs=#{missing_in_rbs_methods.join(', ')}, " \ + "missing_in_ruby=#{missing_in_ruby_methods.join(', ')}" + end + end + + def check_collisions!(label, names) + dupes = names.tally.select { |_, v| v > 1 }.keys.sort + raise "#{label} collisions: #{dupes.join(', ')}" unless dupes.empty? + end + + # --- Utilities --- + + def patch_bot_entrypoint!(path) + return unless path.exist? + + content = path.read + required_line = "require 'line/bot/v2/line_bot_client'" + return if content.include?(required_line) + + write(path, content.rstrip + "\n#{required_line}\n") + end + + def write(path, content) + FileUtils.mkdir_p(path.dirname) + path.write(content) + end + + def indent(text, depth) + prefix = ' ' * depth + text.lines.map { |line| line.chomp.empty? ? line : "#{prefix}#{line}" }.join + end +end + +require_relative 'parser' +require_relative 'renderer' + +UnifiedClientGenerator.run(ARGV.fetch(0, File.expand_path('../..', __dir__))) if $PROGRAM_NAME == __FILE__ diff --git a/scripts/unified-client-generator/parser.rb b/scripts/unified-client-generator/parser.rb new file mode 100644 index 00000000..6de5a0bd --- /dev/null +++ b/scripts/unified-client-generator/parser.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +module UnifiedClientGenerator + module_function + + def discover_clients_from_rbs(root) + clients = Dir[root.join('sig/line/bot/v2/*/api/*_client.rbs').to_s].sort.filter_map do |sig_path| + pkg = Pathname(sig_path).relative_path_from(root.join('sig/line/bot/v2')).each_filename.first + next if EXCLUDED_PACKAGES.include?(pkg) + + rb_path = root.join('lib/line/bot/v2', pkg, 'api', File.basename(sig_path, '.rbs') + '.rb') + raise "Missing Ruby client for #{sig_path}" unless rb_path.exist? + + parse_client_from_rbs(sig_path: Pathname(sig_path), rb_path: rb_path) + end + clients.sort_by { |c| [c.package_dir, c.delegate_name] } + end + + def discover_clients_from_ruby(root) + clients = Dir[root.join('lib/line/bot/v2/*/api/*_client.rb').to_s].sort.filter_map do |rb_path| + pkg = Pathname(rb_path).relative_path_from(root.join('lib/line/bot/v2')).each_filename.first + next if EXCLUDED_PACKAGES.include?(pkg) + + sig_path = root.join('sig/line/bot/v2', pkg, 'api', File.basename(rb_path, '.rb') + '.rbs') + parse_client_from_ruby(rb_path: Pathname(rb_path), sig_path: sig_path.exist? ? sig_path : nil) + end + clients.sort_by { |c| [c.package_dir, c.delegate_name] } + end + + # Backward-compatible entrypoint used by tests. + def parse_client(sig_path:, rb_path:) + parse_client_from_rbs(sig_path: sig_path, rb_path: rb_path) + end + + def parse_client_from_rbs(sig_path:, rb_path:) + content = sig_path.read.force_encoding('UTF-8') + declarations = RBS::Parser.parse_signature( + RBS::Buffer.new(name: sig_path.to_s, content: content) + ).last + + component_module = dig_module(declarations, :Line, :Bot, :V2) + klass = component_module.members.grep(RBS::AST::Declarations::Class).first or + raise "Missing class in #{component_module.name.name}" + + init = klass.members.grep(RBS::AST::Members::MethodDefinition).find { |m| m.name == :initialize } or + raise "Missing initialize in #{sig_path}" + ctor = init.overloads.fetch(0).method_type.type + + ns = component_module.name.name.to_s + models = collect_model_names(klass) + + ClientSpec.new( + package_dir: sig_path.relative_path_from(sig_path.parent.parent.parent).each_filename.first, + namespace_name: ns, + class_name: klass.name.name.to_s, + delegate_name: File.basename(sig_path, '.rbs').sub(/_client\z/, ''), + default_base_url: parse_default_base_url(rb_path.read, rb_path), + constructor_required_keywords: ctor.required_keywords.keys.map(&:to_s), + constructor_optional_keywords: ctor.optional_keywords.keys.map(&:to_s), + delegated_methods: klass.members.grep(RBS::AST::Members::MethodDefinition).filter_map do |m| + next if m.name == :initialize + + build_method_spec(m, ns, models) + end, + model_names: models + ) + end + + def parse_client_from_ruby(rb_path:, sig_path: nil) + source = rb_path.read.force_encoding('UTF-8') + parsed = parse_ruby_client_source(source) + init = parsed.fetch(:initialize) { raise "Missing initialize in #{rb_path}" } + package_dir = rb_path.relative_path_from(rb_path.parent.parent.parent).each_filename.first + namespace_name = camelize_path_component(package_dir) + + model_names = Set[] + if sig_path + sig_content = sig_path.read.force_encoding('UTF-8') + declarations = RBS::Parser.parse_signature( + RBS::Buffer.new(name: sig_path.to_s, content: sig_content) + ).last + component_module = dig_module(declarations, :Line, :Bot, :V2) + klass = component_module.members.grep(RBS::AST::Declarations::Class).first + model_names = collect_model_names(klass) if klass + end + + delegated_methods = parsed.fetch(:methods).reject { |m| m[:name] == 'initialize' }.map do |m| + MethodSpec.new( + name: m[:name], + comment: qualify_comment(m[:comment], namespace_name, model_names), + required_keywords: m[:required_keywords], + optional_keywords: m[:optional_keywords], + return_type: 'untyped' + ) + end + + ClientSpec.new( + package_dir: package_dir, + namespace_name: namespace_name, + class_name: parsed.fetch(:class_name), + delegate_name: File.basename(rb_path, '.rb').sub(/_client\z/, ''), + default_base_url: parse_default_base_url(source, rb_path), + constructor_required_keywords: init[:required_keywords].keys.map(&:to_s), + constructor_optional_keywords: init[:optional_keywords].keys.map(&:to_s), + delegated_methods: delegated_methods, + model_names: model_names + ) + end + + def dig_module(declarations, *names) + node = declarations.find { |d| d.is_a?(RBS::AST::Declarations::Module) && d.name.name == names.first } or + raise "Missing #{names.first} module" + names.drop(1).each do |name| + node = node.members.find { |m| m.is_a?(RBS::AST::Declarations::Module) && m.name.name == name } or + raise "Missing #{name} module" + end + node.members.find { |m| m.is_a?(RBS::AST::Declarations::Module) } or + raise "Missing component module under V2" + end + + def collect_model_names(klass) + names = Set[] + klass.members.grep(RBS::AST::Members::MethodDefinition).each do |member| + member.overloads.each do |ol| + walk_type(ol.method_type.type) do |t| + next unless t.is_a?(RBS::Types::ClassInstance) && t.name.namespace.empty? + + n = t.name.name.to_s + names << n unless BUILTINS.include?(n) + end + end + end + names + end + + def walk_type(type, &block) + yield(type) + case type + when RBS::Types::Function + [*type.required_keywords.each_value, *type.optional_keywords.each_value, + *type.required_positionals, *type.optional_positionals, *type.trailing_positionals].each { |p| walk_type(p.type, &block) } + walk_type(type.rest_positionals.type, &block) if type.rest_positionals + walk_type(type.rest_keywords.type, &block) if type.rest_keywords + walk_type(type.return_type, &block) + when RBS::Types::Union, RBS::Types::Tuple + type.types.each { |child| walk_type(child, &block) } + when RBS::Types::Optional + walk_type(type.type, &block) + when RBS::Types::ClassInstance + type.args.each { |child| walk_type(child, &block) } + end + end + + def build_method_spec(member, ns, models) + ft = member.overloads.fetch(0).method_type.type + raise "Positional args not supported: #{member.name}" unless + ft.required_positionals.empty? && ft.optional_positionals.empty? && + ft.trailing_positionals.empty? && ft.rest_positionals.nil? + raise "Rest keywords not supported: #{member.name}" if ft.rest_keywords + + MethodSpec.new( + name: member.name.to_s, + comment: qualify_comment(member.comment&.string.to_s, ns, models), + required_keywords: ft.required_keywords.transform_values { |p| rbs_type(p.type, ns, models) }, + optional_keywords: ft.optional_keywords.transform_values { |p| rbs_type(p.type, ns, models) }, + return_type: rbs_type(ft.return_type, ns, models) + ) + end + + def parse_ruby_client_source(source) + lines = source.lines + class_name = source[/^\s*class\s+([A-Za-z_][A-Za-z0-9_]*)/, 1] + raise 'Missing class declaration in Ruby client source' unless class_name + + methods = [] + i = 0 + while i < lines.length + line = lines[i] + md = line.match(/^\s*def\s+([A-Za-z_][A-Za-z0-9_]*[!?]?)(.*)$/) + unless md + i += 1 + next + end + + name = md[1] + tail = md[2] + def_line_index = i + + params_text = nil + if tail.include?('(') + after_open = tail.split('(', 2).last + params_text, i = collect_parenthesized_params(lines, i, after_open) + end + + required_keywords, optional_keywords = parse_ruby_keyword_params(params_text) + methods << { + name: name, + comment: extract_ruby_comment_block(lines, def_line_index), + required_keywords: required_keywords, + optional_keywords: optional_keywords + } + i += 1 + end + + initialize_method = methods.find { |m| m[:name] == 'initialize' } + { + class_name: class_name, + initialize: initialize_method, + methods: methods + } + end + + def collect_parenthesized_params(lines, start_index, after_open) + return [after_open.split(')', 2).first, start_index] if after_open.include?(')') + + collected = [after_open] + j = start_index + 1 + while j < lines.length + segment = lines[j] + if segment.include?(')') + collected << segment.split(')', 2).first + return [collected.join("\n"), j] + end + + collected << segment + j += 1 + end + + [collected.join("\n"), start_index] + end + + def extract_ruby_comment_block(lines, def_line_index) + j = def_line_index - 1 + buffer = [] + while j >= 0 && lines[j].match?(/^\s*#/) + buffer << lines[j] + j -= 1 + end + return '' if buffer.empty? + + buffer.reverse.map do |line| + content = line.sub(/^\s*#\s?/, '') + content.rstrip + end.join("\n") + end + + def parse_ruby_keyword_params(params_text) + required_keywords = {} + optional_keywords = {} + return [required_keywords, optional_keywords] if params_text.nil? + + normalized = params_text.lines.map { |line| line.sub(/#.*$/, '') }.join(' ').gsub("\n", ' ') + normalized.split(',').each do |segment| + token = segment.strip + next if token.empty? || token.start_with?('**') + + if (match = token.match(/\A([a-z_][a-zA-Z0-9_]*):\z/)) + required_keywords[match[1].to_sym] = nil + elsif (match = token.match(/\A([a-z_][a-zA-Z0-9_]*):\s*(.+)\z/)) + optional_keywords[match[1].to_sym] = nil + end + end + [required_keywords, optional_keywords] + end + + def camelize_path_component(value) + value.split('_').map(&:capitalize).join + end + + def rbs_type(type, ns, models) + case type + when RBS::Types::Bases::Any then 'untyped' + when RBS::Types::Bases::Bool then 'bool' + when RBS::Types::Bases::Void then 'void' + when RBS::Types::Literal then type.literal.inspect + when RBS::Types::Optional then "#{rbs_type(type.type, ns, models)}?" + when RBS::Types::Union + type.types.map { |c| rbs_type(c, ns, models) }.uniq.join(' | ') + when RBS::Types::Tuple + "[#{type.types.map { |c| rbs_type(c, ns, models) }.join(', ')}]" + when RBS::Types::ClassInstance + name = rbs_type_name(type.name, ns, models) + type.args.empty? ? name : "#{name}[#{type.args.map { |c| rbs_type(c, ns, models) }.join(', ')}]" + else + raise "Unsupported RBS type: #{type.class}" + end + end + + def rbs_type_name(type_name, ns, models) + if type_name.namespace.empty? + n = type_name.name.to_s + return n if BUILTINS.include?(n) + return "Line::Bot::V2::#{ns}::#{n}" if models.include?(n) + + n + else + [*type_name.namespace.path.map(&:to_s), type_name.name.to_s].join('::') + end + end + + # Extracts the default base URL from a generated ApiClient Ruby source. + # + # All generated clients follow the pattern: + # @http_client = HttpClient.new( + # base_url: base_url || 'https://api.line.me', + # ... + # ) + def parse_default_base_url(source, path) + source = source.encode('UTF-8', invalid: :replace, undef: :replace) + match = source.match(/HttpClient\.new\([^)]*base_url:\s*base_url\s*\|\|\s*['"]([^'"]+)['"]/m) + raise "Could not determine default base_url for #{path}" unless match + + match[1] + end +end diff --git a/scripts/unified-client-generator/renderer.rb b/scripts/unified-client-generator/renderer.rb new file mode 100644 index 00000000..6fc939d4 --- /dev/null +++ b/scripts/unified-client-generator/renderer.rb @@ -0,0 +1,200 @@ +# frozen_string_literal: true + +module UnifiedClientGenerator + module_function + + # --- Comment qualification --- + + def qualify_comment(comment, ns, models) + return '' if comment.nil? || comment.empty? + + comment.each_line.map do |line| + if line.include?('[') && (line.include?('@param') || line.include?('@return')) + line.gsub(/\[([^\]]+)\]/) { "[#{qualify_types(::Regexp.last_match(1), ns, models)}]" } + else + line + end + end.join + end + + def qualify_types(expr, ns, models) + expr.gsub(/(? 'api_base_url', + 'https://api-data.line.me' => 'data_api_base_url' + }.freeze + + def render_factory_assignment(client) + base_url_kw = BASE_URL_MAP[client.default_base_url] + + supports = lambda do |key| + client.constructor_required_keywords.include?(key) || + client.constructor_optional_keywords.include?(key) + end + + args = [] + args << "base_url: #{base_url_kw}" if supports.call('base_url') && base_url_kw + args << 'channel_access_token: channel_access_token' if supports.call('channel_access_token') + args << 'http_options: http_options' if supports.call('http_options') + + "#{client.ivar_name} = #{client.qualified_class_name}.\n new(#{args.join(', ')})" + end + + # --- RBS rendering --- + + def render_rbs(clients) + ivars = clients.map { |c| "@#{c.delegate_name}: #{c.namespace_reference}::#{c.class_name}" }.join("\n") + pub = clients.flat_map { |c| c.delegated_methods.map { |m| render_rbs_method(m) } }.join("\n\n") + + <<~RBS + # This file is autogenerated. + # + # Generated by scripts/unified-client-generator/main.rb + # Do not edit this file directly. + + module Line + module Bot + module V2 + class LineBotClient + #{indent(render_comment(CLIENT_CLASS_COMMENT), 8)} + #{indent(ivars, 8)} + + #{indent(render_comment(CLIENT_INITIALIZE_COMMENT), 8)} + def initialize: ( + channel_access_token: String, + ?api_base_url: String?, + ?data_api_base_url: String?, + ?http_options: Hash[String | Symbol, untyped] + ) -> void + + #{indent(pub, 8)} + + private + + def build_generated_delegates: ( + channel_access_token: String, + ?api_base_url: String?, + ?data_api_base_url: String?, + ?http_options: Hash[String | Symbol, untyped] + ) -> void + end + end + end + end + RBS + end + + def render_rbs_method(method) + parts = [] + parts << render_comment(method.comment) unless method.comment.empty? + + kw = method.required_keywords.map { |k, t| "#{k}: #{t}" } + + method.optional_keywords.map { |k, t| "?#{k}: #{t}" } + + ret = render_rbs_return_type(method.return_type) + if kw.empty? + parts << "def #{method.name}: () -> #{ret}" + else + parts << "def #{method.name}: (" + parts << indent(kw.join(",\n"), 2) + parts << ") -> #{ret}" + end + parts.join("\n") + end + + def render_rbs_return_type(return_type) + if return_type.include?(' | ') && return_type.length > 100 + parts = return_type.split(' | ') + "(\n#{indent(parts.join("\n| "), 2)}\n)" + else + "(#{return_type})" + end + end +end diff --git a/sig/line/bot/v2/line_bot_client.rbs b/sig/line/bot/v2/line_bot_client.rbs new file mode 100644 index 00000000..33150189 --- /dev/null +++ b/sig/line/bot/v2/line_bot_client.rbs @@ -0,0 +1,2898 @@ +# This file is autogenerated. +# +# Generated by scripts/unified-client-generator/main.rb +# Do not edit this file directly. + +module Line + module Bot + module V2 + class LineBotClient + # A single client for all LINE Bot APIs, except channel access token and module attach management. + # + # It wraps the individual generated API clients and exposes their methods directly, + # so callers can work with one object instead of juggling several client instances. + # + # For channel access token operations, use {Line::Bot::V2::ChannelAccessToken::ApiClient} directly. + # For module attach operations, use {Line::Bot::V2::ModuleAttach::ApiClient} directly. + @insight: Line::Bot::V2::Insight::ApiClient + @liff: Line::Bot::V2::Liff::ApiClient + @manage_audience: Line::Bot::V2::ManageAudience::ApiClient + @manage_audience_blob: Line::Bot::V2::ManageAudience::ApiBlobClient + @messaging_api: Line::Bot::V2::MessagingApi::ApiClient + @messaging_api_blob: Line::Bot::V2::MessagingApi::ApiBlobClient + @line_module: Line::Bot::V2::Module::ApiClient + @shop: Line::Bot::V2::Shop::ApiClient + + # @param channel_access_token [String] Channel access token issued for your LINE Official Account. + # @param api_base_url [String, nil] Base URL for Messaging API style endpoints. Defaults to https://api.line.me. + # @param data_api_base_url [String, nil] Base URL for data/blob endpoints. Defaults to https://api-data.line.me. + # @param http_options [Hash{String|Symbol => untyped}] Net::HTTP options passed to all generated clients. + def initialize: ( + channel_access_token: String, + ?api_base_url: String?, + ?data_api_base_url: String?, + ?http_options: Hash[String | Symbol, untyped] + ) -> void + + # Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). + # This requests to GET https://api.line.me/v2/bot/insight/demographic + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-demographic + # @return [Array(Line::Bot::V2::Insight::GetFriendsDemographicsResponse, 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 get_friends_demographics_with_http_info: () -> ( + [Line::Bot::V2::Insight::GetFriendsDemographicsResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). + # This requests to GET https://api.line.me/v2/bot/insight/demographic + # When you want to get HTTP status code or response headers, use {#get_friends_demographics_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-demographic + # @return [Line::Bot::V2::Insight::GetFriendsDemographicsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_friends_demographics: () -> (Line::Bot::V2::Insight::GetFriendsDemographicsResponse | String?) + + # Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param request_id [String] Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-message-event + # @return [Array(Line::Bot::V2::Insight::GetMessageEventResponse, 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 get_message_event_with_http_info: ( + request_id: String + ) -> ( + [Line::Bot::V2::Insight::GetMessageEventResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event + # When you want to get HTTP status code or response headers, use {#get_message_event_with_http_info} instead of this. + # + # @param request_id [String] Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-message-event + # @return [Line::Bot::V2::Insight::GetMessageEventResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_event: ( + request_id: String + ) -> (Line::Bot::V2::Insight::GetMessageEventResponse | String?) + + # Returns the number of users who have added the LINE Official Account on or before a specified date. + # This requests to GET https://api.line.me/v2/bot/insight/followers + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String, nil] Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers + # @return [Array(Line::Bot::V2::Insight::GetNumberOfFollowersResponse, 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 get_number_of_followers_with_http_info: ( + ?date: String? + ) -> ( + [Line::Bot::V2::Insight::GetNumberOfFollowersResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Returns the number of users who have added the LINE Official Account on or before a specified date. + # This requests to GET https://api.line.me/v2/bot/insight/followers + # When you want to get HTTP status code or response headers, use {#get_number_of_followers_with_http_info} instead of this. + # + # @param date [String, nil] Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers + # @return [Line::Bot::V2::Insight::GetNumberOfFollowersResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_followers: ( + ?date: String? + ) -> (Line::Bot::V2::Insight::GetNumberOfFollowersResponse | String?) + + # Returns the number of messages sent from LINE Official Account on a specified day. + # This requests to GET https://api.line.me/v2/bot/insight/message/delivery + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages + # @return [Array(Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, 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 get_number_of_message_deliveries_with_http_info: ( + date: String + ) -> ( + [Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Returns the number of messages sent from LINE Official Account on a specified day. + # This requests to GET https://api.line.me/v2/bot/insight/message/delivery + # When you want to get HTTP status code or response headers, use {#get_number_of_message_deliveries_with_http_info} instead of this. + # + # @param date [String] Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages + # @return [Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_message_deliveries: ( + date: String + ) -> (Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse | String?) + + # You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event/aggregation + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param custom_aggregation_unit [String] Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. + # @param from [String] Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @param to [String] End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit + # @return [Array(Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, 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 get_statistics_per_unit_with_http_info: ( + custom_aggregation_unit: String, + from: String, + to: String + ) -> ( + [Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. + # This requests to GET https://api.line.me/v2/bot/insight/message/event/aggregation + # When you want to get HTTP status code or response headers, use {#get_statistics_per_unit_with_http_info} instead of this. + # + # @param custom_aggregation_unit [String] Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. + # @param from [String] Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @param to [String] End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit + # @return [Line::Bot::V2::Insight::GetStatisticsPerUnitResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_statistics_per_unit: ( + custom_aggregation_unit: String, + from: String, + to: String + ) -> (Line::Bot::V2::Insight::GetStatisticsPerUnitResponse | String?) + + # Adding the LIFF app to a channel + # This requests to POST https://api.line.me/liff/v1/apps + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param add_liff_app_request [Line::Bot::V2::Liff::AddLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#add-liff-app + # @return [Array(Line::Bot::V2::Liff::AddLiffAppResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def add_liff_app_with_http_info: ( + add_liff_app_request: Line::Bot::V2::Liff::AddLiffAppRequest + ) -> ( + [Line::Bot::V2::Liff::AddLiffAppResponse, 200, Hash[untyped, untyped]] + | [String?, 400, Hash[untyped, untyped]] + | [String?, 401, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Adding the LIFF app to a channel + # This requests to POST https://api.line.me/liff/v1/apps + # When you want to get HTTP status code or response headers, use {#add_liff_app_with_http_info} instead of this. + # + # @param add_liff_app_request [Line::Bot::V2::Liff::AddLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#add-liff-app + # @return [Line::Bot::V2::Liff::AddLiffAppResponse] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 400 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def add_liff_app: ( + add_liff_app_request: Line::Bot::V2::Liff::AddLiffAppRequest + ) -> (Line::Bot::V2::Liff::AddLiffAppResponse | String?) + + # Deletes a LIFF app from a channel. + # This requests to DELETE https://api.line.me/liff/v1/apps/{liffId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @see https://developers.line.biz/en/reference/liff-server/#delete-liff-app + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def delete_liff_app_with_http_info: ( + liff_id: String + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [String?, 401, Hash[untyped, untyped]] + | [String?, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Deletes a LIFF app from a channel. + # This requests to DELETE https://api.line.me/liff/v1/apps/{liffId} + # When you want to get HTTP status code or response headers, use {#delete_liff_app_with_http_info} instead of this. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @see https://developers.line.biz/en/reference/liff-server/#delete-liff-app + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_liff_app: ( + liff_id: String + ) -> (String?) + + # Gets information on all the LIFF apps added to the channel. + # This requests to GET https://api.line.me/liff/v1/apps + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps + # @return [Array(Line::Bot::V2::Liff::GetAllLiffAppsResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_all_liff_apps_with_http_info: () -> ( + [Line::Bot::V2::Liff::GetAllLiffAppsResponse, 200, Hash[untyped, untyped]] + | [String?, 401, Hash[untyped, untyped]] + | [String?, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets information on all the LIFF apps added to the channel. + # This requests to GET https://api.line.me/liff/v1/apps + # When you want to get HTTP status code or response headers, use {#get_all_liff_apps_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps + # @return [Line::Bot::V2::Liff::GetAllLiffAppsResponse] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_all_liff_apps: () -> (Line::Bot::V2::Liff::GetAllLiffAppsResponse | String?) + + # Update LIFF app settings + # This requests to PUT https://api.line.me/liff/v1/apps/{liffId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @param update_liff_app_request [Line::Bot::V2::Liff::UpdateLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#update-liff-app + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 401 + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def update_liff_app_with_http_info: ( + liff_id: String, + update_liff_app_request: Line::Bot::V2::Liff::UpdateLiffAppRequest + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [String?, 400, Hash[untyped, untyped]] + | [String?, 401, Hash[untyped, untyped]] + | [String?, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Update LIFF app settings + # This requests to PUT https://api.line.me/liff/v1/apps/{liffId} + # When you want to get HTTP status code or response headers, use {#update_liff_app_with_http_info} instead of this. + # + # @param liff_id [String] ID of the LIFF app to be updated + # @param update_liff_app_request [Line::Bot::V2::Liff::UpdateLiffAppRequest] + # @see https://developers.line.biz/en/reference/liff-server/#update-liff-app + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when HTTP status code is 400 + # @return [String, nil] when HTTP status code is 401 + # @return [String, nil] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def update_liff_app: ( + liff_id: String, + update_liff_app_request: Line::Bot::V2::Liff::UpdateLiffAppRequest + ) -> (String?) + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/upload + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param add_audience_to_audience_group_request [Line::Bot::V2::ManageAudience::AddAudienceToAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def add_audience_to_audience_group_with_http_info: ( + add_audience_to_audience_group_request: Line::Bot::V2::ManageAudience::AddAudienceToAudienceGroupRequest + ) -> ([String?, 202, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/upload + # When you want to get HTTP status code or response headers, use {#add_audience_to_audience_group_with_http_info} instead of this. + # + # @param add_audience_to_audience_group_request [Line::Bot::V2::ManageAudience::AddAudienceToAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def add_audience_to_audience_group: ( + add_audience_to_audience_group_request: Line::Bot::V2::ManageAudience::AddAudienceToAudienceGroupRequest + ) -> (String?) + + # Create audience for uploading user IDs (by JSON) + # This requests to POST https://api.line.me/v2/bot/audienceGroup/upload + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_audience_group_request [Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_audience_group_with_http_info: ( + create_audience_group_request: Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest + ) -> ( + [Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, 202, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create audience for uploading user IDs (by JSON) + # This requests to POST https://api.line.me/v2/bot/audienceGroup/upload + # When you want to get HTTP status code or response headers, use {#create_audience_group_with_http_info} instead of this. + # + # @param create_audience_group_request [Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group + # @return [Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_audience_group: ( + create_audience_group_request: Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest + ) -> (Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse | String?) + + # Create audience for click-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/click + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_click_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_click_based_audience_group_with_http_info: ( + create_click_based_audience_group_request: Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupRequest + ) -> ( + [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse, 202, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create audience for click-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/click + # When you want to get HTTP status code or response headers, use {#create_click_based_audience_group_with_http_info} instead of this. + # + # @param create_click_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group + # @return [Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_click_based_audience_group: ( + create_click_based_audience_group_request: Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupRequest + ) -> (Line::Bot::V2::ManageAudience::CreateClickBasedAudienceGroupResponse | String?) + + # Create audience for impression-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/imp + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_imp_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_imp_based_audience_group_with_http_info: ( + create_imp_based_audience_group_request: Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupRequest + ) -> ( + [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse, 202, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create audience for impression-based retargeting + # This requests to POST https://api.line.me/v2/bot/audienceGroup/imp + # When you want to get HTTP status code or response headers, use {#create_imp_based_audience_group_with_http_info} instead of this. + # + # @param create_imp_based_audience_group_request [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group + # @return [Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_imp_based_audience_group: ( + create_imp_based_audience_group_request: Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupRequest + ) -> (Line::Bot::V2::ManageAudience::CreateImpBasedAudienceGroupResponse | String?) + + # Delete audience + # This requests to DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-audience-group + # @return [Array((String|nil), 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 delete_audience_group_with_http_info: ( + audience_group_id: Integer + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Delete audience + # This requests to DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # When you want to get HTTP status code or response headers, use {#delete_audience_group_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-audience-group + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_audience_group: ( + audience_group_id: Integer + ) -> (String?) + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-group + # @return [Array(Line::Bot::V2::ManageAudience::GetAudienceDataResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::ManageAudience::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_audience_data_with_http_info: ( + audience_group_id: Integer + ) -> ( + [Line::Bot::V2::ManageAudience::GetAudienceDataResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::ManageAudience::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId} + # When you want to get HTTP status code or response headers, use {#get_audience_data_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-group + # @return [Line::Bot::V2::ManageAudience::GetAudienceDataResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::ManageAudience::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_audience_data: ( + audience_group_id: Integer + ) -> ( + Line::Bot::V2::ManageAudience::GetAudienceDataResponse + | Line::Bot::V2::ManageAudience::ErrorResponse + | String? + ) + + # Gets data for more than one audience. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param includes_external_public_groups [bool, nil] true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-groups + # @return [Array(Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse, 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 get_audience_groups_with_http_info: ( + page: Integer, + ?description: String?, + ?status: Line::Bot::V2::ManageAudience::AudienceGroupStatus?, + ?size: Integer?, + ?includes_external_public_groups: bool?, + ?create_route: Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute? + ) -> ( + [Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets data for more than one audience. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/list + # When you want to get HTTP status code or response headers, use {#get_audience_groups_with_http_info} instead of this. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param includes_external_public_groups [bool, nil] true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @see https://developers.line.biz/en/reference/messaging-api/#get-audience-groups + # @return [Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_audience_groups: ( + page: Integer, + ?description: String?, + ?status: Line::Bot::V2::ManageAudience::AudienceGroupStatus?, + ?size: Integer?, + ?includes_external_public_groups: bool?, + ?create_route: Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute? + ) -> (Line::Bot::V2::ManageAudience::GetAudienceGroupsResponse | String?) + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience + # @return [Array(Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::ManageAudience::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_shared_audience_data_with_http_info: ( + audience_group_id: Integer + ) -> ( + [Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::ManageAudience::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets audience data. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId} + # When you want to get HTTP status code or response headers, use {#get_shared_audience_data_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience + # @return [Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::ManageAudience::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_shared_audience_data: ( + audience_group_id: Integer + ) -> ( + Line::Bot::V2::ManageAudience::GetSharedAudienceDataResponse + | Line::Bot::V2::ManageAudience::ErrorResponse + | String? + ) + + # Gets data for more than one audience, including those shared by the Business Manager. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @param includes_owned_audience_groups [bool, nil] true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list + # @return [Array(Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse, 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 get_shared_audience_groups_with_http_info: ( + page: Integer, + ?description: String?, + ?status: Line::Bot::V2::ManageAudience::AudienceGroupStatus?, + ?size: Integer?, + ?create_route: Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute?, + ?includes_owned_audience_groups: bool? + ) -> ( + [Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets data for more than one audience, including those shared by the Business Manager. + # This requests to GET https://api.line.me/v2/bot/audienceGroup/shared/list + # When you want to get HTTP status code or response headers, use {#get_shared_audience_groups_with_http_info} instead of this. + # + # @param page [Integer] The page to return when getting (paginated) results. Must be 1 or higher. + # @param description [String, nil] The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. + # @param status [Line::Bot::V2::ManageAudience::AudienceGroupStatus, nil] The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. + # @param size [Integer, nil] The number of audiences per page. Default: 20 Max: 40 + # @param create_route [Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute, nil] How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. + # @param includes_owned_audience_groups [bool, nil] true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager + # @see https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list + # @return [Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_shared_audience_groups: ( + page: Integer, + ?description: String?, + ?status: Line::Bot::V2::ManageAudience::AudienceGroupStatus?, + ?size: Integer?, + ?create_route: Line::Bot::V2::ManageAudience::AudienceGroupCreateRoute?, + ?includes_owned_audience_groups: bool? + ) -> (Line::Bot::V2::ManageAudience::GetSharedAudienceGroupsResponse | String?) + + # Renames an existing audience. + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param audience_group_id [Integer] The audience ID. + # @param update_audience_group_description_request [Line::Bot::V2::ManageAudience::UpdateAudienceGroupDescriptionRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group + # @return [Array((String|nil), 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 update_audience_group_description_with_http_info: ( + audience_group_id: Integer, + update_audience_group_description_request: Line::Bot::V2::ManageAudience::UpdateAudienceGroupDescriptionRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Renames an existing audience. + # This requests to PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription + # When you want to get HTTP status code or response headers, use {#update_audience_group_description_with_http_info} instead of this. + # + # @param audience_group_id [Integer] The audience ID. + # @param update_audience_group_description_request [Line::Bot::V2::ManageAudience::UpdateAudienceGroupDescriptionRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def update_audience_group_description: ( + audience_group_id: Integer, + update_audience_group_description_request: Line::Bot::V2::ManageAudience::UpdateAudienceGroupDescriptionRequest + ) -> (String?) + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + # This requests to PUT https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param audience_group_id [Integer, nil] The audience ID. + # @param upload_description [String, nil] The description to register with the job + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group-by-file + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def add_user_ids_to_audience_with_http_info: ( + file: File, + ?audience_group_id: Integer?, + ?upload_description: String? + ) -> ([String?, 202, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). + # This requests to PUT https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # When you want to get HTTP status code or response headers, use {#add_user_ids_to_audience_with_http_info} instead of this. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param audience_group_id [Integer, nil] The audience ID. + # @param upload_description [String, nil] The description to register with the job + # @see https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group-by-file + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def add_user_ids_to_audience: ( + file: File, + ?audience_group_id: Integer?, + ?upload_description: String? + ) -> (String?) + + # Create audience for uploading user IDs (by file). + # This requests to POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param description [String, nil] The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + # @param is_ifa_audience [bool, nil] To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + # @param upload_description [String, nil] The description to register for the job (in `jobs[].description`). + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group-by-file + # @return [Array(Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_audience_for_uploading_user_ids_with_http_info: ( + file: File, + ?description: String?, + ?is_ifa_audience: bool?, + ?upload_description: String? + ) -> ( + [Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse, 202, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create audience for uploading user IDs (by file). + # This requests to POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile + # When you want to get HTTP status code or response headers, use {#create_audience_for_uploading_user_ids_with_http_info} instead of this. + # + # @param file [File] A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 + # @param description [String, nil] The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 + # @param is_ifa_audience [bool, nil] To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. + # @param upload_description [String, nil] The description to register for the job (in `jobs[].description`). + # @see https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group-by-file + # @return [Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_audience_for_uploading_user_ids: ( + file: File, + ?description: String?, + ?is_ifa_audience: bool?, + ?upload_description: String? + ) -> (Line::Bot::V2::ManageAudience::CreateAudienceGroupResponse | String?) + + # Sends a message to multiple users at any time. + # This requests to POST https://api.line.me/v2/bot/message/broadcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param broadcast_request [Line::Bot::V2::MessagingApi::BroadcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def broadcast_with_http_info: ( + broadcast_request: Line::Bot::V2::MessagingApi::BroadcastRequest, + ?x_line_retry_key: String? + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 403, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 409, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 429, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Sends a message to multiple users at any time. + # This requests to POST https://api.line.me/v2/bot/message/broadcast + # When you want to get HTTP status code or response headers, use {#broadcast_with_http_info} instead of this. + # + # @param broadcast_request [Line::Bot::V2::MessagingApi::BroadcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def broadcast: ( + broadcast_request: Line::Bot::V2::MessagingApi::BroadcastRequest, + ?x_line_retry_key: String? + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Cancel default rich menu + # This requests to DELETE https://api.line.me/v2/bot/user/all/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu + # @return [Array((String|nil), 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 cancel_default_rich_menu_with_http_info: () -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Cancel default rich menu + # This requests to DELETE https://api.line.me/v2/bot/user/all/richmenu + # When you want to get HTTP status code or response headers, use {#cancel_default_rich_menu_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def cancel_default_rich_menu: () -> (String?) + + # Close coupon + # This requests to PUT https://api.line.me/v2/bot/coupon/{couponId}/close + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 410 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def close_coupon_with_http_info: ( + coupon_id: String + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 404, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 410, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Close coupon + # This requests to PUT https://api.line.me/v2/bot/coupon/{couponId}/close + # When you want to get HTTP status code or response headers, use {#close_coupon_with_http_info} instead of this. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 410 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def close_coupon: ( + coupon_id: String + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Create a new coupon. Define coupon details such as type, title, and validity period. + # This requests to POST https://api.line.me/v2/bot/coupon + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param coupon_create_request [Line::Bot::V2::MessagingApi::CouponCreateRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#create-coupon + # @return [Array(Line::Bot::V2::MessagingApi::CouponCreateResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_coupon_with_http_info: ( + ?coupon_create_request: Line::Bot::V2::MessagingApi::CouponCreateRequest? + ) -> ( + [Line::Bot::V2::MessagingApi::CouponCreateResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create a new coupon. Define coupon details such as type, title, and validity period. + # This requests to POST https://api.line.me/v2/bot/coupon + # When you want to get HTTP status code or response headers, use {#create_coupon_with_http_info} instead of this. + # + # @param coupon_create_request [Line::Bot::V2::MessagingApi::CouponCreateRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#create-coupon + # @return [Line::Bot::V2::MessagingApi::CouponCreateResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_coupon: ( + ?coupon_create_request: Line::Bot::V2::MessagingApi::CouponCreateRequest? + ) -> ( + Line::Bot::V2::MessagingApi::CouponCreateResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # Create rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuIdResponse, 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 create_rich_menu_with_http_info: ( + rich_menu_request: Line::Bot::V2::MessagingApi::RichMenuRequest + ) -> ( + [Line::Bot::V2::MessagingApi::RichMenuIdResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu + # When you want to get HTTP status code or response headers, use {#create_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu + # @return [Line::Bot::V2::MessagingApi::RichMenuIdResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_rich_menu: ( + rich_menu_request: Line::Bot::V2::MessagingApi::RichMenuRequest + ) -> (Line::Bot::V2::MessagingApi::RichMenuIdResponse | String?) + + # Create rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param create_rich_menu_alias_request [Line::Bot::V2::MessagingApi::CreateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def create_rich_menu_alias_with_http_info: ( + create_rich_menu_alias_request: Line::Bot::V2::MessagingApi::CreateRichMenuAliasRequest + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Create rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias + # When you want to get HTTP status code or response headers, use {#create_rich_menu_alias_with_http_info} instead of this. + # + # @param create_rich_menu_alias_request [Line::Bot::V2::MessagingApi::CreateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def create_rich_menu_alias: ( + create_rich_menu_alias_request: Line::Bot::V2::MessagingApi::CreateRichMenuAliasRequest + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Deletes a rich menu. + # This requests to DELETE https://api.line.me/v2/bot/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu + # @return [Array((String|nil), 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 delete_rich_menu_with_http_info: ( + rich_menu_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Deletes a rich menu. + # This requests to DELETE https://api.line.me/v2/bot/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#delete_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_rich_menu: ( + rich_menu_id: String + ) -> (String?) + + # Delete rich menu alias + # This requests to DELETE https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_alias_id [String] Rich menu alias ID that you want to delete. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def delete_rich_menu_alias_with_http_info: ( + rich_menu_alias_id: String + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Delete rich menu alias + # This requests to DELETE https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # When you want to get HTTP status code or response headers, use {#delete_rich_menu_alias_with_http_info} instead of this. + # + # @param rich_menu_alias_id [String] Rich menu alias ID that you want to delete. + # @see https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def delete_rich_menu_alias: ( + rich_menu_alias_id: String + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Get name list of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param limit [String, nil] The maximum number of aggregation units you can get per request. + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + # @see https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month + # @return [Array(Line::Bot::V2::MessagingApi::GetAggregationUnitNameListResponse, 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 get_aggregation_unit_name_list_with_http_info: ( + ?limit: String?, + ?start: String? + ) -> ( + [Line::Bot::V2::MessagingApi::GetAggregationUnitNameListResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get name list of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/list + # When you want to get HTTP status code or response headers, use {#get_aggregation_unit_name_list_with_http_info} instead of this. + # + # @param limit [String, nil] The maximum number of aggregation units you can get per request. + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all the aggregation units in one request, include this parameter to get the remaining array. + # @see https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month + # @return [Line::Bot::V2::MessagingApi::GetAggregationUnitNameListResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_aggregation_unit_name_list: ( + ?limit: String?, + ?start: String? + ) -> (Line::Bot::V2::MessagingApi::GetAggregationUnitNameListResponse | String?) + + # Get number of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/info + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month + # @return [Array(Line::Bot::V2::MessagingApi::GetAggregationUnitUsageResponse, 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 get_aggregation_unit_usage_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::GetAggregationUnitUsageResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of units used this month + # This requests to GET https://api.line.me/v2/bot/message/aggregation/info + # When you want to get HTTP status code or response headers, use {#get_aggregation_unit_usage_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month + # @return [Line::Bot::V2::MessagingApi::GetAggregationUnitUsageResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_aggregation_unit_usage: () -> (Line::Bot::V2::MessagingApi::GetAggregationUnitUsageResponse | String?) + + # Get bot info + # This requests to GET https://api.line.me/v2/bot/info + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-bot-info + # @return [Array(Line::Bot::V2::MessagingApi::BotInfoResponse, 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 get_bot_info_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::BotInfoResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get bot info + # This requests to GET https://api.line.me/v2/bot/info + # When you want to get HTTP status code or response headers, use {#get_bot_info_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-bot-info + # @return [Line::Bot::V2::MessagingApi::BotInfoResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_bot_info: () -> (Line::Bot::V2::MessagingApi::BotInfoResponse | String?) + + # Get coupon detail + # This requests to GET https://api.line.me/v2/bot/coupon/{couponId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupon + # @return [Array(Line::Bot::V2::MessagingApi::CouponResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_coupon_detail_with_http_info: ( + coupon_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::CouponResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get coupon detail + # This requests to GET https://api.line.me/v2/bot/coupon/{couponId} + # When you want to get HTTP status code or response headers, use {#get_coupon_detail_with_http_info} instead of this. + # + # @param coupon_id [String] + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupon + # @return [Line::Bot::V2::MessagingApi::CouponResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_coupon_detail: ( + coupon_id: String + ) -> (Line::Bot::V2::MessagingApi::CouponResponse | Line::Bot::V2::MessagingApi::ErrorResponse | String?) + + # Gets the ID of the default rich menu set with the Messaging API. + # This requests to GET https://api.line.me/v2/bot/user/all/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuIdResponse, 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 get_default_rich_menu_id_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::RichMenuIdResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets the ID of the default rich menu set with the Messaging API. + # This requests to GET https://api.line.me/v2/bot/user/all/richmenu + # When you want to get HTTP status code or response headers, use {#get_default_rich_menu_id_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id + # @return [Line::Bot::V2::MessagingApi::RichMenuIdResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_default_rich_menu_id: () -> (Line::Bot::V2::MessagingApi::RichMenuIdResponse | String?) + + # Get a list of users who added your LINE Official Account as a friend + # This requests to GET https://api.line.me/v2/bot/followers/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + # @param limit [Integer, nil] The maximum number of user IDs to retrieve in a single request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-follower-ids + # @return [Array(Line::Bot::V2::MessagingApi::GetFollowersResponse, 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 get_followers_with_http_info: ( + ?start: String?, + ?limit: Integer? + ) -> ( + [Line::Bot::V2::MessagingApi::GetFollowersResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get a list of users who added your LINE Official Account as a friend + # This requests to GET https://api.line.me/v2/bot/followers/ids + # When you want to get HTTP status code or response headers, use {#get_followers_with_http_info} instead of this. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs. + # @param limit [Integer, nil] The maximum number of user IDs to retrieve in a single request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-follower-ids + # @return [Line::Bot::V2::MessagingApi::GetFollowersResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_followers: ( + ?start: String?, + ?limit: Integer? + ) -> (Line::Bot::V2::MessagingApi::GetFollowersResponse | String?) + + # Get number of users in a group chat + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/count + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-group-count + # @return [Array(Line::Bot::V2::MessagingApi::GroupMemberCountResponse, 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 get_group_member_count_with_http_info: ( + group_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::GroupMemberCountResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of users in a group chat + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/count + # When you want to get HTTP status code or response headers, use {#get_group_member_count_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-group-count + # @return [Line::Bot::V2::MessagingApi::GroupMemberCountResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_member_count: ( + group_id: String + ) -> (Line::Bot::V2::MessagingApi::GroupMemberCountResponse | String?) + + # Get group chat member profile + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/member/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile + # @return [Array(Line::Bot::V2::MessagingApi::GroupUserProfileResponse, 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 get_group_member_profile_with_http_info: ( + group_id: String, + user_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::GroupUserProfileResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get group chat member profile + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/member/{userId} + # When you want to get HTTP status code or response headers, use {#get_group_member_profile_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile + # @return [Line::Bot::V2::MessagingApi::GroupUserProfileResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_member_profile: ( + group_id: String, + user_id: String + ) -> (Line::Bot::V2::MessagingApi::GroupUserProfileResponse | String?) + + # Get group chat member user IDs + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids + # @return [Array(Line::Bot::V2::MessagingApi::MembersIdsResponse, 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 get_group_members_ids_with_http_info: ( + group_id: String, + ?start: String? + ) -> ( + [Line::Bot::V2::MessagingApi::MembersIdsResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get group chat member user IDs + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/members/ids + # When you want to get HTTP status code or response headers, use {#get_group_members_ids_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids + # @return [Line::Bot::V2::MessagingApi::MembersIdsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_members_ids: ( + group_id: String, + ?start: String? + ) -> (Line::Bot::V2::MessagingApi::MembersIdsResponse | String?) + + # Get group chat summary + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/summary + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-summary + # @return [Array(Line::Bot::V2::MessagingApi::GroupSummaryResponse, 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 get_group_summary_with_http_info: ( + group_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::GroupSummaryResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get group chat summary + # This requests to GET https://api.line.me/v2/bot/group/{groupId}/summary + # When you want to get HTTP status code or response headers, use {#get_group_summary_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-group-summary + # @return [Line::Bot::V2::MessagingApi::GroupSummaryResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_group_summary: ( + group_id: String + ) -> (Line::Bot::V2::MessagingApi::GroupSummaryResponse | String?) + + # Get a list of user IDs who joined the membership. + # This requests to GET https://api.line.me/v2/bot/membership/{membershipId}/users/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param membership_id [Integer] Membership plan ID. + # @param start [String, nil] A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + # @param limit [Integer, nil] The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-user-ids + # @return [Array(Line::Bot::V2::MessagingApi::GetJoinedMembershipUsersResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_joined_membership_users_with_http_info: ( + membership_id: Integer, + ?start: String?, + ?limit: Integer? + ) -> ( + [Line::Bot::V2::MessagingApi::GetJoinedMembershipUsersResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get a list of user IDs who joined the membership. + # This requests to GET https://api.line.me/v2/bot/membership/{membershipId}/users/ids + # When you want to get HTTP status code or response headers, use {#get_joined_membership_users_with_http_info} instead of this. + # + # @param membership_id [Integer] Membership plan ID. + # @param start [String, nil] A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds). + # @param limit [Integer, nil] The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000. + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-user-ids + # @return [Line::Bot::V2::MessagingApi::GetJoinedMembershipUsersResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_joined_membership_users: ( + membership_id: Integer, + ?start: String?, + ?limit: Integer? + ) -> ( + Line::Bot::V2::MessagingApi::GetJoinedMembershipUsersResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # Get a list of memberships. + # This requests to GET https://api.line.me/v2/bot/membership/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-plans + # @return [Array(Line::Bot::V2::MessagingApi::MembershipListResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_membership_list_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::MembershipListResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get a list of memberships. + # This requests to GET https://api.line.me/v2/bot/membership/list + # When you want to get HTTP status code or response headers, use {#get_membership_list_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-membership-plans + # @return [Line::Bot::V2::MessagingApi::MembershipListResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_membership_list: () -> ( + Line::Bot::V2::MessagingApi::MembershipListResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # Get a user's membership subscription. + # This requests to GET https://api.line.me/v2/bot/membership/subscription/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status + # @return [Array(Line::Bot::V2::MessagingApi::GetMembershipSubscriptionResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def get_membership_subscription_with_http_info: ( + user_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::GetMembershipSubscriptionResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get a user's membership subscription. + # This requests to GET https://api.line.me/v2/bot/membership/subscription/{userId} + # When you want to get HTTP status code or response headers, use {#get_membership_subscription_with_http_info} instead of this. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status + # @return [Line::Bot::V2::MessagingApi::GetMembershipSubscriptionResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_membership_subscription: ( + user_id: String + ) -> ( + Line::Bot::V2::MessagingApi::GetMembershipSubscriptionResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + # This requests to GET https://api.line.me/v2/bot/message/quota + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-quota + # @return [Array(Line::Bot::V2::MessagingApi::MessageQuotaResponse, 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 get_message_quota_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::MessageQuotaResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned. + # This requests to GET https://api.line.me/v2/bot/message/quota + # When you want to get HTTP status code or response headers, use {#get_message_quota_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-quota + # @return [Line::Bot::V2::MessagingApi::MessageQuotaResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_quota: () -> (Line::Bot::V2::MessagingApi::MessageQuotaResponse | String?) + + # Gets the number of messages sent in the current month. + # This requests to GET https://api.line.me/v2/bot/message/quota/consumption + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-consumption + # @return [Array(Line::Bot::V2::MessagingApi::QuotaConsumptionResponse, 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 get_message_quota_consumption_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::QuotaConsumptionResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets the number of messages sent in the current month. + # This requests to GET https://api.line.me/v2/bot/message/quota/consumption + # When you want to get HTTP status code or response headers, use {#get_message_quota_consumption_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-consumption + # @return [Line::Bot::V2::MessagingApi::QuotaConsumptionResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_quota_consumption: () -> (Line::Bot::V2::MessagingApi::QuotaConsumptionResponse | String?) + + # Gets the status of a narrowcast message. + # This requests to GET https://api.line.me/v2/bot/message/progress/narrowcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param request_id [String] The narrowcast message's request ID. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status + # @return [Array(Line::Bot::V2::MessagingApi::NarrowcastProgressResponse, 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 get_narrowcast_progress_with_http_info: ( + request_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::NarrowcastProgressResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets the status of a narrowcast message. + # This requests to GET https://api.line.me/v2/bot/message/progress/narrowcast + # When you want to get HTTP status code or response headers, use {#get_narrowcast_progress_with_http_info} instead of this. + # + # @param request_id [String] The narrowcast message's request ID. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status + # @return [Line::Bot::V2::MessagingApi::NarrowcastProgressResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_narrowcast_progress: ( + request_id: String + ) -> (Line::Bot::V2::MessagingApi::NarrowcastProgressResponse | String?) + + # Get number of sent broadcast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/broadcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-broadcast-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_broadcast_messages_with_http_info: ( + date: String + ) -> ( + [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of sent broadcast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/broadcast + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_broadcast_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-broadcast-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_broadcast_messages: ( + date: String + ) -> (Line::Bot::V2::MessagingApi::NumberOfMessagesResponse | String?) + + # Get number of sent multicast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/multicast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-multicast-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_multicast_messages_with_http_info: ( + date: String + ) -> ( + [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of sent multicast messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/multicast + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_multicast_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-multicast-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_multicast_messages: ( + date: String + ) -> (Line::Bot::V2::MessagingApi::NumberOfMessagesResponse | String?) + + # Get number of sent push messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-push-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_push_messages_with_http_info: ( + date: String + ) -> ( + [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of sent push messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/push + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_push_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-push-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_push_messages: ( + date: String + ) -> (Line::Bot::V2::MessagingApi::NumberOfMessagesResponse | String?) + + # Get number of sent reply messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/reply + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-reply-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_number_of_sent_reply_messages_with_http_info: ( + date: String + ) -> ( + [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of sent reply messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/reply + # When you want to get HTTP status code or response headers, use {#get_number_of_sent_reply_messages_with_http_info} instead of this. + # + # @param date [String] Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9 + # @see https://developers.line.biz/en/reference/messaging-api/#get-number-of-reply-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_number_of_sent_reply_messages: ( + date: String + ) -> (Line::Bot::V2::MessagingApi::NumberOfMessagesResponse | String?) + + # Get number of sent LINE notification messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/pnp + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages + # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 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 get_pnp_message_statistics_with_http_info: ( + date: String + ) -> ( + [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of sent LINE notification messages + # This requests to GET https://api.line.me/v2/bot/message/delivery/pnp + # When you want to get HTTP status code or response headers, use {#get_pnp_message_statistics_with_http_info} instead of this. + # + # @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9 + # @see https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages + # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_pnp_message_statistics: ( + date: String + ) -> (Line::Bot::V2::MessagingApi::NumberOfMessagesResponse | String?) + + # Get profile + # This requests to GET https://api.line.me/v2/bot/profile/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-profile + # @return [Array(Line::Bot::V2::MessagingApi::UserProfileResponse, 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 get_profile_with_http_info: ( + user_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::UserProfileResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get profile + # This requests to GET https://api.line.me/v2/bot/profile/{userId} + # When you want to get HTTP status code or response headers, use {#get_profile_with_http_info} instead of this. + # + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-profile + # @return [Line::Bot::V2::MessagingApi::UserProfileResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_profile: ( + user_id: String + ) -> (Line::Bot::V2::MessagingApi::UserProfileResponse | String?) + + # Gets a rich menu via a rich menu ID. + # This requests to GET https://api.line.me/v2/bot/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuResponse, 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 get_rich_menu_with_http_info: ( + rich_menu_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::RichMenuResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets a rich menu via a rich menu ID. + # This requests to GET https://api.line.me/v2/bot/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#get_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu + # @return [Line::Bot::V2::MessagingApi::RichMenuResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu: ( + rich_menu_id: String + ) -> (Line::Bot::V2::MessagingApi::RichMenuResponse | String?) + + # Get rich menu alias information + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_alias_id [String] The rich menu alias ID whose information you want to obtain. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuAliasResponse, 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 get_rich_menu_alias_with_http_info: ( + rich_menu_alias_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::RichMenuAliasResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get rich menu alias information + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # When you want to get HTTP status code or response headers, use {#get_rich_menu_alias_with_http_info} instead of this. + # + # @param rich_menu_alias_id [String] The rich menu alias ID whose information you want to obtain. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id + # @return [Line::Bot::V2::MessagingApi::RichMenuAliasResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_alias: ( + rich_menu_alias_id: String + ) -> (Line::Bot::V2::MessagingApi::RichMenuAliasResponse | String?) + + # Get list of rich menu alias + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuAliasListResponse, 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 get_rich_menu_alias_list_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::RichMenuAliasListResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get list of rich menu alias + # This requests to GET https://api.line.me/v2/bot/richmenu/alias/list + # When you want to get HTTP status code or response headers, use {#get_rich_menu_alias_list_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list + # @return [Line::Bot::V2::MessagingApi::RichMenuAliasListResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_alias_list: () -> (Line::Bot::V2::MessagingApi::RichMenuAliasListResponse | String?) + + # Get the status of Replace or unlink a linked rich menus in batches. + # This requests to GET https://api.line.me/v2/bot/richmenu/progress/batch + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param request_id [String] A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-batch-control-rich-menus-progress-status + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuBatchProgressResponse, 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 get_rich_menu_batch_progress_with_http_info: ( + request_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::RichMenuBatchProgressResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get the status of Replace or unlink a linked rich menus in batches. + # This requests to GET https://api.line.me/v2/bot/richmenu/progress/batch + # When you want to get HTTP status code or response headers, use {#get_rich_menu_batch_progress_with_http_info} instead of this. + # + # @param request_id [String] A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID. + # @see https://developers.line.biz/en/reference/messaging-api/#get-batch-control-rich-menus-progress-status + # @return [Line::Bot::V2::MessagingApi::RichMenuBatchProgressResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_batch_progress: ( + request_id: String + ) -> (Line::Bot::V2::MessagingApi::RichMenuBatchProgressResponse | String?) + + # Get rich menu ID of user + # This requests to GET https://api.line.me/v2/bot/user/{userId}/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuIdResponse, 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 get_rich_menu_id_of_user_with_http_info: ( + user_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::RichMenuIdResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get rich menu ID of user + # This requests to GET https://api.line.me/v2/bot/user/{userId}/richmenu + # When you want to get HTTP status code or response headers, use {#get_rich_menu_id_of_user_with_http_info} instead of this. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user + # @return [Line::Bot::V2::MessagingApi::RichMenuIdResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_id_of_user: ( + user_id: String + ) -> (Line::Bot::V2::MessagingApi::RichMenuIdResponse | String?) + + # Get rich menu list + # This requests to GET https://api.line.me/v2/bot/richmenu/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list + # @return [Array(Line::Bot::V2::MessagingApi::RichMenuListResponse, 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 get_rich_menu_list_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::RichMenuListResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get rich menu list + # This requests to GET https://api.line.me/v2/bot/richmenu/list + # When you want to get HTTP status code or response headers, use {#get_rich_menu_list_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list + # @return [Line::Bot::V2::MessagingApi::RichMenuListResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_list: () -> (Line::Bot::V2::MessagingApi::RichMenuListResponse | String?) + + # Get number of users in a multi-person chat + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/count + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-room-count + # @return [Array(Line::Bot::V2::MessagingApi::RoomMemberCountResponse, 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 get_room_member_count_with_http_info: ( + room_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::RoomMemberCountResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get number of users in a multi-person chat + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/count + # When you want to get HTTP status code or response headers, use {#get_room_member_count_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-members-room-count + # @return [Line::Bot::V2::MessagingApi::RoomMemberCountResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_room_member_count: ( + room_id: String + ) -> (Line::Bot::V2::MessagingApi::RoomMemberCountResponse | String?) + + # Get multi-person chat member profile + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/member/{userId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile + # @return [Array(Line::Bot::V2::MessagingApi::RoomUserProfileResponse, 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 get_room_member_profile_with_http_info: ( + room_id: String, + user_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::RoomUserProfileResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get multi-person chat member profile + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/member/{userId} + # When you want to get HTTP status code or response headers, use {#get_room_member_profile_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @param user_id [String] User ID + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile + # @return [Line::Bot::V2::MessagingApi::RoomUserProfileResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_room_member_profile: ( + room_id: String, + user_id: String + ) -> (Line::Bot::V2::MessagingApi::RoomUserProfileResponse | String?) + + # Get multi-person chat member user IDs + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/ids + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids + # @return [Array(Line::Bot::V2::MessagingApi::MembersIdsResponse, 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 get_room_members_ids_with_http_info: ( + room_id: String, + ?start: String? + ) -> ( + [Line::Bot::V2::MessagingApi::MembersIdsResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get multi-person chat member user IDs + # This requests to GET https://api.line.me/v2/bot/room/{roomId}/members/ids + # When you want to get HTTP status code or response headers, use {#get_room_members_ids_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @param start [String, nil] Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group. + # @see https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids + # @return [Line::Bot::V2::MessagingApi::MembersIdsResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_room_members_ids: ( + room_id: String, + ?start: String? + ) -> (Line::Bot::V2::MessagingApi::MembersIdsResponse | String?) + + # Get webhook endpoint information + # This requests to GET https://api.line.me/v2/bot/channel/webhook/endpoint + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information + # @return [Array(Line::Bot::V2::MessagingApi::GetWebhookEndpointResponse, 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 get_webhook_endpoint_with_http_info: () -> ( + [Line::Bot::V2::MessagingApi::GetWebhookEndpointResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get webhook endpoint information + # This requests to GET https://api.line.me/v2/bot/channel/webhook/endpoint + # When you want to get HTTP status code or response headers, use {#get_webhook_endpoint_with_http_info} instead of this. + # + # @see https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information + # @return [Line::Bot::V2::MessagingApi::GetWebhookEndpointResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_webhook_endpoint: () -> (Line::Bot::V2::MessagingApi::GetWebhookEndpointResponse | String?) + + # Issue link token + # This requests to POST https://api.line.me/v2/bot/user/{userId}/linkToken + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-link-token + # @return [Array(Line::Bot::V2::MessagingApi::IssueLinkTokenResponse, 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_link_token_with_http_info: ( + user_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::IssueLinkTokenResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Issue link token + # This requests to POST https://api.line.me/v2/bot/user/{userId}/linkToken + # When you want to get HTTP status code or response headers, use {#issue_link_token_with_http_info} instead of this. + # + # @param user_id [String] User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#issue-link-token + # @return [Line::Bot::V2::MessagingApi::IssueLinkTokenResponse] 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_link_token: ( + user_id: String + ) -> (Line::Bot::V2::MessagingApi::IssueLinkTokenResponse | String?) + + # Leave group chat + # This requests to POST https://api.line.me/v2/bot/group/{groupId}/leave + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-group + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def leave_group_with_http_info: ( + group_id: String + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 404, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Leave group chat + # This requests to POST https://api.line.me/v2/bot/group/{groupId}/leave + # When you want to get HTTP status code or response headers, use {#leave_group_with_http_info} instead of this. + # + # @param group_id [String] Group ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-group + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def leave_group: ( + group_id: String + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Leave multi-person chat + # This requests to POST https://api.line.me/v2/bot/room/{roomId}/leave + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-room + # @return [Array((String|nil), 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 leave_room_with_http_info: ( + room_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Leave multi-person chat + # This requests to POST https://api.line.me/v2/bot/room/{roomId}/leave + # When you want to get HTTP status code or response headers, use {#leave_room_with_http_info} instead of this. + # + # @param room_id [String] Room ID + # @see https://developers.line.biz/en/reference/messaging-api/#leave-room + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def leave_room: ( + room_id: String + ) -> (String?) + + # Link rich menu to user. + # This requests to POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user + # @return [Array((String|nil), 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 link_rich_menu_id_to_user_with_http_info: ( + user_id: String, + rich_menu_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Link rich menu to user. + # This requests to POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#link_rich_menu_id_to_user_with_http_info} instead of this. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def link_rich_menu_id_to_user: ( + user_id: String, + rich_menu_id: String + ) -> (String?) + + # Link rich menu to multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/link + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_bulk_link_request [Line::Bot::V2::MessagingApi::RichMenuBulkLinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def link_rich_menu_id_to_users_with_http_info: ( + rich_menu_bulk_link_request: Line::Bot::V2::MessagingApi::RichMenuBulkLinkRequest + ) -> ([String?, 202, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Link rich menu to multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/link + # When you want to get HTTP status code or response headers, use {#link_rich_menu_id_to_users_with_http_info} instead of this. + # + # @param rich_menu_bulk_link_request [Line::Bot::V2::MessagingApi::RichMenuBulkLinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def link_rich_menu_id_to_users: ( + rich_menu_bulk_link_request: Line::Bot::V2::MessagingApi::RichMenuBulkLinkRequest + ) -> (String?) + + # Get a paginated list of coupons. + # This requests to GET https://api.line.me/v2/bot/coupon + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param status [Array[String], nil] Filter coupons by their status. + # @param start [String, nil] Pagination token to retrieve the next page of results. + # @param limit [Integer, nil] Maximum number of coupons to return per request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupons-list + # @return [Array(Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def list_coupon_with_http_info: ( + ?status: Array[String]?, + ?start: String?, + ?limit: Integer? + ) -> ( + [Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Get a paginated list of coupons. + # This requests to GET https://api.line.me/v2/bot/coupon + # When you want to get HTTP status code or response headers, use {#list_coupon_with_http_info} instead of this. + # + # @param status [Array[String], nil] Filter coupons by their status. + # @param start [String, nil] Pagination token to retrieve the next page of results. + # @param limit [Integer, nil] Maximum number of coupons to return per request. + # @see https://developers.line.biz/en/reference/messaging-api/#get-coupons-list + # @return [Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def list_coupon: ( + ?status: Array[String]?, + ?start: String?, + ?limit: Integer? + ) -> ( + Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # Mark messages from users as read + # This requests to POST https://api.line.me/v2/bot/message/markAsRead + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param mark_messages_as_read_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read + # @return [Array((String|nil), 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 mark_messages_as_read_with_http_info: ( + mark_messages_as_read_request: Line::Bot::V2::MessagingApi::MarkMessagesAsReadRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Mark messages from users as read + # This requests to POST https://api.line.me/v2/bot/message/markAsRead + # When you want to get HTTP status code or response headers, use {#mark_messages_as_read_with_http_info} instead of this. + # + # @param mark_messages_as_read_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def mark_messages_as_read: ( + mark_messages_as_read_request: Line::Bot::V2::MessagingApi::MarkMessagesAsReadRequest + ) -> (String?) + + # Mark messages from users as read by token + # This requests to POST https://api.line.me/v2/bot/chat/markAsRead + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param mark_messages_as_read_by_token_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadByTokenRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#mark-as-read + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def mark_messages_as_read_by_token_with_http_info: ( + mark_messages_as_read_by_token_request: Line::Bot::V2::MessagingApi::MarkMessagesAsReadByTokenRequest + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Mark messages from users as read by token + # This requests to POST https://api.line.me/v2/bot/chat/markAsRead + # When you want to get HTTP status code or response headers, use {#mark_messages_as_read_by_token_with_http_info} instead of this. + # + # @param mark_messages_as_read_by_token_request [Line::Bot::V2::MessagingApi::MarkMessagesAsReadByTokenRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#mark-as-read + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def mark_messages_as_read_by_token: ( + mark_messages_as_read_by_token_request: Line::Bot::V2::MessagingApi::MarkMessagesAsReadByTokenRequest + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + # This requests to POST https://api.line.me/v2/bot/message/multicast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param multicast_request [Line::Bot::V2::MessagingApi::MulticastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-multicast-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def multicast_with_http_info: ( + multicast_request: Line::Bot::V2::MessagingApi::MulticastRequest, + ?x_line_retry_key: String? + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 403, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 409, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 429, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats. + # This requests to POST https://api.line.me/v2/bot/message/multicast + # When you want to get HTTP status code or response headers, use {#multicast_with_http_info} instead of this. + # + # @param multicast_request [Line::Bot::V2::MessagingApi::MulticastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-multicast-message + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def multicast: ( + multicast_request: Line::Bot::V2::MessagingApi::MulticastRequest, + ?x_line_retry_key: String? + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Send narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/narrowcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param narrowcast_request [Line::Bot::V2::MessagingApi::NarrowcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def narrowcast_with_http_info: ( + narrowcast_request: Line::Bot::V2::MessagingApi::NarrowcastRequest, + ?x_line_retry_key: String? + ) -> ( + [String?, 202, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 403, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 409, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 429, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Send narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/narrowcast + # When you want to get HTTP status code or response headers, use {#narrowcast_with_http_info} instead of this. + # + # @param narrowcast_request [Line::Bot::V2::MessagingApi::NarrowcastRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message + # @return [String, nil] when HTTP status code is 202 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def narrowcast: ( + narrowcast_request: Line::Bot::V2::MessagingApi::NarrowcastRequest, + ?x_line_retry_key: String? + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Sends a message to a user, group chat, or multi-person chat at any time. + # This requests to POST https://api.line.me/v2/bot/message/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param push_message_request [Line::Bot::V2::MessagingApi::PushMessageRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-push-message + # @return [Array(Line::Bot::V2::MessagingApi::PushMessageResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 403 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 409 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def push_message_with_http_info: ( + push_message_request: Line::Bot::V2::MessagingApi::PushMessageRequest, + ?x_line_retry_key: String? + ) -> ( + [Line::Bot::V2::MessagingApi::PushMessageResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 403, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 409, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 429, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Sends a message to a user, group chat, or multi-person chat at any time. + # This requests to POST https://api.line.me/v2/bot/message/push + # When you want to get HTTP status code or response headers, use {#push_message_with_http_info} instead of this. + # + # @param push_message_request [Line::Bot::V2::MessagingApi::PushMessageRequest] + # @param x_line_retry_key [String, nil] Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn't generated by LINE. Each developer must generate their own retry key. + # @see https://developers.line.biz/en/reference/messaging-api/#send-push-message + # @return [Line::Bot::V2::MessagingApi::PushMessageResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 403 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 409 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def push_message: ( + push_message_request: Line::Bot::V2::MessagingApi::PushMessageRequest, + ?x_line_retry_key: String? + ) -> ( + Line::Bot::V2::MessagingApi::PushMessageResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # Send LINE notification message + # This requests to POST https://api.line.me/bot/pnp/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param pnp_messages_request [Line::Bot::V2::MessagingApi::PnpMessagesRequest] + # @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook. + # @see https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 422 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def push_messages_by_phone_with_http_info: ( + pnp_messages_request: Line::Bot::V2::MessagingApi::PnpMessagesRequest, + ?x_line_delivery_tag: String? + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 422, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Send LINE notification message + # This requests to POST https://api.line.me/bot/pnp/push + # When you want to get HTTP status code or response headers, use {#push_messages_by_phone_with_http_info} instead of this. + # + # @param pnp_messages_request [Line::Bot::V2::MessagingApi::PnpMessagesRequest] + # @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook. + # @see https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 422 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def push_messages_by_phone: ( + pnp_messages_request: Line::Bot::V2::MessagingApi::PnpMessagesRequest, + ?x_line_delivery_tag: String? + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Send reply message + # This requests to POST https://api.line.me/v2/bot/message/reply + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param reply_message_request [Line::Bot::V2::MessagingApi::ReplyMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#send-reply-message + # @return [Array(Line::Bot::V2::MessagingApi::ReplyMessageResponse, Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 429 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def reply_message_with_http_info: ( + reply_message_request: Line::Bot::V2::MessagingApi::ReplyMessageRequest + ) -> ( + [Line::Bot::V2::MessagingApi::ReplyMessageResponse, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 429, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Send reply message + # This requests to POST https://api.line.me/v2/bot/message/reply + # When you want to get HTTP status code or response headers, use {#reply_message_with_http_info} instead of this. + # + # @param reply_message_request [Line::Bot::V2::MessagingApi::ReplyMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#send-reply-message + # @return [Line::Bot::V2::MessagingApi::ReplyMessageResponse] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 429 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def reply_message: ( + reply_message_request: Line::Bot::V2::MessagingApi::ReplyMessageRequest + ) -> ( + Line::Bot::V2::MessagingApi::ReplyMessageResponse + | Line::Bot::V2::MessagingApi::ErrorResponse + | String? + ) + + # You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu/batch + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def rich_menu_batch_with_http_info: ( + rich_menu_batch_request: Line::Bot::V2::MessagingApi::RichMenuBatchRequest + ) -> ([String?, 202, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu + # This requests to POST https://api.line.me/v2/bot/richmenu/batch + # When you want to get HTTP status code or response headers, use {#rich_menu_batch_with_http_info} instead of this. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def rich_menu_batch: ( + rich_menu_batch_request: Line::Bot::V2::MessagingApi::RichMenuBatchRequest + ) -> (String?) + + # Set default rich menu + # This requests to POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu + # @return [Array((String|nil), 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 set_default_rich_menu_with_http_info: ( + rich_menu_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Set default rich menu + # This requests to POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId} + # When you want to get HTTP status code or response headers, use {#set_default_rich_menu_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of a rich menu + # @see https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def set_default_rich_menu: ( + rich_menu_id: String + ) -> (String?) + + # Set webhook endpoint URL + # This requests to PUT https://api.line.me/v2/bot/channel/webhook/endpoint + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param set_webhook_endpoint_request [Line::Bot::V2::MessagingApi::SetWebhookEndpointRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url + # @return [Array((String|nil), 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 set_webhook_endpoint_with_http_info: ( + set_webhook_endpoint_request: Line::Bot::V2::MessagingApi::SetWebhookEndpointRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Set webhook endpoint URL + # This requests to PUT https://api.line.me/v2/bot/channel/webhook/endpoint + # When you want to get HTTP status code or response headers, use {#set_webhook_endpoint_with_http_info} instead of this. + # + # @param set_webhook_endpoint_request [Line::Bot::V2::MessagingApi::SetWebhookEndpointRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def set_webhook_endpoint: ( + set_webhook_endpoint_request: Line::Bot::V2::MessagingApi::SetWebhookEndpointRequest + ) -> (String?) + + # Display a loading animation in one-on-one chats between users and LINE Official Accounts. + # This requests to POST https://api.line.me/v2/bot/chat/loading/start + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param show_loading_animation_request [Line::Bot::V2::MessagingApi::ShowLoadingAnimationRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def show_loading_animation_with_http_info: ( + show_loading_animation_request: Line::Bot::V2::MessagingApi::ShowLoadingAnimationRequest + ) -> ( + [String?, 202, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Display a loading animation in one-on-one chats between users and LINE Official Accounts. + # This requests to POST https://api.line.me/v2/bot/chat/loading/start + # When you want to get HTTP status code or response headers, use {#show_loading_animation_with_http_info} instead of this. + # + # @param show_loading_animation_request [Line::Bot::V2::MessagingApi::ShowLoadingAnimationRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator + # @return [String, nil] when HTTP status code is 202 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def show_loading_animation: ( + show_loading_animation_request: Line::Bot::V2::MessagingApi::ShowLoadingAnimationRequest + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Test webhook endpoint + # This requests to POST https://api.line.me/v2/bot/channel/webhook/test + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param test_webhook_endpoint_request [Line::Bot::V2::MessagingApi::TestWebhookEndpointRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint + # @return [Array(Line::Bot::V2::MessagingApi::TestWebhookEndpointResponse, 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 test_webhook_endpoint_with_http_info: ( + ?test_webhook_endpoint_request: Line::Bot::V2::MessagingApi::TestWebhookEndpointRequest? + ) -> ( + [Line::Bot::V2::MessagingApi::TestWebhookEndpointResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Test webhook endpoint + # This requests to POST https://api.line.me/v2/bot/channel/webhook/test + # When you want to get HTTP status code or response headers, use {#test_webhook_endpoint_with_http_info} instead of this. + # + # @param test_webhook_endpoint_request [Line::Bot::V2::MessagingApi::TestWebhookEndpointRequest, nil] + # @see https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint + # @return [Line::Bot::V2::MessagingApi::TestWebhookEndpointResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def test_webhook_endpoint: ( + ?test_webhook_endpoint_request: Line::Bot::V2::MessagingApi::TestWebhookEndpointRequest? + ) -> (Line::Bot::V2::MessagingApi::TestWebhookEndpointResponse | String?) + + # Unlink rich menu from user + # This requests to DELETE https://api.line.me/v2/bot/user/{userId}/richmenu + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user + # @return [Array((String|nil), 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 unlink_rich_menu_id_from_user_with_http_info: ( + user_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Unlink rich menu from user + # This requests to DELETE https://api.line.me/v2/bot/user/{userId}/richmenu + # When you want to get HTTP status code or response headers, use {#unlink_rich_menu_id_from_user_with_http_info} instead of this. + # + # @param user_id [String] User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE. + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def unlink_rich_menu_id_from_user: ( + user_id: String + ) -> (String?) + + # Unlink rich menus from multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/unlink + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_bulk_unlink_request [Line::Bot::V2::MessagingApi::RichMenuBulkUnlinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def unlink_rich_menu_id_from_users_with_http_info: ( + rich_menu_bulk_unlink_request: Line::Bot::V2::MessagingApi::RichMenuBulkUnlinkRequest + ) -> ([String?, 202, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Unlink rich menus from multiple users + # This requests to POST https://api.line.me/v2/bot/richmenu/bulk/unlink + # When you want to get HTTP status code or response headers, use {#unlink_rich_menu_id_from_users_with_http_info} instead of this. + # + # @param rich_menu_bulk_unlink_request [Line::Bot::V2::MessagingApi::RichMenuBulkUnlinkRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users + # @return [String, nil] when HTTP status code is 202 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def unlink_rich_menu_id_from_users: ( + rich_menu_bulk_unlink_request: Line::Bot::V2::MessagingApi::RichMenuBulkUnlinkRequest + ) -> (String?) + + # Update rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_alias_id [String] The rich menu alias ID you want to update. + # @param update_rich_menu_alias_request [Line::Bot::V2::MessagingApi::UpdateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias + # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200 + # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400 + # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself. + def update_rich_menu_alias_with_http_info: ( + rich_menu_alias_id: String, + update_rich_menu_alias_request: Line::Bot::V2::MessagingApi::UpdateRichMenuAliasRequest + ) -> ( + [String?, 200, Hash[untyped, untyped]] + | [Line::Bot::V2::MessagingApi::ErrorResponse, 400, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Update rich menu alias + # This requests to POST https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId} + # When you want to get HTTP status code or response headers, use {#update_rich_menu_alias_with_http_info} instead of this. + # + # @param rich_menu_alias_id [String] The rich menu alias ID you want to update. + # @param update_rich_menu_alias_request [Line::Bot::V2::MessagingApi::UpdateRichMenuAliasRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias + # @return [String, nil] when HTTP status code is 200 + # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def update_rich_menu_alias: ( + rich_menu_alias_id: String, + update_rich_menu_alias_request: Line::Bot::V2::MessagingApi::UpdateRichMenuAliasRequest + ) -> (String? | Line::Bot::V2::MessagingApi::ErrorResponse) + + # Validate message objects of a broadcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/broadcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message + # @return [Array((String|nil), 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 validate_broadcast_with_http_info: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate message objects of a broadcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/broadcast + # When you want to get HTTP status code or response headers, use {#validate_broadcast_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_broadcast: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> (String?) + + # Validate message objects of a multicast message + # This requests to POST https://api.line.me/v2/bot/message/validate/multicast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message + # @return [Array((String|nil), 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 validate_multicast_with_http_info: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate message objects of a multicast message + # This requests to POST https://api.line.me/v2/bot/message/validate/multicast + # When you want to get HTTP status code or response headers, use {#validate_multicast_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_multicast: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> (String?) + + # Validate message objects of a narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/narrowcast + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message + # @return [Array((String|nil), 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 validate_narrowcast_with_http_info: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate message objects of a narrowcast message + # This requests to POST https://api.line.me/v2/bot/message/validate/narrowcast + # When you want to get HTTP status code or response headers, use {#validate_narrowcast_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_narrowcast: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> (String?) + + # Validate message objects of a push message + # This requests to POST https://api.line.me/v2/bot/message/validate/push + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message + # @return [Array((String|nil), 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 validate_push_with_http_info: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate message objects of a push message + # This requests to POST https://api.line.me/v2/bot/message/validate/push + # When you want to get HTTP status code or response headers, use {#validate_push_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_push: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> (String?) + + # Validate message objects of a reply message + # This requests to POST https://api.line.me/v2/bot/message/validate/reply + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message + # @return [Array((String|nil), 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 validate_reply_with_http_info: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate message objects of a reply message + # This requests to POST https://api.line.me/v2/bot/message/validate/reply + # When you want to get HTTP status code or response headers, use {#validate_reply_with_http_info} instead of this. + # + # @param validate_message_request [Line::Bot::V2::MessagingApi::ValidateMessageRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_reply: ( + validate_message_request: Line::Bot::V2::MessagingApi::ValidateMessageRequest + ) -> (String?) + + # Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + # This requests to POST https://api.line.me/v2/bot/richmenu/validate/batch + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request + # @return [Array((String|nil), 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 validate_rich_menu_batch_request_with_http_info: ( + rich_menu_batch_request: Line::Bot::V2::MessagingApi::RichMenuBatchRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate a request body of the Replace or unlink the linked rich menus in batches endpoint. + # This requests to POST https://api.line.me/v2/bot/richmenu/validate/batch + # When you want to get HTTP status code or response headers, use {#validate_rich_menu_batch_request_with_http_info} instead of this. + # + # @param rich_menu_batch_request [Line::Bot::V2::MessagingApi::RichMenuBatchRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_rich_menu_batch_request: ( + rich_menu_batch_request: Line::Bot::V2::MessagingApi::RichMenuBatchRequest + ) -> (String?) + + # Validate rich menu object + # This requests to POST https://api.line.me/v2/bot/richmenu/validate + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object + # @return [Array((String|nil), 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 validate_rich_menu_object_with_http_info: ( + rich_menu_request: Line::Bot::V2::MessagingApi::RichMenuRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Validate rich menu object + # This requests to POST https://api.line.me/v2/bot/richmenu/validate + # When you want to get HTTP status code or response headers, use {#validate_rich_menu_object_with_http_info} instead of this. + # + # @param rich_menu_request [Line::Bot::V2::MessagingApi::RichMenuRequest] + # @see https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def validate_rich_menu_object: ( + rich_menu_request: Line::Bot::V2::MessagingApi::RichMenuRequest + ) -> (String?) + + # Download image, video, and audio data sent from users. + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#get-content + # @return [Array((String|nil), 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 get_message_content_with_http_info: ( + message_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Download image, video, and audio data sent from users. + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content + # When you want to get HTTP status code or response headers, use {#get_message_content_with_http_info} instead of this. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#get-content + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_content: ( + message_id: String + ) -> (String?) + + # Get a preview image of the image or video + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/preview + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param message_id [String] Message ID of image or video + # @see https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview + # @return [Array((String|nil), 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 get_message_content_preview_with_http_info: ( + message_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Get a preview image of the image or video + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/preview + # When you want to get HTTP status code or response headers, use {#get_message_content_preview_with_http_info} instead of this. + # + # @param message_id [String] Message ID of image or video + # @see https://developers.line.biz/en/reference/messaging-api/#get-image-or-video-preview + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_content_preview: ( + message_id: String + ) -> (String?) + + # Verify the preparation status of a video or audio for getting + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcoding + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#verify-video-or-audio-preparation-status + # @return [Array(Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, 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 get_message_content_transcoding_by_message_id_with_http_info: ( + message_id: String + ) -> ( + [Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Verify the preparation status of a video or audio for getting + # This requests to GET https://api-data.line.me/v2/bot/message/{messageId}/content/transcoding + # When you want to get HTTP status code or response headers, use {#get_message_content_transcoding_by_message_id_with_http_info} instead of this. + # + # @param message_id [String] Message ID of video or audio + # @see https://developers.line.biz/en/reference/messaging-api/#verify-video-or-audio-preparation-status + # @return [Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_message_content_transcoding_by_message_id: ( + message_id: String + ) -> (Line::Bot::V2::MessagingApi::GetMessageContentTranscodingResponse | String?) + + # Download rich menu image. + # This requests to GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] ID of the rich menu with the image to be downloaded + # @see https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image + # @return [Array((String|nil), 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 get_rich_menu_image_with_http_info: ( + rich_menu_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Download rich menu image. + # This requests to GET https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # When you want to get HTTP status code or response headers, use {#get_rich_menu_image_with_http_info} instead of this. + # + # @param rich_menu_id [String] ID of the rich menu with the image to be downloaded + # @see https://developers.line.biz/en/reference/messaging-api/#download-rich-menu-image + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_rich_menu_image: ( + rich_menu_id: String + ) -> (String?) + + # Upload rich menu image + # This requests to POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param rich_menu_id [String] The ID of the rich menu to attach the image to + # @param body [File] + # @see https://developers.line.biz/en/reference/messaging-api/#upload-rich-menu-image + # @return [Array((String|nil), 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 set_rich_menu_image_with_http_info: ( + rich_menu_id: String, + body: File + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Upload rich menu image + # This requests to POST https://api-data.line.me/v2/bot/richmenu/{richMenuId}/content + # When you want to get HTTP status code or response headers, use {#set_rich_menu_image_with_http_info} instead of this. + # + # @param rich_menu_id [String] The ID of the rich menu to attach the image to + # @param body [File] + # @see https://developers.line.biz/en/reference/messaging-api/#upload-rich-menu-image + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def set_rich_menu_image: ( + rich_menu_id: String, + body: File + ) -> (String?) + + # If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/acquire + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @param acquire_chat_control_request [Line::Bot::V2::Module::AcquireChatControlRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#acquire-control-api + # @return [Array((String|nil), 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 acquire_chat_control_with_http_info: ( + chat_id: String, + ?acquire_chat_control_request: Line::Bot::V2::Module::AcquireChatControlRequest? + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # If the Standby Channel wants to take the initiative (Chat Control), it calls the Acquire Control API. The channel that was previously an Active Channel will automatically switch to a Standby Channel. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/acquire + # When you want to get HTTP status code or response headers, use {#acquire_chat_control_with_http_info} instead of this. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @param acquire_chat_control_request [Line::Bot::V2::Module::AcquireChatControlRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#acquire-control-api + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def acquire_chat_control: ( + chat_id: String, + ?acquire_chat_control_request: Line::Bot::V2::Module::AcquireChatControlRequest? + ) -> (String?) + + # The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + # This requests to POST https://api.line.me/v2/bot/channel/detach + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param detach_module_request [Line::Bot::V2::Module::DetachModuleRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#unlink-detach-module-channel-by-operation-mc-admin + # @return [Array((String|nil), 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 detach_module_with_http_info: ( + ?detach_module_request: Line::Bot::V2::Module::DetachModuleRequest? + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # The module channel admin calls the Detach API to detach the module channel from a LINE Official Account. + # This requests to POST https://api.line.me/v2/bot/channel/detach + # When you want to get HTTP status code or response headers, use {#detach_module_with_http_info} instead of this. + # + # @param detach_module_request [Line::Bot::V2::Module::DetachModuleRequest, nil] + # @see https://developers.line.biz/en/reference/partner-docs/#unlink-detach-module-channel-by-operation-mc-admin + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def detach_module: ( + ?detach_module_request: Line::Bot::V2::Module::DetachModuleRequest? + ) -> (String?) + + # Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + # This requests to GET https://api.line.me/v2/bot/list + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + # @param limit [Integer, nil] Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + # @see https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api + # @return [Array(Line::Bot::V2::Module::GetModulesResponse, 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 get_modules_with_http_info: ( + ?start: String?, + ?limit: Integer? + ) -> ( + [Line::Bot::V2::Module::GetModulesResponse, 200, Hash[untyped, untyped]] + | [String?, Integer, Hash[untyped, untyped]] + ) + + # Gets a list of basic information about the bots of multiple LINE Official Accounts that have attached module channels. + # This requests to GET https://api.line.me/v2/bot/list + # When you want to get HTTP status code or response headers, use {#get_modules_with_http_info} instead of this. + # + # @param start [String, nil] Value of the continuation token found in the next property of the JSON object returned in the response. If you can't get all basic information about the bots in one request, include this parameter to get the remaining array. + # @param limit [Integer, nil] Specify the maximum number of bots that you get basic information from. The default value is 100. Max value: 100 + # @see https://developers.line.biz/en/reference/partner-docs/#get-multiple-bot-info-api + # @return [Line::Bot::V2::Module::GetModulesResponse] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def get_modules: ( + ?start: String?, + ?limit: Integer? + ) -> (Line::Bot::V2::Module::GetModulesResponse | String?) + + # To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/release + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @see https://developers.line.biz/en/reference/partner-docs/#release-control-api + # @return [Array((String|nil), 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 release_chat_control_with_http_info: ( + chat_id: String + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # To return the initiative (Chat Control) of Active Channel to Primary Channel, call the Release Control API. + # This requests to POST https://api.line.me/v2/bot/chat/{chatId}/control/release + # When you want to get HTTP status code or response headers, use {#release_chat_control_with_http_info} instead of this. + # + # @param chat_id [String] The `userId`, `roomId`, or `groupId` + # @see https://developers.line.biz/en/reference/partner-docs/#release-control-api + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def release_chat_control: ( + chat_id: String + ) -> (String?) + + # Sends a mission sticker. + # This requests to POST https://api.line.me/shop/v3/mission + # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase. + # + # @param mission_sticker_request [Line::Bot::V2::Shop::MissionStickerRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 + # @return [Array((String|nil), 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 mission_sticker_v3_with_http_info: ( + mission_sticker_request: Line::Bot::V2::Shop::MissionStickerRequest + ) -> ([String?, 200, Hash[untyped, untyped]] | [String?, Integer, Hash[untyped, untyped]]) + + # Sends a mission sticker. + # This requests to POST https://api.line.me/shop/v3/mission + # When you want to get HTTP status code or response headers, use {#mission_sticker_v3_with_http_info} instead of this. + # + # @param mission_sticker_request [Line::Bot::V2::Shop::MissionStickerRequest] + # @see https://developers.line.biz/en/reference/partner-docs/#send-mission-stickers-v3 + # @return [String, nil] when HTTP status code is 200 + # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself. + def mission_sticker_v3: ( + mission_sticker_request: Line::Bot::V2::Shop::MissionStickerRequest + ) -> (String?) + + private + + def build_generated_delegates: ( + channel_access_token: String, + ?api_base_url: String?, + ?data_api_base_url: String?, + ?http_options: Hash[String | Symbol, untyped] + ) -> void + end + end + end +end diff --git a/spec/line/bot/v2/unified_client_spec.rb b/spec/line/bot/v2/unified_client_spec.rb new file mode 100644 index 00000000..ccb2f22e --- /dev/null +++ b/spec/line/bot/v2/unified_client_spec.rb @@ -0,0 +1,350 @@ +require 'spec_helper' + +describe 'Line::Bot::V2::LineBotClient' do + let(:channel_access_token) { 'test-channel-access-token' } + let(:client) { Line::Bot::V2::LineBotClient.new(channel_access_token: channel_access_token) } + + describe '#initialize' do + it 'raises TypeError when channel_access_token is nil', rbs_test: :skip do + expect { Line::Bot::V2::LineBotClient.new(channel_access_token: nil) }.to raise_error(TypeError) + end + + it 'raises TypeError when channel_access_token is empty' do + expect { Line::Bot::V2::LineBotClient.new(channel_access_token: '') }.to raise_error(TypeError) + end + + it 'creates a client with valid channel_access_token' do + expect(client).to be_a(Line::Bot::V2::LineBotClient) + end + end + + describe 'Insight API delegation' do + describe 'GET /v2/bot/insight/followers' do + it 'returns the number of followers via unified client' do + response_body = { + "status" => "ready", + "followers" => 1000, + "targetedReaches" => 900, + "blocks" => 100 + }.to_json + + stub_request(:get, "https://api.line.me/v2/bot/insight/followers") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body, status_code, = client.get_number_of_followers_with_http_info + + expect(status_code).to eq(200) + expect(body).to be_a(Line::Bot::V2::Insight::GetNumberOfFollowersResponse) + expect(body.status).to eq('ready') + expect(body.followers).to eq(1000) + expect(body.targeted_reaches).to eq(900) + expect(body.blocks).to eq(100) + end + + it 'also works without _with_http_info' do + response_body = { "status" => "ready", "followers" => 500 }.to_json + + stub_request(:get, "https://api.line.me/v2/bot/insight/followers") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body = client.get_number_of_followers + + expect(body).to be_a(Line::Bot::V2::Insight::GetNumberOfFollowersResponse) + expect(body.followers).to eq(500) + end + end + end + + describe 'MessagingApi delegation' do + describe 'POST /v2/bot/message/push' do + let(:push_response_body) do + { "sentMessages": [{ "id": "461230966842064897", "quoteToken": "IStG5h1Tz7b..." }] }.to_json + end + + it 'sends a push message via unified client' do + stub_request(:post, "https://api.line.me/v2/bot/message/push") + .with( + headers: { 'Authorization' => "Bearer #{channel_access_token}" }, + body: { + "to" => "USER_ID", + "messages" => [{ "type" => "text", "text" => "Hello!" }], + "notificationDisabled" => false + }.to_json + ) + .to_return(status: 200, body: push_response_body, headers: { 'Content-Type' => 'application/json' }) + + request = Line::Bot::V2::MessagingApi::PushMessageRequest.new( + to: 'USER_ID', + messages: [Line::Bot::V2::MessagingApi::TextMessage.new(text: 'Hello!')] + ) + body, status_code, = client.push_message_with_http_info(push_message_request: request) + + expect(status_code).to eq(200) + expect(body).to be_a(Line::Bot::V2::MessagingApi::PushMessageResponse) + expect(body.sent_messages[0].id).to eq('461230966842064897') + end + end + + describe 'GET /v2/bot/followers/ids' do + it 'returns a list of followers with optional parameters' do + response_body = { "userIds" => ["U1234567890", "U0987654321"], "next" => "nextToken" }.to_json + + stub_request(:get, "https://api.line.me/v2/bot/followers/ids") + .with( + headers: { 'Authorization' => "Bearer #{channel_access_token}" }, + query: { "start" => "prevToken", "limit" => "10" } + ) + .to_return(status: 200, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body, status_code, = client.get_followers_with_http_info(start: "prevToken", limit: 10) + + expect(status_code).to eq(200) + expect(body.user_ids).to eq(["U1234567890", "U0987654321"]) + expect(body._next).to eq("nextToken") + end + end + + describe 'GET /v2/bot/profile/{userId}' do + it 'gets a user profile' do + user_id = 'U1234567890' + response_body = { + "displayName" => "LINE taro", + "userId" => user_id, + "language" => "en", + "pictureUrl" => "https://profile.line-scdn.net/example", + "statusMessage" => "Hello!" + }.to_json + + stub_request(:get, "https://api.line.me/v2/bot/profile/#{user_id}") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body = client.get_profile(user_id: user_id) + + expect(body).to be_a(Line::Bot::V2::MessagingApi::UserProfileResponse) + expect(body.display_name).to eq('LINE taro') + expect(body.user_id).to eq(user_id) + end + end + end + + describe 'MessagingApi Blob delegation (data API)' do + describe 'GET /v2/bot/message/{messageId}/content' do + it 'downloads message content via unified client using data API base URL' do + message_id = 'test-message-id' + + stub_request(:get, "https://api-data.line.me/v2/bot/message/#{message_id}/content/transcoding") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: { "status" => "processing" }.to_json, headers: { 'Content-Type' => 'application/json' }) + + body, status_code, = client.get_message_content_transcoding_by_message_id_with_http_info(message_id: message_id) + + expect(status_code).to eq(200) + expect(body.status).to eq('processing') + end + end + end + + describe 'Liff API delegation' do + describe 'PUT /liff/v1/apps/{liffId}' do + it 'updates a LIFF app via unified client' do + stub_request(:put, "https://api.line.me/liff/v1/apps/test-liff-id") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: "", headers: {}) + + request = Line::Bot::V2::Liff::UpdateLiffAppRequest.new(view: { url: 'https://example.com' }) + body, status_code, = client.update_liff_app_with_http_info(liff_id: 'test-liff-id', update_liff_app_request: request) + + expect(status_code).to eq(200) + expect(body).to eq("") + end + end + end + + describe 'ManageAudience API delegation' do + describe 'POST /v2/bot/audienceGroup/upload' do + it 'creates an audience group via unified client' do + response_body = { "description" => "Test Audience response" }.to_json + + stub_request(:post, "https://api.line.me/v2/bot/audienceGroup/upload") + .with( + body: "{\"description\":\"Test Audience\"}", + headers: { + 'Authorization' => "Bearer #{channel_access_token}", + 'Content-Type' => 'application/json' + } + ) + .to_return(status: 202, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + request = Line::Bot::V2::ManageAudience::CreateAudienceGroupRequest.new(description: 'Test Audience') + body, status_code, = client.create_audience_group_with_http_info(create_audience_group_request: request) + + expect(status_code).to eq(202) + expect(body.description).to eq('Test Audience response') + end + end + end + + describe 'custom base URLs' do + let(:client) do + Line::Bot::V2::LineBotClient.new( + channel_access_token: channel_access_token, + api_base_url: 'https://custom-api.example.com', + data_api_base_url: 'https://custom-data.example.com' + ) + end + + it 'uses custom api_base_url for normal API endpoints' do + user_id = 'U1234567890' + response_body = { "displayName" => "Taro", "userId" => user_id }.to_json + + stub_request(:get, "https://custom-api.example.com/v2/bot/profile/#{user_id}") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: response_body, headers: { 'Content-Type' => 'application/json' }) + + body = client.get_profile(user_id: user_id) + + expect(body.display_name).to eq('Taro') + end + + it 'uses custom data_api_base_url for blob endpoints' do + message_id = 'test-msg-id' + + stub_request(:get, "https://custom-data.example.com/v2/bot/message/#{message_id}/content/transcoding") + .with(headers: { 'Authorization' => "Bearer #{channel_access_token}" }) + .to_return(status: 200, body: { "status" => "succeeded" }.to_json, headers: { 'Content-Type' => 'application/json' }) + + body = client.get_message_content_transcoding_by_message_id(message_id: message_id) + + expect(body.status).to eq('succeeded') + end + end + + describe 'method coverage' do + # Dynamically discover all API client classes, excluding the same packages as the generator + excluded_modules = [Line::Bot::V2::ChannelAccessToken, Line::Bot::V2::ModuleAttach].freeze + + original_client_classes = ObjectSpace.each_object(Class).select do |klass| + klass.name&.match?(/\ALine::Bot::V2::\w+::Api\w*Client\z/) && + excluded_modules.none? { |mod| klass.name.start_with?(mod.name) } + end.sort_by(&:name).freeze + + expected_methods = original_client_classes.flat_map do |klass| + klass.public_instance_methods(false) - [:initialize] + end.sort + + unified_methods = Line::Bot::V2::LineBotClient.public_instance_methods(false).sort + + it 'discovers at least one original client class' do + expect(original_client_classes).not_to be_empty + end + + it 'exposes every public method from the original API clients' do + expect(expected_methods.size).to be > 0 + missing = expected_methods - unified_methods + expect(missing).to be_empty, "Missing methods in unified client: #{missing.join(', ')}" + end + + it 'does not expose extra methods beyond the original API clients and initialize' do + extra = unified_methods - expected_methods - [:initialize] + expect(extra).to be_empty, "Extra methods in unified client: #{extra.join(', ')}" + end + + it 'has no method name collisions across original clients' do + all_names = original_client_classes.flat_map { |k| k.public_instance_methods(false) - [:initialize] } + duplicates = all_names.group_by(&:itself).select { |_, v| v.size > 1 }.keys + expect(duplicates).to be_empty, "Method name collisions: #{duplicates.join(', ')}" + end + end + + describe 'generated file quality' do + generated_rb = File.read(File.expand_path('../../../../lib/line/bot/v2/line_bot_client.generated.rb', __dir__), encoding: 'utf-8') + + it 'has a YARD comment block before every method' do + lines = generated_rb.lines + method_count = 0 + lines.each_with_index do |line, i| + next unless line =~ /^\s+def\s+(\w+)/ + + method_count += 1 + prev = i > 0 ? lines[i - 1].strip : '' + expect(prev).to start_with('#'), + "Method #{Regexp.last_match(1)} (line #{i + 1}) has no preceding YARD comment" + end + expect(method_count).to be > 0, "No methods found in generated file" + end + + it 'has no bare (unqualified) model types in YARD comments' do + generated_rb.each_line.with_index(1) do |line, lineno| + next unless line.include?('@param') || line.include?('@return') + + # Match model types like FooResponse/FooRequest that are NOT preceded by "::" + line.scan(/(? "insight" + pkg = File.basename(File.dirname(File.dirname(path))) + next if %w[channel_access_token module_attach].include?(pkg) + + methods = [] + File.readlines(path, encoding: 'utf-8').each do |line| + if line =~ /^\s+def\s+(\w+[?!]?):/ && Regexp.last_match(1) != 'initialize' + methods << Regexp.last_match(1).to_sym + end + end + original_rbs_methods_by_file[File.basename(path)] = methods + end + all_original_rbs_methods = original_rbs_methods_by_file.values.flatten.sort + + it 'declares every method from the original RBS files' do + expect(all_original_rbs_methods.size).to be > 0, "No original RBS methods found" + expect(rbs_public_methods.size).to be > 0, "No unified RBS methods found" + missing = all_original_rbs_methods - rbs_public_methods + expect(missing).to be_empty, "Missing in unified RBS: #{missing.join(', ')}" + end + + it 'does not declare extra public methods beyond the originals' do + extra = rbs_public_methods - all_original_rbs_methods + expect(extra).to be_empty, "Extra in unified RBS: #{extra.join(', ')}" + end + + it 'has no bare (unqualified) model types in signatures' do + # Types like "GetFriendsDemographicsResponse" should appear as "Line::Bot::V2::Insight::GetFriendsDemographicsResponse" + rbs_content.each_line.with_index(1) do |line, lineno| + next if line.strip.start_with?('#') # skip comments + next unless line.include?('Response') || line.include?('Request') + + line.scan(/(? void + + # RBS_SOURCE_COMMENT + # @param model [SampleModel] + # @return [SampleModel] + def ping: (model: SampleModel) -> SampleModel + end + end + end + end + end + RBS + + rb_path.write(<<~'RB') + module Line + module Bot + module V2 + module Foo + class ApiClient + # RB_SOURCE_COMMENT + def initialize(base_url: nil, channel_access_token:, http_options: {}) + @http_client = HttpClient.new( + base_url: base_url || 'https://api.line.me', + http_headers: { Authorization: "Bearer \\#{channel_access_token}" }, + http_options: http_options + ) + end + end + end + end + end + end + RB + + client = UnifiedClientGenerator.parse_client(sig_path: sig_path, rb_path: rb_path) + method = client.delegated_methods.find { |m| m.name == 'ping' } + + expect(method).not_to be_nil + expect(method.comment).to include('RBS_SOURCE_COMMENT') + expect(method.comment).not_to include('RB_SOURCE_COMMENT') + expect(method.comment).to include('@param model [Line::Bot::V2::Foo::SampleModel]') + expect(method.comment).to include('@return [Line::Bot::V2::Foo::SampleModel]') + end + end + end + + describe '.parse_client_from_ruby' do + it 'uses method comments from ruby source as-is' do + Dir.mktmpdir do |tmpdir| + rb_path = Pathname(tmpdir).join('lib/line/bot/v2/foo/api/foo_client.rb') + FileUtils.mkdir_p(rb_path.dirname) + + rb_path.write(<<~'RB') + module Line + module Bot + module V2 + module Foo + class ApiClient + def initialize(base_url: nil, channel_access_token:, http_options: {}) + @http_client = HttpClient.new( + base_url: base_url || 'https://api.line.me', + http_headers: { Authorization: "Bearer #{channel_access_token}" }, + http_options: http_options + ) + end + + # RB_BOOLEAN_COMMENT + # @param flag [Boolean, nil] + def ping_with_http_info(flag: nil) + nil + end + end + end + end + end + end + RB + + client = UnifiedClientGenerator.parse_client_from_ruby(rb_path: rb_path) + method = client.delegated_methods.find { |m| m.name == 'ping_with_http_info' } + + expect(method).not_to be_nil + expect(method.comment).to include('RB_BOOLEAN_COMMENT') + expect(method.comment).to include('@param flag [Boolean, nil]') + end + end + end +end diff --git a/type-test/README.md b/type-test/README.md new file mode 100644 index 00000000..37a7f9aa --- /dev/null +++ b/type-test/README.md @@ -0,0 +1,8 @@ +# type-test + +This directory contains type-only sanity checks for Steep. + +- Files here are checked by `steep check` in CI. +- They are not runtime specs and are not executed by RSpec. +- Purpose: detect typing regressions in public API usage examples early. +- You can also run them locally to quickly verify user-land usage stays type-safe. diff --git a/type-test/unified_client_usage_sanity.rb b/type-test/unified_client_usage_sanity.rb new file mode 100644 index 00000000..d9f505a2 --- /dev/null +++ b/type-test/unified_client_usage_sanity.rb @@ -0,0 +1,24 @@ +# typed: true + +require 'line/bot' + +# Type-level sanity check for the unified v2 client surface. +# This file is intentionally not executed in runtime tests; it exists so +# `steep check` fails when public API usage drifts from expected typing. +client = Line::Bot::V2::LineBotClient.new(channel_access_token: 'token') + +profile = client.get_profile(user_id: 'U1234567890') +if profile.is_a?(Line::Bot::V2::MessagingApi::UserProfileResponse) + profile.user_id +end + +client.get_audience_groups( + page: 1, + includes_external_public_groups: true +) + +push_request = Line::Bot::V2::MessagingApi::PushMessageRequest.new( + to: 'U1234567890', + messages: [Line::Bot::V2::MessagingApi::TextMessage.new(text: 'hello')] +) +client.push_message(push_message_request: push_request)