line-bot-api 2.9.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/line/bot/v2/messaging_api/api/messaging_api_client.rb +114 -0
  3. data/lib/line/bot/v2/messaging_api/core.rb +5 -0
  4. data/lib/line/bot/v2/messaging_api/model/acquisition_condition_request.rb +1 -1
  5. data/lib/line/bot/v2/messaging_api/model/acquisition_condition_response.rb +1 -1
  6. data/lib/line/bot/v2/messaging_api/model/action.rb +1 -1
  7. data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_request.rb +1 -1
  8. data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_response.rb +1 -1
  9. data/lib/line/bot/v2/messaging_api/model/coupon_reward_request.rb +1 -1
  10. data/lib/line/bot/v2/messaging_api/model/coupon_reward_response.rb +1 -1
  11. data/lib/line/bot/v2/messaging_api/model/demographic_filter.rb +1 -1
  12. data/lib/line/bot/v2/messaging_api/model/discount_price_info_request.rb +1 -1
  13. data/lib/line/bot/v2/messaging_api/model/discount_price_info_response.rb +1 -1
  14. data/lib/line/bot/v2/messaging_api/model/flex_box_background.rb +1 -1
  15. data/lib/line/bot/v2/messaging_api/model/flex_component.rb +1 -1
  16. data/lib/line/bot/v2/messaging_api/model/flex_container.rb +1 -1
  17. data/lib/line/bot/v2/messaging_api/model/imagemap_action.rb +1 -1
  18. data/lib/line/bot/v2/messaging_api/model/mention_target.rb +1 -1
  19. data/lib/line/bot/v2/messaging_api/model/message.rb +1 -1
  20. data/lib/line/bot/v2/messaging_api/model/pnp_messages_request.rb +6 -0
  21. data/lib/line/bot/v2/messaging_api/model/pnp_templated_button.rb +73 -0
  22. data/lib/line/bot/v2/messaging_api/model/pnp_templated_emphasized_item.rb +74 -0
  23. data/lib/line/bot/v2/messaging_api/model/pnp_templated_item.rb +73 -0
  24. data/lib/line/bot/v2/messaging_api/model/pnp_templated_message_body.rb +92 -0
  25. data/lib/line/bot/v2/messaging_api/model/pnp_templated_message_request.rb +85 -0
  26. data/lib/line/bot/v2/messaging_api/model/recipient.rb +1 -1
  27. data/lib/line/bot/v2/messaging_api/model/rich_menu_batch_operation.rb +1 -1
  28. data/lib/line/bot/v2/messaging_api/model/substitution_object.rb +1 -1
  29. data/lib/line/bot/v2/messaging_api/model/template.rb +1 -1
  30. data/lib/line/bot/v2/webhook/core.rb +1 -0
  31. data/lib/line/bot/v2/webhook/model/event.rb +2 -1
  32. data/lib/line/bot/v2/webhook/model/membership_content.rb +1 -1
  33. data/lib/line/bot/v2/webhook/model/mentionee.rb +1 -1
  34. data/lib/line/bot/v2/webhook/model/message_content.rb +1 -1
  35. data/lib/line/bot/v2/webhook/model/message_edited_event.rb +110 -0
  36. data/lib/line/bot/v2/webhook/model/module_content.rb +1 -1
  37. data/lib/line/bot/v2/webhook/model/source.rb +1 -1
  38. data/lib/line/bot/version.rb +1 -1
  39. data/sig/line/bot/v2/messaging_api/api/messaging_api_client.rbs +68 -0
  40. data/sig/line/bot/v2/messaging_api/model/pnp_messages_request.rbs +3 -0
  41. data/sig/line/bot/v2/messaging_api/model/pnp_templated_button.rbs +43 -0
  42. data/sig/line/bot/v2/messaging_api/model/pnp_templated_emphasized_item.rbs +44 -0
  43. data/sig/line/bot/v2/messaging_api/model/pnp_templated_item.rbs +43 -0
  44. data/sig/line/bot/v2/messaging_api/model/pnp_templated_message_body.rbs +47 -0
  45. data/sig/line/bot/v2/messaging_api/model/pnp_templated_message_request.rbs +49 -0
  46. data/sig/line/bot/v2/webhook/model/message_edited_event.rbs +60 -0
  47. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 591b6fa1640c88a50a6e09496245d4ba2732edb7ad997c7089c0821060b5875e
