line-bot-api 1.30.0 → 2.1.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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +49 -1
  3. data/README.md +250 -26
  4. data/lib/line/bot/v2/messaging_api/api/messaging_api_client.rb +269 -0
  5. data/lib/line/bot/v2/messaging_api/core.rb +39 -0
  6. data/lib/line/bot/v2/messaging_api/model/acquisition_condition_request.rb +77 -0
  7. data/lib/line/bot/v2/messaging_api/model/acquisition_condition_response.rb +78 -0
  8. data/lib/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_request.rb +72 -0
  9. data/lib/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_response.rb +78 -0
  10. data/lib/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_request.rb +72 -0
  11. data/lib/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_response.rb +72 -0
  12. data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_request.rb +77 -0
  13. data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_response.rb +77 -0
  14. data/lib/line/bot/v2/messaging_api/model/coupon_cash_back_reward_request.rb +72 -0
  15. data/lib/line/bot/v2/messaging_api/model/coupon_cash_back_reward_response.rb +72 -0
  16. data/lib/line/bot/v2/messaging_api/model/coupon_create_request.rb +139 -0
  17. data/lib/line/bot/v2/messaging_api/model/coupon_create_response.rb +67 -0
  18. data/lib/line/bot/v2/messaging_api/model/coupon_discount_reward_request.rb +72 -0
  19. data/lib/line/bot/v2/messaging_api/model/coupon_discount_reward_response.rb +72 -0
  20. data/lib/line/bot/v2/messaging_api/model/coupon_free_reward_request.rb +66 -0
  21. data/lib/line/bot/v2/messaging_api/model/coupon_free_reward_response.rb +66 -0
  22. data/lib/line/bot/v2/messaging_api/model/coupon_gift_reward_request.rb +66 -0
  23. data/lib/line/bot/v2/messaging_api/model/coupon_gift_reward_response.rb +66 -0
  24. data/lib/line/bot/v2/messaging_api/model/coupon_list_response.rb +73 -0
  25. data/lib/line/bot/v2/messaging_api/model/coupon_message.rb +91 -0
  26. data/lib/line/bot/v2/messaging_api/model/coupon_others_reward_request.rb +66 -0
  27. data/lib/line/bot/v2/messaging_api/model/coupon_others_reward_response.rb +66 -0
  28. data/lib/line/bot/v2/messaging_api/model/coupon_response.rb +169 -0
  29. data/lib/line/bot/v2/messaging_api/model/coupon_reward_request.rb +80 -0
  30. data/lib/line/bot/v2/messaging_api/model/coupon_reward_response.rb +80 -0
  31. data/lib/line/bot/v2/messaging_api/model/discount_explicit_price_info_request.rb +78 -0
  32. data/lib/line/bot/v2/messaging_api/model/discount_explicit_price_info_response.rb +84 -0
  33. data/lib/line/bot/v2/messaging_api/model/discount_fixed_price_info_request.rb +72 -0
  34. data/lib/line/bot/v2/messaging_api/model/discount_fixed_price_info_response.rb +78 -0
  35. data/lib/line/bot/v2/messaging_api/model/discount_percentage_price_info_request.rb +72 -0
  36. data/lib/line/bot/v2/messaging_api/model/discount_percentage_price_info_response.rb +72 -0
  37. data/lib/line/bot/v2/messaging_api/model/discount_price_info_request.rb +78 -0
  38. data/lib/line/bot/v2/messaging_api/model/discount_price_info_response.rb +78 -0
  39. data/lib/line/bot/v2/messaging_api/model/lottery_acquisition_condition_request.rb +78 -0
  40. data/lib/line/bot/v2/messaging_api/model/lottery_acquisition_condition_response.rb +78 -0
  41. data/lib/line/bot/v2/messaging_api/model/message.rb +1 -0
  42. data/lib/line/bot/v2/messaging_api/model/messaging_api_pager_coupon_list_response.rb +79 -0
  43. data/lib/line/bot/v2/messaging_api/model/normal_acquisition_condition_request.rb +66 -0
  44. data/lib/line/bot/v2/messaging_api/model/normal_acquisition_condition_response.rb +66 -0
  45. data/lib/line/bot/v2/messaging_api/model/referral_acquisition_condition_response.rb +66 -0
  46. data/lib/line/bot/version.rb +1 -1
  47. data/lib/line/bot.rb +0 -9
  48. data/line-bot-api.gemspec +1 -1
  49. data/sig/line/bot/v2/messaging_api/api/messaging_api_client.rbs +156 -0
  50. data/sig/line/bot/v2/messaging_api/model/acquisition_condition_request.rbs +43 -0
  51. data/sig/line/bot/v2/messaging_api/model/acquisition_condition_response.rbs +43 -0
  52. data/sig/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_request.rbs +40 -0
  53. data/sig/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_response.rbs +43 -0
  54. data/sig/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_request.rbs +40 -0
  55. data/sig/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_response.rbs +40 -0
  56. data/sig/line/bot/v2/messaging_api/model/cash_back_price_info_request.rbs +43 -0
  57. data/sig/line/bot/v2/messaging_api/model/cash_back_price_info_response.rbs +43 -0
  58. data/sig/line/bot/v2/messaging_api/model/coupon_cash_back_reward_request.rbs +40 -0
  59. data/sig/line/bot/v2/messaging_api/model/coupon_cash_back_reward_response.rbs +40 -0
  60. data/sig/line/bot/v2/messaging_api/model/coupon_create_request.rbs +76 -0
  61. data/sig/line/bot/v2/messaging_api/model/coupon_create_response.rbs +40 -0
  62. data/sig/line/bot/v2/messaging_api/model/coupon_discount_reward_request.rbs +40 -0
  63. data/sig/line/bot/v2/messaging_api/model/coupon_discount_reward_response.rbs +40 -0
  64. data/sig/line/bot/v2/messaging_api/model/coupon_free_reward_request.rbs +37 -0
  65. data/sig/line/bot/v2/messaging_api/model/coupon_free_reward_response.rbs +37 -0
  66. data/sig/line/bot/v2/messaging_api/model/coupon_gift_reward_request.rbs +37 -0
  67. data/sig/line/bot/v2/messaging_api/model/coupon_gift_reward_response.rbs +37 -0
  68. data/sig/line/bot/v2/messaging_api/model/coupon_list_response.rbs +43 -0
  69. data/sig/line/bot/v2/messaging_api/model/coupon_message.rbs +50 -0
  70. data/sig/line/bot/v2/messaging_api/model/coupon_others_reward_request.rbs +37 -0
  71. data/sig/line/bot/v2/messaging_api/model/coupon_others_reward_response.rbs +37 -0
  72. data/sig/line/bot/v2/messaging_api/model/coupon_response.rbs +91 -0
  73. data/sig/line/bot/v2/messaging_api/model/coupon_reward_request.rbs +43 -0
  74. data/sig/line/bot/v2/messaging_api/model/coupon_reward_response.rbs +43 -0
  75. data/sig/line/bot/v2/messaging_api/model/discount_explicit_price_info_request.rbs +43 -0
  76. data/sig/line/bot/v2/messaging_api/model/discount_explicit_price_info_response.rbs +46 -0
  77. data/sig/line/bot/v2/messaging_api/model/discount_fixed_price_info_request.rbs +40 -0
  78. data/sig/line/bot/v2/messaging_api/model/discount_fixed_price_info_response.rbs +43 -0
  79. data/sig/line/bot/v2/messaging_api/model/discount_percentage_price_info_request.rbs +40 -0
  80. data/sig/line/bot/v2/messaging_api/model/discount_percentage_price_info_response.rbs +40 -0
  81. data/sig/line/bot/v2/messaging_api/model/discount_price_info_request.rbs +43 -0
  82. data/sig/line/bot/v2/messaging_api/model/discount_price_info_response.rbs +43 -0
  83. data/sig/line/bot/v2/messaging_api/model/lottery_acquisition_condition_request.rbs +43 -0
  84. data/sig/line/bot/v2/messaging_api/model/lottery_acquisition_condition_response.rbs +43 -0
  85. data/sig/line/bot/v2/messaging_api/model/messaging_api_pager_coupon_list_response.rbs +43 -0
  86. data/sig/line/bot/v2/messaging_api/model/normal_acquisition_condition_request.rbs +37 -0
  87. data/sig/line/bot/v2/messaging_api/model/normal_acquisition_condition_response.rbs +37 -0
  88. data/sig/line/bot/v2/messaging_api/model/referral_acquisition_condition_response.rbs +37 -0
  89. metadata +81 -24
  90. data/lib/line/bot/v1/api/errors.rb +0 -23
  91. data/lib/line/bot/v1/api/version.rb +0 -23
  92. data/lib/line/bot/v1/api.rb +0 -33
  93. data/lib/line/bot/v1/client.rb +0 -1936
  94. data/lib/line/bot/v1/event/account_link.rb +0 -38
  95. data/lib/line/bot/v1/event/base.rb +0 -39
  96. data/lib/line/bot/v1/event/beacon.rb +0 -43
  97. data/lib/line/bot/v1/event/follow.rb +0 -30
  98. data/lib/line/bot/v1/event/join.rb +0 -29
  99. data/lib/line/bot/v1/event/leave.rb +0 -31
  100. data/lib/line/bot/v1/event/member_joined.rb +0 -29
  101. data/lib/line/bot/v1/event/member_left.rb +0 -31
  102. data/lib/line/bot/v1/event/message.rb +0 -51
  103. data/lib/line/bot/v1/event/postback.rb +0 -29
  104. data/lib/line/bot/v1/event/things.rb +0 -49
  105. data/lib/line/bot/v1/event/unfollow.rb +0 -31
  106. data/lib/line/bot/v1/event/unsend.rb +0 -31
  107. data/lib/line/bot/v1/event/video_play_complete.rb +0 -29
  108. data/lib/line/bot/v1/event.rb +0 -28
  109. data/lib/line/bot/v1/httpclient.rb +0 -91
  110. data/lib/line/bot/v1/util.rb +0 -28
