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,139 @@
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
+ # Request object for creating a coupon. Contains all configurable coupon properties.
15
+ class CouponCreateRequest
16
+ # @!attribute [rw] acquisition_condition
17
+ # @return [AcquisitionConditionRequest]
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. Optional.
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] 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_use_count_per_ticket
35
+ # @return [Integer] Maximum number of times a single coupon ticket can be used. Use -1 to indicate no limit.
36
+ attr_accessor :max_use_count_per_ticket
37
+ # @!attribute [rw] start_timestamp
38
+ # @return [Integer] Coupon start time (epoch seconds). Coupon can be used from this time.
39
+ attr_accessor :start_timestamp
40
+ # @!attribute [rw] title
41
+ # @return [String] Title of the coupon. Displayed in the coupon list.
42
+ attr_accessor :title
43
+ # @!attribute [rw] usage_condition
44
+ # @return [String,nil] Conditions for using the coupon. Shown to users.
45
+ attr_accessor :usage_condition
46
+ # @!attribute [rw] reward
47
+ # @return [CouponRewardRequest,nil]
48
+ attr_accessor :reward
49
+ # @!attribute [rw] visibility
50
+ # @return [String] ('UNLISTED'|'PUBLIC') Visibility of the coupon. Determines who can see or acquire the coupon.
51
+ attr_accessor :visibility
52
+ # @!attribute [rw] timezone
53
+ # @return [String] ('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.
54
+ attr_accessor :timezone
55
+
56
+ # @param acquisition_condition [AcquisitionConditionRequest, Hash[Symbol, untyped]]
57
+ # @param barcode_image_url [String,nil] URL of the barcode image associated with the coupon. Used for in-store redemption.
58
+ # @param coupon_code [String,nil] Unique code to be presented by the user to redeem the coupon. Optional.
59
+ # @param description [String,nil] Detailed description of the coupon. Displayed to users.
60
+ # @param end_timestamp [Integer] Coupon expiration time (epoch seconds). Coupon cannot be used after this time.
61
+ # @param image_url [String,nil] URL of the main image representing the coupon. Displayed in the coupon list.
62
+ # @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
+ # @param start_timestamp [Integer] Coupon start time (epoch seconds). Coupon can be used from this time.
64
+ # @param title [String] Title of the coupon. Displayed in the coupon list.
65
+ # @param usage_condition [String,nil] Conditions for using the coupon. Shown to users.
66
+ # @param reward [CouponRewardRequest, Hash[Symbol, untyped], nil]
67
+ # @param visibility [String] ('UNLISTED'|'PUBLIC') Visibility of the coupon. Determines who can see or acquire the coupon.
68
+ # @param timezone [String] ('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.
69
+ def initialize(
70
+ acquisition_condition:,
71
+ barcode_image_url: nil,
72
+ coupon_code: nil,
73
+ description: nil,
74
+ end_timestamp:,
75
+ image_url: nil,
76
+ max_use_count_per_ticket:,
77
+ start_timestamp:,
78
+ title:,
79
+ usage_condition: nil,
80
+ reward: nil,
81
+ visibility:,
82
+ timezone:,
83
+ **dynamic_attributes
84
+ )
85
+
86
+ @acquisition_condition = acquisition_condition.is_a?(Line::Bot::V2::MessagingApi::AcquisitionConditionRequest) ? acquisition_condition : Line::Bot::V2::MessagingApi::AcquisitionConditionRequest.create(**acquisition_condition) # steep:ignore
87
+ @barcode_image_url = barcode_image_url
88
+ @coupon_code = coupon_code
89
+ @description = description
90
+ @end_timestamp = end_timestamp
91
+ @image_url = image_url
92
+ @max_use_count_per_ticket = max_use_count_per_ticket
93
+ @start_timestamp = start_timestamp
94
+ @title = title
95
+ @usage_condition = usage_condition
96
+ @reward = reward.is_a?(Line::Bot::V2::MessagingApi::CouponRewardRequest) || reward.nil? ? reward : Line::Bot::V2::MessagingApi::CouponRewardRequest.create(**reward) # steep:ignore
97
+ @visibility = visibility
98
+ @timezone = timezone
99
+
100
+ dynamic_attributes.each do |key, value|
101
+ self.class.attr_accessor key
102
+
103
+ if value.is_a?(Hash)
104
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
105
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
106
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
107
+ else
108
+ instance_variable_set("@#{key}", value)
109
+ end
110
+ end
111
+ end
112
+
113
+ # Create an instance of the class from a hash
114
+ # @param args [Hash] Hash containing all the required attributes
115
+ # @return [Line::Bot::V2::MessagingApi::CouponCreateRequest] Instance of the class
116
+ def self.create(args) # steep:ignore
117
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
118
+ return new(**symbolized_args) # steep:ignore
119
+ end
120
+
121
+ # @param other [Object] Object to compare
122
+ # @return [Boolean] true if the objects are equal, false otherwise
123
+ def ==(other)
124
+ return false unless self.class == other.class
125
+
126
+ instance_variables.all? do |var|
127
+ instance_variable_get(var) == other.instance_variable_get(var)
128
+ end
129
+ end
130
+
131
+ # @return [Integer] Hash code of the object
132
+ def hash
133
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,67 @@
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
+ # Response object returned after creating a coupon. Contains the coupon ID.
15
+ class CouponCreateResponse
16
+ # @!attribute [rw] coupon_id
17
+ # @return [String] Unique identifier of the coupon.
18
+ attr_accessor :coupon_id
19
+
20
+ # @param coupon_id [String] Unique identifier of the coupon.
21
+ def initialize(
22
+ coupon_id:,
23
+ **dynamic_attributes
24
+ )
25
+
26
+ @coupon_id = coupon_id
27
+
28
+ dynamic_attributes.each do |key, value|
29
+ self.class.attr_accessor key
30
+
31
+ if value.is_a?(Hash)
32
+ struct_klass = Struct.new(*value.keys.map(&:to_sym))
33
+ struct_values = value.map { |_k, v| v.is_a?(Hash) ? Line::Bot::V2::Utils.hash_to_struct(v) : v }
34
+ instance_variable_set("@#{key}", struct_klass.new(*struct_values))
35
+ else
36
+ instance_variable_set("@#{key}", value)
37
+ end
38
+ end
39
+ end
40
+
41
+ # Create an instance of the class from a hash
42
+ # @param args [Hash] Hash containing all the required attributes
43
+ # @return [Line::Bot::V2::MessagingApi::CouponCreateResponse] Instance of the class
44
+ def self.create(args) # steep:ignore
45
+ symbolized_args = Line::Bot::V2::Utils.deep_symbolize(args)
46
+ return new(**symbolized_args) # steep:ignore
47
+ end
48
+
49
+ # @param other [Object] Object to compare
50
+ # @return [Boolean] true if the objects are equal, false otherwise
51
+ def ==(other)
52
+ return false unless self.class == other.class
53
+
54
+ instance_variables.all? do |var|
55
+ instance_variable_get(var) == other.instance_variable_get(var)
56
+ end
57
+ end
58
+
59
+ # @return [Integer] Hash code of the object
60
+ def hash
61
+ [self.class, *instance_variables.map { |var| instance_variable_get(var) }].hash
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ 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 './coupon_reward_request'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CouponDiscountRewardRequest < CouponRewardRequest
17
+ # @!attribute [r] type
18
+ # @return [String] Type of coupon. Determines the benefit provided.
19
+ attr_reader :type
20
+ # @!attribute [rw] price_info
21
+ # @return [DiscountPriceInfoRequest,nil]
22
+ attr_accessor :price_info
23
+
24
+ # @param price_info [DiscountPriceInfoRequest, Hash[Symbol, untyped], nil]
25
+ def initialize(
26
+ price_info: nil,
27
+ **dynamic_attributes
28
+ )
29
+ @type = "discount"
30
+
31
+ @price_info = price_info.is_a?(Line::Bot::V2::MessagingApi::DiscountPriceInfoRequest) || price_info.nil? ? price_info : Line::Bot::V2::MessagingApi::DiscountPriceInfoRequest.create(**price_info) # steep:ignore
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::CouponDiscountRewardRequest] 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,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 './coupon_reward_response'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CouponDiscountRewardResponse < CouponRewardResponse
17
+ # @!attribute [r] type
18
+ # @return [String] Type of coupon. Determines the benefit provided.
19
+ attr_reader :type
20
+ # @!attribute [rw] price_info
21
+ # @return [DiscountPriceInfoResponse,nil]
22
+ attr_accessor :price_info
23
+
24
+ # @param price_info [DiscountPriceInfoResponse, Hash[Symbol, untyped], nil]
25
+ def initialize(
26
+ price_info: nil,
27
+ **dynamic_attributes
28
+ )
29
+ @type = "discount"
30
+
31
+ @price_info = price_info.is_a?(Line::Bot::V2::MessagingApi::DiscountPriceInfoResponse) || price_info.nil? ? price_info : Line::Bot::V2::MessagingApi::DiscountPriceInfoResponse.create(**price_info) # steep:ignore
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::CouponDiscountRewardResponse] 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,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 CouponFreeRewardRequest < 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 = "free"
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::CouponFreeRewardRequest] 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 CouponFreeRewardResponse < 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 = "free"
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::CouponFreeRewardResponse] 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_request'
11
+
12
+ module Line
13
+ module Bot
14
+ module V2
15
+ module MessagingApi
16
+ class CouponGiftRewardRequest < 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 = "gift"
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::CouponGiftRewardRequest] 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 CouponGiftRewardResponse < 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 = "gift"
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::CouponGiftRewardResponse] 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