4
- data.tar.gz: aab0b9c74007a7732f4e51d28e6caeb88c51a03559124556fe7d5dd6bb7dcff3
3
+ metadata.gz: 58f75c16c5deffac0948b216f6af802e1a736edc0017471b9947920d9d01a576
4
+ data.tar.gz: 032dab1369ac0b46233cdcae89f35fa1689eba5211269ae8768315213e090d04
5
5
  SHA512:
6
- metadata.gz: f689ce6cd26aa001bde9006dab4988abcd5922d51e38554436ef9f4956031742e8f573b2f4e5423b802b760690d8a7699ab51fb0a77ede62ac1dce9e19d1f874
7
- data.tar.gz: 1e2cbabf8ea11824b28c897d81705923629c75a50a7fe5ce2b0365cdd113011f4057865c4bf9d011ff471552f52a13c2f6dbdd2465eef49badf1a1fe02a26643
6
+ metadata.gz: fd22b6a86335ff63881ff0f0b45b619e1471627dc60060cd1f18c6d2d5d298efc06fca5173d8e8e73a1d52ccc44d52e36d38fdd9c74eb817ebc3e98c388a9808
7
+ data.tar.gz: 73c1d19420d5737d6b8d35e3a99e546fe39d25a2a9c62bdf8a989cf230f4ef5a38bf0966f237fde4c7bc5dd1b195597619e10a8e04477371d31f135976778ccc
@@ -1632,6 +1632,58 @@ module Line
1632
1632
  response_body
1633
1633
  end
1634
1634
 
1635
+ # Get number of sent LINE notification messages (template)
1636
+ # This requests to <code>GET https://api.line.me/v2/bot/message/delivery/pnp/templated</code>
1637
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
1638
+ #
1639
+ # @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
1640
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#get-number-of-sent-line-notification-messages-template
1641
+ # @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, Integer, Hash{String => String})] when HTTP status code is 200
1642
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
1643
+ def get_pnp_templated_message_statistics_with_http_info(
1644
+ date:
1645
+ )
1646
+ path = "/v2/bot/message/delivery/pnp/templated"
1647
+ query_params = {
1648
+ "date": date
1649
+ }.compact
1650
+
1651
+ response = @http_client.get(
1652
+ path: path,
1653
+ query_params: query_params,
1654
+ )
1655
+
1656
+ case response.code.to_i
1657
+ when 200
1658
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
1659
+ json.transform_keys! do |key|
1660
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
1661
+ end
1662
+ response_body = Line::Bot::V2::MessagingApi::NumberOfMessagesResponse.create(json)
1663
+ [response_body, 200, response.each_header.to_h]
1664
+ else
1665
+ [response.body, response.code.to_i, response.each_header.to_h]
1666
+ end
1667
+ end
1668
+
1669
+ # Get number of sent LINE notification messages (template)
1670
+ # This requests to <code>GET https://api.line.me/v2/bot/message/delivery/pnp/templated</code>
1671
+ # When you want to get HTTP status code or response headers, use {#get_pnp_templated_message_statistics_with_http_info} instead of this.
1672
+ #
1673
+ # @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
1674
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#get-number-of-sent-line-notification-messages-template
1675
+ # @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200
1676
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
1677
+ def get_pnp_templated_message_statistics(
1678
+ date:
1679
+ )
1680
+ response_body, _status_code, _headers = get_pnp_templated_message_statistics_with_http_info(
1681
+ date: date
1682
+ )
1683
+
1684
+ response_body
1685
+ end
1686
+
1635
1687
  # Get profile
1636
1688
  # This requests to <code>GET https://api.line.me/v2/bot/profile/{userId}</code>