@@ -172,6 +172,135 @@ module Line
172
172
  response_body
173
173
  end
174
174
 
175
+ # Close coupon
176
+ # This requests to <code>PUT https://api.line.me/v2/bot/coupon/{couponId}/close</code>
177
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
178
+ #
179
+ # @param coupon_id [String]
180
+ # @see https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon
181
+ # @return [Array((String|nil), Integer, Hash{String => String})] when HTTP status code is 200
182
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
183
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404
184
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 410
185
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
186
+ def close_coupon_with_http_info( # steep:ignore MethodBodyTypeMismatch
187
+ coupon_id:
188
+ )
189
+ path = "/v2/bot/coupon/{couponId}/close"
190
+ .gsub(/{couponId}/, coupon_id.to_s)
191
+
192
+ response = @http_client.put(
193
+ path: path,
194
+ )
195
+
196
+ case response.code.to_i
197
+ when 200
198
+ [response.body, 200, response.each_header.to_h]
199
+ when 400
200
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
201
+ json.transform_keys! do |key|
202
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
203
+ end
204
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
205
+ [response_body, 400, response.each_header.to_h]
206
+ when 404
207
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
208
+ json.transform_keys! do |key|
209
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
210
+ end
211
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
212
+ [response_body, 404, response.each_header.to_h]
213
+ when 410
214
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
215
+ json.transform_keys! do |key|
216
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
217
+ end
218
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
219
+ [response_body, 410, response.each_header.to_h]
220
+ else
221
+ [response.body, response.code.to_i, response.each_header.to_h]
222
+ end
223
+ end
224
+
225
+ # Close coupon
226
+ # This requests to <code>PUT https://api.line.me/v2/bot/coupon/{couponId}/close</code>
227
+ # When you want to get HTTP status code or response headers, use {#close_coupon_with_http_info} instead of this.
228
+ #
229
+ # @param coupon_id [String]
230
+ # @see https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon
231
+ # @return [String, nil] when HTTP status code is 200
232
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400
233
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404
234
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 410
235
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
236
+ def close_coupon(
237
+ coupon_id:
238
+ )
239
+ response_body, _status_code, _headers = close_coupon_with_http_info(
240
+ coupon_id: coupon_id
241
+ )
242
+
243
+ response_body
244
+ end
245
+
246
+ # Create a new coupon. Define coupon details such as type, title, and validity period.
247
+ # This requests to <code>POST https://api.line.me/v2/bot/coupon</code>
248
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
249
+ #
250
+ # @param coupon_create_request [CouponCreateRequest, nil]
251
+ # @see https://developers.line.biz/en/reference/messaging-api/#create-coupon
252
+ # @return [Array(Line::Bot::V2::MessagingApi::CouponCreateResponse, Integer, Hash{String => String})] when HTTP status code is 200
253
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
254
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
255
+ def create_coupon_with_http_info( # steep:ignore MethodBodyTypeMismatch
256
+ coupon_create_request: nil
257
+ )
258
+ path = "/v2/bot/coupon"
259
+
260
+ response = @http_client.post(
261
+ path: path,
262
+ body_params: coupon_create_request,
263
+ )
264
+
265
+ case response.code.to_i
266
+ when 200
267
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
268
+ json.transform_keys! do |key|
269
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
270
+ end
271
+ response_body = Line::Bot::V2::MessagingApi::CouponCreateResponse.create(json) # steep:ignore InsufficientKeywordArguments
272
+ [response_body, 200, response.each_header.to_h]
273
+ when 400
274
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
275
+ json.transform_keys! do |key|
276
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
277
+ end
278
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
279
+ [response_body, 400, response.each_header.to_h]
280
+ else
281
+ [response.body, response.code.to_i, response.each_header.to_h]
282
+ end
283
+ end
284
+
285
+ # Create a new coupon. Define coupon details such as type, title, and validity period.
286
+ # This requests to <code>POST https://api.line.me/v2/bot/coupon</code>
287
+ # When you want to get HTTP status code or response headers, use {#create_coupon_with_http_info} instead of this.
288
+ #
289
+ # @param coupon_create_request [CouponCreateRequest, nil]
290
+ # @see https://developers.line.biz/en/reference/messaging-api/#create-coupon
291
+ # @return [Line::Bot::V2::MessagingApi::CouponCreateResponse] when HTTP status code is 200
292
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400
293
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
294
+ def create_coupon(
295
+ coupon_create_request: nil
296
+ )
297
+ response_body, _status_code, _headers = create_coupon_with_http_info(
298
+ coupon_create_request: coupon_create_request
299
+ )
300
+
301
+ response_body
302
+ end
303
+
175
304
  # Create rich menu
