transferzero-sdk 1.14.1 → 1.14.2

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,269 @@
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
+ class PayoutMethodCountryEnumUSDBank
17
+
18
+ AF = "AF".freeze
19
+ AL = "AL".freeze
20
+ DZ = "DZ".freeze
21
+ AS = "AS".freeze
22
+ AD = "AD".freeze
23
+ AO = "AO".freeze
24
+ AI = "AI".freeze
25
+ AQ = "AQ".freeze
26
+ AG = "AG".freeze
27
+ AR = "AR".freeze
28
+ AM = "AM".freeze
29
+ AW = "AW".freeze
30
+ AU = "AU".freeze
31
+ AT = "AT".freeze
32
+ AZ = "AZ".freeze
33
+ BS = "BS".freeze
34
+ BH = "BH".freeze
35
+ BD = "BD".freeze
36
+ BB = "BB".freeze
37
+ BY = "BY".freeze
38
+ BE = "BE".freeze
39
+ BZ = "BZ".freeze
40
+ BJ = "BJ".freeze
41
+ BM = "BM".freeze
42
+ BT = "BT".freeze
43
+ BO = "BO".freeze
44
+ BA = "BA".freeze
45
+ BW = "BW".freeze
46
+ BV = "BV".freeze
47
+ BR = "BR".freeze
48
+ IO = "IO".freeze
49
+ BN = "BN".freeze
50
+ BG = "BG".freeze
51
+ BF = "BF".freeze
52
+ BI = "BI".freeze
53
+ KH = "KH".freeze
54
+ CM = "CM".freeze
55
+ CA = "CA".freeze
56
+ CV = "CV".freeze
57
+ KY = "KY".freeze
58
+ CF = "CF".freeze
59
+ TD = "TD".freeze
60
+ CL = "CL".freeze
61
+ CN = "CN".freeze
62
+ CX = "CX".freeze
63
+ CC = "CC".freeze
64
+ CO = "CO".freeze
65
+ KM = "KM".freeze
66
+ CG = "CG".freeze
67
+ CD = "CD".freeze
68
+ CK = "CK".freeze
69
+ CR = "CR".freeze
70
+ CI = "CI".freeze
71
+ HR = "HR".freeze
72
+ CU = "CU".freeze
73
+ CY = "CY".freeze
74
+ CZ = "CZ".freeze
75
+ DK = "DK".freeze
76
+ DJ = "DJ".freeze
77
+ DM = "DM".freeze
78
+ DO = "DO".freeze
79
+ TP = "TP".freeze
80
+ EC = "EC".freeze
81
+ EG = "EG".freeze
82
+ SV = "SV".freeze
83
+ GQ = "GQ".freeze
84
+ ER = "ER".freeze
85
+ EE = "EE".freeze
86
+ ET = "ET".freeze
87
+ FK = "FK".freeze
88
+ FO = "FO".freeze
89
+ FJ = "FJ".freeze
90
+ FI = "FI".freeze
91
+ FR = "FR".freeze
92
+ GF = "GF".freeze
93
+ PF = "PF".freeze
94
+ TF = "TF".freeze
95
+ GA = "GA".freeze
96
+ GM = "GM".freeze
97
+ GE = "GE".freeze
98
+ DE = "DE".freeze
99
+ GH = "GH".freeze
100
+ GI = "GI".freeze
101
+ GR = "GR".freeze
102
+ GL = "GL".freeze
103
+ GD = "GD".freeze
104
+ GP = "GP".freeze
105
+ GU = "GU".freeze
106
+ GT = "GT".freeze
107
+ GN = "GN".freeze
108
+ GW = "GW".freeze
109
+ GY = "GY".freeze
110
+ HT = "HT".freeze
111
+ HM = "HM".freeze
112
+ VA = "VA".freeze
113
+ HN = "HN".freeze
114
+ HK = "HK".freeze
115
+ HU = "HU".freeze
116
+ IS = "IS".freeze
117
+ IN = "IN".freeze
118
+ ID = "ID".freeze
119
+ IR = "IR".freeze
120
+ IQ = "IQ".freeze
121
+ IE = "IE".freeze
122
+ IL = "IL".freeze
123
+ IT = "IT".freeze
124
+ JM = "JM".freeze
125
+ JP = "JP".freeze
126
+ JO = "JO".freeze
127
+ KZ = "KZ".freeze
128
+ KE = "KE".freeze
129
+ KI = "KI".freeze
130
+ KP = "KP".freeze
131
+ KR = "KR".freeze
132
+ KV = "KV".freeze
133
+ KW = "KW".freeze
134
+ KG = "KG".freeze
135
+ LA = "LA".freeze
136
+ LV = "LV".freeze
137
+ LB = "LB".freeze
138
+ LS = "LS".freeze
139
+ LR = "LR".freeze
140
+ LY = "LY".freeze
141
+ LI = "LI".freeze
142
+ LT = "LT".freeze
143
+ LU = "LU".freeze
144
+ MO = "MO".freeze
145
+ MK = "MK".freeze
146
+ MG = "MG".freeze
147
+ MW = "MW".freeze
148
+ MY = "MY".freeze
149
+ MV = "MV".freeze
150
+ ML = "ML".freeze
151
+ MT = "MT".freeze
152
+ MH = "MH".freeze
153
+ MQ = "MQ".freeze
154
+ MR = "MR".freeze
155
+ MU = "MU".freeze
156
+ YT = "YT".freeze
157
+ MX = "MX".freeze
158
+ FM = "FM".freeze
159
+ MD = "MD".freeze
160
+ MC = "MC".freeze
161
+ MN = "MN".freeze
162
+ MS = "MS".freeze
163
+ ME = "ME".freeze
164
+ MA = "MA".freeze
165
+ MZ = "MZ".freeze
166
+ MM = "MM".freeze
167
+ NA = "NA".freeze
168
+ NR = "NR".freeze
169
+ NP = "NP".freeze
170
+ NL = "NL".freeze
171
+ AN = "AN".freeze
172
+ NC = "NC".freeze
173
+ NZ = "NZ".freeze
174
+ NI = "NI".freeze
175
+ NE = "NE".freeze
176
+ NG = "NG".freeze
177
+ NU = "NU".freeze
178
+ NF = "NF".freeze
179
+ MP = "MP".freeze
180
+ FALSE = "false".freeze
181
+ OM = "OM".freeze
182
+ PK = "PK".freeze
183
+ PW = "PW".freeze
184
+ PS = "PS".freeze
185
+ PA = "PA".freeze
186
+ PG = "PG".freeze
187
+ PY = "PY".freeze
188
+ PE = "PE".freeze
189
+ PH = "PH".freeze
190
+ PN = "PN".freeze
191
+ PL = "PL".freeze
192
+ PT = "PT".freeze
193
+ PR = "PR".freeze
194
+ QA = "QA".freeze
195
+ RE = "RE".freeze
196
+ RO = "RO".freeze
197
+ RU = "RU".freeze
198
+ RW = "RW".freeze
199
+ SH = "SH".freeze
200
+ KN = "KN".freeze
201
+ LC = "LC".freeze
202
+ PM = "PM".freeze
203
+ VC = "VC".freeze
204
+ WS = "WS".freeze
205
+ SM = "SM".freeze
206
+ ST = "ST".freeze
207
+ SA = "SA".freeze
208
+ SN = "SN".freeze
209
+ RS = "RS".freeze
210
+ SC = "SC".freeze
211
+ SL = "SL".freeze
212
+ SG = "SG".freeze
213
+ SK = "SK".freeze
214
+ SI = "SI".freeze
215
+ SB = "SB".freeze
216
+ SO = "SO".freeze
217
+ ZA = "ZA".freeze
218
+ GS = "GS".freeze
219
+ ES = "ES".freeze
220
+ LK = "LK".freeze
221
+ SD = "SD".freeze
222
+ SR = "SR".freeze
223
+ SJ = "SJ".freeze
224
+ SZ = "SZ".freeze
225
+ SE = "SE".freeze
226
+ CH = "CH".freeze
227
+ SY = "SY".freeze
228
+ TW = "TW".freeze
229
+ TJ = "TJ".freeze
230
+ TZ = "TZ".freeze
231
+ TH = "TH".freeze
232
+ TG = "TG".freeze
233
+ TK = "TK".freeze
234
+ TO = "TO".freeze
235
+ TT = "TT".freeze
236
+ TN = "TN".freeze
237
+ TR = "TR".freeze
238
+ TM = "TM".freeze
239
+ TC = "TC".freeze
240
+ TV = "TV".freeze
241
+ UG = "UG".freeze
242
+ UA = "UA".freeze
243
+ AE = "AE".freeze
244
+ GB = "GB".freeze
245
+ US = "US".freeze
246
+ UM = "UM".freeze
247
+ UY = "UY".freeze
248
+ UZ = "UZ".freeze
249
+ VU = "VU".freeze
250
+ VE = "VE".freeze
251
+ VN = "VN".freeze
252
+ VG = "VG".freeze
253
+ VI = "VI".freeze
254
+ WF = "WF".freeze
255
+ EH = "EH".freeze
256
+ YE = "YE".freeze
257
+ ZM = "ZM".freeze
258
+
259
+ # Builds the enum from string
260
+ # @param [String] The enum value in the form of the string
261
+ # @return [String] The enum value
262
+ def build_from_hash(value)
263
+ constantValues = PayoutMethodCountryEnumUSDBank.constants.select { |c| PayoutMethodCountryEnumUSDBank::const_get(c) == value }
264
+ raise "Invalid ENUM value #{value} for class #PayoutMethodCountryEnumUSDBank" if constantValues.empty? && !value.empty?
265
+ value
266
+ end
267
+ end
268
+
269
+ end
@@ -135,7 +135,7 @@ class PayoutMethodDetails
135
135
  :'bank_account_type' => :'PayoutMethodBankAccountTypeEnum',
