transferzero-sdk 1.6.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +93 -0
  3. data/README.md +12 -4
  4. data/docs/Currency.md +0 -2
  5. data/docs/CurrencyExchange.md +0 -2
  6. data/docs/CurrencyOpposite.md +3 -3
  7. data/docs/Document.md +2 -0
  8. data/docs/PayoutMethod.md +1 -1
  9. data/docs/PayoutMethodCashProviderEnum.md +16 -0
  10. data/docs/PayoutMethodDetails.md +19 -5
  11. data/docs/PayoutMethodDetailsGBPBank.md +29 -0
  12. data/docs/PayoutMethodDetailsIBAN.md +1 -1
  13. data/docs/PayoutMethodDetailsMobile.md +3 -1
  14. data/docs/PayoutMethodDetailsXOFCash.md +27 -0
  15. data/docs/PayoutMethodDetailsZARBank.md +35 -0
  16. data/docs/ProofOfPayment.md +23 -0
  17. data/docs/ProofOfPaymentListResponse.md +17 -0
  18. data/docs/Recipient.md +3 -1
  19. data/docs/RecipientStateReasonDetails.md +23 -0
  20. data/docs/RecipientsApi.md +63 -1
  21. data/docs/Sender.md +20 -8
  22. data/lib/transferzero-sdk.rb +7 -0
  23. data/lib/transferzero-sdk/api/recipients_api.rb +56 -2
  24. data/lib/transferzero-sdk/api_client.rb +5 -3
  25. data/lib/transferzero-sdk/models/account.rb +70 -69
  26. data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
  27. data/lib/transferzero-sdk/models/account_meta.rb +61 -60
  28. data/lib/transferzero-sdk/models/account_response.rb +66 -65
  29. data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
  30. data/lib/transferzero-sdk/models/account_validation_request.rb +164 -163
  31. data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
  32. data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
  33. data/lib/transferzero-sdk/models/api_log.rb +136 -135
  34. data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
  35. data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
  36. data/lib/transferzero-sdk/models/currency.rb +133 -142
  37. data/lib/transferzero-sdk/models/currency_exchange.rb +149 -158
  38. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
  39. data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
  40. data/lib/transferzero-sdk/models/currency_opposite.rb +166 -165
  41. data/lib/transferzero-sdk/models/debit.rb +151 -150
  42. data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
  43. data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
  44. data/lib/transferzero-sdk/models/debit_request.rb +60 -59
  45. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
  46. data/lib/transferzero-sdk/models/debit_response.rb +60 -59
  47. data/lib/transferzero-sdk/models/document.rb +180 -169
  48. data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
  49. data/lib/transferzero-sdk/models/document_request.rb +60 -59
  50. data/lib/transferzero-sdk/models/document_response.rb +60 -59
  51. data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
  52. data/lib/transferzero-sdk/models/error_status.rb +66 -65
  53. data/lib/transferzero-sdk/models/field_description.rb +95 -94
  54. data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
  55. data/lib/transferzero-sdk/models/field_validation.rb +78 -77
  56. data/lib/transferzero-sdk/models/pagination.rb +97 -96
  57. data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
  58. data/lib/transferzero-sdk/models/payin_method.rb +97 -96
  59. data/lib/transferzero-sdk/models/payin_method_details.rb +122 -121
  60. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +62 -61
  61. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
  62. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -70
  63. data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
  64. data/lib/transferzero-sdk/models/payment_method.rb +109 -108
  65. data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
  66. data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
  67. data/lib/transferzero-sdk/models/payout_method.rb +107 -106
  68. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
  69. data/lib/transferzero-sdk/models/payout_method_cash_provider_enum.rb +31 -0
  70. data/lib/transferzero-sdk/models/payout_method_details.rb +402 -320
  71. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
  72. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +97 -96
  73. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
  74. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
  75. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
  76. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
  77. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +93 -83
  78. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -103
  79. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +108 -107
  80. data/lib/transferzero-sdk/models/payout_method_details_xof_cash.rb +263 -0
  81. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
  82. data/lib/transferzero-sdk/models/payout_method_details_zar_bank.rb +324 -0
  83. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
  84. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
  85. data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
  86. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +17 -19
  87. data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
  88. data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
  89. data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
  90. data/lib/transferzero-sdk/models/politically_exposed_person.rb +123 -122
  91. data/lib/transferzero-sdk/models/proof_of_payment.rb +233 -0
  92. data/lib/transferzero-sdk/models/proof_of_payment_list_response.rb +204 -0
  93. data/lib/transferzero-sdk/models/recipient.rb +237 -227
  94. data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
  95. data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
  96. data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
  97. data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
  98. data/lib/transferzero-sdk/models/recipient_state_reason_details.rb +235 -0
  99. data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
  100. data/lib/transferzero-sdk/models/sender.rb +565 -480
  101. data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
  102. data/lib/transferzero-sdk/models/sender_request.rb +60 -59
  103. data/lib/transferzero-sdk/models/sender_response.rb +66 -65
  104. data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
  105. data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
  106. data/lib/transferzero-sdk/models/sender_state.rb +19 -24
  107. data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
  108. data/lib/transferzero-sdk/models/transaction.rb +192 -191
  109. data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
  110. data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
  111. data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
  112. data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
  113. data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
  114. data/lib/transferzero-sdk/models/transaction_state.rb +23 -28
  115. data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
  116. data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
  117. data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
  118. data/lib/transferzero-sdk/models/webhook.rb +92 -91
  119. data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
  120. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
  121. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
  122. data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
  123. data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
  124. data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
  125. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
  126. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
  127. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
  128. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
  129. data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
  130. data/lib/transferzero-sdk/version.rb +1 -1
  131. data/spec/models/payout_method_cash_provider_enum_spec.rb +35 -0
  132. data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
  133. data/spec/models/payout_method_details_xof_cash_spec.rb +71 -0
  134. data/spec/models/payout_method_details_zar_bank_spec.rb +89 -0
  135. data/spec/models/proof_of_payment_list_response_spec.rb +41 -0
  136. data/spec/models/proof_of_payment_spec.rb +59 -0
  137. data/spec/models/recipient_state_reason_details_spec.rb +59 -0
  138. metadata +32 -3