176
305
  # This requests to <code>POST https://api.line.me/v2/bot/richmenu</code>
177
306
  # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -515,6 +644,73 @@ module Line
515
644
  response_body
516
645
  end
517
646
 
647
+ # Get coupon detail
648
+ # This requests to <code>GET https://api.line.me/v2/bot/coupon/{couponId}</code>
649
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
650
+ #
651
+ # @param coupon_id [String]
652
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-coupon
653
+ # @return [Array(Line::Bot::V2::MessagingApi::CouponResponse, Integer, Hash{String => String})] when HTTP status code is 200
654
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
655
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 404
656
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
657
+ def get_coupon_detail_with_http_info( # steep:ignore MethodBodyTypeMismatch
658
+ coupon_id:
659
+ )
660
+ path = "/v2/bot/coupon/{couponId}"
661
+ .gsub(/{couponId}/, coupon_id.to_s)
662
+
663
+ response = @http_client.get(
664
+ path: path,
665
+ )
666
+
667
+ case response.code.to_i
668
+ when 200
669
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
670
+ json.transform_keys! do |key|
671
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
672
+ end
673
+ response_body = Line::Bot::V2::MessagingApi::CouponResponse.create(json) # steep:ignore InsufficientKeywordArguments
674
+ [response_body, 200, response.each_header.to_h]
675
+ when 400
676
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
677
+ json.transform_keys! do |key|
678
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
679
+ end
680
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
681
+ [response_body, 400, response.each_header.to_h]
682
+ when 404
683
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
684
+ json.transform_keys! do |key|
685
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
686
+ end
687
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
688
+ [response_body, 404, response.each_header.to_h]
689
+ else
690
+ [response.body, response.code.to_i, response.each_header.to_h]
691
+ end
692
+ end
693
+
694
+ # Get coupon detail
695
+ # This requests to <code>GET https://api.line.me/v2/bot/coupon/{couponId}</code>
696
+ # When you want to get HTTP status code or response headers, use {#get_coupon_detail_with_http_info} instead of this.
697
+ #
698
+ # @param coupon_id [String]
699
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-coupon
700
+ # @return [Line::Bot::V2::MessagingApi::CouponResponse] when HTTP status code is 200
701
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400
702
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 404
703
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
704
+ def get_coupon_detail(
705
+ coupon_id:
706
+ )
707
+ response_body, _status_code, _headers = get_coupon_detail_with_http_info(
708
+ coupon_id: coupon_id
709
+ )
710
+
711
+ response_body
712
+ end
713
+
518
714
  # Gets the ID of the default rich menu set with the Messaging API.
