line-bot-api 2.11.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/model/coupon_create_request.rb +16 -4
- data/lib/line/bot/v2/messaging_api/model/coupon_response.rb +14 -2
- 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/model/coupon_create_request.rbs +10 -4
- data/sig/line/bot/v2/messaging_api/model/coupon_response.rbs +7 -1
- metadata +1 -1
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)
|
|
@@ -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
|
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]?,
|
|
@@ -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?,
|