line-bot-api 2.0.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 (88) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +49 -1
  3. data/README.md +34 -16
  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/line-bot-api.gemspec +1 -1
  48. data/sig/line/bot/v2/messaging_api/api/messaging_api_client.rbs +156 -0
  49. data/sig/line/bot/v2/messaging_api/model/acquisition_condition_request.rbs +43 -0
  50. data/sig/line/bot/v2/messaging_api/model/acquisition_condition_response.rbs +43 -0
  51. data/sig/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_request.rbs +40 -0
  52. data/sig/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_response.rbs +43 -0
  53. data/sig/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_request.rbs +40 -0
  54. data/sig/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_response.rbs +40 -0
  55. data/sig/line/bot/v2/messaging_api/model/cash_back_price_info_request.rbs +43 -0
  56. data/sig/line/bot/v2/messaging_api/model/cash_back_price_info_response.rbs +43 -0
  57. data/sig/line/bot/v2/messaging_api/model/coupon_cash_back_reward_request.rbs +40 -0
  58. data/sig/line/bot/v2/messaging_api/model/coupon_cash_back_reward_response.rbs +40 -0
  59. data/sig/line/bot/v2/messaging_api/model/coupon_create_request.rbs +76 -0
  60. data/sig/line/bot/v2/messaging_api/model/coupon_create_response.rbs +40 -0
  61. data/sig/line/bot/v2/messaging_api/model/coupon_discount_reward_request.rbs +40 -0
  62. data/sig/line/bot/v2/messaging_api/model/coupon_discount_reward_response.rbs +40 -0
  63. data/sig/line/bot/v2/messaging_api/model/coupon_free_reward_request.rbs +37 -0
  64. data/sig/line/bot/v2/messaging_api/model/coupon_free_reward_response.rbs +37 -0
  65. data/sig/line/bot/v2/messaging_api/model/coupon_gift_reward_request.rbs +37 -0
  66. data/sig/line/bot/v2/messaging_api/model/coupon_gift_reward_response.rbs +37 -0
  67. data/sig/line/bot/v2/messaging_api/model/coupon_list_response.rbs +43 -0
  68. data/sig/line/bot/v2/messaging_api/model/coupon_message.rbs +50 -0
  69. data/sig/line/bot/v2/messaging_api/model/coupon_others_reward_request.rbs +37 -0
  70. data/sig/line/bot/v2/messaging_api/model/coupon_others_reward_response.rbs +37 -0
  71. data/sig/line/bot/v2/messaging_api/model/coupon_response.rbs +91 -0
  72. data/sig/line/bot/v2/messaging_api/model/coupon_reward_request.rbs +43 -0
  73. data/sig/line/bot/v2/messaging_api/model/coupon_reward_response.rbs +43 -0
  74. data/sig/line/bot/v2/messaging_api/model/discount_explicit_price_info_request.rbs +43 -0
  75. data/sig/line/bot/v2/messaging_api/model/discount_explicit_price_info_response.rbs +46 -0
  76. data/sig/line/bot/v2/messaging_api/model/discount_fixed_price_info_request.rbs +40 -0
  77. data/sig/line/bot/v2/messaging_api/model/discount_fixed_price_info_response.rbs +43 -0
  78. data/sig/line/bot/v2/messaging_api/model/discount_percentage_price_info_request.rbs +40 -0
  79. data/sig/line/bot/v2/messaging_api/model/discount_percentage_price_info_response.rbs +40 -0
  80. data/sig/line/bot/v2/messaging_api/model/discount_price_info_request.rbs +43 -0
  81. data/sig/line/bot/v2/messaging_api/model/discount_price_info_response.rbs +43 -0
  82. data/sig/line/bot/v2/messaging_api/model/lottery_acquisition_condition_request.rbs +43 -0
  83. data/sig/line/bot/v2/messaging_api/model/lottery_acquisition_condition_response.rbs +43 -0
  84. data/sig/line/bot/v2/messaging_api/model/messaging_api_pager_coupon_list_response.rbs +43 -0
  85. data/sig/line/bot/v2/messaging_api/model/normal_acquisition_condition_request.rbs +37 -0
  86. data/sig/line/bot/v2/messaging_api/model/normal_acquisition_condition_response.rbs +37 -0
  87. data/sig/line/bot/v2/messaging_api/model/referral_acquisition_condition_response.rbs +37 -0
  88. metadata +81 -3