519
715
  # This requests to <code>GET https://api.line.me/v2/bot/user/all/richmenu</code>
520
716
  # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -2214,6 +2410,79 @@ module Line
2214
2410
  response_body
2215
2411
  end
2216
2412
 
2413
+ # Get a paginated list of coupons.
2414
+ # This requests to <code>GET https://api.line.me/v2/bot/coupon</code>
2415
+ # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
2416
+ #
2417
+ # @param status [Array[String], nil] Filter coupons by their status.
2418
+ # @param start [String, nil] Pagination token to retrieve the next page of results.
2419
+ # @param limit [Integer, nil] Maximum number of coupons to return per request.
2420
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-coupons-list
2421
+ # @return [Array(Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse, Integer, Hash{String => String})] when HTTP status code is 200
2422
+ # @return [Array(Line::Bot::V2::MessagingApi::ErrorResponse, Integer, Hash{String => String})] when HTTP status code is 400
2423
+ # @return [Array((String|nil), Integer, Hash{String => String})] when other HTTP status code is returned. String is HTTP response body itself.
2424
+ def list_coupon_with_http_info( # steep:ignore MethodBodyTypeMismatch
2425
+ status: nil,
2426
+ start: nil,
2427
+ limit: nil
2428
+ )
2429
+ path = "/v2/bot/coupon"
2430
+ query_params = {
2431
+ "status": status&.join(','),
2432
+ "start": start,
2433
+ "limit": limit
2434
+ }.compact
2435
+
2436
+ response = @http_client.get(
2437
+ path: path,
2438
+ query_params: query_params,
2439
+ )
2440
+
2441
+ case response.code.to_i
2442
+ when 200
2443
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
2444
+ json.transform_keys! do |key|
2445
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
2446
+ end
2447
+ response_body = Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse.create(json) # steep:ignore InsufficientKeywordArguments
2448
+ [response_body, 200, response.each_header.to_h]
2449
+ when 400
2450
+ json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
2451
+ json.transform_keys! do |key|
2452
+ Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
2453
+ end
2454
+ response_body = Line::Bot::V2::MessagingApi::ErrorResponse.create(json) # steep:ignore InsufficientKeywordArguments
2455
+ [response_body, 400, response.each_header.to_h]
2456
+ else
2457
+ [response.body, response.code.to_i, response.each_header.to_h]
2458
+ end
2459
+ end
2460
+
2461
+ # Get a paginated list of coupons.
2462
+ # This requests to <code>GET https://api.line.me/v2/bot/coupon</code>
2463
+ # When you want to get HTTP status code or response headers, use {#list_coupon_with_http_info} instead of this.
2464
+ #
2465
+ # @param status [Array[String], nil] Filter coupons by their status.
2466
+ # @param start [String, nil] Pagination token to retrieve the next page of results.
2467
+ # @param limit [Integer, nil] Maximum number of coupons to return per request.
2468
+ # @see https://developers.line.biz/en/reference/messaging-api/#get-coupons-list
2469
+ # @return [Line::Bot::V2::MessagingApi::MessagingApiPagerCouponListResponse] when HTTP status code is 200
2470
+ # @return [Line::Bot::V2::MessagingApi::ErrorResponse] when HTTP status code is 400
2471
+ # @return [String, nil] when other HTTP status code is returned. This String is HTTP response body itself.
2472
+ def list_coupon(
2473
+ status: nil,
2474
+ start: nil,
2475
+ limit: nil
2476
+ )
2477
+ response_body, _status_code, _headers = list_coupon_with_http_info(
2478
+ status: status,
2479
+ start: start,
2480
+ limit: limit
2481
+ )
2482
+
2483
+ response_body
2484
+ end
2485
+
2217
2486
  # Mark messages from users as read
