jamm 1.2.2 → 1.3.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.
@@ -0,0 +1,232 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Jamm API
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: 1.0
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ class BankBranch
18
+ attr_accessor :bank_code, :branch_code, :name, :name_katakana, :name_hiragana, :name_alphabet
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :bank_code => :bankCode,
24
+ :branch_code => :branchCode,
25
+ :name => :name,
26
+ :name_katakana => :nameKatakana,
27
+ :name_hiragana => :nameHiragana,
28
+ :name_alphabet => :nameAlphabet
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :bank_code => :String,
41
+ :branch_code => :String,
42
+ :name => :String,
43
+ :name_katakana => :String,
44
+ :name_hiragana => :String,
45
+ :name_alphabet => :String
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::BankBranch` initialize method' unless attributes.is_a?(Hash)
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) do |(k, v), h|
61
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::BankBranch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)
62
+
63
+ h[k.to_sym] = v
64
+ end
65
+
66
+ self.bank_code = attributes[:bank_code] if attributes.key?(:bank_code)
67
+
68
+ self.branch_code = attributes[:branch_code] if attributes.key?(:branch_code)
69
+
70
+ self.name = attributes[:name] if attributes.key?(:name)
71
+
72
+ self.name_katakana = attributes[:name_katakana] if attributes.key?(:name_katakana)
73
+
74
+ self.name_hiragana = attributes[:name_hiragana] if attributes.key?(:name_hiragana)
75
+
76
+ return unless attributes.key?(:name_alphabet)
77
+
78
+ self.name_alphabet = attributes[:name_alphabet]
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ []
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(other)
98
+ return true if equal?(other)
99
+
100
+ self.class == other.class &&
101
+ bank_code == other.bank_code &&
102
+ branch_code == other.branch_code &&
103
+ name == other.name &&
104
+ name_katakana == other.name_katakana &&
105
+ name_hiragana == other.name_hiragana &&
106
+ name_alphabet == other.name_alphabet
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(other)
112
+ self == other
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [bank_code, branch_code, name, name_katakana, name_hiragana, name_alphabet].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ transformed_hash = {}
129
+ openapi_types.each_pair do |key, type|
130
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
131
+ transformed_hash[key.to_s] = nil
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) } if attributes[attribute_map[key]].is_a?(Array)
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def self._deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = Api.const_get(type)
182
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+ end
232
+ end
@@ -0,0 +1,243 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Jamm API
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: 1.0
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ # See Google Spreadsheet for more information: https://docs.google.com/spreadsheets/d/1sxklqXzTGt-E7FgXB801d12Az8pbpZgs/edit?gid=1684227518#gid=1684227518
18
+ class BankQuota
19
+ attr_accessor :offline_purchase_limit_per_charge_with_kyc, :offline_purchase_limit_per_charge_without_kyc, :offline_purchase_limit_per_day_with_kyc, :offline_purchase_limit_per_day_without_kyc, :subscription_purchase_limit_per_charge_with_kyc, :subscription_purchase_limit_per_charge_without_kyc, :subscription_purchase_limit_per_day_with_kyc, :subscription_purchase_limit_per_day_without_kyc
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :offline_purchase_limit_per_charge_with_kyc => :offlinePurchaseLimitPerChargeWithKyc,
25
+ :offline_purchase_limit_per_charge_without_kyc => :offlinePurchaseLimitPerChargeWithoutKyc,
26
+ :offline_purchase_limit_per_day_with_kyc => :offlinePurchaseLimitPerDayWithKyc,
27
+ :offline_purchase_limit_per_day_without_kyc => :offlinePurchaseLimitPerDayWithoutKyc,
28
+ :subscription_purchase_limit_per_charge_with_kyc => :subscriptionPurchaseLimitPerChargeWithKyc,
29
+ :subscription_purchase_limit_per_charge_without_kyc => :subscriptionPurchaseLimitPerChargeWithoutKyc,
30
+ :subscription_purchase_limit_per_day_with_kyc => :subscriptionPurchaseLimitPerDayWithKyc,
31
+ :subscription_purchase_limit_per_day_without_kyc => :subscriptionPurchaseLimitPerDayWithoutKyc
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :offline_purchase_limit_per_charge_with_kyc => :Integer,
44
+ :offline_purchase_limit_per_charge_without_kyc => :Integer,
45
+ :offline_purchase_limit_per_day_with_kyc => :Integer,
46
+ :offline_purchase_limit_per_day_without_kyc => :Integer,
47
+ :subscription_purchase_limit_per_charge_with_kyc => :Integer,
48
+ :subscription_purchase_limit_per_charge_without_kyc => :Integer,
49
+ :subscription_purchase_limit_per_day_with_kyc => :Integer,
50
+ :subscription_purchase_limit_per_day_without_kyc => :Integer
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::BankQuota` initialize method' unless attributes.is_a?(Hash)
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) do |(k, v), h|
66
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::BankQuota`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)
67
+
68
+ h[k.to_sym] = v
69
+ end
70
+
71
+ self.offline_purchase_limit_per_charge_with_kyc = attributes[:offline_purchase_limit_per_charge_with_kyc] if attributes.key?(:offline_purchase_limit_per_charge_with_kyc)
72
+
73
+ self.offline_purchase_limit_per_charge_without_kyc = attributes[:offline_purchase_limit_per_charge_without_kyc] if attributes.key?(:offline_purchase_limit_per_charge_without_kyc)
74
+
75
+ self.offline_purchase_limit_per_day_with_kyc = attributes[:offline_purchase_limit_per_day_with_kyc] if attributes.key?(:offline_purchase_limit_per_day_with_kyc)
76
+
77
+ self.offline_purchase_limit_per_day_without_kyc = attributes[:offline_purchase_limit_per_day_without_kyc] if attributes.key?(:offline_purchase_limit_per_day_without_kyc)
78
+
79
+ self.subscription_purchase_limit_per_charge_with_kyc = attributes[:subscription_purchase_limit_per_charge_with_kyc] if attributes.key?(:subscription_purchase_limit_per_charge_with_kyc)
80
+
81
+ self.subscription_purchase_limit_per_charge_without_kyc = attributes[:subscription_purchase_limit_per_charge_without_kyc] if attributes.key?(:subscription_purchase_limit_per_charge_without_kyc)
82
+
83
+ self.subscription_purchase_limit_per_day_with_kyc = attributes[:subscription_purchase_limit_per_day_with_kyc] if attributes.key?(:subscription_purchase_limit_per_day_with_kyc)
84
+
85
+ return unless attributes.key?(:subscription_purchase_limit_per_day_without_kyc)
86
+
87
+ self.subscription_purchase_limit_per_day_without_kyc = attributes[:subscription_purchase_limit_per_day_without_kyc]
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ []
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(other)
107
+ return true if equal?(other)
108
+
109
+ self.class == other.class &&
110
+ offline_purchase_limit_per_charge_with_kyc == other.offline_purchase_limit_per_charge_with_kyc &&
111
+ offline_purchase_limit_per_charge_without_kyc == other.offline_purchase_limit_per_charge_without_kyc &&
112
+ offline_purchase_limit_per_day_with_kyc == other.offline_purchase_limit_per_day_with_kyc &&
113
+ offline_purchase_limit_per_day_without_kyc == other.offline_purchase_limit_per_day_without_kyc &&
114
+ subscription_purchase_limit_per_charge_with_kyc == other.subscription_purchase_limit_per_charge_with_kyc &&
115
+ subscription_purchase_limit_per_charge_without_kyc == other.subscription_purchase_limit_per_charge_without_kyc &&
116
+ subscription_purchase_limit_per_day_with_kyc == other.subscription_purchase_limit_per_day_with_kyc &&
117
+ subscription_purchase_limit_per_day_without_kyc == other.subscription_purchase_limit_per_day_without_kyc
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(other)
123
+ self == other
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [offline_purchase_limit_per_charge_with_kyc, offline_purchase_limit_per_charge_without_kyc, offline_purchase_limit_per_day_with_kyc, offline_purchase_limit_per_day_without_kyc, subscription_purchase_limit_per_charge_with_kyc, subscription_purchase_limit_per_charge_without_kyc, subscription_purchase_limit_per_day_with_kyc, subscription_purchase_limit_per_day_without_kyc].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash[key.to_s] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) } if attributes[attribute_map[key]].is_a?(Array)
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
149
+ end
150
+ end
151
+ new(transformed_hash)
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def self._deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = Api.const_get(type)
193
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ end
243
+ end
@@ -0,0 +1,227 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Jamm API
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: 1.0
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ class BankScheduledMaintenancePeriod
18
+ attr_accessor :bank_code, :start_at_jst, :end_at_jst, :start_at_utc, :end_at_utc
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :bank_code => :bankCode,
24
+ :start_at_jst => :startAtJst,
25
+ :end_at_jst => :endAtJst,
26
+ :start_at_utc => :startAtUtc,
27
+ :end_at_utc => :endAtUtc
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :bank_code => :String,
40
+ :start_at_jst => :String,
41
+ :end_at_jst => :String,
42
+ :start_at_utc => :String,
43
+ :end_at_utc => :String
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::BankScheduledMaintenancePeriod` initialize method' unless attributes.is_a?(Hash)
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) do |(k, v), h|
59
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::BankScheduledMaintenancePeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)
60
+
61
+ h[k.to_sym] = v
62
+ end
63
+
64
+ self.bank_code = attributes[:bank_code] if attributes.key?(:bank_code)
65
+
66
+ self.start_at_jst = attributes[:start_at_jst] if attributes.key?(:start_at_jst)
67
+
68
+ self.end_at_jst = attributes[:end_at_jst] if attributes.key?(:end_at_jst)
69
+
70
+ self.start_at_utc = attributes[:start_at_utc] if attributes.key?(:start_at_utc)
71
+
72
+ return unless attributes.key?(:end_at_utc)
73
+
74
+ self.end_at_utc = attributes[:end_at_utc]
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ []
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(other)
94
+ return true if equal?(other)
95
+
96
+ self.class == other.class &&
97
+ bank_code == other.bank_code &&
98
+ start_at_jst == other.start_at_jst &&
99
+ end_at_jst == other.end_at_jst &&
100
+ start_at_utc == other.start_at_utc &&
101
+ end_at_utc == other.end_at_utc
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(other)
107
+ self == other
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [bank_code, start_at_jst, end_at_jst, start_at_utc, end_at_utc].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash[key.to_s] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) } if attributes[attribute_map[key]].is_a?(Array)
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def self._deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = Api.const_get(type)
177
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end