@@ -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
+ # Summary information about a coupon, used in coupon lists.
15
+ class CouponListResponse
16
+ # @!attribute [rw] coupon_id
17
+ # @return [String] Unique identifier of the coupon.
18
+ attr_accessor :coupon_id
19
+ # @!attribute [rw] title
20
+ # @return [String] Title of the coupon. Displayed in the coupon list.
21
+ attr_accessor :title
22
+
23
+ # @param coupon_id [String] Unique identifier of the coupon.
24
+ # @param title [String] Title of the coupon. Displayed in the coupon list.
25
+ def initialize(
26
+ coupon_id:,
27
+ title:,
28
+ **dynamic_attributes
29
+ )
30
+
31
+ @coupon_id = coupon_id
32
+ @title = title
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::CouponListResponse] Instance of the class
50
+ def self.create(args) # steep:ignore
51
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
52
+ return new(**symbolized_args) # steep:ignore
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,91 @@
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 './message'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ # @see https://developers.line.biz/en/reference/messaging-api/#coupon-message
17
+ class CouponMessage < Message
18
+ # @!attribute [r] type
19
+ # @return [String] Type of message
20
+ attr_reader :type
21
+ # @!attribute [rw] quick_reply
22
+ # @return [QuickReply,nil]
23
+ attr_accessor :quick_reply
24
+ # @!attribute [rw] sender
25
+ # @return [Sender,nil]
26
+ attr_accessor :sender
27
+ # @!attribute [rw] coupon_id
28
+ # @return [String] Unique identifier of the coupon.
29
+ attr_accessor :coupon_id
30
+ # @!attribute [rw] delivery_tag
31
+ # @return [String,nil] Delivery route tag information. It can be used for analysis in LINE OA Manager.
32
+ attr_accessor :delivery_tag
33
+
34
+ # @param quick_reply [QuickReply, Hash[Symbol, untyped], nil]
35
+ # @param sender [Sender, Hash[Symbol, untyped], nil]
36
+ # @param coupon_id [String] Unique identifier of the coupon.
37
+ # @param delivery_tag [String,nil] Delivery route tag information. It can be used for analysis in LINE OA Manager.
38
+ def initialize(
39
+ quick_reply: nil,
40
+ sender: nil,
41
+ coupon_id:,
42
+ delivery_tag: nil,
43
+ **dynamic_attributes
44
+ )
45
+ @type = "coupon"
46
+
47
+ @quick_reply = quick_reply.is_a?(Line::Bot::V2::MessagingApi::QuickReply) || quick_reply.nil? ? quick_reply : Line::Bot::V2::MessagingApi::QuickReply.create(**quick_reply) # steep:ignore
48
+ @sender = sender.is_a?(Line::Bot::V2::MessagingApi::Sender) || sender.nil? ? sender : Line::Bot::V2::MessagingApi::Sender.create(**sender) # steep:ignore
49
+ @coupon_id = coupon_id
50
+ @delivery_tag = delivery_tag
51
+
52
+ dynamic_attributes.each do |key, value|
53
+ self.class.attr_accessor key
54
+
55
+ if value.is_a?(Hash)
56
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
57
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
58
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
59
+ else
60
+ instance_variable_set("@#{key}", value)
61
+ end
62
+ end
63
+ end
64
+
65
+ # Create an instance of the class from a hash
66
+ # @param args [Hash] Hash containing all the required attributes
67
+ # @return [Line::Bot::V2::MessagingApi::CouponMessage] Instance of the class
68
+ def self.create(args) # steep:ignore
69
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
70
+ return new(**symbolized_args) # steep:ignore
71
+ end
72
+
73
+ # @param other [Object] Object to compare
74
+ # @return [Boolean] true if the objects are equal, false otherwise
75
+ def ==(other)
76
+ return false unless self.class == other.class
77
+
78
+ instance_variables.all? do |var|
79
+ instance_variable_get(var) == other.instance_variable_get(var)
80
+ end
81
+ end
82
+
83
+ # @return [Integer] Hash code of the object
84
+ def hash
85
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,66 @@
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 './coupon_reward_request'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CouponOthersRewardRequest < CouponRewardRequest
17
+ # @!attribute [r] type
18
+ # @return [String] Type of coupon. Determines the benefit provided.
19
+ attr_reader :type
20
+
21
+ def initialize(
22
+ **dynamic_attributes
23
+ )
24
+ @type = "others"
25
+
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::CouponOthersRewardRequest] Instance of the class
43
+ def self.create(args) # steep:ignore
44
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
+ return new(**symbolized_args) # steep:ignore
46
+ end
47
+
48
+ # @param other [Object] Object to compare
49
+ # @return [Boolean] true if the objects are equal, false otherwise
50
+ def ==(other)
51
+ return false unless self.class == other.class
52
+
53
+ instance_variables.all? do |var|
54
+ instance_variable_get(var) == other.instance_variable_get(var)
55
+ end
56
+ end
57
+
58
+ # @return [Integer] Hash code of the object
59
+ def hash
60
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,66 @@
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 './coupon_reward_response'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CouponOthersRewardResponse < CouponRewardResponse
17
+ # @!attribute [r] type
18
+ # @return [String] Type of coupon. Determines the benefit provided.
19
+ attr_reader :type
20
+
21
+ def initialize(
22
+ **dynamic_attributes
23
+ )
24
+ @type = "others"
25
+
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::CouponOthersRewardResponse] Instance of the class
43
+ def self.create(args) # steep:ignore
44
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
45
+ return new(**symbolized_args) # steep:ignore
46
+ end
47
+
48
+ # @param other [Object] Object to compare
49
+ # @return [Boolean] true if the objects are equal, false otherwise
50
+ def ==(other)
51
+ return false unless self.class == other.class
52
+
53
+ instance_variables.all? do |var|
54
+ instance_variable_get(var) == other.instance_variable_get(var)
55
+ end
56
+ end
57
+
58
+ # @return [Integer] Hash code of the object
59
+ def hash
60
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,169 @@
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
+ # Detailed information about a coupon, including all properties and current status.
15
+ class CouponResponse
16
+ # @!attribute [rw] acquisition_condition
17
+ # @return [AcquisitionConditionResponse,nil]
18
+ attr_accessor :acquisition_condition
19
+ # @!attribute [rw] barcode_image_url
20
+ # @return [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
21
+ attr_accessor :barcode_image_url
22
+ # @!attribute [rw] coupon_code
23
+ # @return [String,nil] Unique code to be presented by the user to redeem the coupon.
24
+ attr_accessor :coupon_code
25
+ # @!attribute [rw] description
26
+ # @return [String,nil] Detailed description of the coupon. Displayed to users.
27
+ attr_accessor :description
28
+ # @!attribute [rw] end_timestamp
29
+ # @return [Integer,nil] Coupon expiration time (epoch seconds). Coupon cannot be used after this time.
30
+ attr_accessor :end_timestamp
31
+ # @!attribute [rw] image_url
32
+ # @return [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
33
+ attr_accessor :image_url
34
+ # @!attribute [rw] max_acquire_count
35
+ # @return [Integer,nil] Maximum number of coupons that can be issued in total.
36
+ attr_accessor :max_acquire_count
37
+ # @!attribute [rw] max_use_count_per_ticket
38
+ # @return [Integer,nil] Maximum number of times a single coupon ticket can be used.
39
+ attr_accessor :max_use_count_per_ticket
40
+ # @!attribute [rw] max_ticket_per_user
41
+ # @return [Integer,nil] Maximum number of coupon tickets a single user can acquire.
42
+ attr_accessor :max_ticket_per_user
43
+ # @!attribute [rw] start_timestamp
44
+ # @return [Integer,nil] Coupon start time (epoch seconds). Coupon can be used from this time.
45
+ attr_accessor :start_timestamp
46
+ # @!attribute [rw] title
47
+ # @return [String,nil] Title of the coupon. Displayed in the coupon list.
48
+ attr_accessor :title
49
+ # @!attribute [rw] usage_condition
50
+ # @return [String,nil] Conditions for using the coupon. Shown to users.
51
+ attr_accessor :usage_condition
52
+ # @!attribute [rw] reward
53
+ # @return [CouponRewardResponse,nil]
54
+ attr_accessor :reward
55
+ # @!attribute [rw] visibility
56
+ # @return [String,nil] ('UNLISTED'|'PUBLIC'|'PRIVATE') Visibility of the coupon. Determines who can see or acquire the coupon.
57
+ attr_accessor :visibility
58
+ # @!attribute [rw] timezone
59
+ # @return [String,nil] ('ETC_GMT_MINUS_12'|'ETC_GMT_MINUS_11'|'PACIFIC_HONOLULU'|'AMERICA_ANCHORAGE'|'AMERICA_LOS_ANGELES'|'AMERICA_PHOENIX'|'AMERICA_CHICAGO'|'AMERICA_NEW_YORK'|'AMERICA_CARACAS'|'AMERICA_SANTIAGO'|'AMERICA_ST_JOHNS'|'AMERICA_SAO_PAULO'|'ETC_GMT_MINUS_2'|'ATLANTIC_CAPE_VERDE'|'EUROPE_LONDON'|'EUROPE_PARIS'|'EUROPE_ISTANBUL'|'EUROPE_MOSCOW'|'ASIA_TEHRAN'|'ASIA_TBILISI'|'ASIA_KABUL'|'ASIA_TASHKENT'|'ASIA_COLOMBO'|'ASIA_KATHMANDU'|'ASIA_ALMATY'|'ASIA_RANGOON'|'ASIA_BANGKOK'|'ASIA_TAIPEI'|'ASIA_TOKYO'|'AUSTRALIA_DARWIN'|'AUSTRALIA_SYDNEY'|'ASIA_VLADIVOSTOK'|'ETC_GMT_PLUS_12'|'PACIFIC_TONGATAPU') Timezone for interpreting start and end timestamps.
60
+ attr_accessor :timezone
61
+ # @!attribute [rw] coupon_id
62
+ # @return [String,nil] Unique identifier of the coupon.
63
+ attr_accessor :coupon_id
64
+ # @!attribute [rw] created_timestamp
65
+ # @return [Integer,nil] Created timestamp (seconds) of the coupon.
66
+ attr_accessor :created_timestamp
67
+ # @!attribute [rw] status
68
+ # @return [String,nil] ('DRAFT'|'RUNNING'|'CLOSED') Current status of the coupon.
69
+ attr_accessor :status
70
+
71
+ # @param acquisition_condition [AcquisitionConditionResponse, Hash[Symbol, untyped], nil]
72
+ # @param barcode_image_url [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
73
+ # @param coupon_code [String,nil] Unique code to be presented by the user to redeem the coupon.
74
+ # @param description [String,nil] Detailed description of the coupon. Displayed to users.
75
+ # @param end_timestamp [Integer,nil] Coupon expiration time (epoch seconds). Coupon cannot be used after this time.
76
+ # @param image_url [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
77
+ # @param max_acquire_count [Integer,nil] Maximum number of coupons that can be issued in total.
78
+ # @param max_use_count_per_ticket [Integer,nil] Maximum number of times a single coupon ticket can be used.
79
+ # @param max_ticket_per_user [Integer,nil] Maximum number of coupon tickets a single user can acquire.
80
+ # @param start_timestamp [Integer,nil] Coupon start time (epoch seconds). Coupon can be used from this time.
81
+ # @param title [String,nil] Title of the coupon. Displayed in the coupon list.
82
+ # @param usage_condition [String,nil] Conditions for using the coupon. Shown to users.
83
+ # @param reward [CouponRewardResponse, Hash[Symbol, untyped], nil]
84
+ # @param visibility [String,nil] ('UNLISTED'|'PUBLIC'|'PRIVATE') Visibility of the coupon. Determines who can see or acquire the coupon.
85
+ # @param timezone [String,nil] ('ETC_GMT_MINUS_12'|'ETC_GMT_MINUS_11'|'PACIFIC_HONOLULU'|'AMERICA_ANCHORAGE'|'AMERICA_LOS_ANGELES'|'AMERICA_PHOENIX'|'AMERICA_CHICAGO'|'AMERICA_NEW_YORK'|'AMERICA_CARACAS'|'AMERICA_SANTIAGO'|'AMERICA_ST_JOHNS'|'AMERICA_SAO_PAULO'|'ETC_GMT_MINUS_2'|'ATLANTIC_CAPE_VERDE'|'EUROPE_LONDON'|'EUROPE_PARIS'|'EUROPE_ISTANBUL'|'EUROPE_MOSCOW'|'ASIA_TEHRAN'|'ASIA_TBILISI'|'ASIA_KABUL'|'ASIA_TASHKENT'|'ASIA_COLOMBO'|'ASIA_KATHMANDU'|'ASIA_ALMATY'|'ASIA_RANGOON'|'ASIA_BANGKOK'|'ASIA_TAIPEI'|'ASIA_TOKYO'|'AUSTRALIA_DARWIN'|'AUSTRALIA_SYDNEY'|'ASIA_VLADIVOSTOK'|'ETC_GMT_PLUS_12'|'PACIFIC_TONGATAPU') Timezone for interpreting start and end timestamps.
86
+ # @param coupon_id [String,nil] Unique identifier of the coupon.
87
+ # @param created_timestamp [Integer,nil] Created timestamp (seconds) of the coupon.
88
+ # @param status [String,nil] ('DRAFT'|'RUNNING'|'CLOSED') Current status of the coupon.
89
+ def initialize(
90
+ acquisition_condition: nil,
91
+ barcode_image_url: nil,
92
+ coupon_code: nil,
93
+ description: nil,
94
+ end_timestamp: nil,
95
+ image_url: nil,
96
+ max_acquire_count: nil,
97
+ max_use_count_per_ticket: nil,
98
+ max_ticket_per_user: nil,
99
+ start_timestamp: nil,
100
+ title: nil,
101
+ usage_condition: nil,
102
+ reward: nil,
103
+ visibility: nil,
104
+ timezone: nil,
105
+ coupon_id: nil,
106
+ created_timestamp: nil,
107
+ status: nil,
108
+ **dynamic_attributes
109
+ )
110
+
111
+ @acquisition_condition = acquisition_condition.is_a?(Line::Bot::V2::MessagingApi::AcquisitionConditionResponse) || acquisition_condition.nil? ? acquisition_condition : Line::Bot::V2::MessagingApi::AcquisitionConditionResponse.create(**acquisition_condition) # steep:ignore
112
+ @barcode_image_url = barcode_image_url
113
+ @coupon_code = coupon_code
114
+ @description = description
115
+ @end_timestamp = end_timestamp
116
+ @image_url = image_url
117
+ @max_acquire_count = max_acquire_count
118
+ @max_use_count_per_ticket = max_use_count_per_ticket
119
+ @max_ticket_per_user = max_ticket_per_user
120
+ @start_timestamp = start_timestamp
121
+ @title = title
122
+ @usage_condition = usage_condition
123
+ @reward = reward.is_a?(Line::Bot::V2::MessagingApi::CouponRewardResponse) || reward.nil? ? reward : Line::Bot::V2::MessagingApi::CouponRewardResponse.create(**reward) # steep:ignore
124
+ @visibility = visibility
125
+ @timezone = timezone
126
+ @coupon_id = coupon_id
127
+ @created_timestamp = created_timestamp
128
+ @status = status
129
+
130
+ dynamic_attributes.each do |key, value|
131
+ self.class.attr_accessor key
132
+
133
+ if value.is_a?(Hash)
134
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
135
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
136
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
137
+ else
138
+ instance_variable_set("@#{key}", value)
139
+ end
140
+ end
141
+ end
142
+
143
+ # Create an instance of the class from a hash
144
+ # @param args [Hash] Hash containing all the required attributes
145
+ # @return [Line::Bot::V2::MessagingApi::CouponResponse] Instance of the class
146
+ def self.create(args) # steep:ignore
147
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
148
+ return new(**symbolized_args) # steep:ignore
149
+ end
150
+
151
+ # @param other [Object] Object to compare
152
+ # @return [Boolean] true if the objects are equal, false otherwise
153
+ def ==(other)
154
+ return false unless self.class == other.class
155
+
156
+ instance_variables.all? do |var|
157
+ instance_variable_get(var) == other.instance_variable_get(var)
158
+ end
159
+ end
160
+
161
+ # @return [Integer] Hash code of the object
162
+ def hash
163
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
164
+ end
165
+ end
166
+ end
167
+ end
168
+ end
169
+ end
@@ -0,0 +1,80 @@
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 CouponRewardRequest
15
+ # @!attribute [rw] type
16
+ # @return [String] Type of coupon. Determines the benefit provided.
17
+ attr_accessor :type
18
+
19
+ # @param type [String] Type of coupon. Determines the benefit provided.
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::CouponRewardRequest] 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
+ cashBack: Line::Bot::V2::MessagingApi::CouponCashBackRewardRequest,
70
+ discount: Line::Bot::V2::MessagingApi::CouponDiscountRewardRequest,
71
+ free: Line::Bot::V2::MessagingApi::CouponFreeRewardRequest,
72
+ gift: Line::Bot::V2::MessagingApi::CouponGiftRewardRequest,
73
+ others: Line::Bot::V2::MessagingApi::CouponOthersRewardRequest,
74
+ }[type.to_sym]
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,80 @@
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 CouponRewardResponse
15
+ # @!attribute [rw] type
16
+ # @return [String] Type of coupon. Determines the benefit provided.
17
+ attr_accessor :type
18
+
19
+ # @param type [String] Type of coupon. Determines the benefit provided.
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::CouponRewardResponse] 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
+ cashBack: Line::Bot::V2::MessagingApi::CouponCashBackRewardResponse,
70
+ discount: Line::Bot::V2::MessagingApi::CouponDiscountRewardResponse,
71
+ free: Line::Bot::V2::MessagingApi::CouponFreeRewardResponse,
72
+ gift: Line::Bot::V2::MessagingApi::CouponGiftRewardResponse,
73
+ others: Line::Bot::V2::MessagingApi::CouponOthersRewardResponse,
74
+ }[type.to_sym]
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end