2218
2487
  # This requests to <code>POST https://api.line.me/v2/bot/message/markAsRead</code>
2219
2488
  # This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
@@ -9,6 +9,8 @@
9
9
  # Do not edit the class manually.
10
10
 
11
11
  # Models
12
+ require_relative './model/acquisition_condition_request'
13
+ require_relative './model/acquisition_condition_response'
12
14
  require_relative './model/action'
13
15
  require_relative './model/age_demographic'
14
16
  require_relative './model/age_demographic_filter'
@@ -27,13 +29,44 @@ require_relative './model/camera_action'
27
29
  require_relative './model/camera_roll_action'
28
30
  require_relative './model/carousel_column'
29
31
  require_relative './model/carousel_template'
32
+ require_relative './model/cash_back_fixed_price_info_request'
33
+ require_relative './model/cash_back_fixed_price_info_response'
34
+ require_relative './model/cash_back_percentage_price_info_request'
35
+ require_relative './model/cash_back_percentage_price_info_response'
36
+ require_relative './model/cash_back_price_info_request'
37
+ require_relative './model/cash_back_price_info_response'
30
38
  require_relative './model/chat_reference'
31
39
  require_relative './model/clipboard_action'
32
40
  require_relative './model/clipboard_imagemap_action'
33
41
  require_relative './model/confirm_template'
