diff --git a/CHANGELOG.md b/CHANGELOG.md index 118ac926..bc1b9374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [v1.27.0](https://github.com/line/line-bot-sdk-ruby/tree/v1.27.0) (2023-02-08) + +[Full Changelog](https://github.com/line/line-bot-sdk-ruby/compare/v1.26.0...v1.27.0) + +**Closed issues:** + +- Create chat bot with conversation loop and save message to database [\#272](https://github.com/line/line-bot-sdk-ruby/issues/272) +- Messaging API - January 2021 update [\#215](https://github.com/line/line-bot-sdk-ruby/issues/215) + +**Merged pull requests:** + +- Implement get_narrowcast_message_status [\#276](https://github.com/line/line-bot-sdk-ruby/pull/276) ([dlackty](https://github.com/dlackty)) +- Update dependency rubocop to '~\> 1.44.0' [\#275](https://github.com/line/line-bot-sdk-ruby/pull/275) ([renovate[bot]](https://github.com/apps/renovate)) +- Update dependency rubocop to '~\> 1.43.0' [\#274](https://github.com/line/line-bot-sdk-ruby/pull/274) ([renovate[bot]](https://github.com/apps/renovate)) +- Update dependency rubocop to '~\> 1.40.0' [\#273](https://github.com/line/line-bot-sdk-ruby/pull/273) ([renovate[bot]](https://github.com/apps/renovate)) +- Update dependency rubocop to '~\> 1.39.0' [\#271](https://github.com/line/line-bot-sdk-ruby/pull/271) ([renovate[bot]](https://github.com/apps/renovate)) + ## [v1.26.0](https://github.com/line/line-bot-sdk-ruby/tree/v1.26.0) (2022-11-09) [Full Changelog](https://github.com/line/line-bot-sdk-ruby/compare/v1.25.0...v1.26.0) @@ -12,6 +29,7 @@ **Merged pull requests:** +- Release v1.26.0 [\#270](https://github.com/line/line-bot-sdk-ruby/pull/270) ([zenizh](https://github.com/zenizh)) - Update dependency rubocop to '~\> 1.38.0' [\#269](https://github.com/line/line-bot-sdk-ruby/pull/269) ([renovate[bot]](https://github.com/apps/renovate)) - Add APIs to validate message objects [\#268](https://github.com/line/line-bot-sdk-ruby/pull/268) ([zenizh](https://github.com/zenizh)) - Update dependency rubocop to '~\> 1.37.0' [\#266](https://github.com/line/line-bot-sdk-ruby/pull/266) ([renovate[bot]](https://github.com/apps/renovate)) diff --git a/Gemfile b/Gemfile index 4da88c1f..f50bd951 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,6 @@ gemspec group :development, :test do # ref: http://docs.rubocop.org/en/latest/installation/ - gem 'rubocop', '~> 1.38.0', require: false + gem 'rubocop', '~> 1.44.0', require: false gem 'yard', '~> 0.9.20' end diff --git a/lib/line/bot/api/version.rb b/lib/line/bot/api/version.rb index 639180cb..45019f23 100644 --- a/lib/line/bot/api/version.rb +++ b/lib/line/bot/api/version.rb @@ -15,7 +15,7 @@ module Line module Bot module API - VERSION = "1.26.0" + VERSION = "1.27.0" end end end diff --git a/lib/line/bot/client.rb b/lib/line/bot/client.rb index 671945bc..b92a8149 100644 --- a/lib/line/bot/client.rb +++ b/lib/line/bot/client.rb @@ -1162,6 +1162,18 @@ def get_aggregation_list(limit: nil, start: nil) get(endpoint, endpoint_path, credentials) end + # Gets the status of a narrowcast message. + # + # @param request_id [String] The narrowcast message's request ID. Each Messaging API request has a request ID. Find it in the response headers. + # + # @return [Net::HTTPResponse] + def get_narrowcast_message_status(request_id) + channel_token_required + + endpoint_path = "/bot/message/progress/narrowcast?requestId=#{request_id}" + get(endpoint, endpoint_path, credentials) + end + # Fetch data, get content of specified URL. # # @param endpoint_base [String] diff --git a/spec/line/bot/client_get_spec.rb b/spec/line/bot/client_get_spec.rb index ebc85d9b..d003d6cc 100644 --- a/spec/line/bot/client_get_spec.rb +++ b/spec/line/bot/client_get_spec.rb @@ -200,6 +200,17 @@ } EOS +NARROWCAST_MESSAGE_STATUS_CONTENT = <<"EOS" +{ + "phase": "succeeded", + "successCount": 65535, + "failureCount": 128, + "targetCount": 65663, + "acceptedTime": "2020-12-03T10:15:30.121Z", + "completedTime": "2020-12-03T10:15:30.121Z" +} +EOS + describe Line::Bot::Client do def dummy_config { @@ -477,4 +488,22 @@ def generate_client markAsReadMode: 'manual' ) end + + it 'get narrowcast message status' do + uri_template = Addressable::Template.new Line::Bot::API::DEFAULT_ENDPOINT + '/bot/message/progress/narrowcast?requestId=request_id' + stub_request(:get, uri_template).to_return(body: NARROWCAST_MESSAGE_STATUS_CONTENT, status: 200) + + client = generate_client + response = client.get_narrowcast_message_status('request_id') + + json = JSON.parse(response.body, symbolize_names: true) + expect(json).to eq( + phase: "succeeded", + successCount: 65535, + failureCount: 128, + targetCount: 65663, + acceptedTime: "2020-12-03T10:15:30.121Z", + completedTime: "2020-12-03T10:15:30.121Z" + ) + end end