transferzero-sdk 1.37.8 → 1.37.10

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -5
  3. data/README.md +10 -4
  4. data/docs/PayoutMethod.md +1 -1
  5. data/docs/PayoutMethodDetails.md +2 -2
  6. data/docs/PayoutMethodDetailsCRCBank.md +27 -0
  7. data/docs/PayoutMethodDetailsGTQBank.md +27 -0
  8. data/docs/PayoutMethodDetailsMADBank.md +25 -0
  9. data/docs/PayoutMethodDetailsPENBank.md +29 -0
  10. data/docs/PayoutMethodDetailsVNDBank.md +25 -0
  11. data/docs/PayoutMethodDetailsVNDMobile.md +27 -0
  12. data/lib/transferzero-sdk/api_client.rb +1 -1
  13. data/lib/transferzero-sdk/models/payout_method.rb +1 -1
  14. data/lib/transferzero-sdk/models/payout_method_details.rb +12 -1
  15. data/lib/transferzero-sdk/models/payout_method_details_crc_bank.rb +278 -0
  16. data/lib/transferzero-sdk/models/payout_method_details_gtq_bank.rb +278 -0
  17. data/lib/transferzero-sdk/models/payout_method_details_mad_bank.rb +259 -0
  18. data/lib/transferzero-sdk/models/payout_method_details_pen_bank.rb +292 -0
  19. data/lib/transferzero-sdk/models/payout_method_details_vnd_bank.rb +259 -0
  20. data/lib/transferzero-sdk/models/payout_method_details_vnd_mobile.rb +273 -0
  21. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +7 -0
  22. data/lib/transferzero-sdk/version.rb +1 -1
  23. data/lib/transferzero-sdk.rb +6 -0
  24. data/spec/models/payout_method_details_crc_bank_spec.rb +71 -0
  25. data/spec/models/payout_method_details_gtq_bank_spec.rb +71 -0
  26. data/spec/models/payout_method_details_mad_bank_spec.rb +65 -0
  27. data/spec/models/payout_method_details_pen_bank_spec.rb +77 -0
  28. data/spec/models/payout_method_details_vnd_bank_spec.rb +65 -0
  29. data/spec/models/payout_method_details_vnd_mobile_spec.rb +71 -0
  30. metadata +160 -136