42
+ require_relative './model/coupon_cash_back_reward_request'
43
+ require_relative './model/coupon_cash_back_reward_response'
44
+ require_relative './model/coupon_create_request'
45
+ require_relative './model/coupon_create_response'
46
+ require_relative './model/coupon_discount_reward_request'
47
+ require_relative './model/coupon_discount_reward_response'
48
+ require_relative './model/coupon_free_reward_request'
49
+ require_relative './model/coupon_free_reward_response'
50
+ require_relative './model/coupon_gift_reward_request'
51
+ require_relative './model/coupon_gift_reward_response'
52
+ require_relative './model/coupon_list_response'
53
+ require_relative './model/coupon_message'
54
+ require_relative './model/coupon_others_reward_request'
55
+ require_relative './model/coupon_others_reward_response'
56
+ require_relative './model/coupon_response'
57
+ require_relative './model/coupon_reward_request'
58
+ require_relative './model/coupon_reward_response'
34
59
  require_relative './model/create_rich_menu_alias_request'
35
60
  require_relative './model/datetime_picker_action'
36
61
  require_relative './model/demographic_filter'
62
+ require_relative './model/discount_explicit_price_info_request'
63
+ require_relative './model/discount_explicit_price_info_response'
64
+ require_relative './model/discount_fixed_price_info_request'
65
+ require_relative './model/discount_fixed_price_info_response'
66
+ require_relative './model/discount_percentage_price_info_request'
67
+ require_relative './model/discount_percentage_price_info_response'
68
+ require_relative './model/discount_price_info_request'
69
+ require_relative './model/discount_price_info_response'
37
70
  require_relative './model/emoji'
38
71
  require_relative './model/emoji_substitution_object'
39
72
  require_relative './model/error_detail'
@@ -92,6 +125,8 @@ require_relative './model/issue_link_token_response'
92
125
  require_relative './model/limit'
93
126
  require_relative './model/location_action'
94
127
  require_relative './model/location_message'
128
+ require_relative './model/lottery_acquisition_condition_request'
129
+ require_relative './model/lottery_acquisition_condition_response'
95
130
  require_relative './model/mark_messages_as_read_request'
96
131
  require_relative './model/members_ids_response'
97
132
  require_relative './model/membership'
@@ -102,9 +137,12 @@ require_relative './model/message'
102
137
  require_relative './model/message_action'
103
138
  require_relative './model/message_imagemap_action'
104
139
  require_relative './model/message_quota_response'
140
+ require_relative './model/messaging_api_pager_coupon_list_response'
105
141
  require_relative './model/multicast_request'
106
142
  require_relative './model/narrowcast_progress_response'
107
143
  require_relative './model/narrowcast_request'
144
+ require_relative './model/normal_acquisition_condition_request'
145
+ require_relative './model/normal_acquisition_condition_response'
108
146
  require_relative './model/number_of_messages_response'
109
147
  require_relative './model/operator_demographic_filter'
110
148
  require_relative './model/operator_recipient'