1637
1689
  # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -2935,6 +2987,68 @@ module Line
2935
2987
  response_body
2936
2988
  end
2937
2989
 
2990
+ # Send LINE notification message (template)
2991
+ # This requests to <code>POST https://api.line.me/v2/bot/message/pnp/templated/push</code>
2992
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
2993
+ #
2994
+ # @param pnp_templated_message_request [PnpTemplatedMessageRequest]
2995
+ # @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook.
2996
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template
2997
+ # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202
2998
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 422
2999
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
3000
+ def push_templated_messages_by_phone_with_http_info(
3001
+ pnp_templated_message_request:,
3002
+ x_line_delivery_tag: nil
3003
+ )
3004
+ path = "/v2/bot/message/pnp/templated/push"
3005
+ header_params = {
3006
+ "X-Line-Delivery-Tag": x_line_delivery_tag
3007
+ }.compact
3008
+
3009
+ response = @http_client.post(
3010
+ path: path,
3011
+ body_params: pnp_templated_message_request,
3012
+ headers: header_params
3013
+ )
3014
+
3015
+ case response.code.to_i
3016
+ when 202
3017
+ [response.body, 202, response.each_header.to_h]
3018
+ when 422
3019
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
3020
+ json.transform_keys! do |key|
3021
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
3022
+ end
3023
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json)
3024
+ [response_body, 422, response.each_header.to_h]
3025
+ else
3026
+ [response.body, response.code.to_i, response.each_header.to_h]
3027
+ end
3028
+ end
3029
+
3030
+ # Send LINE notification message (template)
3031
+ # This requests to <code>POST https://api.line.me/v2/bot/message/pnp/templated/push</code>
3032
+ # When you want to get HTTP status code or response headers, use {#push_templated_messages_by_phone_with_http_info} instead of this.
3033
+ #
3034
+ # @param pnp_templated_message_request [PnpTemplatedMessageRequest]
3035
+ # @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook.
3036
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template
3037
+ # @return [String, nil] when HTTP status code is 202
3038
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 422
3039
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
3040
+ def push_templated_messages_by_phone(
3041
+ pnp_templated_message_request:,
3042
+ x_line_delivery_tag: nil
3043
+ )
3044
+ response_body, _status_code, _headers = push_templated_messages_by_phone_with_http_info(
3045
+ pnp_templated_message_request: pnp_templated_message_request,
3046
+ x_line_delivery_tag: x_line_delivery_tag
3047
+ )
3048
+
3049
+ response_body
3050
+ end
3051
+
2938
3052
  # Send reply message
2939
3053
  # This requests to <code>POST https://api.line.me/v2/bot/message/reply</code>
2940
3054
  # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -148,6 +148,11 @@ require_relative './model/number_of_messages_response'
148
148
  require_relative './model/operator_demographic_filter'
149
149
  require_relative './model/operator_recipient'
150
150
  require_relative './model/pnp_messages_request'
151
+ require_relative './model/pnp_templated_button'
152
+ require_relative './model/pnp_templated_emphasized_item'
153
+ require_relative './model/pnp_templated_item'
154
+ require_relative './model/pnp_templated_message_body'
155
+ require_relative './model/pnp_templated_message_request'
151
156
  require_relative './model/postback_action'
152
157
  require_relative './model/push_message_request'
153
158
  require_relative './model/push_message_response'
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -51,7 +51,7 @@ module Line
51
51
  def self.create(args)
52
52
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
53
53
  klass = detect_class(type: symbolized_args[:type])
54
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
54
+ return klass.new(**symbolized_args) if klass
55
55
  return new(**symbolized_args)
56
56
  end
57
57
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -44,7 +44,7 @@ module Line
44
44
  def self.create(args)
45
45
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
46
46
  klass = detect_class(type: symbolized_args[:type])
47
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
47
+ return klass.new(**symbolized_args) if klass
48
48
  return new(**symbolized_args)
49
49
  end
50
50
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -50,7 +50,7 @@ module Line
50
50
  def self.create(args)
