transferzero-sdk 1.0.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -11
  3. data/docs/AccountMeta.md +1 -1
  4. data/docs/AccountValidationApi.md +4 -4
  5. data/docs/AccountValidationRequest.md +6 -4
  6. data/docs/Currency.md +1 -1
  7. data/docs/CurrencyExchange.md +1 -1
  8. data/docs/CurrencyInfoApi.md +20 -6
  9. data/docs/CurrencyOpposite.md +4 -2
  10. data/docs/Debit.md +2 -2
  11. data/docs/Document.md +4 -0
  12. data/docs/FieldSelectValidation.md +1 -1
  13. data/docs/FieldValidation.md +1 -1
  14. data/docs/PayinMethod.md +4 -4
  15. data/docs/PayinMethodDetails.md +7 -3
  16. data/docs/PayinMethodDetailsBTC.md +17 -0
  17. data/docs/PayinMethodDetailsMobile.md +1 -1
  18. data/docs/PayinMethodDetailsNGNBank.md +4 -2
  19. data/docs/PaymentMethod.md +2 -2
  20. data/docs/PaymentMethodOpposite.md +2 -2
  21. data/docs/PayoutMethod.md +1 -1
  22. data/docs/PayoutMethodDetails.md +12 -4
  23. data/docs/PayoutMethodDetailsBTC.md +23 -0
  24. data/docs/PayoutMethodDetailsGBPBank.md +29 -0
  25. data/docs/PayoutMethodDetailsIBAN.md +1 -1
  26. data/docs/PayoutMethodDetailsNGNBank.md +1 -1
  27. data/docs/PayoutMethodDetailsXOFBank.md +25 -0
  28. data/docs/PoliticallyExposedPerson.md +31 -0
  29. data/docs/Recipient.md +5 -3
  30. data/docs/RecipientsApi.md +3 -3
  31. data/docs/Sender.md +63 -27
  32. data/docs/Transaction.md +5 -5
  33. data/docs/TransactionTraits.md +2 -2
  34. data/docs/TransactionsApi.md +64 -0
  35. data/example/client.rb +14 -14
  36. data/git_push.sh +1 -1
  37. data/lib/transferzero-sdk.rb +5 -0
  38. data/lib/transferzero-sdk/api/account_validation_api.rb +4 -4
  39. data/lib/transferzero-sdk/api/currency_info_api.rb +6 -0
  40. data/lib/transferzero-sdk/api/recipients_api.rb +4 -4
  41. data/lib/transferzero-sdk/api/transactions_api.rb +59 -0
  42. data/lib/transferzero-sdk/api_client.rb +5 -5
  43. data/lib/transferzero-sdk/models/account.rb +70 -69
  44. data/lib/transferzero-sdk/models/account_list_response.rb +67 -66
  45. data/lib/transferzero-sdk/models/account_meta.rb +61 -60
  46. data/lib/transferzero-sdk/models/account_response.rb +66 -65
  47. data/lib/transferzero-sdk/models/account_validation_error.rb +61 -60
  48. data/lib/transferzero-sdk/models/account_validation_request.rb +164 -163
  49. data/lib/transferzero-sdk/models/account_validation_response.rb +66 -65
  50. data/lib/transferzero-sdk/models/account_validation_result.rb +61 -60
  51. data/lib/transferzero-sdk/models/api_log.rb +136 -135
  52. data/lib/transferzero-sdk/models/api_log_list_response.rb +70 -69
  53. data/lib/transferzero-sdk/models/api_log_response.rb +60 -59
  54. data/lib/transferzero-sdk/models/currency.rb +142 -141
  55. data/lib/transferzero-sdk/models/currency_exchange.rb +158 -157
  56. data/lib/transferzero-sdk/models/currency_exchange_list_response.rb +62 -61
  57. data/lib/transferzero-sdk/models/currency_list_response.rb +62 -61
  58. data/lib/transferzero-sdk/models/currency_opposite.rb +166 -155
  59. data/lib/transferzero-sdk/models/debit.rb +151 -155
  60. data/lib/transferzero-sdk/models/debit_list_request.rb +61 -60
  61. data/lib/transferzero-sdk/models/debit_list_response.rb +67 -66
  62. data/lib/transferzero-sdk/models/debit_request.rb +60 -59
  63. data/lib/transferzero-sdk/models/debit_request_wrapper.rb +80 -79
  64. data/lib/transferzero-sdk/models/debit_response.rb +60 -59
  65. data/lib/transferzero-sdk/models/document.rb +181 -160
  66. data/lib/transferzero-sdk/models/document_list_response.rb +67 -66
  67. data/lib/transferzero-sdk/models/document_request.rb +60 -59
  68. data/lib/transferzero-sdk/models/document_response.rb +60 -59
  69. data/lib/transferzero-sdk/models/document_webhook.rb +96 -95
  70. data/lib/transferzero-sdk/models/error_status.rb +66 -65
  71. data/lib/transferzero-sdk/models/field_description.rb +95 -94
  72. data/lib/transferzero-sdk/models/field_select_validation.rb +70 -69
  73. data/lib/transferzero-sdk/models/field_validation.rb +78 -77
  74. data/lib/transferzero-sdk/models/pagination.rb +97 -96
  75. data/lib/transferzero-sdk/models/pagination_meta.rb +60 -59
  76. data/lib/transferzero-sdk/models/payin_method.rb +97 -96
  77. data/lib/transferzero-sdk/models/payin_method_details.rb +122 -105
  78. data/lib/transferzero-sdk/models/payin_method_details_btc.rb +204 -0
  79. data/lib/transferzero-sdk/models/payin_method_details_mobile.rb +75 -74
  80. data/lib/transferzero-sdk/models/payin_method_details_ngn_bank.rb +71 -65
  81. data/lib/transferzero-sdk/models/payin_method_request.rb +60 -59
  82. data/lib/transferzero-sdk/models/payment_method.rb +109 -108
  83. data/lib/transferzero-sdk/models/payment_method_list_response.rb +61 -60
  84. data/lib/transferzero-sdk/models/payment_method_opposite.rb +124 -123
  85. data/lib/transferzero-sdk/models/payout_method.rb +107 -106
  86. data/lib/transferzero-sdk/models/payout_method_bank_account_type_enum.rb +14 -19
  87. data/lib/transferzero-sdk/models/payout_method_details.rb +338 -288
  88. data/lib/transferzero-sdk/models/payout_method_details_balance.rb +61 -60
  89. data/lib/transferzero-sdk/models/payout_method_details_btc.rb +250 -0
  90. data/lib/transferzero-sdk/models/payout_method_details_gbp_bank.rb +267 -0
  91. data/lib/transferzero-sdk/models/payout_method_details_ghs_bank.rb +97 -96
  92. data/lib/transferzero-sdk/models/payout_method_details_iban.rb +100 -104
  93. data/lib/transferzero-sdk/models/payout_method_details_mad_cash.rb +162 -161
  94. data/lib/transferzero-sdk/models/payout_method_details_mobile.rb +86 -85
  95. data/lib/transferzero-sdk/models/payout_method_details_ngn_bank.rb +104 -108
  96. data/lib/transferzero-sdk/models/payout_method_details_xof_bank.rb +264 -0
  97. data/lib/transferzero-sdk/models/payout_method_details_xof_mobile.rb +97 -96
  98. data/lib/transferzero-sdk/models/payout_method_gender_enum.rb +14 -19
  99. data/lib/transferzero-sdk/models/payout_method_identity_card_type_enum.rb +15 -20
  100. data/lib/transferzero-sdk/models/payout_method_list_response.rb +67 -66
  101. data/lib/transferzero-sdk/models/payout_method_mobile_provider_enum.rb +14 -19
  102. data/lib/transferzero-sdk/models/payout_method_request.rb +60 -59
  103. data/lib/transferzero-sdk/models/payout_method_response.rb +60 -59
  104. data/lib/transferzero-sdk/models/payout_method_webhook.rb +96 -95
  105. data/lib/transferzero-sdk/models/politically_exposed_person.rb +272 -0
  106. data/lib/transferzero-sdk/models/recipient.rb +230 -219
  107. data/lib/transferzero-sdk/models/recipient_list_response.rb +67 -66
  108. data/lib/transferzero-sdk/models/recipient_request.rb +60 -59
  109. data/lib/transferzero-sdk/models/recipient_response.rb +60 -59
  110. data/lib/transferzero-sdk/models/recipient_state.rb +22 -27
  111. data/lib/transferzero-sdk/models/recipient_webhook.rb +96 -95
  112. data/lib/transferzero-sdk/models/sender.rb +529 -322
  113. data/lib/transferzero-sdk/models/sender_list_response.rb +67 -66
  114. data/lib/transferzero-sdk/models/sender_request.rb +60 -59
  115. data/lib/transferzero-sdk/models/sender_response.rb +66 -65
  116. data/lib/transferzero-sdk/models/sender_response_existing.rb +60 -59
  117. data/lib/transferzero-sdk/models/sender_response_meta.rb +60 -59
  118. data/lib/transferzero-sdk/models/sender_state.rb +19 -23
  119. data/lib/transferzero-sdk/models/sender_webhook.rb +96 -95
  120. data/lib/transferzero-sdk/models/transaction.rb +192 -191
  121. data/lib/transferzero-sdk/models/transaction_list_response.rb +67 -66
  122. data/lib/transferzero-sdk/models/transaction_request.rb +60 -59
  123. data/lib/transferzero-sdk/models/transaction_response.rb +66 -65
  124. data/lib/transferzero-sdk/models/transaction_response_existing.rb +66 -65
  125. data/lib/transferzero-sdk/models/transaction_response_meta.rb +60 -59
  126. data/lib/transferzero-sdk/models/transaction_state.rb +23 -27
  127. data/lib/transferzero-sdk/models/transaction_traits.rb +71 -70
  128. data/lib/transferzero-sdk/models/transaction_webhook.rb +96 -95
  129. data/lib/transferzero-sdk/models/validation_error_description.rb +62 -61
  130. data/lib/transferzero-sdk/models/webhook.rb +92 -91
  131. data/lib/transferzero-sdk/models/webhook_definition.rb +107 -106
  132. data/lib/transferzero-sdk/models/webhook_definition_event_list_response.rb +61 -60
  133. data/lib/transferzero-sdk/models/webhook_definition_list_response.rb +67 -66
  134. data/lib/transferzero-sdk/models/webhook_definition_request.rb +60 -59
  135. data/lib/transferzero-sdk/models/webhook_definition_response.rb +60 -59
  136. data/lib/transferzero-sdk/models/webhook_log.rb +97 -96
  137. data/lib/transferzero-sdk/models/webhook_log_list_response.rb +70 -69
  138. data/lib/transferzero-sdk/models/webhook_log_metadata.rb +129 -128
  139. data/lib/transferzero-sdk/models/webhook_log_metadata_request.rb +80 -79
  140. data/lib/transferzero-sdk/models/webhook_log_metadata_response.rb +81 -80
  141. data/lib/transferzero-sdk/models/webhook_log_response.rb +60 -59
  142. data/lib/transferzero-sdk/version.rb +1 -1
  143. data/spec/api/account_validation_api_spec.rb +2 -2
  144. data/spec/api/currency_info_api_spec.rb +2 -0
  145. data/spec/api/documents_api_spec.rb +15 -0
  146. data/spec/api/recipients_api_spec.rb +1 -1
  147. data/spec/api/transactions_api_spec.rb +13 -0
  148. data/spec/models/account_validation_request_spec.rb +7 -1
  149. data/spec/models/currency_opposite_spec.rb +6 -0
  150. data/spec/models/document_spec.rb +12 -0
  151. data/spec/models/payin_method_details_btc_spec.rb +41 -0
  152. data/spec/models/payin_method_details_ngn_bank_spec.rb +6 -0
  153. data/spec/models/payin_method_details_spec.rb +6 -0
  154. data/spec/models/payout_method_details_btc_spec.rb +59 -0
  155. data/spec/models/payout_method_details_gbp_bank_spec.rb +77 -0
  156. data/spec/models/payout_method_details_spec.rb +7 -1
  157. data/spec/models/payout_method_details_xof_bank_spec.rb +65 -0
  158. data/spec/models/politically_exposed_person_spec.rb +83 -0
  159. data/spec/models/recipient_spec.rb +6 -0
  160. data/spec/models/sender_spec.rb +16 -0
  161. data/transferzero-sdk.gemspec +2 -2
  162. metadata +35 -24
  163. data/spec/api_client_spec.rb +0 -189