@@ -118,6 +156,7 @@ require_relative './model/quota_consumption_response'
118
156
  require_relative './model/quota_type'
119
157
  require_relative './model/recipient'
120
158
  require_relative './model/redelivery_recipient'
159
+ require_relative './model/referral_acquisition_condition_response'
121
160
  require_relative './model/reply_message_request'
122
161
  require_relative './model/reply_message_response'
123
162
  require_relative './model/rich_menu_alias_list_response'
@@ -0,0 +1,77 @@
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
+ class AcquisitionConditionRequest
15
+ # @!attribute [rw] type
16
+ # @return [String] Determines how the coupon is distributed or used.
17
+ attr_accessor :type
18
+
19
+ # @param type [String] Determines how the coupon is distributed or used.
20
+ def initialize(
21
+ type:,
22
+ **dynamic_attributes
23
+ )
24
+
25
+ @type = type
26
+
27
+ dynamic_attributes.each do |key, value|
28
+ self.class.attr_accessor key
29
+
30
+ if value.is_a?(Hash)
31
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
32
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
33
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
34
+ else
35
+ instance_variable_set("@#{key}", value)
36
+ end
37
+ end
38
+ end
39
+
40
+ # Create an instance of the class from a hash
41
+ # @param args [Hash] Hash containing all the required attributes
42
+ # @return [Line::Bot::V2::MessagingApi::AcquisitionConditionRequest] Instance of the class
43
+ def self.create(args) # steep:ignore
44
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
+ klass = detect_class(type: symbolized_args[:type])
46
+ return klass.new(**symbolized_args) if klass # steep:ignore
47
+ return new(**symbolized_args) # steep:ignore
48
+ end
49
+
50
+ # @param other [Object] Object to compare
51
+ # @return [Boolean] true if the objects are equal, false otherwise
52
+ def ==(other)
53
+ return false unless self.class == other.class
54
+
55
+ instance_variables.all? do |var|
56
+ instance_variable_get(var) == other.instance_variable_get(var)
57
+ end
58
+ end
59
+
60
+ # @return [Integer] Hash code of the object
61
+ def hash
62
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
63
+ end
64
+
65
+ private
66
+
67
+ def self.detect_class(type:)
68
+ {
69
+ lottery: Line::Bot::V2::MessagingApi::LotteryAcquisitionConditionRequest,
70
+ normal: Line::Bot::V2::MessagingApi::NormalAcquisitionConditionRequest,
71
+ }[type.to_sym]
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,78 @@
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
+ class AcquisitionConditionResponse
15
+ # @!attribute [rw] type
16
+ # @return [String] Determines how the coupon is distributed or used.
17
+ attr_accessor :type
18
+
19
+ # @param type [String] Determines how the coupon is distributed or used.
20
+ def initialize(
21
+ type:,
22
+ **dynamic_attributes
23
+ )
24
+
25
+ @type = type
26
+
27
+ dynamic_attributes.each do |key, value|
28
+ self.class.attr_accessor key
29
+
30
+ if value.is_a?(Hash)
31
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
32
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
33
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
34
+ else
35
+ instance_variable_set("@#{key}", value)
36
+ end
37
+ end
38
+ end
39
+
40
+ # Create an instance of the class from a hash
41
+ # @param args [Hash] Hash containing all the required attributes
42
+ # @return [Line::Bot::V2::MessagingApi::AcquisitionConditionResponse] Instance of the class
43
+ def self.create(args) # steep:ignore
44
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
+ klass = detect_class(type: symbolized_args[:type])
46
+ return klass.new(**symbolized_args) if klass # steep:ignore
47
+ return new(**symbolized_args) # steep:ignore
48
+ end
49
+
50
+ # @param other [Object] Object to compare
51
+ # @return [Boolean] true if the objects are equal, false otherwise
52
+ def ==(other)
53
+ return false unless self.class == other.class
54
+
55
+ instance_variables.all? do |var|
56
+ instance_variable_get(var) == other.instance_variable_get(var)
57
+ end
58
+ end
59
+
60
+ # @return [Integer] Hash code of the object
61
+ def hash
62
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
63
+ end
64
+
65
+ private
66
+
67
+ def self.detect_class(type:)
68
+ {
69
+ lottery: Line::Bot::V2::MessagingApi::LotteryAcquisitionConditionResponse,
70
+ normal: Line::Bot::V2::MessagingApi::NormalAcquisitionConditionResponse,
71
+ referral: Line::Bot::V2::MessagingApi::ReferralAcquisitionConditionResponse,
72
+ }[type.to_sym]
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,72 @@
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
+ require_relative './cash_back_price_info_request'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CashBackFixedPriceInfoRequest < CashBackPriceInfoRequest
17
+ # @!attribute [r] type
18
+ # @return [String]
19
+ attr_reader :type
20
+ # @!attribute [rw] fixed_amount
21
+ # @return [Integer,nil]
22
+ attr_accessor :fixed_amount
23
+
24
+ # @param fixed_amount [Integer,nil]
25
+ def initialize(
26
+ fixed_amount: nil,
27
+ **dynamic_attributes
28
+ )
29
+ @type = "fixed"
30
+
31
+ @fixed_amount = fixed_amount
32
+
33
+ dynamic_attributes.each do |key, value|
34
+ self.class.attr_accessor key
35
+
36
+ if value.is_a?(Hash)
37
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
38
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
39
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
40
+ else
41
+ instance_variable_set("@#{key}", value)
42
+ end
43
+ end
44
+ end
45
+
46
+ # Create an instance of the class from a hash
47
+ # @param args [Hash] Hash containing all the required attributes
48
+ # @return [Line::Bot::V2::MessagingApi::CashBackFixedPriceInfoRequest] Instance of the class
49
+ def self.create(args) # steep:ignore
50
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
51
+ return new(**symbolized_args) # steep:ignore
52
+ end
53
+
54
+ # @param other [Object] Object to compare
55
+ # @return [Boolean] true if the objects are equal, false otherwise
56
+ def ==(other)
57
+ return false unless self.class == other.class
58
+
59
+ instance_variables.all? do |var|
60
+ instance_variable_get(var) == other.instance_variable_get(var)
61
+ end
62
+ end
63
+
64
+ # @return [Integer] Hash code of the object
65
+ def hash
66
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,78 @@
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
+ require_relative './cash_back_price_info_response'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CashBackFixedPriceInfoResponse < CashBackPriceInfoResponse
17
+ # @!attribute [r] type
18
+ # @return [String]
19
+ attr_reader :type
20
+ # @!attribute [rw] currency
21
+ # @return [String,nil] ('JPY'|'THB'|'TWD') Currency code (e.g., JPY, THB, TWD).
22
+ attr_accessor :currency
23
+ # @!attribute [rw] fixed_amount
24
+ # @return [Integer,nil]
25
+ attr_accessor :fixed_amount
26
+
27
+ # @param currency [String,nil] ('JPY'|'THB'|'TWD') Currency code (e.g., JPY, THB, TWD).
28
+ # @param fixed_amount [Integer,nil]
29
+ def initialize(
30
+ currency: nil,
31
+ fixed_amount: nil,
32
+ **dynamic_attributes
33
+ )
34
+ @type = "fixed"
35
+
36
+ @currency = currency
37
+ @fixed_amount = fixed_amount
38
+
39
+ dynamic_attributes.each do |key, value|
40
+ self.class.attr_accessor key
41
+
42
+ if value.is_a?(Hash)
43
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
44
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
45
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
46
+ else
47
+ instance_variable_set("@#{key}", value)
48
+ end
49
+ end
50
+ end
51
+
52
+ # Create an instance of the class from a hash
53
+ # @param args [Hash] Hash containing all the required attributes
54
+ # @return [Line::Bot::V2::MessagingApi::CashBackFixedPriceInfoResponse] Instance of the class
55
+ def self.create(args) # steep:ignore
56
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
57
+ return new(**symbolized_args) # steep:ignore
58
+ end
59
+
60
+ # @param other [Object] Object to compare
61
+ # @return [Boolean] true if the objects are equal, false otherwise
62
+ def ==(other)
63
+ return false unless self.class == other.class
64
+
65
+ instance_variables.all? do |var|
66
+ instance_variable_get(var) == other.instance_variable_get(var)
67
+ end
68
+ end
69
+
70
+ # @return [Integer] Hash code of the object
71
+ def hash
72
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end