@@ -0,0 +1,263 @@
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\", \"phone_number\": \"774044436\", // local or international Senegalese format \"identity_card_id\": \"2231324232\", // Required if cash_provider value is \"wizall\" \"identity_card_type\": \"PP\", // Required if cash_provider value is \"wizall\" \"cash_provider\": \"wizall\" // Optional; Values: \"wari\" or \"wizall; Default value is \"wari\" } ``` Please note when sending Wari cash pickup requests you should subscribe to the recipient.pending webhook, as that will broadcast the payment reference ID the customer need to use to obtain the funds. Example webhook response excerpt - ```JSON { (...) \"state\":\"pending\", \"metadata\": { \"payment_reference\":\"9M5GJRJUBCY\" }, (...) } ```
17
+ class PayoutMethodDetailsXOFCash
18
+ attr_accessor :first_name
19
+
20
+ attr_accessor :last_name
21
+
22
+ attr_accessor :identity_card_id
23
+
24
+ attr_accessor :identity_card_type
25
+
26
+ attr_accessor :phone_number
27
+
28
+ attr_accessor :cash_provider
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
+ :'identity_card_type' => :'identity_card_type',
37
+ :'phone_number' => :'phone_number',
38
+ :'cash_provider' => :'cash_provider'
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
+ :'identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
49
+ :'phone_number' => :'String',
50
+ :'cash_provider' => :'PayoutMethodCashProviderEnum'
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::PayoutMethodDetailsXOFCash` 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::PayoutMethodDetailsXOFCash`. 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?(:'identity_card_type')
82
+ self.identity_card_type = attributes[:'identity_card_type']
83
+ end
84
+
85
+ if attributes.key?(:'phone_number')
86
+ self.phone_number = attributes[:'phone_number']
87
+ end
88
+
89
+ if attributes.key?(:'cash_provider')
90
+ self.cash_provider = attributes[:'cash_provider']
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
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ return false if @first_name.nil?
117
+ return false if @last_name.nil?
118
+ return false if @phone_number.nil?
119
+ true
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ first_name == o.first_name &&
128
+ last_name == o.last_name &&
129
+ identity_card_id == o.identity_card_id &&
130
+ identity_card_type == o.identity_card_type &&
131
+ phone_number == o.phone_number &&
132
+ cash_provider == o.cash_provider
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [first_name, last_name, identity_card_id, identity_card_type, phone_number, cash_provider].hash
145
+ end
146
+
147
+ require 'active_support/core_ext/hash'
148
+ require 'active_support/hash_with_indifferent_access.rb'
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ DateTime.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ temp_model = TransferZero.const_get(type).new
207
+ temp_model.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ next if value.nil?
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ ::ActiveSupport::HashWithIndifferentAccess.new(hash)
233
+ end
234
+
235
+ def [](key)
236
+ to_hash[key]
237
+ end
238
+
239
+ def dig(*args)
240
+ to_hash.dig(*args)
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ end
@@ -13,124 +13,124 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- # ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"774044436\" # local or international Senegalese format \"mobile_provider\": \"orange\", # \"orange\" or \"tigo\" }
17
- class PayoutMethodDetailsXOFMobile
18
- attr_accessor :first_name
16
+ # ```JSON \"details\": { \"first_name\": \"First\", \"last_name\": \"Last\", \"phone_number\": \"774044436\" # local or international Senegalese format \"mobile_provider\": \"orange\", # \"orange\" or \"tigo\" } ```
17
+ class PayoutMethodDetailsXOFMobile
18
+ attr_accessor :first_name
19
19
 
20
- attr_accessor :last_name
20
+ attr_accessor :last_name
21
21
 