@@ -13,24 +13,19 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class PayoutMethodBankAccountTypeEnum
17
- N10 = "10".freeze
18
- N20 = "20".freeze
19
-
20
- # Builds the enum from string
21
- # @param [String] The enum value in the form of the string
22
- # @return [String] The enum value
23
- def self.build_from_hash(value)
24
- new.build_from_hash(value)
25
- end
26
-
27
- # Builds the enum from string
28
- # @param [String] The enum value in the form of the string
29
- # @return [String] The enum value
30
- def build_from_hash(value)
31
- constantValues = PayoutMethodBankAccountTypeEnum.constants.select { |c| PayoutMethodBankAccountTypeEnum::const_get(c) == value }
32
- raise "Invalid ENUM value #{value} for class #PayoutMethodBankAccountTypeEnum" if constantValues.empty?
33
- value
34
- end
16
+ class PayoutMethodBankAccountTypeEnum
17
+
18
+ N10 = "10".freeze
19
+ N20 = "20".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def build_from_hash(value)
25
+ constantValues = PayoutMethodBankAccountTypeEnum.constants.select { |c| PayoutMethodBankAccountTypeEnum::const_get(c) == value }
26
+ raise "Invalid ENUM value #{value} for class #PayoutMethodBankAccountTypeEnum" if constantValues.empty? && !value.empty?
27
+ value
35
28
  end