136
136
  :'phone_number' => :'String',
137
137
  :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
138
- :'country' => :'PayoutMethodCountryEnum',
138
+ :'country' => :'PayoutMethodCountryEnumUSDBank',
139
139
  :'iban' => :'String',
140
140
  :'bank_name' => :'String',
141
141
  :'bank_country' => :'String',
@@ -178,6 +178,7 @@ class PayoutMethodDetails
178
178
  :'PayoutMethodDetailsMADCash',
179
179
  :'PayoutMethodDetailsMobile',
180
180
  :'PayoutMethodDetailsNGNBank',
181
+ :'PayoutMethodDetailsUSDBank',
181
182
  :'PayoutMethodDetailsXOFBank',
182
183
  :'PayoutMethodDetailsXOFCash',
183
184
  :'PayoutMethodDetailsXOFMobile',
@@ -369,6 +370,10 @@ class PayoutMethodDetails
369
370
  invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
370
371
  end
371
372
 
373
+ if @country.nil?
374
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
375
+ end
376
+
372
377
  if @iban.nil?
373
378
  invalid_properties.push('invalid value for "iban", iban cannot be nil.')
374
379
  end
@@ -421,6 +426,7 @@ class PayoutMethodDetails
421
426
  return false if @bank_account.nil?
422
427
  return false if @phone_number.nil?
