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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +49 -1
- data/README.md +34 -16
- data/lib/line/bot/v2/messaging_api/api/messaging_api_client.rb +269 -0
- data/lib/line/bot/v2/messaging_api/core.rb +39 -0
- data/lib/line/bot/v2/messaging_api/model/acquisition_condition_request.rb +77 -0
- data/lib/line/bot/v2/messaging_api/model/acquisition_condition_response.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_request.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_response.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_request.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_response.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_request.rb +77 -0
- data/lib/line/bot/v2/messaging_api/model/cash_back_price_info_response.rb +77 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_cash_back_reward_request.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_cash_back_reward_response.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_create_request.rb +139 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_create_response.rb +67 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_discount_reward_request.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_discount_reward_response.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_free_reward_request.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_free_reward_response.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_gift_reward_request.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_gift_reward_response.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_list_response.rb +73 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_message.rb +91 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_others_reward_request.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_others_reward_response.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_response.rb +169 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_reward_request.rb +80 -0
- data/lib/line/bot/v2/messaging_api/model/coupon_reward_response.rb +80 -0
- data/lib/line/bot/v2/messaging_api/model/discount_explicit_price_info_request.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/discount_explicit_price_info_response.rb +84 -0
- data/lib/line/bot/v2/messaging_api/model/discount_fixed_price_info_request.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/discount_fixed_price_info_response.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/discount_percentage_price_info_request.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/discount_percentage_price_info_response.rb +72 -0
- data/lib/line/bot/v2/messaging_api/model/discount_price_info_request.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/discount_price_info_response.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/lottery_acquisition_condition_request.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/lottery_acquisition_condition_response.rb +78 -0
- data/lib/line/bot/v2/messaging_api/model/message.rb +1 -0
- data/lib/line/bot/v2/messaging_api/model/messaging_api_pager_coupon_list_response.rb +79 -0
- data/lib/line/bot/v2/messaging_api/model/normal_acquisition_condition_request.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/normal_acquisition_condition_response.rb +66 -0
- data/lib/line/bot/v2/messaging_api/model/referral_acquisition_condition_response.rb +66 -0
- data/lib/line/bot/version.rb +1 -1
- data/line-bot-api.gemspec +1 -1
- data/sig/line/bot/v2/messaging_api/api/messaging_api_client.rbs +156 -0
- data/sig/line/bot/v2/messaging_api/model/acquisition_condition_request.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/acquisition_condition_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_request.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/cash_back_fixed_price_info_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_request.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/cash_back_percentage_price_info_response.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/cash_back_price_info_request.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/cash_back_price_info_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_cash_back_reward_request.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_cash_back_reward_response.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_create_request.rbs +76 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_create_response.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_discount_reward_request.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_discount_reward_response.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_free_reward_request.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_free_reward_response.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_gift_reward_request.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_gift_reward_response.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_list_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_message.rbs +50 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_others_reward_request.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_others_reward_response.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_response.rbs +91 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_reward_request.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/coupon_reward_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/discount_explicit_price_info_request.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/discount_explicit_price_info_response.rbs +46 -0
- data/sig/line/bot/v2/messaging_api/model/discount_fixed_price_info_request.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/discount_fixed_price_info_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/discount_percentage_price_info_request.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/discount_percentage_price_info_response.rbs +40 -0
- data/sig/line/bot/v2/messaging_api/model/discount_price_info_request.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/discount_price_info_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/lottery_acquisition_condition_request.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/lottery_acquisition_condition_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/messaging_api_pager_coupon_list_response.rbs +43 -0
- data/sig/line/bot/v2/messaging_api/model/normal_acquisition_condition_request.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/normal_acquisition_condition_response.rbs +37 -0
- data/sig/line/bot/v2/messaging_api/model/referral_acquisition_condition_response.rbs +37 -0
- metadata +81 -3
@@ -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
|
@@ -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 CashBackPercentagePriceInfoRequest < CashBackPriceInfoRequest
|
17
|
+
# @!attribute [r] type
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :type
|
20
|
+
# @!attribute [rw] percentage
|
21
|
+
# @return [Integer,nil] Specifies the cashback rate as a percentage. Must be an integer between 1 and 99.
|
22
|
+
attr_accessor :percentage
|
23
|
+
|
24
|
+
# @param percentage [Integer,nil] Specifies the cashback rate as a percentage. Must be an integer between 1 and 99.
|
25
|
+
def initialize(
|
26
|
+
percentage: nil,
|
27
|
+
**dynamic_attributes
|
28
|
+
)
|
29
|
+
@type = "percentage"
|
30
|
+
|
31
|
+
@percentage = percentage
|
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::CashBackPercentagePriceInfoRequest] 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 './cash_back_price_info_response'
|
11
|
+
|
12
|
+
module Line
|
13
|
+
module Bot
|
14
|
+
module V2
|
15
|
+
module MessagingApi
|
16
|
+
class CashBackPercentagePriceInfoResponse < CashBackPriceInfoResponse
|
17
|
+
# @!attribute [r] type
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :type
|
20
|
+
# @!attribute [rw] percentage
|
21
|
+
# @return [Integer,nil]
|
22
|
+
attr_accessor :percentage
|
23
|
+
|
24
|
+
# @param percentage [Integer,nil]
|
25
|
+
def initialize(
|
26
|
+
percentage: nil,
|
27
|
+
**dynamic_attributes
|
28
|
+
)
|
29
|
+
@type = "percentage"
|
30
|
+
|
31
|
+
@percentage = percentage
|
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::CashBackPercentagePriceInfoResponse] 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,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 CashBackPriceInfoRequest
|
15
|
+
# @!attribute [rw] type
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :type
|
18
|
+
|
19
|
+
# @param type [String]
|
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::CashBackPriceInfoRequest] 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
|
+
fixed: Line::Bot::V2::MessagingApi::CashBackFixedPriceInfoRequest,
|
70
|
+
percentage: Line::Bot::V2::MessagingApi::CashBackPercentagePriceInfoRequest,
|
71
|
+
}[type.to_sym]
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -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 CashBackPriceInfoResponse
|
15
|
+
# @!attribute [rw] type
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :type
|
18
|
+
|
19
|
+
# @param type [String]
|
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::CashBackPriceInfoResponse] 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
|
+
fixed: Line::Bot::V2::MessagingApi::CashBackFixedPriceInfoResponse,
|
70
|
+
percentage: Line::Bot::V2::MessagingApi::CashBackPercentagePriceInfoResponse,
|
71
|
+
}[type.to_sym]
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
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 CouponCashBackRewardRequest < 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 [CashBackPriceInfoRequest,nil]
|
22
|
+
attr_accessor :price_info
|
23
|
+
|
24
|
+
# @param price_info [CashBackPriceInfoRequest, Hash[Symbol, untyped], nil]
|
25
|
+
def initialize(
|
26
|
+
price_info: nil,
|
27
|
+
**dynamic_attributes
|
28
|
+
)
|
29
|
+
@type = "cashBack"
|
30
|
+
|
31
|
+
@price_info = price_info.is_a?(Line::Bot::V2::MessagingApi::CashBackPriceInfoRequest) || price_info.nil? ? price_info : Line::Bot::V2::MessagingApi::CashBackPriceInfoRequest.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::CouponCashBackRewardRequest] 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 CouponCashBackRewardResponse < 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 [CashBackPriceInfoResponse,nil]
|
22
|
+
attr_accessor :price_info
|
23
|
+
|
24
|
+
# @param price_info [CashBackPriceInfoResponse, Hash[Symbol, untyped], nil]
|
25
|
+
def initialize(
|
26
|
+
price_info: nil,
|
27
|
+
**dynamic_attributes
|
28
|
+
)
|
29
|
+
@type = "cashBack"
|
30
|
+
|
31
|
+
@price_info = price_info.is_a?(Line::Bot::V2::MessagingApi::CashBackPriceInfoResponse) || price_info.nil? ? price_info : Line::Bot::V2::MessagingApi::CashBackPriceInfoResponse.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::CouponCashBackRewardResponse] 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
|