51
51
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
52
52
  klass = detect_class(type: symbolized_args[:type])
53
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
53
+ return klass.new(**symbolized_args) if klass
54
54
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
55
55
  end
56
56
 
@@ -43,7 +43,7 @@ module Line
43
43
  def self.create(args)
44
44
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
45
  klass = detect_class(type: symbolized_args[:type])
46
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
46
+ return klass.new(**symbolized_args) if klass
47
47
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
48
48
  end
49
49
 
@@ -56,7 +56,7 @@ module Line
56
56
  def self.create(args)
57
57
  symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
58
58
  klass = detect_class(type: symbolized_args[:type])
59
- return klass.new(**symbolized_args) if klass # steep:ignore UnannotatedEmptyCollection
59
+ return klass.new(**symbolized_args) if klass
60
60
  return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
61
61
  end
62
62
 
@@ -22,14 +22,19 @@ module Line
22
22
  # @!attribute [rw] notification_disabled
23
23
  # @return [Boolean,nil] `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false.
24
24
  attr_accessor :notification_disabled
25
+ # @!attribute [rw] custom_aggregation_units
26
+ # @return [Array[String],nil] Name of aggregation unit. Case-sensitive.
27
+ attr_accessor :custom_aggregation_units
25
28
 
26
29
  # @param messages [Array[Message, Hash[Symbol, untyped]]] Message to be sent.
27
30
  # @param to [String] Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.
28
31
  # @param notification_disabled [Boolean,nil] `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false.
32
+ # @param custom_aggregation_units [Array[String],nil] Name of aggregation unit. Case-sensitive.
29
33
  def initialize(
30
34
  messages:,
31
35
  to:,
32
36
  notification_disabled: false,
37
+ custom_aggregation_units: nil,
33
38
  **dynamic_attributes
34
39
  )
35
40
 
@@ -42,6 +47,7 @@ module Line
42
47
  end
43
48
  @to = to
44
49
  @notification_disabled = notification_disabled
50
+ @custom_aggregation_units = custom_aggregation_units
45
51
 
46
52
  dynamic_attributes.each do |key, value|
47
53
  self.class.attr_accessor key
