velopayments 2.11.73

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 (273) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/LICENSE +201 -0
  5. data/Makefile +39 -0
  6. data/README.md +279 -0
  7. data/Rakefile +10 -0
  8. data/docs/Address.md +31 -0
  9. data/docs/Challenge.md +19 -0
  10. data/docs/Company.md +19 -0
  11. data/docs/CountriesApi.md +106 -0
  12. data/docs/CreatePayee.md +59 -0
  13. data/docs/CreatePayeesCSVRequest.md +71 -0
  14. data/docs/CreatePayeesCSVResponse.md +19 -0
  15. data/docs/CreatePayeesRequest.md +19 -0
  16. data/docs/CreatePaymentChannel.md +29 -0
  17. data/docs/CreatePayoutRequest.md +21 -0
  18. data/docs/CurrenciesApi.md +57 -0
  19. data/docs/FailedSubmission.md +19 -0
  20. data/docs/FundingAudit.md +31 -0
  21. data/docs/FundingEvent.md +21 -0
  22. data/docs/FundingEventType.md +16 -0
  23. data/docs/FundingManagerApi.md +347 -0
  24. data/docs/FundingRequest.md +17 -0
  25. data/docs/FundingRequest2.md +17 -0
  26. data/docs/FxSummary.md +35 -0
  27. data/docs/GetFundingsResponse.md +21 -0
  28. data/docs/GetPaymentsForPayoutResponse.md +23 -0
  29. data/docs/GetPaymentsForPayoutResponseLinks.md +19 -0
  30. data/docs/GetPaymentsForPayoutResponsePage.md +25 -0
  31. data/docs/GetPaymentsForPayoutResponseSummary.md +25 -0
  32. data/docs/GetPayoutApi.md +61 -0
  33. data/docs/GetPayoutStatistics.md +19 -0
  34. data/docs/GetPayoutsResponse.md +23 -0
  35. data/docs/Individual.md +21 -0
  36. data/docs/IndividualName.md +23 -0
  37. data/docs/InstructPayoutApi.md +60 -0
  38. data/docs/InvitationStatusResponse.md +17 -0
  39. data/docs/InvitePayeeRequest.md +17 -0
  40. data/docs/Language.md +16 -0
  41. data/docs/ListPaymentsResponse.md +23 -0
  42. data/docs/ListSourceAccountResponse.md +21 -0
  43. data/docs/MarketingOptIn.md +19 -0
  44. data/docs/OfacStatus.md +16 -0
  45. data/docs/OnboardedStatus.md +16 -0
  46. data/docs/PagedResponse.md +19 -0
  47. data/docs/PagedResponsePage.md +25 -0
  48. data/docs/Payee.md +57 -0
  49. data/docs/PayeeInvitationApi.md +222 -0
  50. data/docs/PayeeInvitationStatus.md +21 -0
  51. data/docs/PayeeResponse.md +23 -0
  52. data/docs/PayeeType.md +16 -0
  53. data/docs/PayeesApi.md +192 -0
  54. data/docs/PaymentAuditCurrency.md +16 -0
  55. data/docs/PaymentAuditServiceApi.md +424 -0
  56. data/docs/PaymentChannel.md +29 -0
  57. data/docs/PaymentChannelCountry.md +19 -0
  58. data/docs/PaymentChannelRule.md +29 -0
  59. data/docs/PaymentChannelRulesResponse.md +17 -0
  60. data/docs/PaymentEventResponse.md +39 -0
  61. data/docs/PaymentInstruction.md +27 -0
  62. data/docs/PaymentResponse.md +81 -0
  63. data/docs/Payor.md +55 -0
  64. data/docs/PayorApplicationsApi.md +119 -0
  65. data/docs/PayorBrandingResponse.md +25 -0
  66. data/docs/PayorCreateApiKeyRequest.md +21 -0
  67. data/docs/PayorCreateApiKeyResponse.md +19 -0
  68. data/docs/PayorCreateApplicationRequest.md +19 -0
  69. data/docs/PayorEmailOptOutRequest.md +17 -0
  70. data/docs/PayorFundingBankDetailsUpdate.md +21 -0
  71. data/docs/PayorLogoRequest.md +17 -0
  72. data/docs/PayorRef.md +21 -0
  73. data/docs/PayorsApi.md +224 -0
  74. data/docs/PayoutHistoryApi.md +142 -0
  75. data/docs/PayoutStatus.md +16 -0
  76. data/docs/PayoutSummaryAudit.md +39 -0
  77. data/docs/PayoutSummaryResponse.md +31 -0
  78. data/docs/QueryBatchResponse.md +23 -0
  79. data/docs/QuoteFxSummary.md +37 -0
  80. data/docs/QuotePayoutApi.md +61 -0
  81. data/docs/QuoteResponse.md +17 -0
  82. data/docs/RejectedPayment.md +31 -0
  83. data/docs/Social.md +21 -0
  84. data/docs/SourceAccount.md +23 -0
  85. data/docs/SourceAccountResponse.md +39 -0
  86. data/docs/SourceAccountSummary.md +21 -0
  87. data/docs/SubmitPayoutApi.md +60 -0
  88. data/docs/SupportedCountriesResponse.md +17 -0
  89. data/docs/SupportedCountry.md +19 -0
  90. data/docs/SupportedCurrency.md +19 -0
  91. data/docs/SupportedCurrencyResponse.md +17 -0
  92. data/docs/WithdrawPayoutApi.md +60 -0
  93. data/lib/velopayments.rb +124 -0
  94. data/lib/velopayments/api/countries_api.rb +116 -0
  95. data/lib/velopayments/api/currencies_api.rb +69 -0
  96. data/lib/velopayments/api/funding_manager_api.rb +374 -0
  97. data/lib/velopayments/api/get_payout_api.rb +75 -0
  98. data/lib/velopayments/api/instruct_payout_api.rb +72 -0
  99. data/lib/velopayments/api/payee_invitation_api.rb +244 -0
  100. data/lib/velopayments/api/payees_api.rb +217 -0
  101. data/lib/velopayments/api/payment_audit_service_api.rb +473 -0
  102. data/lib/velopayments/api/payor_applications_api.rb +147 -0
  103. data/lib/velopayments/api/payors_api.rb +241 -0
  104. data/lib/velopayments/api/payout_history_api.rb +165 -0
  105. data/lib/velopayments/api/quote_payout_api.rb +75 -0
  106. data/lib/velopayments/api/submit_payout_api.rb +74 -0
  107. data/lib/velopayments/api/withdraw_payout_api.rb +72 -0
  108. data/lib/velopayments/api_client.rb +387 -0
  109. data/lib/velopayments/api_error.rb +57 -0
  110. data/lib/velopayments/configuration.rb +251 -0
  111. data/lib/velopayments/models/address.rb +478 -0
  112. data/lib/velopayments/models/challenge.rb +271 -0
  113. data/lib/velopayments/models/company.rb +256 -0
  114. data/lib/velopayments/models/create_payee.rb +466 -0
  115. data/lib/velopayments/models/create_payees_csv_request.rb +1052 -0
  116. data/lib/velopayments/models/create_payees_csv_response.rb +207 -0
  117. data/lib/velopayments/models/create_payees_request.rb +217 -0
  118. data/lib/velopayments/models/create_payment_channel.rb +414 -0
  119. data/lib/velopayments/models/create_payout_request.rb +226 -0
  120. data/lib/velopayments/models/failed_submission.rb +205 -0
  121. data/lib/velopayments/models/funding_audit.rb +295 -0
  122. data/lib/velopayments/models/funding_event.rb +214 -0
  123. data/lib/velopayments/models/funding_event_type.rb +41 -0
  124. data/lib/velopayments/models/funding_request.rb +230 -0
  125. data/lib/velopayments/models/funding_request2.rb +230 -0
  126. data/lib/velopayments/models/fx_summary.rb +363 -0
  127. data/lib/velopayments/models/get_fundings_response.rb +223 -0
  128. data/lib/velopayments/models/get_payments_for_payout_response.rb +228 -0
  129. data/lib/velopayments/models/get_payments_for_payout_response_links.rb +205 -0
  130. data/lib/velopayments/models/get_payments_for_payout_response_page.rb +232 -0
  131. data/lib/velopayments/models/get_payments_for_payout_response_summary.rb +232 -0
  132. data/lib/velopayments/models/get_payout_statistics.rb +215 -0
  133. data/lib/velopayments/models/get_payouts_response.rb +228 -0
  134. data/lib/velopayments/models/individual.rb +224 -0
  135. data/lib/velopayments/models/individual_name.rb +337 -0
  136. data/lib/velopayments/models/invitation_status_response.rb +203 -0
  137. data/lib/velopayments/models/invite_payee_request.rb +201 -0
  138. data/lib/velopayments/models/language.rb +45 -0
  139. data/lib/velopayments/models/list_payments_response.rb +228 -0
  140. data/lib/velopayments/models/list_source_account_response.rb +219 -0
  141. data/lib/velopayments/models/marketing_opt_in.rb +205 -0
  142. data/lib/velopayments/models/ofac_status.rb +37 -0
  143. data/lib/velopayments/models/onboarded_status.rb +38 -0
  144. data/lib/velopayments/models/paged_response.rb +207 -0
  145. data/lib/velopayments/models/paged_response_page.rb +232 -0
  146. data/lib/velopayments/models/payee.rb +381 -0
  147. data/lib/velopayments/models/payee_invitation_status.rb +258 -0
  148. data/lib/velopayments/models/payee_response.rb +228 -0
  149. data/lib/velopayments/models/payee_type.rb +36 -0
  150. data/lib/velopayments/models/payment_audit_currency.rb +37 -0
  151. data/lib/velopayments/models/payment_channel.rb +430 -0
  152. data/lib/velopayments/models/payment_channel_country.rb +207 -0
  153. data/lib/velopayments/models/payment_channel_rule.rb +250 -0
  154. data/lib/velopayments/models/payment_channel_rules_response.rb +198 -0
  155. data/lib/velopayments/models/payment_event_response.rb +351 -0
  156. data/lib/velopayments/models/payment_instruction.rb +430 -0
  157. data/lib/velopayments/models/payment_response.rb +587 -0
  158. data/lib/velopayments/models/payor.rb +435 -0
  159. data/lib/velopayments/models/payor_branding_response.rb +247 -0
  160. data/lib/velopayments/models/payor_create_api_key_request.rb +303 -0
  161. data/lib/velopayments/models/payor_create_api_key_response.rb +207 -0
  162. data/lib/velopayments/models/payor_create_application_request.rb +264 -0
  163. data/lib/velopayments/models/payor_email_opt_out_request.rb +196 -0
  164. data/lib/velopayments/models/payor_funding_bank_details_update.rb +316 -0
  165. data/lib/velopayments/models/payor_logo_request.rb +196 -0
  166. data/lib/velopayments/models/payor_ref.rb +214 -0
  167. data/lib/velopayments/models/payout_status.rb +43 -0
  168. data/lib/velopayments/models/payout_summary_audit.rb +314 -0
  169. data/lib/velopayments/models/payout_summary_response.rb +280 -0
  170. data/lib/velopayments/models/query_batch_response.rb +260 -0
  171. data/lib/velopayments/models/quote_fx_summary.rb +377 -0
  172. data/lib/velopayments/models/quote_response.rb +198 -0
  173. data/lib/velopayments/models/rejected_payment.rb +323 -0
  174. data/lib/velopayments/models/social.rb +214 -0
  175. data/lib/velopayments/models/source_account.rb +243 -0
  176. data/lib/velopayments/models/source_account_response.rb +341 -0
  177. data/lib/velopayments/models/source_account_summary.rb +224 -0
  178. data/lib/velopayments/models/supported_countries_response.rb +198 -0
  179. data/lib/velopayments/models/supported_country.rb +207 -0
  180. data/lib/velopayments/models/supported_currency.rb +206 -0
  181. data/lib/velopayments/models/supported_currency_response.rb +198 -0
  182. data/lib/velopayments/version.rb +15 -0
  183. data/oa3-config.json +8 -0
  184. data/spec/api/countries_api_spec.rb +57 -0
  185. data/spec/api/currencies_api_spec.rb +46 -0
  186. data/spec/api/funding_manager_api_spec.rb +117 -0
  187. data/spec/api/get_payout_api_spec.rb +47 -0
  188. data/spec/api/instruct_payout_api_spec.rb +47 -0
  189. data/spec/api/payee_invitation_api_spec.rb +84 -0
  190. data/spec/api/payees_api_spec.rb +82 -0
  191. data/spec/api/payment_audit_service_api_spec.rb +150 -0
  192. data/spec/api/payor_applications_api_spec.rb +62 -0
  193. data/spec/api/payors_api_spec.rb +85 -0
  194. data/spec/api/payout_history_api_spec.rb +71 -0
  195. data/spec/api/quote_payout_api_spec.rb +47 -0
  196. data/spec/api/submit_payout_api_spec.rb +47 -0
  197. data/spec/api/withdraw_payout_api_spec.rb +47 -0
  198. data/spec/api_client_spec.rb +226 -0
  199. data/spec/configuration_spec.rb +42 -0
  200. data/spec/models/address_spec.rb +83 -0
  201. data/spec/models/challenge_spec.rb +47 -0
  202. data/spec/models/company_spec.rb +47 -0
  203. data/spec/models/create_payee_spec.rb +167 -0
  204. data/spec/models/create_payees_csv_request_spec.rb +211 -0
  205. data/spec/models/create_payees_csv_response_spec.rb +47 -0
  206. data/spec/models/create_payees_request_spec.rb +47 -0
  207. data/spec/models/create_payment_channel_spec.rb +81 -0
  208. data/spec/models/create_payout_request_spec.rb +53 -0
  209. data/spec/models/failed_submission_spec.rb +47 -0
  210. data/spec/models/funding_audit_spec.rb +87 -0
  211. data/spec/models/funding_event_spec.rb +53 -0
  212. data/spec/models/funding_event_type_spec.rb +35 -0
  213. data/spec/models/funding_request2_spec.rb +41 -0
  214. data/spec/models/funding_request_spec.rb +41 -0
  215. data/spec/models/fx_summary_spec.rb +103 -0
  216. data/spec/models/get_fundings_response_spec.rb +53 -0
  217. data/spec/models/get_payments_for_payout_response_links_spec.rb +47 -0
  218. data/spec/models/get_payments_for_payout_response_page_spec.rb +65 -0
  219. data/spec/models/get_payments_for_payout_response_spec.rb +59 -0
  220. data/spec/models/get_payments_for_payout_response_summary_spec.rb +65 -0
  221. data/spec/models/get_payout_statistics_spec.rb +47 -0
  222. data/spec/models/get_payouts_response_spec.rb +59 -0
  223. data/spec/models/individual_name_spec.rb +59 -0
  224. data/spec/models/individual_spec.rb +53 -0
  225. data/spec/models/invitation_status_response_spec.rb +41 -0
  226. data/spec/models/invite_payee_request_spec.rb +41 -0
  227. data/spec/models/language_spec.rb +35 -0
  228. data/spec/models/list_payments_response_spec.rb +59 -0
  229. data/spec/models/list_source_account_response_spec.rb +53 -0
  230. data/spec/models/marketing_opt_in_spec.rb +47 -0
  231. data/spec/models/ofac_status_spec.rb +35 -0
  232. data/spec/models/onboarded_status_spec.rb +35 -0
  233. data/spec/models/paged_response_page_spec.rb +65 -0
  234. data/spec/models/paged_response_spec.rb +47 -0
  235. data/spec/models/payee_invitation_status_spec.rb +57 -0
  236. data/spec/models/payee_response_spec.rb +59 -0
  237. data/spec/models/payee_spec.rb +161 -0
  238. data/spec/models/payee_type_spec.rb +35 -0
  239. data/spec/models/payment_audit_currency_spec.rb +35 -0
  240. data/spec/models/payment_channel_country_spec.rb +47 -0
  241. data/spec/models/payment_channel_rule_spec.rb +77 -0
  242. data/spec/models/payment_channel_rules_response_spec.rb +41 -0
  243. data/spec/models/payment_channel_spec.rb +81 -0
  244. data/spec/models/payment_event_response_spec.rb +111 -0
  245. data/spec/models/payment_instruction_spec.rb +75 -0
  246. data/spec/models/payment_response_spec.rb +241 -0
  247. data/spec/models/payor_branding_response_spec.rb +65 -0
  248. data/spec/models/payor_create_api_key_request_spec.rb +57 -0
  249. data/spec/models/payor_create_api_key_response_spec.rb +47 -0
  250. data/spec/models/payor_create_application_request_spec.rb +47 -0
  251. data/spec/models/payor_email_opt_out_request_spec.rb +41 -0
  252. data/spec/models/payor_funding_bank_details_update_spec.rb +53 -0
  253. data/spec/models/payor_logo_request_spec.rb +41 -0
  254. data/spec/models/payor_ref_spec.rb +53 -0
  255. data/spec/models/payor_spec.rb +163 -0
  256. data/spec/models/payout_status_spec.rb +35 -0
  257. data/spec/models/payout_summary_audit_spec.rb +107 -0
  258. data/spec/models/payout_summary_response_spec.rb +83 -0
  259. data/spec/models/query_batch_response_spec.rb +63 -0
  260. data/spec/models/quote_fx_summary_spec.rb +101 -0
  261. data/spec/models/quote_response_spec.rb +41 -0
  262. data/spec/models/rejected_payment_spec.rb +87 -0
  263. data/spec/models/social_spec.rb +53 -0
  264. data/spec/models/source_account_response_spec.rb +111 -0
  265. data/spec/models/source_account_spec.rb +59 -0
  266. data/spec/models/source_account_summary_spec.rb +53 -0
  267. data/spec/models/supported_countries_response_spec.rb +41 -0
  268. data/spec/models/supported_country_spec.rb +47 -0
  269. data/spec/models/supported_currency_response_spec.rb +41 -0
  270. data/spec/models/supported_currency_spec.rb +47 -0
  271. data/spec/spec_helper.rb +111 -0
  272. data/velopayments.gemspec +45 -0
  273. metadata +586 -0