@@ -0,0 +1,292 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ # ```JSON \"details\": { \"first_name\": \"Maria\", \"last_name\": \"Lopez\", \"identity_card_type\": \"DNI\", // DNI, RUC, CE (Carnet Extranjeria), PASS \"identity_card_id\": \"12345678\", \"bank_code\": \"002\", \"bank_account\": \"00219300247595201411\", // 20-digit CCI \"bank_account_type\": \"20\" // 10=Savings, 20=Checking, 50=Maestra } ```
17
+ class PayoutMethodDetailsPENBank
18
+ attr_accessor :first_name
19
+
20
+ attr_accessor :last_name
21
+
22
+ attr_accessor :identity_card_type
23
+
24
+ attr_accessor :identity_card_id
25
+
26
+ attr_accessor :bank_code
27
+
28
+ attr_accessor :bank_account
29
+
30
+ attr_accessor :bank_account_type
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'first_name' => :'first_name',
36
+ :'last_name' => :'last_name',
37
+ :'identity_card_type' => :'identity_card_type',
38
+ :'identity_card_id' => :'identity_card_id',
39
+ :'bank_code' => :'bank_code',
40
+ :'bank_account' => :'bank_account',
41
+ :'bank_account_type' => :'bank_account_type'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'first_name' => :'String',
49
+ :'last_name' => :'String',
50
+ :'identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
51
+ :'identity_card_id' => :'String',
52
+ :'bank_code' => :'String',
53
+ :'bank_account' => :'String',
54
+ :'bank_account_type' => :'PayoutMethodBankAccountTypeEnum'
55
+ }
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsPENBank` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsPENBank`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'first_name')
74
+ self.first_name = attributes[:'first_name']
75
+ end
76
+
77
+ if attributes.key?(:'last_name')
78
+ self.last_name = attributes[:'last_name']
79
+ end
80
+
81
+ if attributes.key?(:'identity_card_type')
82
+ self.identity_card_type = attributes[:'identity_card_type']
83
+ end
84
+
85
+ if attributes.key?(:'identity_card_id')
86
+ self.identity_card_id = attributes[:'identity_card_id']
87
+ end
88
+
89
+ if attributes.key?(:'bank_code')
90
+ self.bank_code = attributes[:'bank_code']
91
+ end
92
+
93
+ if attributes.key?(:'bank_account')
94
+ self.bank_account = attributes[:'bank_account']
95
+ end
96
+
97
+ if attributes.key?(:'bank_account_type')
98
+ self.bank_account_type = attributes[:'bank_account_type']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ if @first_name.nil?
107
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
108
+ end
109
+
110
+ if @last_name.nil?
111
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
112
+ end
113
+
114
+ if @identity_card_type.nil?
115
+ invalid_properties.push('invalid value for "identity_card_type", identity_card_type cannot be nil.')
116
+ end
117
+
118
+ if @identity_card_id.nil?
119
+ invalid_properties.push('invalid value for "identity_card_id", identity_card_id cannot be nil.')
120
+ end
121
+
122
+ if @bank_code.nil?
123
+ invalid_properties.push('invalid value for "bank_code", bank_code cannot be nil.')
124
+ end
125
+
126
+ if @bank_account.nil?
127
+ invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
128
+ end
129
+
130
+ if @bank_account_type.nil?
131
+ invalid_properties.push('invalid value for "bank_account_type", bank_account_type cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ return false if @first_name.nil?
141
+ return false if @last_name.nil?
142
+ return false if @identity_card_type.nil?
143
+ return false if @identity_card_id.nil?
144
+ return false if @bank_code.nil?
145
+ return false if @bank_account.nil?
146
+ return false if @bank_account_type.nil?
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ first_name == o.first_name &&
156
+ last_name == o.last_name &&
157
+ identity_card_type == o.identity_card_type &&
158
+ identity_card_id == o.identity_card_id &&
159
+ bank_code == o.bank_code &&
160
+ bank_account == o.bank_account &&
161
+ bank_account_type == o.bank_account_type
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [first_name, last_name, identity_card_type, identity_card_id, bank_code, bank_account, bank_account_type].hash
174
+ end
175
+
176
+ require 'active_support/core_ext/hash'
177
+ require 'active_support/hash_with_indifferent_access.rb'
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.openapi_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = TransferZero.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
262
+ end
263
+
264
+ def [](key)
265
+ to_hash[key]
266
+ end
267
+
268
+ def dig(*args)
269
+ to_hash.dig(*args)
270
+ end
271
+
272
+ # Outputs non-array value in the form of hash
273
+ # For object, use to_hash. Otherwise, just return the value
274
+ # @param [Object] value Any valid value
275
+ # @return [Hash] Returns the value in the form of hash
276
+ def _to_hash(value)
277
+ if value.is_a?(Array)
278
+ value.compact.map { |v| _to_hash(v) }
279
+ elsif value.is_a?(Hash)
280
+ {}.tap do |hash|
281
+ value.each { |k, v| hash[k] = _to_hash(v) }
282
+ end
283
+ elsif value.respond_to? :to_hash
284
+ value.to_hash
285
+ else
286
+ value
287
+ end
288
+ end
289
+
290
+ end
291
+
292
+ end
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #TransferZero API
3
+
4
+ #Reference documentation for the TransferZero API V1
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-beta3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TransferZero
16
+ # ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"bank_account\": \"0123456789\", \"bank_code\": \"vcb\", // See VND bank code list in the documentation \"transfer_reason\": \"personal_account\" } ```
17
+ class PayoutMethodDetailsVNDBank
18
+ attr_accessor :first_name
19
+
20
+ attr_accessor :last_name
21
+
22
+ attr_accessor :bank_account
23
+
24
+ attr_accessor :bank_code
25
+
26
+ attr_accessor :transfer_reason
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'first_name' => :'first_name',
32
+ :'last_name' => :'last_name',
33
+ :'bank_account' => :'bank_account',
34
+ :'bank_code' => :'bank_code',
35
+ :'transfer_reason' => :'transfer_reason'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'first_name' => :'String',
43
+ :'last_name' => :'String',
44
+ :'bank_account' => :'String',
45
+ :'bank_code' => :'String',
46
+ :'transfer_reason' => :'PayoutMethodTransferReasonEnum'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsVNDBank` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsVNDBank`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'first_name')
66
+ self.first_name = attributes[:'first_name']
67
+ end
68
+
69
+ if attributes.key?(:'last_name')
70
+ self.last_name = attributes[:'last_name']
71
+ end
72
+
73
+ if attributes.key?(:'bank_account')
74
+ self.bank_account = attributes[:'bank_account']
75
+ end
76
+
77
+ if attributes.key?(:'bank_code')
78
+ self.bank_code = attributes[:'bank_code']
79
+ end
80
+
81
+ if attributes.key?(:'transfer_reason')
82
+ self.transfer_reason = attributes[:'transfer_reason']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @first_name.nil?
91
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
92
+ end
93
+
94
+ if @last_name.nil?
95
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
96
+ end
97
+
98
+ if @bank_account.nil?
99
+ invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
100
+ end
101
+
102
+ if @bank_code.nil?
103
+ invalid_properties.push('invalid value for "bank_code", bank_code cannot be nil.')
104
+ end
105
+
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ return false if @first_name.nil?
113
+ return false if @last_name.nil?
114
+ return false if @bank_account.nil?
115
+ return false if @bank_code.nil?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ first_name == o.first_name &&
125
+ last_name == o.last_name &&
126
+ bank_account == o.bank_account &&
127
+ bank_code == o.bank_code &&
128
+ transfer_reason == o.transfer_reason
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [first_name, last_name, bank_account, bank_code, transfer_reason].hash
141
+ end
142
+
143
+ require 'active_support/core_ext/hash'
144
+ require 'active_support/hash_with_indifferent_access.rb'
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.openapi_types.each_pair do |key, type|
151
+ if type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :DateTime
172
+ DateTime.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ temp_model = TransferZero.const_get(type).new
203
+ temp_model.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ next if value.nil?
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
229
+ end
230
+
231
+ def [](key)
232
+ to_hash[key]
233
+ end
234
+
235
+ def dig(*args)
236
+ to_hash.dig(*args)
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end