36
29
  end
30
+
31
+ end
@@ -13,337 +13,386 @@ OpenAPI Generator version: 4.0.0-beta3
13
13
  require 'date'
14
14
 
15
15
  module TransferZero
16
- class PayoutMethodDetails
17
- attr_accessor :first_name
16
+ class PayoutMethodDetails
17
+ attr_accessor :first_name
18
18
 
19
- attr_accessor :last_name
20
-
21
- attr_accessor :bank_code
22
-
23
- attr_accessor :bank_account
24
-
25
- attr_accessor :bank_account_type
26
-
27
- attr_accessor :phone_number
28
-
29
- attr_accessor :mobile_provider
30
-
31
- attr_accessor :bank_name
32
-
33
- attr_accessor :iban
34
-
35
- attr_accessor :bic
36
-
37
- attr_accessor :sender_identity_card_type
38
-
39
- attr_accessor :sender_identity_card_id
40
-
41
- attr_accessor :sender_city_of_birth
42
-
43
- attr_accessor :sender_country_of_birth
44
-
45
- attr_accessor :sender_gender
46
-
47
- attr_accessor :reason
48
-
49
- attr_accessor :identity_card_type
50
-
51
- attr_accessor :identity_card_id
52
-
53
- attr_accessor :reference
54
-
55
- # Attribute mapping from ruby-style variable name to JSON key.
56
- def self.attribute_map
57
- {
58
- :'first_name' => :'first_name',
59
- :'last_name' => :'last_name',
60
- :'bank_code' => :'bank_code',
61
- :'bank_account' => :'bank_account',
62
- :'bank_account_type' => :'bank_account_type',
63
- :'phone_number' => :'phone_number',
64
- :'mobile_provider' => :'mobile_provider',
65
- :'bank_name' => :'bank_name',
66
- :'iban' => :'iban',
67
- :'bic' => :'bic',
68
- :'sender_identity_card_type' => :'sender_identity_card_type',
69
- :'sender_identity_card_id' => :'sender_identity_card_id',
70
- :'sender_city_of_birth' => :'sender_city_of_birth',
71
- :'sender_country_of_birth' => :'sender_country_of_birth',
72
- :'sender_gender' => :'sender_gender',
73
- :'reason' => :'reason',
74
- :'identity_card_type' => :'identity_card_type',
75
- :'identity_card_id' => :'identity_card_id',
76
- :'reference' => :'reference'
77
- }
78
- end
79
-
80
- # Attribute type mapping.
81
- def self.openapi_types
82
- {
83
- :'first_name' => :'String',
84
- :'last_name' => :'String',
85
- :'bank_code' => :'String',
86
- :'bank_account' => :'String',
87
- :'bank_account_type' => :'PayoutMethodBankAccountTypeEnum',
88
- :'phone_number' => :'String',
89
- :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
90
- :'bank_name' => :'String',
91
- :'iban' => :'String',
92
- :'bic' => :'String',
93
- :'sender_identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
94
- :'sender_identity_card_id' => :'String',
95
- :'sender_city_of_birth' => :'String',
96
- :'sender_country_of_birth' => :'String',
97
- :'sender_gender' => :'PayoutMethodGenderEnum',
98
- :'reason' => :'String',
99
- :'identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
100
- :'identity_card_id' => :'String',
101
- :'reference' => :'String'
102
- }
103
- end
104
-
105
- # List of class defined in oneOf (OpenAPI v3)
106
- def self.openapi_one_of
107
- [
108
- :'PayoutMethodDetailsBalance',
109
- :'PayoutMethodDetailsGHSBank',
110
- :'PayoutMethodDetailsIBAN',
111
- :'PayoutMethodDetailsMADCash',
112
- :'PayoutMethodDetailsMobile',
113
- :'PayoutMethodDetailsNGNBank',
114
- :'PayoutMethodDetailsXOFMobile'
115
- ]
116
- end
117
-
118
- # Initializes the object
119
- # @param [Hash] attributes Model attributes in the form of hash
120
- def initialize(attributes = {})
121
- if (!attributes.is_a?(Hash))
122
- fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetails` initialize method"
123
- end
19
+ attr_accessor :last_name
124
20
 
125
- # check to see if the attribute exists and convert string to symbol for hash key
126
- attributes = attributes.each_with_object({}) { |(k, v), h|
127
- if (!self.class.attribute_map.key?(k.to_sym))
128
- fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
129
- end
130
- h[k.to_sym] = v
131
- }
21
+ attr_accessor :bank_code
132
22
 
133
- if attributes.key?(:'first_name')
134
- self.first_name = attributes[:'first_name']
135
- end
23
+ attr_accessor :bank_account
136
24
 
137
- if attributes.key?(:'last_name')
138
- self.last_name = attributes[:'last_name']
139
- end
25
+ attr_accessor :bank_account_type
140
26
 
141
- if attributes.key?(:'bank_code')
142
- self.bank_code = attributes[:'bank_code']
143
- end
27
+ attr_accessor :phone_number
144
28
 
145
- if attributes.key?(:'bank_account')
146
- self.bank_account = attributes[:'bank_account']
147
- end
29
+ attr_accessor :mobile_provider
148
30
 
149
- if attributes.key?(:'bank_account_type')
150
- self.bank_account_type = attributes[:'bank_account_type']
151
- end
31
+ attr_accessor :iban
152
32
 
153
- if attributes.key?(:'phone_number')
154
- self.phone_number = attributes[:'phone_number']
155
- end
33
+ attr_accessor :bank_name
156
34
 
157
- if attributes.key?(:'mobile_provider')
158
- self.mobile_provider = attributes[:'mobile_provider']
159
- end
35
+ attr_accessor :bank_country
160
36
 
161
- if attributes.key?(:'bank_name')
162
- self.bank_name = attributes[:'bank_name']
163
- end
37
+ attr_accessor :sort_code
164
38
 
165
- if attributes.key?(:'iban')
166
- self.iban = attributes[:'iban']
167
- end
39
+ attr_accessor :bic
168
40
 
169
- if attributes.key?(:'bic')
170
- self.bic = attributes[:'bic']
171
- end
41
+ attr_accessor :sender_identity_card_type
172
42
 
173
- if attributes.key?(:'sender_identity_card_type')
174
- self.sender_identity_card_type = attributes[:'sender_identity_card_type']
175
- end
43
+ attr_accessor :sender_identity_card_id
176
44
 
177
- if attributes.key?(:'sender_identity_card_id')
178
- self.sender_identity_card_id = attributes[:'sender_identity_card_id']
179
- end
45
+ attr_accessor :sender_city_of_birth
180
46
 
181
- if attributes.key?(:'sender_city_of_birth')
182
- self.sender_city_of_birth = attributes[:'sender_city_of_birth']
183
- end
47
+ attr_accessor :sender_country_of_birth
184
48
 
185
- if attributes.key?(:'sender_country_of_birth')
186
- self.sender_country_of_birth = attributes[:'sender_country_of_birth']
187
- end
49
+ attr_accessor :sender_gender
188
50
 
189
- if attributes.key?(:'sender_gender')
190
- self.sender_gender = attributes[:'sender_gender']
191
- end
51
+ attr_accessor :reason
192
52
 
193
- if attributes.key?(:'reason')
194
- self.reason = attributes[:'reason']
195
- end
53
+ attr_accessor :identity_card_type
196
54
 
197
- if attributes.key?(:'identity_card_type')
198
- self.identity_card_type = attributes[:'identity_card_type']
199
- end
55
+ attr_accessor :identity_card_id
200
56
 
201
- if attributes.key?(:'identity_card_id')
202
- self.identity_card_id = attributes[:'identity_card_id']
203
- end
57
+ attr_accessor :reference
204
58
 
205
- if attributes.key?(:'reference')
206
- self.reference = attributes[:'reference']
207
- end
59
+ attr_accessor :name
60
+
61
+ attr_accessor :address
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'first_name' => :'first_name',
67
+ :'last_name' => :'last_name',
68
+ :'bank_code' => :'bank_code',
69
+ :'bank_account' => :'bank_account',
70
+ :'bank_account_type' => :'bank_account_type',
71
+ :'phone_number' => :'phone_number',
72
+ :'mobile_provider' => :'mobile_provider',
73
+ :'iban' => :'iban',
74
+ :'bank_name' => :'bank_name',
75
+ :'bank_country' => :'bank_country',
76
+ :'sort_code' => :'sort_code',
77
+ :'bic' => :'bic',
78
+ :'sender_identity_card_type' => :'sender_identity_card_type',
79
+ :'sender_identity_card_id' => :'sender_identity_card_id',
80
+ :'sender_city_of_birth' => :'sender_city_of_birth',
81
+ :'sender_country_of_birth' => :'sender_country_of_birth',
82
+ :'sender_gender' => :'sender_gender',
83
+ :'reason' => :'reason',
84
+ :'identity_card_type' => :'identity_card_type',
85
+ :'identity_card_id' => :'identity_card_id',
86
+ :'reference' => :'reference',
87
+ :'name' => :'name',
88
+ :'address' => :'address'
89
+ }
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'first_name' => :'String',
96
+ :'last_name' => :'String',
97
+ :'bank_code' => :'String',
98
+ :'bank_account' => :'String',
99
+ :'bank_account_type' => :'PayoutMethodBankAccountTypeEnum',
100
+ :'phone_number' => :'String',
101
+ :'mobile_provider' => :'PayoutMethodMobileProviderEnum',
102
+ :'iban' => :'String',
103
+ :'bank_name' => :'String',
104
+ :'bank_country' => :'String',
105
+ :'sort_code' => :'String',
106
+ :'bic' => :'String',
107
+ :'sender_identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
108
+ :'sender_identity_card_id' => :'String',
109
+ :'sender_city_of_birth' => :'String',
110
+ :'sender_country_of_birth' => :'String',
111
+ :'sender_gender' => :'PayoutMethodGenderEnum',
112
+ :'reason' => :'String',
113
+ :'identity_card_type' => :'PayoutMethodIdentityCardTypeEnum',
114
+ :'identity_card_id' => :'String',
115
+ :'reference' => :'String',
116
+ :'name' => :'String',
117
+ :'address' => :'String'
118
+ }
119
+ end
120
+
121
+ # List of class defined in oneOf (OpenAPI v3)
122
+ def self.openapi_one_of
123
+ [
124
+ :'PayoutMethodDetailsBTC',
125
+ :'PayoutMethodDetailsBalance',
126
+ :'PayoutMethodDetailsGBPBank',
127
+ :'PayoutMethodDetailsGHSBank',
128
+ :'PayoutMethodDetailsIBAN',
129
+ :'PayoutMethodDetailsMADCash',
130
+ :'PayoutMethodDetailsMobile',
131
+ :'PayoutMethodDetailsNGNBank',
132
+ :'PayoutMethodDetailsXOFBank',
133
+ :'PayoutMethodDetailsXOFMobile'
134
+ ]
135
+ end
136
+
137
+ # Initializes the object
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ def initialize(attributes = {})
140
+ if (!attributes.is_a?(Hash))
141
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TransferZero::PayoutMethodDetails` initialize method"
208
142
  end
