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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7a8714b658c23488a6d90b5397c36edd16ced262a3a5b903519b8c36d8a0837
|
|
4
|
+
data.tar.gz: c27478b1a72ed95ab8853f73932f0dd75ffd1c46b6e29648ead1fd82504c64a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e72aa4c81368d742952343790822520b0fac5bc6e44371147543a18393a3c6655320cdf0cc117a010f72d210c7ce76eb5234636e539764298f98c28e40b0c022
|
|
7
|
+
data.tar.gz: aceaae5120129d85de879e0810478d6e92abb8f1e753452d6fc5daec538647cc39e43455b806cdf90af1f5e3de45badb6be07be93903559d6bf640c64257a887
|
data/CONTRIBUTING.md
CHANGED
|
@@ -16,7 +16,6 @@ Run `bundle install` to install all dependencies for development.
|
|
|
16
16
|
The project structure is as follows:
|
|
17
17
|
- `lib`: The main library code.
|
|
18
18
|
- `sig`: The RBS code.
|
|
19
|
-
- `sig-vendor`: The RBS code outside this repository.
|
|
20
19
|
- `spec`: The test code.
|
|
21
20
|
- `examples`: Example projects that use the library.
|
|
22
21
|
- `generator`: The code generator for the library.
|
|
@@ -42,6 +42,12 @@ module Line
|
|
|
42
42
|
perform_request(request: request)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# NOTE: line-bot-sdk-ruby users should not use this. Breaking changes may occur, so use at your own risk.
|
|
46
|
+
def patch(path:, query_params: nil, body_params: nil, headers: nil)
|
|
47
|
+
request = build_request(http_class: Net::HTTP::Patch, path: path, query_params: query_params, headers: headers, body_params: body_params)
|
|
48
|
+
perform_request(request: request)
|
|
49
|
+
end
|
|
50
|
+
|
|
45
51
|
# NOTE: line-bot-sdk-ruby users should not use this. Breaking changes may occur, so use at your own risk.
|
|
46
52
|
def delete(path:, query_params: nil, headers: nil)
|
|
47
53
|
request = build_request(http_class: Net::HTTP::Delete, path: path, query_params: query_params, headers: headers)
|
|
@@ -109,7 +115,7 @@ module Line
|
|
|
109
115
|
|
|
110
116
|
file_params, non_file_params = form_params.partition { |_, value| value.is_a?(File) }.map(&:to_h) # steep:ignore NoMethod
|
|
111
117
|
params = Line::Bot::V2::Utils.deep_to_hash(non_file_params).merge(
|
|
112
|
-
file_params.transform_values { |value| UploadIO.new(value, 'text/plain', File.basename(value.path)) }
|
|
118
|
+
file_params.transform_values { |value| Multipart::Post::UploadIO.new(value, 'text/plain', File.basename(value.path)) }
|
|
113
119
|
)
|
|
114
120
|
|
|
115
121
|
http_class.new(request_url, params, request_headers)
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
46
|
+
return klass.new(**symbolized_args) if klass
|
|
47
47
|
return new(**symbolized_args) # steep:ignore InsufficientKeywordArguments
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -11,7 +11,7 @@ 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
|
# @!attribute [rw] acquisition_condition
|
|
17
17
|
# @return [AcquisitionConditionRequest]
|
|
@@ -26,8 +26,14 @@ module Line
|
|
|
26
26
|
# @return [String,nil] Detailed description of the coupon. Displayed to users.
|
|
27
27
|
attr_accessor :description
|
|
28
28
|
# @!attribute [rw] end_timestamp
|
|
29
|
-
# @return [Integer]
|
|
29
|
+
# @return [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.
|
|
30
30
|
attr_accessor :end_timestamp
|
|
31
|
+
# @!attribute [rw] acquire_end_timestamp
|
|
32
|
+
# @return [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.
|
|
33
|
+
attr_accessor :acquire_end_timestamp
|
|
34
|
+
# @!attribute [rw] expiration_day
|
|
35
|
+
# @return [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
|
+
attr_accessor :expiration_day
|
|
31
37
|
# @!attribute [rw] image_url
|
|
32
38
|
# @return [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
|
|
33
39
|
attr_accessor :image_url
|
|
@@ -57,7 +63,9 @@ module Line
|
|
|
57
63
|
# @param barcode_image_url [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
|
|
58
64
|
# @param coupon_code [String,nil] Unique code to be presented by the user to redeem the coupon. Optional.
|
|
59
65
|
# @param description [String,nil] Detailed description of the coupon. Displayed to users.
|
|
60
|
-
# @param end_timestamp [Integer]
|
|
66
|
+
# @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.
|
|
67
|
+
# @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.
|
|
68
|
+
# @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.
|
|
61
69
|
# @param image_url [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
|
|
62
70
|
# @param max_use_count_per_ticket [Integer] Maximum number of times a single coupon ticket can be used. Use -1 to indicate no limit.
|
|
63
71
|
# @param start_timestamp [Integer] Coupon start time (epoch seconds). Coupon can be used from this time.
|
|
@@ -71,7 +79,9 @@ module Line
|
|
|
71
79
|
barcode_image_url: nil,
|
|
72
80
|
coupon_code: nil,
|
|
73
81
|
description: nil,
|
|
74
|
-
end_timestamp
|
|
82
|
+
end_timestamp: nil,
|
|
83
|
+
acquire_end_timestamp: nil,
|
|
84
|
+
expiration_day: nil,
|
|
75
85
|
image_url: nil,
|
|
76
86
|
max_use_count_per_ticket:,
|
|
77
87
|
start_timestamp:,
|
|
@@ -88,6 +98,8 @@ module Line
|
|
|
88
98
|
@coupon_code = coupon_code
|
|
89
99
|
@description = description
|
|
90
100
|
@end_timestamp = end_timestamp
|
|
101
|
+
@acquire_end_timestamp = acquire_end_timestamp
|
|
102
|
+
@expiration_day = expiration_day
|
|
91
103
|
@image_url = image_url
|
|
92
104
|
@max_use_count_per_ticket = max_use_count_per_ticket
|
|
93
105
|
@start_timestamp = start_timestamp
|
|
@@ -26,8 +26,14 @@ module Line
|
|
|
26
26
|
# @return [String,nil] Detailed description of the coupon. Displayed to users.
|
|
27
27
|
attr_accessor :description
|
|
28
28
|
# @!attribute [rw] end_timestamp
|
|
29
|
-
# @return [Integer,nil]
|
|
29
|
+
# @return [Integer,nil] End time for coupon usage (epoch seconds). Contains the endTimestamp specified at creation, or a future timestamp when endTimestamp was omitted.
|
|
30
30
|
attr_accessor :end_timestamp
|
|
31
|
+
# @!attribute [rw] acquire_end_timestamp
|
|
32
|
+
# @return [Integer,nil] End time for coupon acquisition (epoch seconds). Null when acquisition has no end time.
|
|
33
|
+
attr_accessor :acquire_end_timestamp
|
|
34
|
+
# @!attribute [rw] expiration_day
|
|
35
|
+
# @return [Integer,nil] Number of days a ticket remains usable after acquisition. Null when the coupon does not expire based on the ticket acquisition date.
|
|
36
|
+
attr_accessor :expiration_day
|
|
31
37
|
# @!attribute [rw] image_url
|
|
32
38
|
# @return [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
|
|
33
39
|
attr_accessor :image_url
|
|
@@ -72,7 +78,9 @@ module Line
|
|
|
72
78
|
# @param barcode_image_url [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
|
|
73
79
|
# @param coupon_code [String,nil] Unique code to be presented by the user to redeem the coupon.
|
|
74
80
|
# @param description [String,nil] Detailed description of the coupon. Displayed to users.
|
|
75
|
-
# @param end_timestamp [Integer,nil]
|
|
81
|
+
# @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.
|
|
82
|
+
# @param acquire_end_timestamp [Integer,nil] End time for coupon acquisition (epoch seconds). Null when acquisition has no end time.
|
|
83
|
+
# @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.
|
|
76
84
|
# @param image_url [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
|
|
77
85
|
# @param max_acquire_count [Integer,nil] Maximum number of coupons that can be issued in total.
|
|
78
86
|
# @param max_use_count_per_ticket [Integer,nil] Maximum number of times a single coupon ticket can be used.
|
|
@@ -92,6 +100,8 @@ module Line
|
|
|
92
100
|
coupon_code: nil,
|
|
93
101
|
description: nil,
|
|
94
102
|
end_timestamp: nil,
|
|
103
|
+
acquire_end_timestamp: nil,
|
|
104
|
+
expiration_day: nil,
|
|
95
105
|
image_url: nil,
|
|
96
106
|
max_acquire_count: nil,
|
|
97
107
|
max_use_count_per_ticket: nil,
|
|
@@ -113,6 +123,8 @@ module Line
|
|
|
113
123
|
@coupon_code = coupon_code
|
|
114
124
|
@description = description
|
|
115
125
|
@end_timestamp = end_timestamp
|
|
126
|
+
@acquire_end_timestamp = acquire_end_timestamp
|
|
127
|
+
@expiration_day = expiration_day
|
|
116
128
|
@image_url = image_url
|
|
117
129
|
@max_acquire_count = max_acquire_count
|
|
118
130
|
@max_use_count_per_ticket = max_use_count_per_ticket
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -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
|