@@ -0,0 +1,1052 @@
1
+ =begin
2
+ #Velo Payments APIs
3
+
4
+ ### Terms and Definitions Throughout this document and the Velo platform the following terms are used: * **Payor.** An entity (typically a corporation) which wishes to pay funds to one or more payees via a payout. * **Payee.** The recipient of funds paid out by a payor. * **Payment.** A single transfer of funds from a payor to a payee. * **Payout.** A batch of Payments, typically used by a payor to logically group payments (e.g. by business day). Technically there need be no relationship between the payments in a payout - a single payout can contain payments to multiple payees and/or multiple payments to a single payee. * **Sandbox.** An integration environment provided by Velo Payments which offers a similar API experience to the production environment, but all funding and payment events are simulated, along with many other services such as OFAC sanctions list checking. ## Overview The Velo Payments API allows a payor to perform a number of operations. The following is a list of the main capabilities in a natural order of execution: * Authenticate with the Velo platform * Maintain a collection of payees * Query the payor’s current balance of funds within the platform and perform additional funding * Issue payments to payees * Query the platform for a history of those payments This document describes the main concepts and APIs required to get up and running with the Velo Payments platform. It is not an exhaustive API reference. For that, please see the separate Velo Payments API Reference. ## API Considerations The Velo Payments API is REST based and uses the JSON format for requests and responses. Most calls are secured using OAuth 2 security and require a valid authentication access token for successful operation. See the Authentication section for details. Where a dynamic value is required in the examples below, the {token} format is used, suggesting that the caller needs to supply the appropriate value of the token in question (without including the { or } characters). Where curl examples are given, the –d @filename.json approach is used, indicating that the request body should be placed into a file named filename.json in the current directory. Each of the curl examples in this document should be considered a single line on the command-line, regardless of how they appear in print. ## Authenticating with the Velo Platform Once Velo backoffice staff have added your organization as a payor within the Velo platform sandbox, they will create you a payor Id, an API key and an API secret and share these with you in a secure manner. You will need to use these values to authenticate with the Velo platform in order to gain access to the APIs. The steps to take are explained in the following: create a string comprising the API key (e.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8) and API secret (e.g. c396b26b-137a-44fd-87f5-34631f8fd529) with a colon between them. E.g. 44a9537d-d55d-4b47-8082-14061c2bcdd8:c396b26b-137a-44fd-87f5-34631f8fd529 base64 encode this string. E.g.: NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== create an HTTP **Authorization** header with the value set to e.g. Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ== perform the Velo authentication REST call using the HTTP header created above e.g. via curl: ``` curl -X POST \\ -H \"Content-Type: application/json\" \\ -H \"Authorization: Basic NDRhOTUzN2QtZDU1ZC00YjQ3LTgwODItMTQwNjFjMmJjZGQ4OmMzOTZiMjZiLTEzN2EtNDRmZC04N2Y1LTM0NjMxZjhmZDUyOQ==\" \\ 'https://api.sandbox.velopayments.com/v1/authenticate?grant_type=client_credentials' ``` If successful, this call will result in a **200** HTTP status code and a response body such as: ``` { \"access_token\":\"19f6bafd-93fd-4747-b229-00507bbc991f\", \"token_type\":\"bearer\", \"expires_in\":1799, \"scope\":\"...\" } ``` ## API access following authentication Following successful authentication, the value of the access_token field in the response (indicated in green above) should then be presented with all subsequent API calls to allow the Velo platform to validate that the caller is authenticated. This is achieved by setting the HTTP Authorization header with the value set to e.g. Bearer 19f6bafd-93fd-4747-b229-00507bbc991f such as the curl example below: ``` -H \"Authorization: Bearer 19f6bafd-93fd-4747-b229-00507bbc991f \" ``` If you make other Velo API calls which require authorization but the Authorization header is missing or invalid then you will get a **401** HTTP status response.
5
+
6
+ OpenAPI spec version: 2.11.73
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module VeloPayments
16
+ class CreatePayeesCSVRequest
17
+ attr_accessor :type
18
+
19
+ attr_accessor :remote_id
20
+
21
+ attr_accessor :email
22
+
23
+ attr_accessor :address_line1
24
+
25
+ attr_accessor :address_line2
26
+
27
+ attr_accessor :address_line3
28
+
29
+ attr_accessor :address_line4
30
+
31
+ attr_accessor :address_city
32
+
33
+ attr_accessor :address_county_or_province
34
+
35
+ attr_accessor :address_zip_or_postcode
36
+
37
+ attr_accessor :address_country
38
+
39
+ attr_accessor :individual_title
40
+
41
+ attr_accessor :individual_first_name
42
+
43
+ attr_accessor :individual_other_names
44
+
45
+ attr_accessor :individual_last_name
46
+
47
+ attr_accessor :individual_national_identification
48
+
49
+ # example - 1970-05-20
50
+ attr_accessor :individual_date_of_birth
51
+
52
+ attr_accessor :company_name
53
+
54
+ # Company Tax Id (EIN) must be 9 numeric characters. Must match the regular expression ```[\\d]{9}```.
55
+ attr_accessor :company_tax_id
56
+
57
+ # Must match the regular expression ```^[A-Za-z0-9]+$```.
58
+ attr_accessor :payment_channel_iban
59
+
60
+ attr_accessor :payment_channel_account_number
61
+
62
+ attr_accessor :payment_channel_routing_no
63
+
64
+ # Must be a 3 character currency code. ISO 4217
65
+ attr_accessor :payment_channel_country_code
66
+
67
+ attr_accessor :payment_channel_currency
68
+
69
+ attr_accessor :payment_channel_account_name
70
+
71
+ attr_accessor :challenge_value
72
+
73
+ attr_accessor :challenge_description
74
+
75
+ attr_accessor :payee_language
76
+
77
+ class EnumAttributeValidator
78
+ attr_reader :datatype
79
+ attr_reader :allowable_values
80
+
81
+ def initialize(datatype, allowable_values)
82
+ @allowable_values = allowable_values.map do |value|
83
+ case datatype.to_s
84
+ when /Integer/i
85
+ value.to_i
86
+ when /Float/i
87
+ value.to_f
88
+ else
89
+ value
90
+ end
91
+ end
92
+ end
93
+
94
+ def valid?(value)
95
+ !value || allowable_values.include?(value)
96
+ end
97
+ end
98
+
99
+ # Attribute mapping from ruby-style variable name to JSON key.
100
+ def self.attribute_map
101
+ {
102
+ :'type' => :'type',
103
+ :'remote_id' => :'remoteId',
104
+ :'email' => :'email',
105
+ :'address_line1' => :'addressLine1',
106
+ :'address_line2' => :'addressLine2',
107
+ :'address_line3' => :'addressLine3',
108
+ :'address_line4' => :'addressLine4',
109
+ :'address_city' => :'addressCity',
110
+ :'address_county_or_province' => :'addressCountyOrProvince',
111
+ :'address_zip_or_postcode' => :'addressZipOrPostcode',
112
+ :'address_country' => :'addressCountry',
113
+ :'individual_title' => :'individualTitle',
114
+ :'individual_first_name' => :'individualFirstName',
115
+ :'individual_other_names' => :'individualOtherNames',
116
+ :'individual_last_name' => :'individualLastName',
117
+ :'individual_national_identification' => :'individualNationalIdentification',
118
+ :'individual_date_of_birth' => :'individualDateOfBirth',
119
+ :'company_name' => :'companyName',
120
+ :'company_tax_id' => :'companyTaxId',
121
+ :'payment_channel_iban' => :'paymentChannelIban',
122
+ :'payment_channel_account_number' => :'paymentChannelAccountNumber',
123
+ :'payment_channel_routing_no' => :'paymentChannelRoutingNo',
124
+ :'payment_channel_country_code' => :'paymentChannelCountryCode',
125
+ :'payment_channel_currency' => :'paymentChannelCurrency',
126
+ :'payment_channel_account_name' => :'paymentChannelAccountName',
127
+ :'challenge_value' => :'challengeValue',
128
+ :'challenge_description' => :'challengeDescription',
129
+ :'payee_language' => :'payeeLanguage'
130
+ }
131
+ end
132
+
133
+ # Attribute type mapping.
134
+ def self.openapi_types
135
+ {
136
+ :'type' => :'PayeeType',
137
+ :'remote_id' => :'String',
138
+ :'email' => :'String',
139
+ :'address_line1' => :'String',
140
+ :'address_line2' => :'String',
141
+ :'address_line3' => :'String',
142
+ :'address_line4' => :'String',
143
+ :'address_city' => :'String',
144
+ :'address_county_or_province' => :'String',
145
+ :'address_zip_or_postcode' => :'String',
146
+ :'address_country' => :'String',
147
+ :'individual_title' => :'String',
148
+ :'individual_first_name' => :'String',
149
+ :'individual_other_names' => :'String',
150
+ :'individual_last_name' => :'String',
151
+ :'individual_national_identification' => :'String',
152
+ :'individual_date_of_birth' => :'Date',
153
+ :'company_name' => :'String',
154
+ :'company_tax_id' => :'String',
155
+ :'payment_channel_iban' => :'String',
156
+ :'payment_channel_account_number' => :'String',
157
+ :'payment_channel_routing_no' => :'String',
158
+ :'payment_channel_country_code' => :'String',
159
+ :'payment_channel_currency' => :'String',
160
+ :'payment_channel_account_name' => :'String',
161
+ :'challenge_value' => :'String',
162
+ :'challenge_description' => :'String',
163
+ :'payee_language' => :'String'
164
+ }
165
+ end
166
+
167
+ # Initializes the object
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ def initialize(attributes = {})
170
+ if (!attributes.is_a?(Hash))
171
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeloPayments::CreatePayeesCSVRequest` initialize method"
172
+ end
173
+
174
+ # check to see if the attribute exists and convert string to symbol for hash key
175
+ attributes = attributes.each_with_object({}) { |(k, v), h|
176
+ if (!self.class.attribute_map.key?(k.to_sym))
177
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeloPayments::CreatePayeesCSVRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
178
+ end
179
+ h[k.to_sym] = v
180
+ }
181
+
182
+ if attributes.key?(:'type')
183
+ self.type = attributes[:'type']
184
+ end
185
+
186
+ if attributes.key?(:'remote_id')
187
+ self.remote_id = attributes[:'remote_id']
188
+ end
189
+
190
+ if attributes.key?(:'email')
191
+ self.email = attributes[:'email']
192
+ end
193
+
194
+ if attributes.key?(:'address_line1')
195
+ self.address_line1 = attributes[:'address_line1']
196
+ end
197
+
198
+ if attributes.key?(:'address_line2')
199
+ self.address_line2 = attributes[:'address_line2']
200
+ end
201
+
202
+ if attributes.key?(:'address_line3')
203
+ self.address_line3 = attributes[:'address_line3']
204
+ end
205
+
206
+ if attributes.key?(:'address_line4')
207
+ self.address_line4 = attributes[:'address_line4']
208
+ end
209
+
210
+ if attributes.key?(:'address_city')
211
+ self.address_city = attributes[:'address_city']
212
+ end
213
+
214
+ if attributes.key?(:'address_county_or_province')
215
+ self.address_county_or_province = attributes[:'address_county_or_province']
216
+ end
217
+
218
+ if attributes.key?(:'address_zip_or_postcode')
219
+ self.address_zip_or_postcode = attributes[:'address_zip_or_postcode']
220
+ end
221
+
222
+ if attributes.key?(:'address_country')
223
+ self.address_country = attributes[:'address_country']
224
+ end
225
+
226
+ if attributes.key?(:'individual_title')
227
+ self.individual_title = attributes[:'individual_title']
228
+ end
229
+
230
+ if attributes.key?(:'individual_first_name')
231
+ self.individual_first_name = attributes[:'individual_first_name']
232
+ end
233
+
234
+ if attributes.key?(:'individual_other_names')
235
+ self.individual_other_names = attributes[:'individual_other_names']
236
+ end
237
+
238
+ if attributes.key?(:'individual_last_name')
239
+ self.individual_last_name = attributes[:'individual_last_name']
240
+ end
241
+
242
+ if attributes.key?(:'individual_national_identification')
243
+ self.individual_national_identification = attributes[:'individual_national_identification']
244
+ end
245
+
246
+ if attributes.key?(:'individual_date_of_birth')
247
+ self.individual_date_of_birth = attributes[:'individual_date_of_birth']
248
+ end
249
+
250
+ if attributes.key?(:'company_name')
251
+ self.company_name = attributes[:'company_name']
252
+ end
253
+
254
+ if attributes.key?(:'company_tax_id')
255
+ self.company_tax_id = attributes[:'company_tax_id']
256
+ end
257
+
258
+ if attributes.key?(:'payment_channel_iban')
259
+ self.payment_channel_iban = attributes[:'payment_channel_iban']
260
+ end
261
+
262
+ if attributes.key?(:'payment_channel_account_number')
263
+ self.payment_channel_account_number = attributes[:'payment_channel_account_number']
264
+ end
265
+
266
+ if attributes.key?(:'payment_channel_routing_no')
267
+ self.payment_channel_routing_no = attributes[:'payment_channel_routing_no']
268
+ end
269
+
270
+ if attributes.key?(:'payment_channel_country_code')
271
+ self.payment_channel_country_code = attributes[:'payment_channel_country_code']
272
+ end
273
+
274
+ if attributes.key?(:'payment_channel_currency')
275
+ self.payment_channel_currency = attributes[:'payment_channel_currency']
276
+ end
277
+
278
+ if attributes.key?(:'payment_channel_account_name')
279
+ self.payment_channel_account_name = attributes[:'payment_channel_account_name']
280
+ end
281
+
282
+ if attributes.key?(:'challenge_value')
283
+ self.challenge_value = attributes[:'challenge_value']
284
+ end
285
+
286
+ if attributes.key?(:'challenge_description')
287
+ self.challenge_description = attributes[:'challenge_description']
288
+ end
289
+
290
+ if attributes.key?(:'payee_language')
291
+ self.payee_language = attributes[:'payee_language']
292
+ end
293
+ end
294
+
295
+ # Show invalid properties with the reasons. Usually used together with valid?
296
+ # @return Array for valid properties with the reasons
297
+ def list_invalid_properties
298
+ invalid_properties = Array.new
299
+ if @type.nil?
300
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
301
+ end
302
+
303
+ if @remote_id.nil?
304
+ invalid_properties.push('invalid value for "remote_id", remote_id cannot be nil.')
305
+ end
306
+
307
+ if @remote_id.to_s.length > 100
308
+ invalid_properties.push('invalid value for "remote_id", the character length must be smaller than or equal to 100.')
309
+ end
310
+
311
+ if @remote_id.to_s.length < 1
312
+ invalid_properties.push('invalid value for "remote_id", the character length must be great than or equal to 1.')
313
+ end
314
+
315
+ if @email.nil?
316
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
317
+ end
318
+
319
+ if @address_line1.nil?
320
+ invalid_properties.push('invalid value for "address_line1", address_line1 cannot be nil.')
321
+ end
322
+
323
+ if @address_line1.to_s.length > 255
324
+ invalid_properties.push('invalid value for "address_line1", the character length must be smaller than or equal to 255.')
325
+ end
326
+
327
+ if @address_line1.to_s.length < 2
328
+ invalid_properties.push('invalid value for "address_line1", the character length must be great than or equal to 2.')
329
+ end
330
+
331
+ if !@address_line2.nil? && @address_line2.to_s.length > 255
332
+ invalid_properties.push('invalid value for "address_line2", the character length must be smaller than or equal to 255.')
333
+ end
334
+
335
+ if !@address_line2.nil? && @address_line2.to_s.length < 0
336
+ invalid_properties.push('invalid value for "address_line2", the character length must be great than or equal to 0.')
337
+ end
338
+
339
+ if !@address_line3.nil? && @address_line3.to_s.length > 255
340
+ invalid_properties.push('invalid value for "address_line3", the character length must be smaller than or equal to 255.')
341
+ end
342
+
343
+ if !@address_line3.nil? && @address_line3.to_s.length < 0
344
+ invalid_properties.push('invalid value for "address_line3", the character length must be great than or equal to 0.')
345
+ end
346
+
347
+ if !@address_line4.nil? && @address_line4.to_s.length > 255
348
+ invalid_properties.push('invalid value for "address_line4", the character length must be smaller than or equal to 255.')
349
+ end
350
+
351
+ if !@address_line4.nil? && @address_line4.to_s.length < 0
352
+ invalid_properties.push('invalid value for "address_line4", the character length must be great than or equal to 0.')
353
+ end
354
+
355
+ if @address_city.nil?
356
+ invalid_properties.push('invalid value for "address_city", address_city cannot be nil.')
357
+ end
358
+
359
+ if @address_city.to_s.length > 100
360
+ invalid_properties.push('invalid value for "address_city", the character length must be smaller than or equal to 100.')
361
+ end
362
+
363
+ if @address_city.to_s.length < 2
364
+ invalid_properties.push('invalid value for "address_city", the character length must be great than or equal to 2.')
365
+ end
366
+
367
+ if !@address_county_or_province.nil? && @address_county_or_province.to_s.length > 100
368
+ invalid_properties.push('invalid value for "address_county_or_province", the character length must be smaller than or equal to 100.')
369
+ end
370
+
371
+ if !@address_county_or_province.nil? && @address_county_or_province.to_s.length < 2
372
+ invalid_properties.push('invalid value for "address_county_or_province", the character length must be great than or equal to 2.')
373
+ end
374
+
375
+ if @address_zip_or_postcode.nil?
376
+ invalid_properties.push('invalid value for "address_zip_or_postcode", address_zip_or_postcode cannot be nil.')
377
+ end
378
+
379
+ if @address_zip_or_postcode.to_s.length > 30
380
+ invalid_properties.push('invalid value for "address_zip_or_postcode", the character length must be smaller than or equal to 30.')
381
+ end
382
+
383
+ if @address_zip_or_postcode.to_s.length < 2
384
+ invalid_properties.push('invalid value for "address_zip_or_postcode", the character length must be great than or equal to 2.')
385
+ end
386
+
387
+ if @address_country.nil?
388
+ invalid_properties.push('invalid value for "address_country", address_country cannot be nil.')
389
+ end
390
+
391
+ if @address_country.to_s.length > 50
392
+ invalid_properties.push('invalid value for "address_country", the character length must be smaller than or equal to 50.')
393
+ end
394
+
395
+ if @address_country.to_s.length < 2
396
+ invalid_properties.push('invalid value for "address_country", the character length must be great than or equal to 2.')
397
+ end
398
+
399
+ if !@individual_title.nil? && @individual_title.to_s.length > 10
400
+ invalid_properties.push('invalid value for "individual_title", the character length must be smaller than or equal to 10.')
401
+ end
402
+
403
+ if !@individual_title.nil? && @individual_title.to_s.length < 1
404
+ invalid_properties.push('invalid value for "individual_title", the character length must be great than or equal to 1.')
405
+ end
406
+
407
+ if !@individual_first_name.nil? && @individual_first_name.to_s.length > 40
408
+ invalid_properties.push('invalid value for "individual_first_name", the character length must be smaller than or equal to 40.')
409
+ end
410
+
411
+ if !@individual_first_name.nil? && @individual_first_name.to_s.length < 1
412
+ invalid_properties.push('invalid value for "individual_first_name", the character length must be great than or equal to 1.')
413
+ end
414
+
415
+ if !@individual_other_names.nil? && @individual_other_names.to_s.length > 40
416
+ invalid_properties.push('invalid value for "individual_other_names", the character length must be smaller than or equal to 40.')
417
+ end
418
+
419
+ if !@individual_other_names.nil? && @individual_other_names.to_s.length < 1
420
+ invalid_properties.push('invalid value for "individual_other_names", the character length must be great than or equal to 1.')
421
+ end
422
+
423
+ if !@individual_last_name.nil? && @individual_last_name.to_s.length > 40
424
+ invalid_properties.push('invalid value for "individual_last_name", the character length must be smaller than or equal to 40.')
425
+ end
426
+
427
+ if !@individual_last_name.nil? && @individual_last_name.to_s.length < 1
428
+ invalid_properties.push('invalid value for "individual_last_name", the character length must be great than or equal to 1.')
429
+ end
430
+
431
+ if !@company_name.nil? && @company_name.to_s.length > 40
432
+ invalid_properties.push('invalid value for "company_name", the character length must be smaller than or equal to 40.')
433
+ end
434
+
435
+ if !@company_name.nil? && @company_name.to_s.length < 1
436
+ invalid_properties.push('invalid value for "company_name", the character length must be great than or equal to 1.')
437
+ end
438
+
439
+ pattern = Regexp.new(/[\\d]{9}/)
440
+ if !@company_tax_id.nil? && @company_tax_id !~ pattern
441
+ invalid_properties.push("invalid value for \"company_tax_id\", must conform to the pattern #{pattern}.")
442
+ end
443
+
444
+ if !@payment_channel_iban.nil? && @payment_channel_iban.to_s.length > 34
445
+ invalid_properties.push('invalid value for "payment_channel_iban", the character length must be smaller than or equal to 34.')
446
+ end
447
+
448
+ if !@payment_channel_iban.nil? && @payment_channel_iban.to_s.length < 15
449
+ invalid_properties.push('invalid value for "payment_channel_iban", the character length must be great than or equal to 15.')
450
+ end
451
+
452
+ pattern = Regexp.new(/^[A-Za-z0-9]+$/)
453
+ if !@payment_channel_iban.nil? && @payment_channel_iban !~ pattern
454
+ invalid_properties.push("invalid value for \"payment_channel_iban\", must conform to the pattern #{pattern}.")
455
+ end
456
+
457
+ if !@payment_channel_account_number.nil? && @payment_channel_account_number.to_s.length > 17
458
+ invalid_properties.push('invalid value for "payment_channel_account_number", the character length must be smaller than or equal to 17.')
459
+ end
460
+
461
+ if !@payment_channel_account_number.nil? && @payment_channel_account_number.to_s.length < 6
462
+ invalid_properties.push('invalid value for "payment_channel_account_number", the character length must be great than or equal to 6.')
463
+ end
464
+
465
+ if !@payment_channel_routing_no.nil? && @payment_channel_routing_no.to_s.length > 9
466
+ invalid_properties.push('invalid value for "payment_channel_routing_no", the character length must be smaller than or equal to 9.')
467
+ end
468
+
469
+ if !@payment_channel_routing_no.nil? && @payment_channel_routing_no.to_s.length < 9
470
+ invalid_properties.push('invalid value for "payment_channel_routing_no", the character length must be great than or equal to 9.')
471
+ end
472
+
473
+ if !@payment_channel_country_code.nil? && @payment_channel_country_code.to_s.length > 9
474
+ invalid_properties.push('invalid value for "payment_channel_country_code", the character length must be smaller than or equal to 9.')
475
+ end
476
+
477
+ if !@payment_channel_country_code.nil? && @payment_channel_country_code.to_s.length < 9
478
+ invalid_properties.push('invalid value for "payment_channel_country_code", the character length must be great than or equal to 9.')
479
+ end
480
+
481
+ if !@challenge_value.nil? && @challenge_value.to_s.length > 20
482
+ invalid_properties.push('invalid value for "challenge_value", the character length must be smaller than or equal to 20.')
483
+ end
484
+
485
+ if !@challenge_value.nil? && @challenge_value.to_s.length < 3
486
+ invalid_properties.push('invalid value for "challenge_value", the character length must be great than or equal to 3.')
487
+ end
488
+
489
+ if !@challenge_description.nil? && @challenge_description.to_s.length > 255
490
+ invalid_properties.push('invalid value for "challenge_description", the character length must be smaller than or equal to 255.')
491
+ end
492
+
493
+ if !@challenge_description.nil? && @challenge_description.to_s.length < 1
494
+ invalid_properties.push('invalid value for "challenge_description", the character length must be great than or equal to 1.')
495
+ end
496
+
497
+ invalid_properties
498
+ end
499
+
500
+ # Check to see if the all the properties in the model are valid
501
+ # @return true if the model is valid
502
+ def valid?
503
+ return false if @type.nil?
504
+ return false if @remote_id.nil?
505
+ return false if @remote_id.to_s.length > 100
506
+ return false if @remote_id.to_s.length < 1
507
+ return false if @email.nil?
508
+ return false if @address_line1.nil?
509
+ return false if @address_line1.to_s.length > 255
510
+ return false if @address_line1.to_s.length < 2
511
+ return false if !@address_line2.nil? && @address_line2.to_s.length > 255
512
+ return false if !@address_line2.nil? && @address_line2.to_s.length < 0
513
+ return false if !@address_line3.nil? && @address_line3.to_s.length > 255
514
+ return false if !@address_line3.nil? && @address_line3.to_s.length < 0
515
+ return false if !@address_line4.nil? && @address_line4.to_s.length > 255
516
+ return false if !@address_line4.nil? && @address_line4.to_s.length < 0
517
+ return false if @address_city.nil?
518
+ return false if @address_city.to_s.length > 100
519
+ return false if @address_city.to_s.length < 2
520
+ return false if !@address_county_or_province.nil? && @address_county_or_province.to_s.length > 100
521
+ return false if !@address_county_or_province.nil? && @address_county_or_province.to_s.length < 2
522
+ return false if @address_zip_or_postcode.nil?
523
+ return false if @address_zip_or_postcode.to_s.length > 30
524
+ return false if @address_zip_or_postcode.to_s.length < 2
525
+ return false if @address_country.nil?
526
+ return false if @address_country.to_s.length > 50
527
+ return false if @address_country.to_s.length < 2
528
+ return false if !@individual_title.nil? && @individual_title.to_s.length > 10
529
+ return false if !@individual_title.nil? && @individual_title.to_s.length < 1
530
+ return false if !@individual_first_name.nil? && @individual_first_name.to_s.length > 40
531
+ return false if !@individual_first_name.nil? && @individual_first_name.to_s.length < 1
532
+ return false if !@individual_other_names.nil? && @individual_other_names.to_s.length > 40
533
+ return false if !@individual_other_names.nil? && @individual_other_names.to_s.length < 1
534
+ return false if !@individual_last_name.nil? && @individual_last_name.to_s.length > 40
535
+ return false if !@individual_last_name.nil? && @individual_last_name.to_s.length < 1
536
+ return false if !@company_name.nil? && @company_name.to_s.length > 40
537
+ return false if !@company_name.nil? && @company_name.to_s.length < 1
538
+ return false if !@company_tax_id.nil? && @company_tax_id !~ Regexp.new(/[\\d]{9}/)
539
+ return false if !@payment_channel_iban.nil? && @payment_channel_iban.to_s.length > 34
540
+ return false if !@payment_channel_iban.nil? && @payment_channel_iban.to_s.length < 15
541
+ return false if !@payment_channel_iban.nil? && @payment_channel_iban !~ Regexp.new(/^[A-Za-z0-9]+$/)
542
+ return false if !@payment_channel_account_number.nil? && @payment_channel_account_number.to_s.length > 17
543
+ return false if !@payment_channel_account_number.nil? && @payment_channel_account_number.to_s.length < 6
544
+ return false if !@payment_channel_routing_no.nil? && @payment_channel_routing_no.to_s.length > 9
545
+ return false if !@payment_channel_routing_no.nil? && @payment_channel_routing_no.to_s.length < 9
546
+ return false if !@payment_channel_country_code.nil? && @payment_channel_country_code.to_s.length > 9
547
+ return false if !@payment_channel_country_code.nil? && @payment_channel_country_code.to_s.length < 9
548
+ payment_channel_currency_validator = EnumAttributeValidator.new('String', ["USD", "GBP", "EUR"])
549
+ return false unless payment_channel_currency_validator.valid?(@payment_channel_currency)
550
+ return false if !@challenge_value.nil? && @challenge_value.to_s.length > 20
551
+ return false if !@challenge_value.nil? && @challenge_value.to_s.length < 3
552
+ return false if !@challenge_description.nil? && @challenge_description.to_s.length > 255
553
+ return false if !@challenge_description.nil? && @challenge_description.to_s.length < 1
554
+ payee_language_validator = EnumAttributeValidator.new('String', ["AR", "EN", "ES", "FR", "HE", "HI", "JA", "PT", "RU", "UR", "ZH"])
555
+ return false unless payee_language_validator.valid?(@payee_language)
556
+ true
557
+ end
558
+
559
+ # Custom attribute writer method with validation
560
+ # @param [Object] remote_id Value to be assigned
561
+ def remote_id=(remote_id)
562
+ if remote_id.nil?
563
+ fail ArgumentError, 'remote_id cannot be nil'
564
+ end
565
+
566
+ if remote_id.to_s.length > 100
567
+ fail ArgumentError, 'invalid value for "remote_id", the character length must be smaller than or equal to 100.'
568
+ end
569
+
570
+ if remote_id.to_s.length < 1
571
+ fail ArgumentError, 'invalid value for "remote_id", the character length must be great than or equal to 1.'
572
+ end
573
+
574
+ @remote_id = remote_id
575
+ end
576
+
577
+ # Custom attribute writer method with validation
578
+ # @param [Object] address_line1 Value to be assigned
579
+ def address_line1=(address_line1)
580
+ if address_line1.nil?
581
+ fail ArgumentError, 'address_line1 cannot be nil'
582
+ end
583
+
584
+ if address_line1.to_s.length > 255
585
+ fail ArgumentError, 'invalid value for "address_line1", the character length must be smaller than or equal to 255.'
586
+ end
587
+
588
+ if address_line1.to_s.length < 2
589
+ fail ArgumentError, 'invalid value for "address_line1", the character length must be great than or equal to 2.'
590
+ end
591
+
592
+ @address_line1 = address_line1
593
+ end
594
+
595
+ # Custom attribute writer method with validation
596
+ # @param [Object] address_line2 Value to be assigned
597
+ def address_line2=(address_line2)
598
+ if !address_line2.nil? && address_line2.to_s.length > 255
599
+ fail ArgumentError, 'invalid value for "address_line2", the character length must be smaller than or equal to 255.'
600
+ end
601
+
602
+ if !address_line2.nil? && address_line2.to_s.length < 0
603
+ fail ArgumentError, 'invalid value for "address_line2", the character length must be great than or equal to 0.'
604
+ end
605
+
606
+ @address_line2 = address_line2
607
+ end
608
+
609
+ # Custom attribute writer method with validation
610
+ # @param [Object] address_line3 Value to be assigned
611
+ def address_line3=(address_line3)
612
+ if !address_line3.nil? && address_line3.to_s.length > 255
613
+ fail ArgumentError, 'invalid value for "address_line3", the character length must be smaller than or equal to 255.'
614
+ end
615
+
616
+ if !address_line3.nil? && address_line3.to_s.length < 0
617
+ fail ArgumentError, 'invalid value for "address_line3", the character length must be great than or equal to 0.'
618
+ end
619
+
620
+ @address_line3 = address_line3
621
+ end
622
+
623
+ # Custom attribute writer method with validation
624
+ # @param [Object] address_line4 Value to be assigned
625
+ def address_line4=(address_line4)
626
+ if !address_line4.nil? && address_line4.to_s.length > 255
627
+ fail ArgumentError, 'invalid value for "address_line4", the character length must be smaller than or equal to 255.'
628
+ end
629
+
630
+ if !address_line4.nil? && address_line4.to_s.length < 0
631
+ fail ArgumentError, 'invalid value for "address_line4", the character length must be great than or equal to 0.'
632
+ end
633
+
634
+ @address_line4 = address_line4
635
+ end
636
+
637
+ # Custom attribute writer method with validation
638
+ # @param [Object] address_city Value to be assigned
639
+ def address_city=(address_city)
640
+ if address_city.nil?
641
+ fail ArgumentError, 'address_city cannot be nil'
642
+ end
643
+
644
+ if address_city.to_s.length > 100
645
+ fail ArgumentError, 'invalid value for "address_city", the character length must be smaller than or equal to 100.'
646
+ end
647
+
648
+ if address_city.to_s.length < 2
649
+ fail ArgumentError, 'invalid value for "address_city", the character length must be great than or equal to 2.'
650
+ end
651
+
652
+ @address_city = address_city
653
+ end
654
+
655
+ # Custom attribute writer method with validation
656
+ # @param [Object] address_county_or_province Value to be assigned
657
+ def address_county_or_province=(address_county_or_province)
658
+ if !address_county_or_province.nil? && address_county_or_province.to_s.length > 100
659
+ fail ArgumentError, 'invalid value for "address_county_or_province", the character length must be smaller than or equal to 100.'
660
+ end
661
+
662
+ if !address_county_or_province.nil? && address_county_or_province.to_s.length < 2
663
+ fail ArgumentError, 'invalid value for "address_county_or_province", the character length must be great than or equal to 2.'
664
+ end
665
+
666
+ @address_county_or_province = address_county_or_province
667
+ end
668
+
669
+ # Custom attribute writer method with validation
670
+ # @param [Object] address_zip_or_postcode Value to be assigned
671
+ def address_zip_or_postcode=(address_zip_or_postcode)
672
+ if address_zip_or_postcode.nil?
673
+ fail ArgumentError, 'address_zip_or_postcode cannot be nil'
674
+ end
675
+
676
+ if address_zip_or_postcode.to_s.length > 30
677
+ fail ArgumentError, 'invalid value for "address_zip_or_postcode", the character length must be smaller than or equal to 30.'
678
+ end
679
+
680
+ if address_zip_or_postcode.to_s.length < 2
681
+ fail ArgumentError, 'invalid value for "address_zip_or_postcode", the character length must be great than or equal to 2.'
682
+ end
683
+
684
+ @address_zip_or_postcode = address_zip_or_postcode
685
+ end
686
+
687
+ # Custom attribute writer method with validation
688
+ # @param [Object] address_country Value to be assigned
689
+ def address_country=(address_country)
690
+ if address_country.nil?
691
+ fail ArgumentError, 'address_country cannot be nil'
692
+ end
693
+
694
+ if address_country.to_s.length > 50
695
+ fail ArgumentError, 'invalid value for "address_country", the character length must be smaller than or equal to 50.'
696
+ end
697
+
698
+ if address_country.to_s.length < 2
699
+ fail ArgumentError, 'invalid value for "address_country", the character length must be great than or equal to 2.'
700
+ end
701
+
702
+ @address_country = address_country
703
+ end
704
+
705
+ # Custom attribute writer method with validation
706
+ # @param [Object] individual_title Value to be assigned
707
+ def individual_title=(individual_title)
708
+ if !individual_title.nil? && individual_title.to_s.length > 10
709
+ fail ArgumentError, 'invalid value for "individual_title", the character length must be smaller than or equal to 10.'
710
+ end
711
+
712
+ if !individual_title.nil? && individual_title.to_s.length < 1
713
+ fail ArgumentError, 'invalid value for "individual_title", the character length must be great than or equal to 1.'
714
+ end
715
+
716
+ @individual_title = individual_title
717
+ end
718
+
719
+ # Custom attribute writer method with validation
720
+ # @param [Object] individual_first_name Value to be assigned
721
+ def individual_first_name=(individual_first_name)
722
+ if !individual_first_name.nil? && individual_first_name.to_s.length > 40
723
+ fail ArgumentError, 'invalid value for "individual_first_name", the character length must be smaller than or equal to 40.'
724
+ end
725
+
726
+ if !individual_first_name.nil? && individual_first_name.to_s.length < 1
727
+ fail ArgumentError, 'invalid value for "individual_first_name", the character length must be great than or equal to 1.'
728
+ end
729
+
730
+ @individual_first_name = individual_first_name
731
+ end
732
+
733
+ # Custom attribute writer method with validation
734
+ # @param [Object] individual_other_names Value to be assigned
735
+ def individual_other_names=(individual_other_names)
736
+ if !individual_other_names.nil? && individual_other_names.to_s.length > 40
737
+ fail ArgumentError, 'invalid value for "individual_other_names", the character length must be smaller than or equal to 40.'
738
+ end
739
+
740
+ if !individual_other_names.nil? && individual_other_names.to_s.length < 1
741
+ fail ArgumentError, 'invalid value for "individual_other_names", the character length must be great than or equal to 1.'
742
+ end
743
+
744
+ @individual_other_names = individual_other_names
745
+ end
746
+
747
+ # Custom attribute writer method with validation
748
+ # @param [Object] individual_last_name Value to be assigned
749
+ def individual_last_name=(individual_last_name)
750
+ if !individual_last_name.nil? && individual_last_name.to_s.length > 40
751
+ fail ArgumentError, 'invalid value for "individual_last_name", the character length must be smaller than or equal to 40.'
752
+ end
753
+
754
+ if !individual_last_name.nil? && individual_last_name.to_s.length < 1
755
+ fail ArgumentError, 'invalid value for "individual_last_name", the character length must be great than or equal to 1.'
756
+ end
757
+
758
+ @individual_last_name = individual_last_name
759
+ end
760
+
761
+ # Custom attribute writer method with validation
762
+ # @param [Object] company_name Value to be assigned
763
+ def company_name=(company_name)
764
+ if !company_name.nil? && company_name.to_s.length > 40
765
+ fail ArgumentError, 'invalid value for "company_name", the character length must be smaller than or equal to 40.'
766
+ end
767
+
768
+ if !company_name.nil? && company_name.to_s.length < 1
769
+ fail ArgumentError, 'invalid value for "company_name", the character length must be great than or equal to 1.'
770
+ end
771
+
772
+ @company_name = company_name
773
+ end
774
+
775
+ # Custom attribute writer method with validation
776
+ # @param [Object] company_tax_id Value to be assigned
777
+ def company_tax_id=(company_tax_id)
778
+ pattern = Regexp.new(/[\\d]{9}/)
779
+ if !company_tax_id.nil? && company_tax_id !~ pattern
780
+ fail ArgumentError, "invalid value for \"company_tax_id\", must conform to the pattern #{pattern}."
781
+ end
782
+
783
+ @company_tax_id = company_tax_id
784
+ end
785
+
786
+ # Custom attribute writer method with validation
787
+ # @param [Object] payment_channel_iban Value to be assigned
788
+ def payment_channel_iban=(payment_channel_iban)
789
+ if !payment_channel_iban.nil? && payment_channel_iban.to_s.length > 34
790
+ fail ArgumentError, 'invalid value for "payment_channel_iban", the character length must be smaller than or equal to 34.'
791
+ end
792
+
793
+ if !payment_channel_iban.nil? && payment_channel_iban.to_s.length < 15
794
+ fail ArgumentError, 'invalid value for "payment_channel_iban", the character length must be great than or equal to 15.'
795
+ end
796
+
797
+ pattern = Regexp.new(/^[A-Za-z0-9]+$/)
798
+ if !payment_channel_iban.nil? && payment_channel_iban !~ pattern
799
+ fail ArgumentError, "invalid value for \"payment_channel_iban\", must conform to the pattern #{pattern}."
800
+ end
801
+
802
+ @payment_channel_iban = payment_channel_iban
803
+ end
804
+
805
+ # Custom attribute writer method with validation
806
+ # @param [Object] payment_channel_account_number Value to be assigned
807
+ def payment_channel_account_number=(payment_channel_account_number)
808
+ if !payment_channel_account_number.nil? && payment_channel_account_number.to_s.length > 17
809
+ fail ArgumentError, 'invalid value for "payment_channel_account_number", the character length must be smaller than or equal to 17.'
810
+ end
811
+
812
+ if !payment_channel_account_number.nil? && payment_channel_account_number.to_s.length < 6
813
+ fail ArgumentError, 'invalid value for "payment_channel_account_number", the character length must be great than or equal to 6.'
814
+ end
815
+
816
+ @payment_channel_account_number = payment_channel_account_number
817
+ end
818
+
819
+ # Custom attribute writer method with validation
820
+ # @param [Object] payment_channel_routing_no Value to be assigned
821
+ def payment_channel_routing_no=(payment_channel_routing_no)
822
+ if !payment_channel_routing_no.nil? && payment_channel_routing_no.to_s.length > 9
823
+ fail ArgumentError, 'invalid value for "payment_channel_routing_no", the character length must be smaller than or equal to 9.'
824
+ end
825
+
826
+ if !payment_channel_routing_no.nil? && payment_channel_routing_no.to_s.length < 9
827
+ fail ArgumentError, 'invalid value for "payment_channel_routing_no", the character length must be great than or equal to 9.'
828
+ end
829
+
830
+ @payment_channel_routing_no = payment_channel_routing_no
831
+ end
832
+
833
+ # Custom attribute writer method with validation
834
+ # @param [Object] payment_channel_country_code Value to be assigned
835
+ def payment_channel_country_code=(payment_channel_country_code)
836
+ if !payment_channel_country_code.nil? && payment_channel_country_code.to_s.length > 9
837
+ fail ArgumentError, 'invalid value for "payment_channel_country_code", the character length must be smaller than or equal to 9.'
838
+ end
839
+
840
+ if !payment_channel_country_code.nil? && payment_channel_country_code.to_s.length < 9
841
+ fail ArgumentError, 'invalid value for "payment_channel_country_code", the character length must be great than or equal to 9.'
842
+ end
843
+
844
+ @payment_channel_country_code = payment_channel_country_code
845
+ end
846
+
847
+ # Custom attribute writer method checking allowed values (enum).
848
+ # @param [Object] payment_channel_currency Object to be assigned
849
+ def payment_channel_currency=(payment_channel_currency)
850
+ validator = EnumAttributeValidator.new('String', ["USD", "GBP", "EUR"])
851
+ unless validator.valid?(payment_channel_currency)
852
+ fail ArgumentError, "invalid value for \"payment_channel_currency\", must be one of #{validator.allowable_values}."
853
+ end
854
+ @payment_channel_currency = payment_channel_currency
855
+ end
856
+
857
+ # Custom attribute writer method with validation
858
+ # @param [Object] challenge_value Value to be assigned
859
+ def challenge_value=(challenge_value)
860
+ if !challenge_value.nil? && challenge_value.to_s.length > 20
861
+ fail ArgumentError, 'invalid value for "challenge_value", the character length must be smaller than or equal to 20.'
862
+ end
863
+
864
+ if !challenge_value.nil? && challenge_value.to_s.length < 3
865
+ fail ArgumentError, 'invalid value for "challenge_value", the character length must be great than or equal to 3.'
866
+ end
867
+
868
+ @challenge_value = challenge_value
869
+ end
870
+
871
+ # Custom attribute writer method with validation
872
+ # @param [Object] challenge_description Value to be assigned
873
+ def challenge_description=(challenge_description)
874
+ if !challenge_description.nil? && challenge_description.to_s.length > 255
875
+ fail ArgumentError, 'invalid value for "challenge_description", the character length must be smaller than or equal to 255.'
876
+ end
877
+
878
+ if !challenge_description.nil? && challenge_description.to_s.length < 1
879
+ fail ArgumentError, 'invalid value for "challenge_description", the character length must be great than or equal to 1.'
880
+ end
881
+
882
+ @challenge_description = challenge_description
883
+ end
884
+
885
+ # Custom attribute writer method checking allowed values (enum).
886
+ # @param [Object] payee_language Object to be assigned
887
+ def payee_language=(payee_language)
888
+ validator = EnumAttributeValidator.new('String', ["AR", "EN", "ES", "FR", "HE", "HI", "JA", "PT", "RU", "UR", "ZH"])
889
+ unless validator.valid?(payee_language)
890
+ fail ArgumentError, "invalid value for \"payee_language\", must be one of #{validator.allowable_values}."
891
+ end
892
+ @payee_language = payee_language
893
+ end
894
+
895
+ # Checks equality by comparing each attribute.
896
+ # @param [Object] Object to be compared
897
+ def ==(o)
898
+ return true if self.equal?(o)
899
+ self.class == o.class &&
900
+ type == o.type &&
901
+ remote_id == o.remote_id &&
902
+ email == o.email &&
903
+ address_line1 == o.address_line1 &&
904
+ address_line2 == o.address_line2 &&
905
+ address_line3 == o.address_line3 &&
906
+ address_line4 == o.address_line4 &&
907
+ address_city == o.address_city &&
908
+ address_county_or_province == o.address_county_or_province &&
909
+ address_zip_or_postcode == o.address_zip_or_postcode &&
910
+ address_country == o.address_country &&
911
+ individual_title == o.individual_title &&
912
+ individual_first_name == o.individual_first_name &&
913
+ individual_other_names == o.individual_other_names &&
914
+ individual_last_name == o.individual_last_name &&
915
+ individual_national_identification == o.individual_national_identification &&
916
+ individual_date_of_birth == o.individual_date_of_birth &&
917
+ company_name == o.company_name &&
918
+ company_tax_id == o.company_tax_id &&
919
+ payment_channel_iban == o.payment_channel_iban &&
920
+ payment_channel_account_number == o.payment_channel_account_number &&
921
+ payment_channel_routing_no == o.payment_channel_routing_no &&
922
+ payment_channel_country_code == o.payment_channel_country_code &&
923
+ payment_channel_currency == o.payment_channel_currency &&
924
+ payment_channel_account_name == o.payment_channel_account_name &&
925
+ challenge_value == o.challenge_value &&
926
+ challenge_description == o.challenge_description &&
927
+ payee_language == o.payee_language
928
+ end
929
+
930
+ # @see the `==` method
931
+ # @param [Object] Object to be compared
932
+ def eql?(o)
933
+ self == o
934
+ end
935
+
936
+ # Calculates hash code according to all attributes.
937
+ # @return [Integer] Hash code
938
+ def hash
939
+ [type, remote_id, email, address_line1, address_line2, address_line3, address_line4, address_city, address_county_or_province, address_zip_or_postcode, address_country, individual_title, individual_first_name, individual_other_names, individual_last_name, individual_national_identification, individual_date_of_birth, company_name, company_tax_id, payment_channel_iban, payment_channel_account_number, payment_channel_routing_no, payment_channel_country_code, payment_channel_currency, payment_channel_account_name, challenge_value, challenge_description, payee_language].hash
940
+ end
941
+
942
+ # Builds the object from hash
943
+ # @param [Hash] attributes Model attributes in the form of hash
944
+ # @return [Object] Returns the model itself
945
+ def self.build_from_hash(attributes)
946
+ new.build_from_hash(attributes)
947
+ end
948
+
949
+ # Builds the object from hash
950
+ # @param [Hash] attributes Model attributes in the form of hash
951
+ # @return [Object] Returns the model itself
952
+ def build_from_hash(attributes)
953
+ return nil unless attributes.is_a?(Hash)
954
+ self.class.openapi_types.each_pair do |key, type|
955
+ if type =~ /\AArray<(.*)>/i
956
+ # check to ensure the input is an array given that the attribute
957
+ # is documented as an array but the input is not
958
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
959
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
960
+ end
961
+ elsif !attributes[self.class.attribute_map[key]].nil?
962
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
963
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
964
+ end
965
+
966
+ self
967
+ end
968
+
969
+ # Deserializes the data based on type
970
+ # @param string type Data type
971
+ # @param string value Value to be deserialized
972
+ # @return [Object] Deserialized data
973
+ def _deserialize(type, value)
974
+ case type.to_sym
975
+ when :DateTime
976
+ DateTime.parse(value)
977
+ when :Date
978
+ Date.parse(value)
979
+ when :String
980
+ value.to_s
981
+ when :Integer
982
+ value.to_i
983
+ when :Float
984
+ value.to_f
985
+ when :Boolean
986
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
987
+ true
988
+ else
989
+ false
990
+ end
991
+ when :Object
992
+ # generic object (usually a Hash), return directly
993
+ value
994
+ when /\AArray<(?<inner_type>.+)>\z/
995
+ inner_type = Regexp.last_match[:inner_type]
996
+ value.map { |v| _deserialize(inner_type, v) }
997
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
998
+ k_type = Regexp.last_match[:k_type]
999
+ v_type = Regexp.last_match[:v_type]
1000
+ {}.tap do |hash|
1001
+ value.each do |k, v|
1002
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1003
+ end
1004
+ end
1005
+ else # model
1006
+ VeloPayments.const_get(type).build_from_hash(value)
1007
+ end
1008
+ end
1009
+
1010
+ # Returns the string representation of the object
1011
+ # @return [String] String presentation of the object
1012
+ def to_s
1013
+ to_hash.to_s
1014
+ end
1015
+
1016
+ # to_body is an alias to to_hash (backward compatibility)
1017
+ # @return [Hash] Returns the object in the form of hash
1018
+ def to_body
1019
+ to_hash
1020
+ end
1021
+
1022
+ # Returns the object in the form of hash
1023
+ # @return [Hash] Returns the object in the form of hash
1024
+ def to_hash
1025
+ hash = {}
1026
+ self.class.attribute_map.each_pair do |attr, param|
1027
+ value = self.send(attr)
1028
+ next if value.nil?
1029
+ hash[param] = _to_hash(value)
1030
+ end
1031
+ hash
1032
+ end
1033
+
1034
+ # Outputs non-array value in the form of hash
1035
+ # For object, use to_hash. Otherwise, just return the value
1036
+ # @param [Object] value Any valid value
1037
+ # @return [Hash] Returns the value in the form of hash
1038
+ def _to_hash(value)
1039
+ if value.is_a?(Array)
1040
+ value.compact.map { |v| _to_hash(v) }
1041
+ elsif value.is_a?(Hash)
1042
+ {}.tap do |hash|
1043
+ value.each { |k, v| hash[k] = _to_hash(v) }
1044
+ end
1045
+ elsif value.respond_to? :to_hash
1046
+ value.to_hash
1047
+ else
1048
+ value
1049
+ end
1050
+ end
1051
+ end
1052
+ end