209
143
 
210
- # Show invalid properties with the reasons. Usually used together with valid?
211
- # @return Array for valid properties with the reasons
212
- def list_invalid_properties
213
- invalid_properties = Array.new
214
- if @first_name.nil?
215
- invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
144
+ # check to see if the attribute exists and convert string to symbol for hash key
145
+ attributes = attributes.each_with_object({}) { |(k, v), h|
146
+ if (!self.class.attribute_map.key?(k.to_sym))
147
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TransferZero::PayoutMethodDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
216
148
  end
149
+ h[k.to_sym] = v
150
+ }
217
151
 
218
- if @last_name.nil?
219
- invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
220
- end
152
+ if attributes.key?(:'first_name')
153
+ self.first_name = attributes[:'first_name']
154
+ end
221
155
 
222
- if @bank_code.nil?
223
- invalid_properties.push('invalid value for "bank_code", bank_code cannot be nil.')
224
- end
156
+ if attributes.key?(:'last_name')
157
+ self.last_name = attributes[:'last_name']
158
+ end
225
159
 
226
- if @bank_account.nil?
227
- invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
228
- end
160
+ if attributes.key?(:'bank_code')
161
+ self.bank_code = attributes[:'bank_code']
162
+ end
229
163
 
230
- if @bank_account_type.nil?
231
- invalid_properties.push('invalid value for "bank_account_type", bank_account_type cannot be nil.')
232
- end
164
+ if attributes.key?(:'bank_account')
165
+ self.bank_account = attributes[:'bank_account']
166
+ end
233
167
 
