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,215 @@
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 GetPayoutStatistics
17
+ attr_accessor :this_month_payouts_count
18
+
19
+ attr_accessor :this_month_failed_payments_count
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'this_month_payouts_count' => :'thisMonthPayoutsCount',
25
+ :'this_month_failed_payments_count' => :'thisMonthFailedPaymentsCount'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'this_month_payouts_count' => :'Integer',
33
+ :'this_month_failed_payments_count' => :'Integer'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeloPayments::GetPayoutStatistics` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeloPayments::GetPayoutStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'this_month_payouts_count')
53
+ self.this_month_payouts_count = attributes[:'this_month_payouts_count']
54
+ end
55
+
56
+ if attributes.key?(:'this_month_failed_payments_count')
57
+ self.this_month_failed_payments_count = attributes[:'this_month_failed_payments_count']
58
+ end
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properties with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+ if @this_month_payouts_count.nil?
66
+ invalid_properties.push('invalid value for "this_month_payouts_count", this_month_payouts_count cannot be nil.')
67
+ end
68
+
69
+ if @this_month_failed_payments_count.nil?
70
+ invalid_properties.push('invalid value for "this_month_failed_payments_count", this_month_failed_payments_count cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @this_month_payouts_count.nil?
80
+ return false if @this_month_failed_payments_count.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ this_month_payouts_count == o.this_month_payouts_count &&
90
+ this_month_failed_payments_count == o.this_month_failed_payments_count
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Integer] Hash code
101
+ def hash
102
+ [this_month_payouts_count, this_month_failed_payments_count].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def self.build_from_hash(attributes)
109
+ new.build_from_hash(attributes)
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.openapi_types.each_pair do |key, type|
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :DateTime
139
+ DateTime.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ VeloPayments.const_get(type).build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ next if value.nil?
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,228 @@
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
+ # List Payouts Response
17
+ class GetPayoutsResponse
18
+ attr_accessor :summary
19
+
20
+ attr_accessor :page
21
+
22
+ attr_accessor :links
23
+
24
+ attr_accessor :content
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'summary' => :'summary',
30
+ :'page' => :'page',
31
+ :'links' => :'links',
32
+ :'content' => :'content'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'summary' => :'GetPaymentsForPayoutResponseSummary',
40
+ :'page' => :'GetPaymentsForPayoutResponsePage',
41
+ :'links' => :'Array<GetPaymentsForPayoutResponseLinks>',
42
+ :'content' => :'Array<PayoutSummaryAudit>'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeloPayments::GetPayoutsResponse` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeloPayments::GetPayoutsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'summary')
62
+ self.summary = attributes[:'summary']
63
+ end
64
+
65
+ if attributes.key?(:'page')
66
+ self.page = attributes[:'page']
67
+ end
68
+
69
+ if attributes.key?(:'links')
70
+ if (value = attributes[:'links']).is_a?(Array)
71
+ self.links = value
72
+ end
73
+ end
74
+
75
+ if attributes.key?(:'content')
76
+ if (value = attributes[:'content']).is_a?(Array)
77
+ self.content = value
78
+ end
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ summary == o.summary &&
101
+ page == o.page &&
102
+ links == o.links &&
103
+ content == o.content
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [summary, page, links, content].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ DateTime.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ VeloPayments.const_get(type).build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ next if value.nil?
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end
@@ -0,0 +1,224 @@
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 Individual
17
+ attr_accessor :name
18
+
19
+ attr_accessor :national_identification
20
+
21
+ attr_accessor :date_of_birth
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name' => :'name',
27
+ :'national_identification' => :'nationalIdentification',
28
+ :'date_of_birth' => :'dateOfBirth'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'name' => :'IndividualName',
36
+ :'national_identification' => :'OneOfstringstring',
37
+ :'date_of_birth' => :'OneOfdatestring'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VeloPayments::Individual` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VeloPayments::Individual`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'name')
57
+ self.name = attributes[:'name']
58
+ end
59
+
60
+ if attributes.key?(:'national_identification')
61
+ self.national_identification = attributes[:'national_identification']
62
+ end
63
+
64
+ if attributes.key?(:'date_of_birth')
65
+ self.date_of_birth = attributes[:'date_of_birth']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @name.nil?
74
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
75
+ end
76
+
77
+ if @date_of_birth.nil?
78
+ invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @name.nil?
88
+ return false if @date_of_birth.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ name == o.name &&
98
+ national_identification == o.national_identification &&
99
+ date_of_birth == o.date_of_birth
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [name, national_identification, date_of_birth].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ new.build_from_hash(attributes)
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ VeloPayments.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ next if value.nil?
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end