line-bot-api 2.10.0 → 2.12.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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +0 -1
- data/lib/line/bot/v2/http_client.rb +7 -1
- data/lib/line/bot/v2/messaging_api/api/messaging_api_client.rb +114 -0
- data/lib/line/bot/v2/messaging_api/core.rb +5 -0
- data/lib/line/bot/v2/messaging_api/model/acquisition_condition_request.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/acquisition_condition_response.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/action.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_request.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_response.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/coupon_create_request.rb +16 -4
- data/lib/line/bot/v2/messaging_api/model/coupon_response.rb +14 -2
- data/lib/line/bot/v2/messaging_api/model/coupon_reward_request.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/coupon_reward_response.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/demographic_filter.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/discount_price_info_request.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/discount_price_info_response.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/flex_box_background.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/flex_component.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/flex_container.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/imagemap_action.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/mention_target.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/message.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/pnp_messages_request.rb +6 -0
- data/lib/line/bot/v2/messaging_api/model/pnp_templated_button.rb +73 -0
- data/lib/line/bot/v2/messaging_api/model/pnp_templated_emphasized_item.rb +74 -0
- data/lib/line/bot/v2/messaging_api/model/pnp_templated_item.rb +73 -0
- data/lib/line/bot/v2/messaging_api/model/pnp_templated_message_body.rb +92 -0
- data/lib/line/bot/v2/messaging_api/model/pnp_templated_message_request.rb +85 -0
- data/lib/line/bot/v2/messaging_api/model/recipient.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/rich_menu_batch_operation.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/substitution_object.rb +1 -1
- data/lib/line/bot/v2/messaging_api/model/template.rb +1 -1
- data/lib/line/bot/v2/webhook/model/event.rb +1 -1
- data/lib/line/bot/v2/webhook/model/membership_content.rb +1 -1
- data/lib/line/bot/v2/webhook/model/mentionee.rb +1 -1
- data/lib/line/bot/v2/webhook/model/message_content.rb +1 -1
- data/lib/line/bot/v2/webhook/model/module_content.rb +1 -1
- data/lib/line/bot/v2/webhook/model/source.rb +1 -1
- data/lib/line/bot/version.rb +1 -1
- data/sig/line/bot/v2/http_client.rbs +7 -0
- data/sig/line/bot/v2/messaging_api/api/messaging_api_client.rbs +68 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_create_request.rbs +10 -4
- data/sig/line/bot/v2/messaging_api/model/coupon_response.rbs +7 -1
- data/sig/line/bot/v2/messaging_api/model/pnp_messages_request.rbs +3 -0
- data/sig/line/bot/v2/messaging_api/model/pnp_templated_button.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/pnp_templated_emphasized_item.rbs +44 -0
- data/sig/line/bot/v2/messaging_api/model/pnp_templated_item.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/pnp_templated_message_body.rbs +47 -0
- data/sig/line/bot/v2/messaging_api/model/pnp_templated_message_request.rbs +49 -0
- metadata +12 -2
|
@@ -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
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
# The body object of the template you want to send. You can't specify the same item more than once in a single message.
|
|
15
|
+
# @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template
|
|
16
|
+
class PnpTemplatedMessageBody
|
|
17
|
+
# @!attribute [rw] emphasized_item
|
|
18
|
+
# @return [PnpTemplatedEmphasizedItem,nil]
|
|
19
|
+
attr_accessor :emphasized_item
|
|
20
|
+
# @!attribute [rw] items
|
|
21
|
+
# @return [Array[PnpTemplatedItem],nil] Array of items to include in the message. The `itemKey` must be unique across `emphasizedItem` and `items`.
|
|
22
|
+
attr_accessor :items
|
|
23
|
+
# @!attribute [rw] buttons
|
|
24
|
+
# @return [Array[PnpTemplatedButton],nil] Array of buttons to include in the message. The `buttonKey` must be unique.
|
|
25
|
+
attr_accessor :buttons
|
|
26
|
+
|
|
27
|
+
# @param emphasized_item [PnpTemplatedEmphasizedItem, Hash[Symbol, untyped], nil]
|
|
28
|
+
# @param items [Array[PnpTemplatedItem, Hash[Symbol, untyped]],nil] Array of items to include in the message. The `itemKey` must be unique across `emphasizedItem` and `items`.
|
|
29
|
+
# @param buttons [Array[PnpTemplatedButton, Hash[Symbol, untyped]],nil] Array of buttons to include in the message. The `buttonKey` must be unique.
|
|
30
|
+
def initialize(
|
|
31
|
+
emphasized_item: nil,
|
|
32
|
+
items: nil,
|
|
33
|
+
buttons: nil,
|
|
34
|
+
**dynamic_attributes
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
@emphasized_item = emphasized_item.is_a?(Line::Bot::V2::MessagingApi::PnpTemplatedEmphasizedItem) || emphasized_item.nil? ? emphasized_item : Line::Bot::V2::MessagingApi::PnpTemplatedEmphasizedItem.create(**emphasized_item)
|
|
38
|
+
@items = items&.map do |item|
|
|
39
|
+
if item.is_a?(Hash)
|
|
40
|
+
Line::Bot::V2::MessagingApi::PnpTemplatedItem.create(**item)
|
|
41
|
+
else
|
|
42
|
+
item
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
@buttons = buttons&.map do |item|
|
|
46
|
+
if item.is_a?(Hash)
|
|
47
|
+
Line::Bot::V2::MessagingApi::PnpTemplatedButton.create(**item)
|
|
48
|
+
else
|
|
49
|
+
item
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
dynamic_attributes.each do |key, value|
|
|
54
|
+
self.class.attr_accessor key
|
|
55
|
+
|
|
56
|
+
if value.is_a?(Hash)
|
|
57
|
+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
|
|
58
|
+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
|
|
59
|
+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
|
|
60
|
+
else
|
|
61
|
+
instance_variable_set("@#{key}", value)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Create an instance of the class from a hash
|
|
67
|
+
# @param args [Hash] Hash containing all the required attributes
|
|
68
|
+
# @return [Line::Bot::V2::MessagingApi::PnpTemplatedMessageBody] Instance of the class
|
|
69
|
+
def self.create(args)
|
|
70
|
+
symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
|
|
71
|
+
return new(**symbolized_args)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# @param other [Object] Object to compare
|
|
75
|
+
# @return [Boolean] true if the objects are equal, false otherwise
|
|
76
|
+
def ==(other)
|
|
77
|
+
return false unless self.class == other.class
|
|
78
|
+
|
|
79
|
+
instance_variables.all? do |var|
|
|
80
|
+
instance_variable_get(var) == other.instance_variable_get(var)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# @return [Integer] Hash code of the object
|
|
85
|
+
def hash
|
|
86
|
+
[self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
|
15
|
+
class PnpTemplatedMessageRequest
|
|
16
|
+
# @!attribute [rw] to
|
|
17
|
+
# @return [String] Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.
|
|
18
|
+
attr_accessor :to
|
|
19
|
+
# @!attribute [rw] template_key
|
|
20
|
+
# @return [String] Specify the key of the template you want to send. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#templates
|
|
21
|
+
attr_accessor :template_key
|
|
22
|
+
# @!attribute [rw] body
|
|
23
|
+
# @return [PnpTemplatedMessageBody,nil]
|
|
24
|
+
attr_accessor :body
|
|
25
|
+
# @!attribute [rw] custom_aggregation_units
|
|
26
|
+
# @return [Array[String],nil] Name of aggregation unit. Case-sensitive. For more information about assigning a unit name, see https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/#assign-names-to-units-when-sending-messages
|
|
27
|
+
attr_accessor :custom_aggregation_units
|
|
28
|
+
|
|
29
|
+
# @param to [String] Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.
|
|
30
|
+
# @param template_key [String] Specify the key of the template you want to send. For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#templates
|
|
31
|
+
# @param body [PnpTemplatedMessageBody, Hash[Symbol, untyped], nil]
|
|
32
|
+
# @param custom_aggregation_units [Array[String],nil] Name of aggregation unit. Case-sensitive. For more information about assigning a unit name, see https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/#assign-names-to-units-when-sending-messages
|
|
33
|
+
def initialize(
|
|
34
|
+
to:,
|
|
35
|
+
template_key:,
|
|
36
|
+
body: nil,
|
|
37
|
+
custom_aggregation_units: nil,
|
|
38
|
+
**dynamic_attributes
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
@to = to
|
|
42
|
+
@template_key = template_key
|
|
43
|
+
@body = body.is_a?(Line::Bot::V2::MessagingApi::PnpTemplatedMessageBody) || body.nil? ? body : Line::Bot::V2::MessagingApi::PnpTemplatedMessageBody.create(**body)
|
|
44
|
+
@custom_aggregation_units = custom_aggregation_units
|
|
45
|
+
|
|
46
|
+
dynamic_attributes.each do |key, value|
|
|
47
|
+
self.class.attr_accessor key
|
|
48
|
+
|
|
49
|
+
if value.is_a?(Hash)
|
|
50
|
+
struct_klass = Struct.new(*value.keys.map(&:to_sym))
|
|
51
|
+
struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
|
|
52
|
+
instance_variable_set("@#{key}", struct_klass.new(*struct_values))
|
|
53
|
+
else
|
|
54
|
+
instance_variable_set("@#{key}", value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Create an instance of the class from a hash
|
|
60
|
+
# @param args [Hash] Hash containing all the required attributes
|
|
61
|
+
# @return [Line::Bot::V2::MessagingApi::PnpTemplatedMessageRequest] Instance of the class
|
|
62
|
+
def self.create(args)
|
|
63
|
+
symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
|
|
64
|
+
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# @param other [Object] Object to compare
|
|
68
|
+
# @return [Boolean] true if the objects are equal, false otherwise
|
|
69
|
+
def ==(other)
|
|
70
|
+
return false unless self.class == other.class
|
|
71
|
+
|
|
72
|
+
instance_variables.all? do |var|
|
|
73
|
+
instance_variable_get(var) == other.instance_variable_get(var)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# @return [Integer] Hash code of the object
|
|
78
|
+
def hash
|
|
79
|
+
[self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -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
|
|
47
|
+
return klass.new(**symbolized_args) if klass
|
|
48
48
|
return new(**symbolized_args)
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -45,7 +45,7 @@ module Line
|
|
|
45
45
|
def self.create(args)
|
|
46
46
|
symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
|
|
47
47
|
klass = detect_class(type: symbolized_args[:type])
|
|
48
|
-
return klass.new(**symbolized_args) if klass
|
|
48
|
+
return klass.new(**symbolized_args) if klass
|
|
49
49
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -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
|
|
47
|
+
return klass.new(**symbolized_args) if klass
|
|
48
48
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
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
|
|
46
|
+
return klass.new(**symbolized_args) if klass
|
|
47
47
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -74,7 +74,7 @@ module Line
|
|
|
74
74
|
def self.create(args)
|
|
75
75
|
symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
|
|
76
76
|
klass = detect_class(type: symbolized_args[:type])
|
|
77
|
-
return klass.new(**symbolized_args) if klass
|
|
77
|
+
return klass.new(**symbolized_args) if klass
|
|
78
78
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
79
79
|
end
|
|
80
80
|
|
|
@@ -45,7 +45,7 @@ module Line
|
|
|
45
45
|
def self.create(args)
|
|
46
46
|
symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
|
|
47
47
|
klass = detect_class(type: symbolized_args[:type])
|
|
48
|
-
return klass.new(**symbolized_args) if klass
|
|
48
|
+
return klass.new(**symbolized_args) if klass
|
|
49
49
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -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
|
|
59
|
+
return klass.new(**symbolized_args) if klass
|
|
60
60
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -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
|
|
53
|
+
return klass.new(**symbolized_args) if klass
|
|
54
54
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -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
|
|
47
|
+
return klass.new(**symbolized_args) if klass
|
|
48
48
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -45,7 +45,7 @@ module Line
|
|
|
45
45
|
def self.create(args)
|
|
46
46
|
symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
|
|
47
47
|
klass = detect_class(type: symbolized_args[:type])
|
|
48
|
-
return klass.new(**symbolized_args) if klass
|
|
48
|
+
return klass.new(**symbolized_args) if klass
|
|
49
49
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
50
50
|
end
|
|
51
51
|
|
data/lib/line/bot/version.rb
CHANGED
|
@@ -32,6 +32,13 @@ module Line
|
|
|
32
32
|
?headers: Hash[Symbol, untyped]?
|
|
33
33
|
) -> Net::HTTPResponse
|
|
34
34
|
|
|
35
|
+
def patch: (
|
|
36
|
+
path: String,
|
|
37
|
+
?query_params: Hash[Symbol, untyped]?,
|
|
38
|
+
?body_params: (File | Hash[untyped, untyped] | untyped)?,
|
|
39
|
+
?headers: Hash[Symbol, untyped]?
|
|
40
|
+
) -> Net::HTTPResponse
|
|
41
|
+
|
|
35
42
|
def delete: (
|
|
36
43
|
path: String,
|
|
37
44
|
?query_params: Hash[Symbol, untyped]?,
|
|
@@ -974,6 +974,36 @@ module Line
|
|
|
974
974
|
| String? # otherwise
|
|
975
975
|
)
|
|
976
976
|
|
|
977
|
+
# Get number of sent LINE notification messages (template)
|
|
978
|
+
# This requests to <code>GET https://api.line.me/v2/bot/message/delivery/pnp/templated</code>
|
|
979
|
+
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
|
|
980
|
+
#
|
|
981
|
+
# @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
|
|
982
|
+
# @see https://developers.line.biz/en/reference/line-notification-messages/#get-number-of-sent-line-notification-messages-template
|
|
983
|
+
# @return [Array(Line::Bot::V2::MessagingApi::NumberOfMessagesResponse, Integer, Hash{String => String})] when HTTP status code is 200
|
|
984
|
+
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
|
|
985
|
+
def get_pnp_templated_message_statistics_with_http_info: (
|
|
986
|
+
date: String
|
|
987
|
+
) -> (
|
|
988
|
+
[NumberOfMessagesResponse, 200, Hash[untyped, untyped]] # when HTTP status code is 200
|
|
989
|
+
| [String?, Integer, Hash[untyped, untyped]] # otherwise
|
|
990
|
+
)
|
|
991
|
+
|
|
992
|
+
# Get number of sent LINE notification messages (template)
|
|
993
|
+
# This requests to <code>GET https://api.line.me/v2/bot/message/delivery/pnp/templated</code>
|
|
994
|
+
# When you want to get HTTP status code or response headers, use {#get_pnp_templated_message_statistics_with_http_info} instead of this.
|
|
995
|
+
#
|
|
996
|
+
# @param date [String] Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
|
|
997
|
+
# @see https://developers.line.biz/en/reference/line-notification-messages/#get-number-of-sent-line-notification-messages-template
|
|
998
|
+
# @return [Line::Bot::V2::MessagingApi::NumberOfMessagesResponse] when HTTP status code is 200
|
|
999
|
+
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
|
|
1000
|
+
def get_pnp_templated_message_statistics: (
|
|
1001
|
+
date: String
|
|
1002
|
+
) -> (
|
|
1003
|
+
NumberOfMessagesResponse # when HTTP status code is 200
|
|
1004
|
+
| String? # otherwise
|
|
1005
|
+
)
|
|
1006
|
+
|
|
977
1007
|
# Get profile
|
|
978
1008
|
# This requests to <code>GET https://api.line.me/v2/bot/profile/{userId}</code>
|
|
979
1009
|
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
|
|
@@ -1756,6 +1786,44 @@ module Line
|
|
|
1756
1786
|
| String? # otherwise
|
|
1757
1787
|
)
|
|
1758
1788
|
|
|
1789
|
+
# Send LINE notification message (template)
|
|
1790
|
+
# This requests to <code>POST https://api.line.me/v2/bot/message/pnp/templated/push</code>
|
|
1791
|
+
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
|
|
1792
|
+
#
|
|
1793
|
+
# @param pnp_templated_message_request [PnpTemplatedMessageRequest]
|
|
1794
|
+
# @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook.
|
|
1795
|
+
# @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template
|
|
1796
|
+
# @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 202
|
|
1797
|
+
# @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 422
|
|
1798
|
+
# @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
|
|
1799
|
+
def push_templated_messages_by_phone_with_http_info: (
|
|
1800
|
+
pnp_templated_message_request: PnpTemplatedMessageRequest,
|
|
1801
|
+
?x_line_delivery_tag: String?
|
|
1802
|
+
) -> (
|
|
1803
|
+
[String?, 202, Hash[untyped, untyped]] # when HTTP status code is 202
|
|
1804
|
+
| [ErrorResponse, 422, Hash[untyped, untyped]] # when HTTP status code is 422
|
|
1805
|
+
| [String?, Integer, Hash[untyped, untyped]] # otherwise
|
|
1806
|
+
)
|
|
1807
|
+
|
|
1808
|
+
# Send LINE notification message (template)
|
|
1809
|
+
# This requests to <code>POST https://api.line.me/v2/bot/message/pnp/templated/push</code>
|
|
1810
|
+
# When you want to get HTTP status code or response headers, use {#push_templated_messages_by_phone_with_http_info} instead of this.
|
|
1811
|
+
#
|
|
1812
|
+
# @param pnp_templated_message_request [PnpTemplatedMessageRequest]
|
|
1813
|
+
# @param x_line_delivery_tag [String, nil] String returned in the delivery.data property of the delivery completion event via Webhook.
|
|
1814
|
+
# @see https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template
|
|
1815
|
+
# @return [String, nil] when HTTP status code is 202
|
|
1816
|
+
# @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 422
|
|
1817
|
+
# @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
|
|
1818
|
+
def push_templated_messages_by_phone: (
|
|
1819
|
+
pnp_templated_message_request: PnpTemplatedMessageRequest,
|
|
1820
|
+
?x_line_delivery_tag: String?
|
|
1821
|
+
) -> (
|
|
1822
|
+
String? # when HTTP status code is 202
|
|
1823
|
+
| ErrorResponse # when HTTP status code is 422
|
|
1824
|
+
| String? # otherwise
|
|
1825
|
+
)
|
|
1826
|
+
|
|
1759
1827
|
# Send reply message
|
|
1760
1828
|
# This requests to <code>POST https://api.line.me/v2/bot/message/reply</code>
|
|
1761
1829
|
# This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
|
|
@@ -11,13 +11,15 @@ module Line
|
|
|
11
11
|
module Bot
|
|
12
12
|
module V2
|
|
13
13
|
module MessagingApi
|
|
14
|
-
# Request object for creating a coupon. Contains all configurable coupon properties.
|
|
14
|
+
# Request object for creating a coupon. Contains all configurable coupon properties. Specify the coupon period using one of these patterns: - endTimestamp - acquireEndTimestamp with expirationDay - expirationDay only - no period fields
|
|
15
15
|
class CouponCreateRequest
|
|
16
16
|
attr_accessor acquisition_condition: AcquisitionConditionRequest
|
|
17
17
|
attr_accessor barcode_image_url: String?
|
|
18
18
|
attr_accessor coupon_code: String?
|
|
19
19
|
attr_accessor description: String?
|
|
20
|
-
attr_accessor end_timestamp: Integer
|
|
20
|
+
attr_accessor end_timestamp: Integer?
|
|
21
|
+
attr_accessor acquire_end_timestamp: Integer?
|
|
22
|
+
attr_accessor expiration_day: Integer?
|
|
21
23
|
attr_accessor image_url: String?
|
|
22
24
|
attr_accessor max_use_count_per_ticket: Integer
|
|
23
25
|
attr_accessor start_timestamp: Integer
|
|
@@ -32,7 +34,9 @@ module Line
|
|
|
32
34
|
# @param barcode_image_url [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
|
|
33
35
|
# @param coupon_code [String,nil] Unique code to be presented by the user to redeem the coupon. Optional.
|
|
34
36
|
# @param description [String,nil] Detailed description of the coupon. Displayed to users.
|
|
35
|
-
# @param end_timestamp [Integer]
|
|
37
|
+
# @param end_timestamp [Integer,nil] End time for coupon acquisition and usage (epoch seconds). Users can acquire and use the coupon until this time. Do not specify with acquireEndTimestamp or expirationDay.
|
|
38
|
+
# @param acquire_end_timestamp [Integer,nil] End time for coupon acquisition (epoch seconds). Acquisition has no end time when this field is omitted. Specify with expirationDay, and do not specify with endTimestamp.
|
|
39
|
+
# @param expiration_day [Integer,nil] Number of days a ticket remains usable after acquisition. The ticket expires at the end of the day this many days after it is acquired.
|
|
36
40
|
# @param image_url [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
|
|
37
41
|
# @param max_use_count_per_ticket [Integer] Maximum number of times a single coupon ticket can be used. Use -1 to indicate no limit.
|
|
38
42
|
# @param start_timestamp [Integer] Coupon start time (epoch seconds). Coupon can be used from this time.
|
|
@@ -46,7 +50,9 @@ module Line
|
|
|
46
50
|
?barcode_image_url: String?,
|
|
47
51
|
?coupon_code: String?,
|
|
48
52
|
?description: String?,
|
|
49
|
-
end_timestamp: Integer
|
|
53
|
+
?end_timestamp: Integer?,
|
|
54
|
+
?acquire_end_timestamp: Integer?,
|
|
55
|
+
?expiration_day: Integer?,
|
|
50
56
|
?image_url: String?,
|
|
51
57
|
max_use_count_per_ticket: Integer,
|
|
52
58
|
start_timestamp: Integer,
|
|
@@ -18,6 +18,8 @@ module Line
|
|
|
18
18
|
attr_accessor coupon_code: String?
|
|
19
19
|
attr_accessor description: String?
|
|
20
20
|
attr_accessor end_timestamp: Integer?
|
|
21
|
+
attr_accessor acquire_end_timestamp: Integer?
|
|
22
|
+
attr_accessor expiration_day: Integer?
|
|
21
23
|
attr_accessor image_url: String?
|
|
22
24
|
attr_accessor max_acquire_count: Integer?
|
|
23
25
|
attr_accessor max_use_count_per_ticket: Integer?
|
|
@@ -37,7 +39,9 @@ module Line
|
|
|
37
39
|
# @param barcode_image_url [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
|
|
38
40
|
# @param coupon_code [String,nil] Unique code to be presented by the user to redeem the coupon.
|
|
39
41
|
# @param description [String,nil] Detailed description of the coupon. Displayed to users.
|
|
40
|
-
# @param end_timestamp [Integer,nil]
|
|
42
|
+
# @param end_timestamp [Integer,nil] End time for coupon usage (epoch seconds). Contains the endTimestamp specified at creation, or a future timestamp when endTimestamp was omitted.
|
|
43
|
+
# @param acquire_end_timestamp [Integer,nil] End time for coupon acquisition (epoch seconds). Null when acquisition has no end time.
|
|
44
|
+
# @param expiration_day [Integer,nil] Number of days a ticket remains usable after acquisition. Null when the coupon does not expire based on the ticket acquisition date.
|
|
41
45
|
# @param image_url [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
|
|
42
46
|
# @param max_acquire_count [Integer,nil] Maximum number of coupons that can be issued in total.
|
|
43
47
|
# @param max_use_count_per_ticket [Integer,nil] Maximum number of times a single coupon ticket can be used.
|
|
@@ -57,6 +61,8 @@ module Line
|
|
|
57
61
|
?coupon_code: String?,
|
|
58
62
|
?description: String?,
|
|
59
63
|
?end_timestamp: Integer?,
|
|
64
|
+
?acquire_end_timestamp: Integer?,
|
|
65
|
+
?expiration_day: Integer?,
|
|
60
66
|
?image_url: String?,
|
|
61
67
|
?max_acquire_count: Integer?,
|
|
62
68
|
?max_use_count_per_ticket: Integer?,
|
|
@@ -16,15 +16,18 @@ module Line
|
|
|
16
16
|
attr_accessor messages: Array[Message]
|
|
17
17
|
attr_accessor to: String
|
|
18
18
|
attr_accessor notification_disabled: bool?
|
|
19
|
+
attr_accessor custom_aggregation_units: Array[String]?
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
# @param messages [Array[Message, Hash[Symbol, untyped]]] Message to be sent.
|
|
22
23
|
# @param to [String] Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.
|
|
23
24
|
# @param notification_disabled [bool,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.
|
|
25
|
+
# @param custom_aggregation_units [Array[String],nil] Name of aggregation unit. Case-sensitive.
|
|
24
26
|
def initialize: (
|
|
25
27
|
messages: Array[Message| Hash[Symbol, untyped]],
|
|
26
28
|
to: String,
|
|
27
29
|
?notification_disabled: bool?,
|
|
30
|
+
?custom_aggregation_units: Array[String]?,
|
|
28
31
|
**untyped dynamic_attributes
|
|
29
32
|
) -> void
|
|
30
33
|
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
attr_accessor button_key: String
|
|
17
|
+
attr_accessor url: String
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# @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
|
|
21
|
+
# @param url [String] URL of the page to be opened when the user presses the button.
|
|
22
|
+
def initialize: (
|
|
23
|
+
button_key: String,
|
|
24
|
+
url: String,
|
|
25
|
+
**untyped dynamic_attributes
|
|
26
|
+
) -> void
|
|
27
|
+
|
|
28
|
+
# Create an instance of the class from a hash
|
|
29
|
+
# @param args [Hash] Hash containing all the required attributes
|
|
30
|
+
# @return [Line::Bot::V2::MessagingApi::PnpTemplatedButton] Instance of the class
|
|
31
|
+
def self.create: (Hash[Symbol, untyped]) -> PnpTemplatedButton
|
|
32
|
+
|
|
33
|
+
# @param other [Object] Object to compare
|
|
34
|
+
# @return [Boolean] true if the objects are equal, false otherwise
|
|
35
|
+
def ==: (untyped other) -> bool
|
|
36
|
+
|
|
37
|
+
# @return [Integer] Hash code of the object
|
|
38
|
+
def hash: () -> Integer
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
attr_accessor item_key: String
|
|
18
|
+
attr_accessor content: String
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# @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
|
|
22
|
+
# @param content [String] String to be displayed as the value of the item.
|
|
23
|
+
def initialize: (
|
|
24
|
+
item_key: String,
|
|
25
|
+
content: String,
|
|
26
|
+
**untyped dynamic_attributes
|
|
27
|
+
) -> void
|
|
28
|
+
|
|
29
|
+
# Create an instance of the class from a hash
|
|
30
|
+
# @param args [Hash] Hash containing all the required attributes
|
|
31
|
+
# @return [Line::Bot::V2::MessagingApi::PnpTemplatedEmphasizedItem] Instance of the class
|
|
32
|
+
def self.create: (Hash[Symbol, untyped]) -> PnpTemplatedEmphasizedItem
|
|
33
|
+
|
|
34
|
+
# @param other [Object] Object to compare
|
|
35
|
+
# @return [Boolean] true if the objects are equal, false otherwise
|
|
36
|
+
def ==: (untyped other) -> bool
|
|
37
|
+
|
|
38
|
+
# @return [Integer] Hash code of the object
|
|
39
|
+
def hash: () -> Integer
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|