234
- if @phone_number.nil?
235
- invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
236
- end
168
+ if attributes.key?(:'bank_account_type')
169
+ self.bank_account_type = attributes[:'bank_account_type']
170
+ end
237
171
 
238
- if @mobile_provider.nil?
239
- invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
240
- end
172
+ if attributes.key?(:'phone_number')
173
+ self.phone_number = attributes[:'phone_number']
174
+ end
241
175
 
242
- if @bank_name.nil?
243
- invalid_properties.push('invalid value for "bank_name", bank_name cannot be nil.')
244
- end
176
+ if attributes.key?(:'mobile_provider')
177
+ self.mobile_provider = attributes[:'mobile_provider']
178
+ end
245
179
 
246
- if @iban.nil?
247
- invalid_properties.push('invalid value for "iban", iban cannot be nil.')
248
- end
180
+ if attributes.key?(:'iban')
181
+ self.iban = attributes[:'iban']
182
+ end
249
183
 
250
- if @sender_identity_card_type.nil?
251
- invalid_properties.push('invalid value for "sender_identity_card_type", sender_identity_card_type cannot be nil.')
252
- end
184
+ if attributes.key?(:'bank_name')
185
+ self.bank_name = attributes[:'bank_name']
186
+ end
253
187
 
254
- if @sender_identity_card_id.nil?
255
- invalid_properties.push('invalid value for "sender_identity_card_id", sender_identity_card_id cannot be nil.')
256
- end
188
+ if attributes.key?(:'bank_country')
189
+ self.bank_country = attributes[:'bank_country']
190
+ end
257
191
 
