From 0fa004fd3a74b8087ce5b8eb5a892b338a8cd3c0 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Tue, 1 Apr 2025 11:01:28 +0900 Subject: [PATCH 1/5] NO-ISSUE Add deprecated messages for Line::Bot::Client --- lib/line/bot/v1/client.rb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/line/bot/v1/client.rb b/lib/line/bot/v1/client.rb index 50ef22d0..5bb4757a 100644 --- a/lib/line/bot/v1/client.rb +++ b/lib/line/bot/v1/client.rb @@ -19,8 +19,17 @@ module Line module Bot - # API Client of LINE Bot SDK Ruby + # @deprecated + # This is deprecated. Please use one of the following instead: + # * {Line::Bot::V2::MessagingApi::ApiClient} + # * {Line::Bot::V2::MessagingApi::ApiBlobClient} + # * {Line::Bot::V2::Liff::ApiClient} + # * {Line::Bot::V2::ChannelAccessToken::ApiClient} + # * {Line::Bot::V2::ManageAudience::ApiClient} + # * {Line::Bot::V2::ManageAudience::ApiBlobClient} + # * {Line::Bot::V2::Insight::ApiClient} # + # API Client of LINE Bot SDK Ruby (deprecated) # @client ||= Line::Bot::Client.new do |config| # config.channel_id = ENV["LINE_CHANNEL_ID"] # config.channel_secret = ENV["LINE_CHANNEL_SECRET"] @@ -36,6 +45,16 @@ class Client # @return [Hash] attr_accessor :http_options + # @deprecated + # This is deprecated. Please use one of the following instead: + # * {Line::Bot::V2::MessagingApi::ApiClient} + # * {Line::Bot::V2::MessagingApi::ApiBlobClient} + # * {Line::Bot::V2::Liff::ApiClient} + # * {Line::Bot::V2::ChannelAccessToken::ApiClient} + # * {Line::Bot::V2::ManageAudience::ApiClient} + # * {Line::Bot::V2::ManageAudience::ApiBlobClient} + # * {Line::Bot::V2::Insight::ApiClient} + # # Initialize a new client. # # @param options [Hash] From 2800f01de35dbb6b70cc0b48c98899e5d24e2793 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Tue, 1 Apr 2025 12:09:19 +0900 Subject: [PATCH 2/5] NO-ISSUE Deprecate message for Webhook parser --- lib/line/bot/v1/client.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/line/bot/v1/client.rb b/lib/line/bot/v1/client.rb index 5bb4757a..846b8bad 100644 --- a/lib/line/bot/v1/client.rb +++ b/lib/line/bot/v1/client.rb @@ -1652,6 +1652,10 @@ def delete(endpoint_base, endpoint_path, headers = {}) httpclient.delete(endpoint_base + endpoint_path, headers) end + # @deprecated + # This method is deprecated. + # Please use `Line::Bot::V2::WebhookParser#parse` instead. + # # Parse events from request.body # # @param request_body [String] @@ -1670,6 +1674,10 @@ def parse_events_from(request_body) end end + # @deprecated + # This method is deprecated. + # Please use `Line::Bot::V2::WebhookParser#parse` instead. + # # Validate signature of a webhook event. # # https://developers.line.biz/en/reference/messaging-api/#signature-validation From e096452210419a771c1ed6fc4c34bfb64436f4bd Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Tue, 1 Apr 2025 13:11:35 +0900 Subject: [PATCH 3/5] NO-ISSUE Deprecate message for v1 client --- lib/line/bot/v1/client.rb | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/line/bot/v1/client.rb b/lib/line/bot/v1/client.rb index 846b8bad..e941624a 100644 --- a/lib/line/bot/v1/client.rb +++ b/lib/line/bot/v1/client.rb @@ -190,7 +190,7 @@ def revoke_channel_access_token_jwt(access_token) # # @return [Net::HTTPResponse] def verify_id_token(id_token, nonce: nil, user_id: nil) - warn '[DEPRECATION] `Line::Bot::Client#verify_id_token` is deprecated.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#verify_id_token` is deprecated. Please use `Line::Bot::V2::ChannelAccessToken::ApiClient#verify_channel_token_by_jwt` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_id_required @@ -250,7 +250,7 @@ def get_channel_access_token_key_ids_jwt(jwt) # # @return [Net::HTTPResponse] def get_profile_by_access_token(access_token) - warn '[DEPRECATION] `Line::Bot::Client#get_profile_by_access_token` is deprecated.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_profile_by_access_token` is obsolete. (LINE Login feature, not bot feature)' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] headers = { "Authorization" => "Bearer #{access_token}", @@ -638,7 +638,7 @@ def get_message_delivery_reply(date) # # @return [Net::HTTPResponse] def get_message_delivery_push(date) - warn '[DEPRECATION] `Line::Bot::Client#` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_push_messages` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_message_delivery_push` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_message_delivery_push` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -880,7 +880,7 @@ def unset_default_rich_menu # # @return [Net::HTTPResponse] def set_rich_menus_alias(rich_menu_id, rich_menu_alias_id) - warn '[DEPRECATION] `Line::Bot::Client#unset_default_rich_menu` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#set_rich_menus_alias` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#create_rich_menu_alias` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -943,7 +943,7 @@ def get_rich_menus_alias(rich_menu_alias_id) # # @return [Net::HTTPResponse] def get_rich_menus_alias_list - warn '[DEPRECATION] `Line::Bot::Client#get_rich_menu_alias_list` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias_list` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_rich_menus_alias_list` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias_list` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1076,7 +1076,7 @@ def create_link_token(user_id) # # @return [Net::HTTPResponse] def get_quota - warn '[DEPRECATION] `Line::Bot::Client#get_message_quota` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_message_quota` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_quota` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_message_quota` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1152,7 +1152,7 @@ def get_number_of_followers(date) # # @return [Net::HTTPResponse] def get_friend_demographics - warn '[DEPRECATION] `Line::Bot::Client#get_friends_demographics` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_friends_demographics` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_friend_demographics` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_friends_demographics` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1375,7 +1375,7 @@ def rename_audience(audience_group_id, description) # # @return [Net::HTTPResponse] def delete_audience(audience_group_id) - warn '[DEPRECATION] `Line::Bot::Client#rename_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#delete_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#delete_audience` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#delete_audience_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1430,7 +1430,7 @@ def get_audiences(params) # # @return [Net::HTTPResponse] def get_audience_authority_level - warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#get_audience_group_authority_level` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1449,7 +1449,7 @@ def get_audience_authority_level # # @return [Net::HTTPResponse] def update_audience_authority_level(authority_level) - warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is deprecated. Please use `Line::Bot::V2::ManageAudience::ApiClient#update_audience_group_authority_level` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#update_audience_authority_level` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1468,7 +1468,7 @@ def update_audience_authority_level(authority_level) # # @return [Net::HTTPResponse] def get_statistics_per_unit(unit:, from:, to:) - warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_statistics_per_unit` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_statistics_per_unit` is deprecated. Please use `Line::Bot::V2::Insight::ApiClient#get_statistics_per_unit` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1483,7 +1483,7 @@ def get_statistics_per_unit(unit:, from:, to:) # # @return [Net::HTTPResponse] def get_aggregation_info - warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_usage` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_aggregation_info` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_usage` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1500,7 +1500,7 @@ def get_aggregation_info # # @return [Net::HTTPResponse] def get_aggregation_list(limit: nil, start: nil) - warn '[DEPRECATION] `Line::Bot::Client#get_audience_authority_level` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_statistics_per_unit` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_aggregation_list` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_name_list` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1536,7 +1536,7 @@ def get_narrowcast_message_status(request_id) # # @return [Net::HTTPResponse] def multicast_by_phone_numbers(to, messages, headers: {}, payload: {}) - warn '[DEPRECATION] `Line::Bot::Client#get_narrowcast_message_status` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#audience_match` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_narrowcast_message_status` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1556,7 +1556,7 @@ def multicast_by_phone_numbers(to, messages, headers: {}, payload: {}) # # @return [Net::HTTPResponse] def get_delivery_result_sent_by_phone_numbers(date) - warn '[DEPRECATION] `Line::Bot::Client#get_delivery_result_sent_by_phone_numbers` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#get_ad_phone_message_statistics` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] + warn '[DEPRECATION] `Line::Bot::Client#get_delivery_result_sent_by_phone_numbers` is obsolete.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] channel_token_required @@ -1602,6 +1602,7 @@ def get_message_delivery_pnp(date) get(endpoint, endpoint_path, credentials) end + # @deprecated # Fetch data, get content of specified URL. # # @param endpoint_base [String] @@ -1614,6 +1615,7 @@ def get(endpoint_base, endpoint_path, headers = {}) httpclient.get(endpoint_base + endpoint_path, headers) end + # @deprecated # Post data, get content of specified URL. # # @param endpoint_base [String] @@ -1627,6 +1629,7 @@ def post(endpoint_base, endpoint_path, payload = nil, headers = {}) httpclient.post(endpoint_base + endpoint_path, payload, headers) end + # @deprecated # Put data, get content of specified URL. # # @param endpoint_base [String] @@ -1640,6 +1643,7 @@ def put(endpoint_base, endpoint_path, payload = nil, headers = {}) httpclient.put(endpoint_base + endpoint_path, payload, headers) end + # @deprecated # Delete content of specified URL. # # @param endpoint_base [String] @@ -1662,6 +1666,7 @@ def delete(endpoint_base, endpoint_path, headers = {}) # # @return [Array] def parse_events_from(request_body) + warn '[DEPRECATION] `Line::Bot::Client#parse_events_from` is deprecated. Please use `Line::Bot::V2::WebhookParser#parse` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] json = JSON.parse(request_body) json['events'].map do |item| @@ -1687,6 +1692,7 @@ def parse_events_from(request_body) # # @return [Boolean] def validate_signature(content, channel_signature) + warn '[DEPRECATION] `Line::Bot::Client#validate_signature` is deprecated. Please use `Line::Bot::V2::WebhookParser#parse` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] return false if !channel_signature || !channel_secret hash = OpenSSL::HMAC.digest(OpenSSL::Digest.new('SHA256'), channel_secret, content) From d82f21bd66a8bc11213c423745fbdd67d5307ec9 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Tue, 1 Apr 2025 13:48:26 +0900 Subject: [PATCH 4/5] NO-ISSUE Insert deprecated comment from warn message automatically --- lib/line/bot/v1/client.rb | 177 +++++++++++++++++++++++++++++++++++++- 1 file changed, 173 insertions(+), 4 deletions(-) diff --git a/lib/line/bot/v1/client.rb b/lib/line/bot/v1/client.rb index e941624a..4fadad05 100644 --- a/lib/line/bot/v1/client.rb +++ b/lib/line/bot/v1/client.rb @@ -101,6 +101,8 @@ def credentials end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#issue_channel_token} instead. # # Issue channel access token # @@ -124,6 +126,8 @@ def issue_channel_token(grant_type = 'client_credentials') end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#revoke_channel_token} instead. # # Revoke channel access token # @@ -138,6 +142,8 @@ def revoke_channel_token(access_token) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#issue_channel_token_by_jwt} instead. # # Issue channel access token v2.1 # @@ -158,6 +164,8 @@ def issue_channel_access_token_jwt(jwt) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#revoke_channel_token_by_jwt} instead. # # Revoke channel access token v2.1 # @@ -181,6 +189,8 @@ def revoke_channel_access_token_jwt(access_token) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#verify_channel_token_by_jwt} instead. # # Verify ID token # @@ -206,6 +216,8 @@ def verify_id_token(id_token, nonce: nil, user_id: nil) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#verify_channel_token} instead. # # Verify access token v2.1 # @@ -223,6 +235,8 @@ def verify_access_token(access_token) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ChannelAccessToken::ApiClient#gets_all_valid_channel_access_token_key_ids} instead. # # Get all valid channel access token key IDs v2.1 # @@ -243,6 +257,7 @@ def get_channel_access_token_key_ids_jwt(jwt) end # @deprecated + # This is obsolete. # # Get user profile by access token # @@ -260,6 +275,8 @@ def get_profile_by_access_token(access_token) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#push_message} instead. # # Push messages to a user using user_id. # @@ -281,6 +298,8 @@ def push_message(user_id, messages, headers: {}, payload: {}) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#reply_message} instead. # # Reply messages to a user using replyToken. # @@ -315,6 +334,8 @@ def reply_message(token, messages) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#multicast} instead. # # Send messages to multiple users using userIds. # @@ -337,6 +358,8 @@ def multicast(to, messages, headers: {}, payload: {}) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#broadcast} instead. # # Send messages to all friends. # @@ -357,6 +380,8 @@ def broadcast(messages, headers: {}) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#narrowcast} instead. # # Narrowcast messages to users # @@ -388,6 +413,8 @@ def narrowcast(messages, recipient: nil, filter: nil, limit: nil, headers: {}) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#leave_group} instead. # def leave_group(group_id) warn '[DEPRECATION] `Line::Bot::Client#leave_group` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#leave_group` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] @@ -399,6 +426,8 @@ def leave_group(group_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#leave_room} instead. # def leave_room(room_id) warn '[DEPRECATION] `Line::Bot::Client#leave_room` is deprecated. Please use `Line::Bot::V2::MessagingApi::ApiClient#leave_room` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] @@ -410,6 +439,8 @@ def leave_room(room_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiBlobClient#get_message_content} instead. # # Get message content. # @@ -425,6 +456,8 @@ def get_message_content(identifier) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_profile} instead. # # Get an user's profile. # @@ -440,6 +473,8 @@ def get_profile(user_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_group_member_profile} instead. # # Get an user's profile of a group. # @@ -457,6 +492,8 @@ def get_group_member_profile(group_id, user_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_room_member_profile} instead. # # Get an user's profile of a room. # @@ -474,6 +511,8 @@ def get_room_member_profile(room_id, user_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_followers} instead. # # Get user IDs of who added your LINE Official Account as a friend # @@ -499,6 +538,8 @@ def get_follower_ids(deprecated_continuation_token = nil, start: nil, limit: nil end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_group_members_ids} instead. # # Get user IDs of a group # @@ -518,6 +559,8 @@ def get_group_member_ids(group_id, continuation_token = nil) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_room_members_ids} instead. # # Get user IDs of a room # @@ -537,6 +580,8 @@ def get_room_member_ids(room_id, continuation_token = nil) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_group_summary} instead. # # Gets the group ID, group name, and group icon URL of a group where the LINE Official Account is a member. # @@ -553,6 +598,8 @@ def get_group_summary(group_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_group_member_count} instead. # # Gets the user IDs of the members of a group that the bot is in. # @@ -569,6 +616,8 @@ def get_group_members_count(group_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_room_member_count} instead. # # Gets the count of members in a room. # @@ -585,6 +634,8 @@ def get_room_members_count(room_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_list} instead. # # Get a list of all uploaded rich menus # @@ -599,6 +650,8 @@ def get_rich_menus end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu} instead. # # Get a rich menu via a rich menu ID # @@ -615,6 +668,8 @@ def get_rich_menu(rich_menu_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_reply_messages} instead. # # Gets the number of messages sent with the /bot/message/reply endpoint. # @@ -631,6 +686,8 @@ def get_message_delivery_reply(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_message_delivery_push} instead. # # Gets the number of messages sent with the /bot/message/push endpoint. # @@ -647,6 +704,8 @@ def get_message_delivery_push(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_multicast_messages} instead. # # Gets the number of messages sent with the /bot/message/multicast endpoint. # @@ -663,6 +722,8 @@ def get_message_delivery_multicast(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_number_of_sent_broadcast_messages} instead. # # Gets the number of messages sent with the /bot/message/multicast endpoint. # @@ -679,6 +740,8 @@ def get_message_delivery_broadcast(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#validate_reply} instead. # # Validate message objects of a reply message # @@ -696,6 +759,8 @@ def validate_reply_message_objects(messages) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#validate_push} instead. # # Validate message objects of a push message # @@ -713,6 +778,8 @@ def validate_push_message_objects(messages) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#validate_multicast} instead. # # Validate message objects of a multicast message # @@ -730,6 +797,8 @@ def validate_multicast_message_objects(messages) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#validate_narrowcast} instead. # # Validate message objects of a narrowcast message # @@ -747,6 +816,8 @@ def validate_narrowcast_message_objects(messages) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#validate_broadcast} instead. # # Validate message objects of a broadcast message # @@ -764,6 +835,8 @@ def validate_broadcast_message_objects(messages) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#create_rich_menu} instead. # # Create a rich menu # @@ -780,6 +853,8 @@ def create_rich_menu(rich_menu) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#validate_rich_menu_object} instead. # # Validate a rich menu object # @@ -796,6 +871,8 @@ def validate_rich_menu_object(rich_menu) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#delete_rich_menu} instead. # # Delete a rich menu # @@ -812,6 +889,8 @@ def delete_rich_menu(rich_menu_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_id_of_user} instead. # # Get the ID of the rich menu linked to a user # @@ -828,6 +907,8 @@ def get_user_rich_menu(user_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_default_rich_menu_id} instead. # # Get default rich menu # @@ -842,6 +923,8 @@ def get_default_rich_menu end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#set_default_rich_menu} instead. # # Set default rich menu (Link a rich menu to all user) # @@ -858,6 +941,8 @@ def set_default_rich_menu(rich_menu_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#cancel_default_rich_menu} instead. # # Unset default rich menu (Unlink a rich menu from all user) # @@ -872,6 +957,8 @@ def unset_default_rich_menu end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#create_rich_menu_alias} instead. # # Set rich menu alias # @@ -889,6 +976,8 @@ def set_rich_menus_alias(rich_menu_id, rich_menu_alias_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#delete_rich_menu_alias} instead. # # Unset rich menu alias # @@ -905,6 +994,8 @@ def unset_rich_menus_alias(rich_menu_alias_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#update_rich_menu_alias} instead. # # Update rich menu alias # @@ -922,6 +1013,8 @@ def update_rich_menus_alias(rich_menu_id, rich_menu_alias_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias} instead. # # Get a rich menu alias via a rich menu alias ID # @@ -938,6 +1031,8 @@ def get_rich_menus_alias(rich_menu_alias_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_rich_menu_alias_list} instead. # # Get a list of all uploaded rich menus alias # @@ -952,6 +1047,8 @@ def get_rich_menus_alias_list end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#link_rich_menu_id_to_user} instead. # # Link a rich menu to a user # @@ -972,6 +1069,8 @@ def link_user_rich_menu(user_id, rich_menu_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#unlink_rich_menu_id_from_user} instead. # # Unlink a rich menu from a user # @@ -988,6 +1087,8 @@ def unlink_user_rich_menu(user_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#link_rich_menu_id_to_users} instead. # # To link a rich menu to multiple users at a time # @@ -1005,6 +1106,8 @@ def bulk_link_rich_menus(user_ids, rich_menu_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#unlink_rich_menu_id_from_users} instead. # # To unlink a rich menu from multiple users at a time # @@ -1021,6 +1124,8 @@ def bulk_unlink_rich_menus(user_ids) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiBlobClient#get_rich_menu_image} instead. # # Download an image associated with a rich menu # @@ -1037,6 +1142,8 @@ def get_rich_menu_image(rich_menu_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiBlobClient#set_rich_menu_image} instead. # # Upload and attaches an image to a rich menu # @@ -1055,6 +1162,8 @@ def create_rich_menu_image(rich_menu_id, file) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#issue_link_token} instead. # # Issue a link token to a user # @@ -1071,6 +1180,8 @@ def create_link_token(user_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_message_quota} instead. # # Get the target limit for additional messages # @@ -1085,6 +1196,8 @@ def get_quota end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_message_quota_consumption} instead. # # Get number of messages sent this month # @@ -1099,6 +1212,8 @@ def get_quota_consumption end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Insight::ApiClient#get_number_of_message_deliveries} instead. # # Returns the number of messages sent on a specified day # @@ -1115,6 +1230,8 @@ def get_number_of_message_deliveries(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Insight::ApiClient#get_message_event} instead. # # Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. # @@ -1131,6 +1248,8 @@ def get_user_interaction_statistics(request_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Insight::ApiClient#get_number_of_followers} instead. # # Returns the number of followers # @@ -1147,6 +1266,8 @@ def get_number_of_followers(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Insight::ApiClient#get_friends_demographics} instead. # # Get the demographic attributes for a bot's friends. # @@ -1161,6 +1282,8 @@ def get_friend_demographics end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_bot_info} instead. # # Gets a bot's basic information. # @@ -1175,6 +1298,8 @@ def get_bot_info end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_webhook_endpoint} instead. # # Gets information on a webhook endpoint. # @@ -1189,6 +1314,8 @@ def get_webhook_endpoint end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#set_webhook_endpoint} instead. # # Sets the webhook endpoint URL. # @@ -1206,6 +1333,8 @@ def set_webhook_endpoint(webhook_endpoint) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#test_webhook_endpoint} instead. # # Checks if the configured webhook endpoint can receive a test webhook event. # @@ -1227,6 +1356,8 @@ def test_webhook_endpoint(webhook_endpoint = nil) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Liff::ApiClient#get_all_liff_apps} instead. # def get_liff_apps warn '[DEPRECATION] `Line::Bot::Client#get_liff_apps` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#get_all_liff_apps` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] @@ -1238,6 +1369,8 @@ def get_liff_apps end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Liff::ApiClient#add_liff_app} instead. # def create_liff_app(app) warn '[DEPRECATION] `Line::Bot::Client#create_liff_app` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#add_liff_app` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] @@ -1249,6 +1382,8 @@ def create_liff_app(app) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Liff::ApiClient#update_liff_app} instead. # def update_liff_app(liff_id, app) warn '[DEPRECATION] `Line::Bot::Client#update_liff_app` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#update_liff_app` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] @@ -1260,6 +1395,8 @@ def update_liff_app(liff_id, app) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Liff::ApiClient#delete_liff_app} instead. # def delete_liff_app(liff_id) warn '[DEPRECATION] `Line::Bot::Client#delete_liff_app` is deprecated. Please use `Line::Bot::V2::Liff::ApiClient#delete_liff_app` instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] @@ -1271,6 +1408,8 @@ def delete_liff_app(liff_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#create_audience_group} instead. # # Create an audience group by uploading user_ids # @@ -1290,6 +1429,8 @@ def create_user_id_audience(params) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#add_audience_to_audience_group} instead. # # Update an audience group # @@ -1309,6 +1450,8 @@ def update_user_id_audience(params) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#create_click_based_audience_group} instead. # # Create an audience group of users that clicked a URL in a message sent in the past # @@ -1328,6 +1471,8 @@ def create_click_audience(params) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#create_imp_based_audience_group} instead. # # Create an audience group of users that opened a message sent in the past # @@ -1347,6 +1492,8 @@ def create_impression_audience(params) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#update_audience_group_description} instead. # # Rename an existing audience group # @@ -1365,6 +1512,8 @@ def rename_audience(audience_group_id, description) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#delete_audience_group} instead. # # Delete an existing audience group # @@ -1384,6 +1533,8 @@ def delete_audience(audience_group_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#get_audience_data} instead. # # Get audience group data # @@ -1403,6 +1554,8 @@ def get_audience(audience_group_id) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::ManageAudience::ApiClient#get_audience_groups} instead. # # Get data for more than one audience group # @@ -1422,6 +1575,7 @@ def get_audiences(params) end # @deprecated + # This is obsolete. # # Get the authority level of the audience # @@ -1439,6 +1593,7 @@ def get_audience_authority_level end # @deprecated + # This is obsolete. # # Change the authority level of the audience # @@ -1459,6 +1614,8 @@ def update_audience_authority_level(authority_level) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Insight::ApiClient#get_statistics_per_unit} instead. # # Get the per-unit statistics of how users interact with push messages and multicast messages. # @@ -1478,6 +1635,8 @@ def get_statistics_per_unit(unit:, from:, to:) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_usage} instead. # # Get the number of aggregation units used this month. # @@ -1492,6 +1651,8 @@ def get_aggregation_info end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_aggregation_unit_name_list} instead. # # Get the name list of units used this month for statistics aggregation. # @@ -1510,6 +1671,8 @@ def get_aggregation_list(limit: nil, start: nil) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_narrowcast_progress} instead. # # Gets the status of a narrowcast message. # @@ -1526,6 +1689,7 @@ def get_narrowcast_message_status(request_id) end # @deprecated + # This is obsolete. # # Send messages to multiple users using phone numbers. # @@ -1549,6 +1713,7 @@ def multicast_by_phone_numbers(to, messages, headers: {}, payload: {}) end # @deprecated + # This is obsolete. # # Get the delivery result of the message delivered in Send message using phone number. (`#multicast_by_phone_numbers`) # @@ -1565,6 +1730,8 @@ def get_delivery_result_sent_by_phone_numbers(date) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#push_messages_by_phone} instead. # # Send a LINE notification message by specifying the user's phone number. # @@ -1587,6 +1754,8 @@ def push_pnp(hashed_phone_number, messages, headers: {}, payload: {}) end # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::MessagingApi::ApiClient#get_pnp_message_statistics} instead. # # Get the number of LINE notification messages sent using the /bot/pnp/push endpoint. # @@ -1657,8 +1826,8 @@ def delete(endpoint_base, endpoint_path, headers = {}) end # @deprecated - # This method is deprecated. - # Please use `Line::Bot::V2::WebhookParser#parse` instead. + # This is deprecated. + # Please use {Line::Bot::V2::WebhookParser#parse} instead. # # Parse events from request.body # @@ -1680,8 +1849,8 @@ def parse_events_from(request_body) end # @deprecated - # This method is deprecated. - # Please use `Line::Bot::V2::WebhookParser#parse` instead. + # This is deprecated. + # Please use {Line::Bot::V2::WebhookParser#parse} instead. # # Validate signature of a webhook event. # From f14275ee807a319ffabef7cbb9705364ab354e4b Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Tue, 1 Apr 2025 16:28:29 +0900 Subject: [PATCH 5/5] NO-ISSUE Add @deprecated and specify the class or function name to migrate to --- lib/line/bot/v1/api.rb | 2 ++ lib/line/bot/v1/api/errors.rb | 2 ++ lib/line/bot/v1/api/version.rb | 2 ++ lib/line/bot/v1/client.rb | 12 +++++++++++ lib/line/bot/v1/event/account_link.rb | 4 ++++ lib/line/bot/v1/event/base.rb | 4 ++++ lib/line/bot/v1/event/beacon.rb | 4 ++++ lib/line/bot/v1/event/follow.rb | 4 ++++ lib/line/bot/v1/event/join.rb | 4 ++++ lib/line/bot/v1/event/leave.rb | 4 ++++ lib/line/bot/v1/event/member_joined.rb | 4 ++++ lib/line/bot/v1/event/member_left.rb | 4 ++++ lib/line/bot/v1/event/message.rb | 6 ++++++ lib/line/bot/v1/event/postback.rb | 4 ++++ lib/line/bot/v1/event/things.rb | 6 ++++++ lib/line/bot/v1/event/unfollow.rb | 4 ++++ lib/line/bot/v1/event/unsend.rb | 4 ++++ lib/line/bot/v1/event/video_play_complete.rb | 4 ++++ lib/line/bot/v1/httpclient.rb | 22 ++++++++++++++++++++ lib/line/bot/v1/util.rb | 4 ++++ 20 files changed, 104 insertions(+) diff --git a/lib/line/bot/v1/api.rb b/lib/line/bot/v1/api.rb index 160c1681..1126ff18 100644 --- a/lib/line/bot/v1/api.rb +++ b/lib/line/bot/v1/api.rb @@ -16,6 +16,8 @@ module Line module Bot + # @deprecated + # This is obsolete. module API DEFAULT_OAUTH_ENDPOINT = "https://api.line.me" DEFAULT_ENDPOINT = "https://api.line.me/v2" diff --git a/lib/line/bot/v1/api/errors.rb b/lib/line/bot/v1/api/errors.rb index c7cde543..8feac0f8 100644 --- a/lib/line/bot/v1/api/errors.rb +++ b/lib/line/bot/v1/api/errors.rb @@ -15,6 +15,8 @@ module Line module Bot module API + # @deprecated + # This is obsolete. (and there is no caller...) class Error < StandardError; end end end diff --git a/lib/line/bot/v1/api/version.rb b/lib/line/bot/v1/api/version.rb index 2f03dfcb..bad050be 100644 --- a/lib/line/bot/v1/api/version.rb +++ b/lib/line/bot/v1/api/version.rb @@ -15,6 +15,8 @@ module Line module Bot module API + # @deprecated + # Use {Line::Bot::V2::VERSION} instead. VERSION = "1.29.0" end end diff --git a/lib/line/bot/v1/client.rb b/lib/line/bot/v1/client.rb index 4fadad05..2af9ea2b 100644 --- a/lib/line/bot/v1/client.rb +++ b/lib/line/bot/v1/client.rb @@ -1772,6 +1772,9 @@ def get_message_delivery_pnp(date) end # @deprecated + # This is obsolete. + # You may use {Line::Bot::V2::HttpClient#get} instead, but it is not recommended. + # # Fetch data, get content of specified URL. # # @param endpoint_base [String] @@ -1785,6 +1788,9 @@ def get(endpoint_base, endpoint_path, headers = {}) end # @deprecated + # This is obsolete. + # You may use {Line::Bot::V2::HttpClient#post} instead, but it is not recommended. + # # Post data, get content of specified URL. # # @param endpoint_base [String] @@ -1799,6 +1805,9 @@ def post(endpoint_base, endpoint_path, payload = nil, headers = {}) end # @deprecated + # This is obsolete. + # You may use {Line::Bot::V2::HttpClient#put} instead, but it is not recommended. + # # Put data, get content of specified URL. # # @param endpoint_base [String] @@ -1813,6 +1822,9 @@ def put(endpoint_base, endpoint_path, payload = nil, headers = {}) end # @deprecated + # This is obsolete. + # You may use {Line::Bot::V2::HttpClient#delete} instead, but it is not recommended. + # # Delete content of specified URL. # # @param endpoint_base [String] diff --git a/lib/line/bot/v1/event/account_link.rb b/lib/line/bot/v1/event/account_link.rb index 3f779d63..43ddb1bc 100644 --- a/lib/line/bot/v1/event/account_link.rb +++ b/lib/line/bot/v1/event/account_link.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::AccountLinkEvent} instead. + # # Event object for when a user has linked his/her LINE account with a provider's service account. # # https://developers.line.biz/en/reference/messaging-api/#account-link-event diff --git a/lib/line/bot/v1/event/base.rb b/lib/line/bot/v1/event/base.rb index 2105cd3c..317535c8 100644 --- a/lib/line/bot/v1/event/base.rb +++ b/lib/line/bot/v1/event/base.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::Event} instead. + class Base def initialize(src) warn '[DEPRECATION] Webhook models in V1 is deprecated. Please use V2 instead.' unless ENV['SUPRESS_V1_DEPRECATION_WARNINGS'] diff --git a/lib/line/bot/v1/event/beacon.rb b/lib/line/bot/v1/event/beacon.rb index 4c38a029..d73e986a 100644 --- a/lib/line/bot/v1/event/beacon.rb +++ b/lib/line/bot/v1/event/beacon.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::BeaconEvent} instead. + # # Event object for when a user enters the range of a LINE Beacon. # # https://developers.line.biz/en/reference/messaging-api/#beacon-event diff --git a/lib/line/bot/v1/event/follow.rb b/lib/line/bot/v1/event/follow.rb index f97a69cd..045657e0 100644 --- a/lib/line/bot/v1/event/follow.rb +++ b/lib/line/bot/v1/event/follow.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::FollowEvent} instead. + # # Event object for when your LINE official account is added as a friend (or unblocked). # You can reply to follow events. # diff --git a/lib/line/bot/v1/event/join.rb b/lib/line/bot/v1/event/join.rb index ab2f837f..08fa339f 100644 --- a/lib/line/bot/v1/event/join.rb +++ b/lib/line/bot/v1/event/join.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::JoinEvent} instead. + # # Event object for when your LINE official account joins a group or room. # # https://developers.line.biz/en/reference/messaging-api/#join-event diff --git a/lib/line/bot/v1/event/leave.rb b/lib/line/bot/v1/event/leave.rb index 43ebf43c..e0144751 100644 --- a/lib/line/bot/v1/event/leave.rb +++ b/lib/line/bot/v1/event/leave.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::LeaveEvent} instead. + # # Event object for when a user removes your LINE official account from a group or when your LINE official account leaves a group or room. # # No replyToken is generated for this event. diff --git a/lib/line/bot/v1/event/member_joined.rb b/lib/line/bot/v1/event/member_joined.rb index c6efdbf1..8cfd5d65 100644 --- a/lib/line/bot/v1/event/member_joined.rb +++ b/lib/line/bot/v1/event/member_joined.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::JoinedMembers} instead. + # # Event object for when a user joins a group or room that the LINE official account is in. # # https://developers.line.biz/en/reference/messaging-api/#member-joined-event diff --git a/lib/line/bot/v1/event/member_left.rb b/lib/line/bot/v1/event/member_left.rb index d5726b92..0eb9341e 100644 --- a/lib/line/bot/v1/event/member_left.rb +++ b/lib/line/bot/v1/event/member_left.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::LeftMembers} instead. + # # Event object for when a user leaves a group or room that the LINE official account is in. # # No replyToken is generated for this event. diff --git a/lib/line/bot/v1/event/message.rb b/lib/line/bot/v1/event/message.rb index fc793721..ec074aa0 100644 --- a/lib/line/bot/v1/event/message.rb +++ b/lib/line/bot/v1/event/message.rb @@ -15,6 +15,8 @@ module Line module Bot module Event + # @deprecated + # This is obsolete. module MessageType Text = 'text' Image = 'image' @@ -26,6 +28,10 @@ module MessageType Unsupport = 'unsupport' end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::MessageContent} instead. + # # Webhook event object which contains the sent message. # # https://developers.line.biz/en/reference/messaging-api/#message-event diff --git a/lib/line/bot/v1/event/postback.rb b/lib/line/bot/v1/event/postback.rb index b7c60e10..bdf9c003 100644 --- a/lib/line/bot/v1/event/postback.rb +++ b/lib/line/bot/v1/event/postback.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::PostbackEvent} instead. + # # Event object for when a user performs a postback action which initiates a postback. # # https://developers.line.biz/en/reference/messaging-api/#postback-event diff --git a/lib/line/bot/v1/event/things.rb b/lib/line/bot/v1/event/things.rb index 185f4667..f3d474f3 100644 --- a/lib/line/bot/v1/event/things.rb +++ b/lib/line/bot/v1/event/things.rb @@ -15,6 +15,8 @@ module Line module Bot module Event + # @deprecated + # This is obsolete. module ThingsType Link = 'link' Unlink = 'unlink' @@ -22,6 +24,10 @@ module ThingsType Unsupport = 'unsupport' end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::ThingsEvent} instead. + # # LINE Things API related events. # # * https://developers.line.biz/en/reference/messaging-api/#device-link-event diff --git a/lib/line/bot/v1/event/unfollow.rb b/lib/line/bot/v1/event/unfollow.rb index b0b8713a..519781c4 100644 --- a/lib/line/bot/v1/event/unfollow.rb +++ b/lib/line/bot/v1/event/unfollow.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::UnfollowEvent} instead. + # # Event object for when your LINE official account is blocked. # # No replyToken is generated for this event. diff --git a/lib/line/bot/v1/event/unsend.rb b/lib/line/bot/v1/event/unsend.rb index 6ec7a253..eae786d2 100644 --- a/lib/line/bot/v1/event/unsend.rb +++ b/lib/line/bot/v1/event/unsend.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::UnsendEvent} instead. + # # Event object for when the user unsends a message in a group or room. # # No replyToken is generated for this event. diff --git a/lib/line/bot/v1/event/video_play_complete.rb b/lib/line/bot/v1/event/video_play_complete.rb index e7136736..1bcb933a 100644 --- a/lib/line/bot/v1/event/video_play_complete.rb +++ b/lib/line/bot/v1/event/video_play_complete.rb @@ -15,6 +15,10 @@ module Line module Bot module Event + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Webhook::VideoPlayComplete} instead. + # # Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account. # # https://developers.line.biz/en/reference/messaging-api/#video-viewing-complete diff --git a/lib/line/bot/v1/httpclient.rb b/lib/line/bot/v1/httpclient.rb index 12190325..e7c2e2ec 100644 --- a/lib/line/bot/v1/httpclient.rb +++ b/lib/line/bot/v1/httpclient.rb @@ -18,10 +18,17 @@ module Line module Bot + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::HttpClient} instead. class HTTPClient # @return [Hash] attr_accessor :http_options + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::HttpClient#initialize} instead. + # # Initialize a new HTTPClient # # @param http_options [Hash] @@ -31,6 +38,9 @@ def initialize(http_options = {}) @http_options = http_options end + # @deprecated + # This is obsolete. + # # @return [Net::HTTP] def http(uri) http = Net::HTTP.new(uri.host, uri.port) @@ -45,21 +55,33 @@ def http(uri) http end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::HttpClient#get} instead. def get(url, header = {}) uri = URI(url) http(uri).get(uri.request_uri, header) end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::HttpClient#post} instead. def post(url, payload, header = {}) uri = URI(url) http(uri).post(uri.request_uri, payload, header) end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::HttpClient#put} instead. def put(url, payload, header = {}) uri = URI(url) http(uri).put(uri.request_uri, payload, header) end + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::HttpClient#delete} instead. def delete(url, header = {}) uri = URI(url) http(uri).delete(uri.request_uri, header) diff --git a/lib/line/bot/v1/util.rb b/lib/line/bot/v1/util.rb index 41c8d2a4..92ebc1d3 100644 --- a/lib/line/bot/v1/util.rb +++ b/lib/line/bot/v1/util.rb @@ -15,6 +15,10 @@ module Line module Bot module Util + # @deprecated + # This is deprecated. + # Please use {Line::Bot::V2::Utils::camelize} instead. + # # @return [String] def self.camelize(string) string.split(/_|(?=[A-Z])/).map(&:capitalize).join