423
428
  return false if @mobile_provider.nil?
429
+ return false if @country.nil?
424
430
  return false if @iban.nil?
425
431
  return false if @bank_name.nil?
426
432
  return false if @bank_country.nil?
@@ -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\": \"Jane\", \"last_name\": \"Doe\", \"phone_number\": \"+2341234567\", \"bank_code\": \"057\", \"bank_account\": \"1234567890\", \"country\": \"NG\" } ``` See [USD Bank](https://docs.transferzero.com/docs/payout-details/#usdbank) documentation for the bank_code list
17
+ class PayoutMethodDetailsUSDBank
18
+ attr_accessor :first_name
19
+
20
+ attr_accessor :last_name
21
+
22
+ attr_accessor :phone_number
23
+
24
+ attr_accessor :bank_code
25
+
26
+ attr_accessor :bank_account
27
+
28
+ attr_accessor :country
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
+ :'phone_number' => :'phone_number',
36
+ :'bank_code' => :'bank_code',
37
+ :'bank_account' => :'bank_account',
38
+ :'country' => :'country'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'first_name' => :'String',
46
+ :'last_name' => :'String',
47
+ :'phone_number' => :'String',
48
+ :'bank_code' => :'String',
49
+ :'bank_account' => :'String',
50
+ :'country' => :'PayoutMethodCountryEnumUSDBank'
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::PayoutMethodDetailsUSDBank` 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::PayoutMethodDetailsUSDBank`. 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?(:'phone_number')
78
+ self.phone_number = attributes[:'phone_number']
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?(:'country')
90
+ self.country = attributes[:'country']
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 @phone_number.nil?
107
+ invalid_properties.push('invalid value for "phone_number", phone_number 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 @country.nil?
119
+ invalid_properties.push('invalid value for "country", country 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 @phone_number.nil?
131
+ return false if @bank_code.nil?
132
+ return false if @bank_account.nil?
133
+ return false if @country.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
+ phone_number == o.phone_number &&
145
+ bank_code == o.bank_code &&
146
+ bank_account == o.bank_account &&
147
+ country == o.country
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, phone_number, bank_code, bank_account, country].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