258
- if @sender_city_of_birth.nil?
259
- invalid_properties.push('invalid value for "sender_city_of_birth", sender_city_of_birth cannot be nil.')
260
- end
192
+ if attributes.key?(:'sort_code')
193
+ self.sort_code = attributes[:'sort_code']
194
+ end
261
195
 
262
- if @sender_country_of_birth.nil?
263
- invalid_properties.push('invalid value for "sender_country_of_birth", sender_country_of_birth cannot be nil.')
264
- end
196
+ if attributes.key?(:'bic')
197
+ self.bic = attributes[:'bic']
198
+ end
265
199
 
266
- if @sender_gender.nil?
267
- invalid_properties.push('invalid value for "sender_gender", sender_gender cannot be nil.')
268
- end
200
+ if attributes.key?(:'sender_identity_card_type')
201
+ self.sender_identity_card_type = attributes[:'sender_identity_card_type']
202
+ end
269
203
 
270
- invalid_properties
271
- end
272
-
273
- # Check to see if the all the properties in the model are valid
274
- # @return true if the model is valid
275
- def valid?
276
- return false if @first_name.nil?
277
- return false if @last_name.nil?
278
- return false if @bank_code.nil?
279
- return false if @bank_account.nil?
280
- return false if @bank_account_type.nil?
281
- return false if @phone_number.nil?
282
- return false if @mobile_provider.nil?
283
- return false if @bank_name.nil?
284
- return false if @iban.nil?
285
- return false if @sender_identity_card_type.nil?
286
- return false if @sender_identity_card_id.nil?
287
- return false if @sender_city_of_birth.nil?
288
- return false if @sender_country_of_birth.nil?
289
- return false if @sender_gender.nil?
290
- _one_of_found = false
291
- openapi_one_of.each do |_class|
292
- _one_of = TransferZero.const_get(_class).build_from_hash(self.to_hash)
293
- if _one_of.valid?
294
- if _one_of_found?
295
- return false
296
- else
297
- _one_of_found = true
298
- end
299
- end
300
- end
204
+ if attributes.key?(:'sender_identity_card_id')
205
+ self.sender_identity_card_id = attributes[:'sender_identity_card_id']
206
+ end
301
207
 