@@ -0,0 +1,73 @@
1
+ # LINE Messaging API
2
+ # This document describes LINE Messaging API.
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module MessagingApi
14
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-buttons
15
+ class PnpTemplatedButton
16
+ # @!attribute [rw] button_key
17
+ # @return [String] Specify the key of the button you want to include. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#buttons
18
+ attr_accessor :button_key
19
+ # @!attribute [rw] url
20
+ # @return [String] URL of the page to be opened when the user presses the button.
21
+ attr_accessor :url
22
+
23
+ # @param button_key [String] Specify the key of the button you want to include. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#buttons
24
+ # @param url [String] URL of the page to be opened when the user presses the button.
25
+ def initialize(
26
+ button_key:,
27
+ url:,
28
+ **dynamic_attributes
29
+ )
30
+
31
+ @button_key = button_key
32
+ @url = url
33
+
34
+ dynamic_attributes.each do |key, value|
35
+ self.class.attr_accessor key
36
+
37
+ if value.is_a?(Hash)
38
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
39
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
40
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
41
+ else
42
+ instance_variable_set("@#{key}", value)
43
+ end
44
+ end
45
+ end
46
+
47
+ # Create an instance of the class from a hash
48
+ # @param args [Hash] Hash containing all the required attributes
49
+ # @return [Line::Bot::V2::MessagingApi::PnpTemplatedButton] Instance of the class
50
+ def self.create(args)
51
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
52
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
53
+ end
54
+
55
+ # @param other [Object] Object to compare
56
+ # @return [Boolean] true if the objects are equal, false otherwise
57
+ def ==(other)
58
+ return false unless self.class == other.class
59
+
60
+ instance_variables.all? do |var|
61
+ instance_variable_get(var) == other.instance_variable_get(var)
62
+ end
63
+ end
64
+
65
+ # @return [Integer] Hash code of the object
66
+ def hash
67
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,74 @@
1
+ # LINE Messaging API
2
+ # This document describes LINE Messaging API.
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module MessagingApi
14
+ # Item to emphasize in the message.
15
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-items
16
+ class PnpTemplatedEmphasizedItem
17
+ # @!attribute [rw] item_key
18
+ # @return [String] Specify the key of the item you want to include. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items
19
+ attr_accessor :item_key
20
+ # @!attribute [rw] content
21
+ # @return [String] String to be displayed as the value of the item.
22
+ attr_accessor :content
23
+
24
+ # @param item_key [String] Specify the key of the item you want to include. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items
25
+ # @param content [String] String to be displayed as the value of the item.
26
+ def initialize(
27
+ item_key:,
28
+ content:,
29
+ **dynamic_attributes
30
+ )
31
+
32
+ @item_key = item_key
33
+ @content = content
34
+
35
+ dynamic_attributes.each do |key, value|
36
+ self.class.attr_accessor key
37
+
38
+ if value.is_a?(Hash)
39
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
40
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
41
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
42
+ else
43
+ instance_variable_set("@#{key}", value)
44
+ end
45
+ end
46
+ end
47
+
48
+ # Create an instance of the class from a hash
49
+ # @param args [Hash] Hash containing all the required attributes
50
+ # @return [Line::Bot::V2::MessagingApi::PnpTemplatedEmphasizedItem] Instance of the class
51
+ def self.create(args)
52
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
53
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
54
+ end
55
+
56
+ # @param other [Object] Object to compare
57
+ # @return [Boolean] true if the objects are equal, false otherwise
58
+ def ==(other)
59
+ return false unless self.class == other.class
60
+
61
+ instance_variables.all? do |var|
62
+ instance_variable_get(var) == other.instance_variable_get(var)
63
+ end
64
+ end
65
+
66
+ # @return [Integer] Hash code of the object
67
+ def hash
68
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,73 @@
1
+ # LINE Messaging API
2
+ # This document describes LINE Messaging API.
3
+ #
4
+ # The version of the OpenAPI document: 0.0.1
5
+ #
6
+ # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7
+ # https://openapi-generator.tech
8
+ # Do not edit the class manually.
9
+
10
+ module Line
11
+ module Bot
12
+ module V2
13
+ module MessagingApi
14
+ # @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-items
15
+ class PnpTemplatedItem
16
+ # @!attribute [rw] item_key
17
+ # @return [String] Specify the key of the item you want to include. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items
18
+ attr_accessor :item_key
19
+ # @!attribute [rw] content
20
+ # @return [String] String to be displayed as the value of the item.
21
+ attr_accessor :content
22
+
23
+ # @param item_key [String] Specify the key of the item you want to include. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items
24
+ # @param content [String] String to be displayed as the value of the item.
25
+ def initialize(
26
+ item_key:,
27
+ content:,
28
+ **dynamic_attributes
29
+ )
30
+
31
+ @item_key = item_key
32
+ @content = content
33
+
34
+ dynamic_attributes.each do |key, value|
35
+ self.class.attr_accessor key
36
+
37
+ if value.is_a?(Hash)
38
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
39
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
40
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
41
+ else
42
+ instance_variable_set("@#{key}", value)
43
+ end
44
+ end
45
+ end
46
+
47
+ # Create an instance of the class from a hash
48
+ # @param args [Hash] Hash containing all the required attributes
49
+ # @return [Line::Bot::V2::MessagingApi::PnpTemplatedItem] Instance of the class
50
+ def self.create(args)
51
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
52
+ return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
53
+ end
54
+
55
+ # @param other [Object] Object to compare
56
+ # @return [Boolean] true if the objects are equal, false otherwise
57
+ def ==(other)
58
+ return false unless self.class == other.class
59
+
60
+ instance_variables.all? do |var|
61
+ instance_variable_get(var) == other.instance_variable_get(var)
62
+ end
63
+ end
64
+
65
+ # @return [Integer] Hash code of the object
66
+ def hash
67
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end