22
- attr_accessor :phone_number
22
+ attr_accessor :phone_number
23
23
 
24
- attr_accessor :mobile_provider
24
+ attr_accessor :mobile_provider
25
25
 
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'first_name' => :'first_name',
30
- :'last_name' => :'last_name',
31
- :'phone_number' => :'phone_number',
32
- :'mobile_provider' => :'mobile_provider'
33
- }
34
- end
35
-
36
- # Attribute type mapping.
37
- def self.openapi_types
38
- {
39
- :'first_name' => :'String',
40
- :'last_name' => :'String',
41
- :'phone_number' => :'String',
42
- :'mobile_provider' => :'PayoutMethodMobileProviderEnum'
43
- }
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsXOFMobile` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsXOFMobile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'first_name')
62
- self.first_name = attributes[:'first_name']
63
- end
64
-
65
- if attributes.key?(:'last_name')
66
- self.last_name = attributes[:'last_name']
67
- end
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'first_name' => :'first_name',
30
+ :'last_name' => :'last_name',
31
+ :'phone_number' => :'phone_number',
32
+ :'mobile_provider' => :'mobile_provider'
33
+ }
34
+ end
68
35
 
69
- if attributes.key?(:'phone_number')
70
- self.phone_number = attributes[:'phone_number']
71
- end
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'first_name' => :'String',
40
+ :'last_name' => :'String',
41
+ :'phone_number' => :'String',
42
+ :'mobile_provider' => :'PayoutMethodMobileProviderEnum'
43
+ }
44
+ end
72
45
 
73
- if attributes.key?(:'mobile_provider')
74
- self.mobile_provider = attributes[:'mobile_provider']
75
- end
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetailsXOFMobile` initialize method"
76
51
  end
77
52
 
78
- # Show invalid properties with the reasons. Usually used together with valid?
79
- # @return Array for valid properties with the reasons
80
- def list_invalid_properties
81
- invalid_properties = Array.new
82
- if @first_name.nil?
83
- invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetailsXOFMobile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
57
  end
58
+ h[k.to_sym] = v
59
+ }
85
60
 
86
- if @last_name.nil?
87
- invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
88
- end
61
+ if attributes.key?(:'first_name')
62
+ self.first_name = attributes[:'first_name']
63
+ end
89
64
 
90
- if @phone_number.nil?
91
- invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
92
- end
65
+ if attributes.key?(:'last_name')
66
+ self.last_name = attributes[:'last_name']
67
+ end
93
68
 
94
- if @mobile_provider.nil?
95
- invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
96
- end
69
+ if attributes.key?(:'phone_number')
70
+ self.phone_number = attributes[:'phone_number']
71
+ end
97
72
 
98
- invalid_properties
73
+ if attributes.key?(:'mobile_provider')
74
+ self.mobile_provider = attributes[:'mobile_provider']
99
75
  end
76
+ end
100
77
 
101
- # Check to see if the all the properties in the model are valid
102
- # @return true if the model is valid
103
- def valid?
104
- return false if @first_name.nil?
105
- return false if @last_name.nil?
106
- return false if @phone_number.nil?
107
- return false if @mobile_provider.nil?
108
- true
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ if @first_name.nil?
83
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
109
84
  end
110
85
 
111
- # Checks equality by comparing each attribute.
112
- # @param [Object] Object to be compared
113
- def ==(o)
114
- return true if self.equal?(o)
115
- self.class == o.class &&
116
- first_name == o.first_name &&
117
- last_name == o.last_name &&
118
- phone_number == o.phone_number &&
119
- mobile_provider == o.mobile_provider
86
+ if @last_name.nil?
87
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
120
88
  end
121
89
 
122
- # @see the `==` method
123
- # @param [Object] Object to be compared
124
- def eql?(o)
125
- self == o
90
+ if @phone_number.nil?
91
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
126
92
  end
127
93
 
128
- # Calculates hash code according to all attributes.
129
- # @return [Integer] Hash code
130
- def hash
131
- [first_name, last_name, phone_number, mobile_provider].hash
94
+ if @mobile_provider.nil?
95
+ invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
132
96
  end
133
97
 
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ return false if @first_name.nil?
105
+ return false if @last_name.nil?
106
+ return false if @phone_number.nil?
107
+ return false if @mobile_provider.nil?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ first_name == o.first_name &&
117
+ last_name == o.last_name &&
118
+ phone_number == o.phone_number &&
119
+ mobile_provider == o.mobile_provider
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [first_name, last_name, phone_number, mobile_provider].hash
132
+ end
133
+
134
134
  require 'active_support/core_ext/hash'
135
135
  require 'active_support/hash_with_indifferent_access.rb'
136
136
  # Builds the object from hash
@@ -245,5 +245,6 @@ def _to_hash(value)
245
245
  end
246
246
  end
247
247
 
248
- end
248
+ end
249
+
249
250
  end