302
- if !_one_of_found?
303
- return false
304
- end
208
+ if attributes.key?(:'sender_city_of_birth')
209
+ self.sender_city_of_birth = attributes[:'sender_city_of_birth']
210
+ end
305
211
 
306
- true
212
+ if attributes.key?(:'sender_country_of_birth')
213
+ self.sender_country_of_birth = attributes[:'sender_country_of_birth']
214
+ end
215
+
216
+ if attributes.key?(:'sender_gender')
217
+ self.sender_gender = attributes[:'sender_gender']
307
218
  end
308
219
 
309
- # Checks equality by comparing each attribute.
310
- # @param [Object] Object to be compared
311
- def ==(o)
312
- return true if self.equal?(o)
313
- self.class == o.class &&
314
- first_name == o.first_name &&
315
- last_name == o.last_name &&
316
- bank_code == o.bank_code &&
317
- bank_account == o.bank_account &&
318
- bank_account_type == o.bank_account_type &&
319
- phone_number == o.phone_number &&
320
- mobile_provider == o.mobile_provider &&
321
- bank_name == o.bank_name &&
322
- iban == o.iban &&
323
- bic == o.bic &&
324
- sender_identity_card_type == o.sender_identity_card_type &&
325
- sender_identity_card_id == o.sender_identity_card_id &&
326
- sender_city_of_birth == o.sender_city_of_birth &&
327
- sender_country_of_birth == o.sender_country_of_birth &&
328
- sender_gender == o.sender_gender &&
329
- reason == o.reason &&
330
- identity_card_type == o.identity_card_type &&
331
- identity_card_id == o.identity_card_id &&
332
- reference == o.reference
333
- end
334
-
335
- # @see the `==` method
336
- # @param [Object] Object to be compared
337
- def eql?(o)
338
- self == o
339
- end
340
-
341
- # Calculates hash code according to all attributes.
342
- # @return [Integer] Hash code
343
- def hash
344
- [first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, bank_name, iban, bic, sender_identity_card_type, sender_identity_card_id, sender_city_of_birth, sender_country_of_birth, sender_gender, reason, identity_card_type, identity_card_id, reference].hash
220
+ if attributes.key?(:'reason')
221
+ self.reason = attributes[:'reason']
345
222
  end
346
223
 
