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