224
+ if attributes.key?(:'identity_card_type')
225
+ self.identity_card_type = attributes[:'identity_card_type']
226
+ end
227
+
228
+ if attributes.key?(:'identity_card_id')
229
+ self.identity_card_id = attributes[:'identity_card_id']
230
+ end
231
+
232
+ if attributes.key?(:'reference')
233
+ self.reference = attributes[:'reference']
234
+ end
235
+
236
+ if attributes.key?(:'name')
237
+ self.name = attributes[:'name']
238
+ end
239
+
240
+ if attributes.key?(:'address')
241
+ self.address = attributes[:'address']
242
+ end
243
+ end
244
+
245
+ # Show invalid properties with the reasons. Usually used together with valid?
246
+ # @return Array for valid properties with the reasons
247
+ def list_invalid_properties
248
+ invalid_properties = Array.new
249
+ if @first_name.nil?
250
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
251
+ end
252
+
253
+ if @last_name.nil?
254
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
255
+ end
256
+
257
+ if @bank_code.nil?
258
+ invalid_properties.push('invalid value for "bank_code", bank_code cannot be nil.')
259
+ end
260
+
261
+ if @bank_account.nil?
262
+ invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.')
263
+ end
264
+
265
+ if @phone_number.nil?
266
+ invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
267
+ end
268
+
269
+ if @mobile_provider.nil?
270
+ invalid_properties.push('invalid value for "mobile_provider", mobile_provider cannot be nil.')
271
+ end
272
+
273
+ if @iban.nil?
274
+ invalid_properties.push('invalid value for "iban", iban cannot be nil.')
275
+ end
276
+
277
+ if @bank_name.nil?
278
+ invalid_properties.push('invalid value for "bank_name", bank_name cannot be nil.')
279
+ end
280
+
281
+ if @bank_country.nil?
282
+ invalid_properties.push('invalid value for "bank_country", bank_country cannot be nil.')
283
+ end
284
+
285
+ if @sender_identity_card_type.nil?
286
+ invalid_properties.push('invalid value for "sender_identity_card_type", sender_identity_card_type cannot be nil.')
287
+ end
288
+
289
+ if @sender_identity_card_id.nil?
290
+ invalid_properties.push('invalid value for "sender_identity_card_id", sender_identity_card_id cannot be nil.')
291
+ end
292
+
293
+ if @sender_city_of_birth.nil?
294
+ invalid_properties.push('invalid value for "sender_city_of_birth", sender_city_of_birth cannot be nil.')
295
+ end
296
+
297
+ if @sender_country_of_birth.nil?
298
+ invalid_properties.push('invalid value for "sender_country_of_birth", sender_country_of_birth cannot be nil.')
299
+ end
300
+
301
+ if @sender_gender.nil?
302
+ invalid_properties.push('invalid value for "sender_gender", sender_gender cannot be nil.')
303
+ end
304
+
305
+ if @name.nil?
306
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
307
+ end
308
+
309
+ if @address.nil?
310
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
311
+ end
312
+
313
+ invalid_properties
314
+ end
315
+
316
+ # Check to see if the all the properties in the model are valid
317
+ # @return true if the model is valid
318
+ def valid?
319
+ return false if @first_name.nil?
320
+ return false if @last_name.nil?
321
+ return false if @bank_code.nil?
322
+ return false if @bank_account.nil?
323
+ return false if @phone_number.nil?
324
+ return false if @mobile_provider.nil?
325
+ return false if @iban.nil?
326
+ return false if @bank_name.nil?
327
+ return false if @bank_country.nil?
328
+ return false if @sender_identity_card_type.nil?
329
+ return false if @sender_identity_card_id.nil?
330
+ return false if @sender_city_of_birth.nil?
331
+ return false if @sender_country_of_birth.nil?
332
+ return false if @sender_gender.nil?
333
+ return false if @name.nil?
334
+ return false if @address.nil?
335
+ _one_of_found = false
336
+ openapi_one_of.each do |_class|
337
+ _one_of = TransferZero.const_get(_class).build_from_hash(self.to_hash)
338
+ if _one_of.valid?
339
+ if _one_of_found?
340
+ return false
341
+ else
342
+ _one_of_found = true
343
+ end
344
+ end
345
+ end
346
+
347
+ if !_one_of_found?
348
+ return false
349
+ end
350
+
351
+ true
352
+ end
353
+
354
+ # Checks equality by comparing each attribute.
355
+ # @param [Object] Object to be compared
356
+ def ==(o)
357
+ return true if self.equal?(o)
358
+ self.class == o.class &&
359
+ first_name == o.first_name &&
360
+ last_name == o.last_name &&
361
+ bank_code == o.bank_code &&
362
+ bank_account == o.bank_account &&
363
+ bank_account_type == o.bank_account_type &&
364
+ phone_number == o.phone_number &&
365
+ mobile_provider == o.mobile_provider &&
366
+ iban == o.iban &&
367
+ bank_name == o.bank_name &&
368
+ bank_country == o.bank_country &&
369
+ sort_code == o.sort_code &&
370
+ bic == o.bic &&
371
+ sender_identity_card_type == o.sender_identity_card_type &&
372
+ sender_identity_card_id == o.sender_identity_card_id &&
373
+ sender_city_of_birth == o.sender_city_of_birth &&
374
+ sender_country_of_birth == o.sender_country_of_birth &&
375
+ sender_gender == o.sender_gender &&
376
+ reason == o.reason &&
377
+ identity_card_type == o.identity_card_type &&
378
+ identity_card_id == o.identity_card_id &&
379
+ reference == o.reference &&
380
+ name == o.name &&
381
+ address == o.address
382
+ end
383
+
384
+ # @see the `==` method
385
+ # @param [Object] Object to be compared
386
+ def eql?(o)
387
+ self == o
388
+ end
389
+
390
+ # Calculates hash code according to all attributes.
391
+ # @return [Integer] Hash code
392
+ def hash
393
+ [first_name, last_name, bank_code, bank_account, bank_account_type, phone_number, mobile_provider, iban, bank_name, bank_country, sort_code, bic, sender_identity_card_type, sender_identity_card_id, sender_city_of_birth, sender_country_of_birth, sender_gender, reason, identity_card_type, identity_card_id, reference, name, address].hash
394
+ end
395
+
347
396
  require 'active_support/core_ext/hash'
348
397
  require 'active_support/hash_with_indifferent_access.rb'
349
398
  # Builds the object from hash
@@ -458,5 +507,6 @@ def _to_hash(value)
458
507
  end
459
508
  end
460
509
 
461
- end
510
+ end
511
+
462
512
  end