yapstone-so 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (421) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +79 -0
  4. data/README.md +260 -0
  5. data/Rakefile +10 -0
  6. data/docs/AbstractEntity.md +17 -0
  7. data/docs/ActionResource.md +25 -0
  8. data/docs/ActionStatusResource.md +21 -0
  9. data/docs/AddressResource.md +31 -0
  10. data/docs/ApplicantConsentRequest.md +25 -0
  11. data/docs/ApplicantConsentResource.md +27 -0
  12. data/docs/ApplicantConsentType.md +16 -0
  13. data/docs/ApplicantResource.md +39 -0
  14. data/docs/AssetRequest.md +25 -0
  15. data/docs/AssetRequestAllOf.md +17 -0
  16. data/docs/AssetRequestCommon.md +23 -0
  17. data/docs/AssetResource.md +29 -0
  18. data/docs/AssetResourceAllOf.md +19 -0
  19. data/docs/AssetUpdateRequest.md +27 -0
  20. data/docs/AssetUpdateRequestAllOf.md +19 -0
  21. data/docs/AssetsApi.md +276 -0
  22. data/docs/AssetsResource.md +19 -0
  23. data/docs/AssetsResourceAllOf.md +17 -0
  24. data/docs/AuthenticationApi.md +58 -0
  25. data/docs/BankAccountDataResource.md +23 -0
  26. data/docs/BankAccountResource.md +25 -0
  27. data/docs/BeneficialOwnerRequest.md +27 -0
  28. data/docs/BeneficialOwnerResource.md +31 -0
  29. data/docs/BeneficialOwnersPatch.md +21 -0
  30. data/docs/BusinessApplicantAdminFieldsResource.md +17 -0
  31. data/docs/BusinessApplicantAdminResource.md +49 -0
  32. data/docs/BusinessApplicantRequest.md +39 -0
  33. data/docs/BusinessApplicantResource.md +23 -0
  34. data/docs/BusinessApplicantResourceAllOf.md +23 -0
  35. data/docs/BusinessApplicantUpdateRequest.md +41 -0
  36. data/docs/BusinessApplicantsApi.md +276 -0
  37. data/docs/BusinessApplicantsResource.md +19 -0
  38. data/docs/BusinessApplicantsResourceAllOf.md +17 -0
  39. data/docs/BusinessIdType.md +16 -0
  40. data/docs/BusinessIdentificationResource.md +25 -0
  41. data/docs/BusinessOwnerResource.md +17 -0
  42. data/docs/BusinessProfileResource.md +33 -0
  43. data/docs/BusinessUpdateIdentificationResource.md +25 -0
  44. data/docs/CapabilityResource.md +19 -0
  45. data/docs/CardDataResource.md +35 -0
  46. data/docs/Consent.md +25 -0
  47. data/docs/ConsentRequest.md +25 -0
  48. data/docs/ConsentResource.md +27 -0
  49. data/docs/ConsentType.md +16 -0
  50. data/docs/ContractCreateRequest.md +21 -0
  51. data/docs/ContractResource.md +23 -0
  52. data/docs/ContractResourceDTO.md +17 -0
  53. data/docs/ContractResourceDTOAllOf.md +17 -0
  54. data/docs/ContractUpdateRequest.md +19 -0
  55. data/docs/ContractsApi.md +227 -0
  56. data/docs/CustomerHistoryResource.md +19 -0
  57. data/docs/DeactivateRequest.md +19 -0
  58. data/docs/DeactivateResponse.md +21 -0
  59. data/docs/DirectDebitConsentResource.md +19 -0
  60. data/docs/DirectDebitFrequencyType.md +16 -0
  61. data/docs/DirectDebitSchemeType.md +16 -0
  62. data/docs/DirectDebtCapabilityResource.md +23 -0
  63. data/docs/EntitiesResource.md +17 -0
  64. data/docs/EntityHistoryResource.md +17 -0
  65. data/docs/EntityProductStatusResource.md +19 -0
  66. data/docs/EntityUpdateEvent.md +23 -0
  67. data/docs/EntityUpdatedAttribute.md +21 -0
  68. data/docs/Errors.md +19 -0
  69. data/docs/ExpirationDateResource.md +19 -0
  70. data/docs/Gender.md +16 -0
  71. data/docs/GovIdentificationResource.md +29 -0
  72. data/docs/GovIdentificationUpdateResource.md +29 -0
  73. data/docs/GovernmentIdType.md +16 -0
  74. data/docs/IndividualApplicantAdminFieldsResource.md +17 -0
  75. data/docs/IndividualApplicantAdminResource.md +43 -0
  76. data/docs/IndividualApplicantRequest.md +33 -0
  77. data/docs/IndividualApplicantResource.md +17 -0
  78. data/docs/IndividualApplicantUpdateRequest.md +35 -0
  79. data/docs/IndividualApplicantsApi.md +276 -0
  80. data/docs/IndividualApplicantsResource.md +19 -0
  81. data/docs/IndividualApplicantsResourceAllOf.md +17 -0
  82. data/docs/IndividualOwnerResource.md +19 -0
  83. data/docs/InlineResponse200.md +25 -0
  84. data/docs/InstrumentsApi.md +274 -0
  85. data/docs/IssuerScope.md +16 -0
  86. data/docs/MarketPlaceApplicantResource.md +17 -0
  87. data/docs/MarketPlacePropertyResource.md +27 -0
  88. data/docs/MarketplaceProductAdd.md +27 -0
  89. data/docs/MarketplaceProductBasic.md +23 -0
  90. data/docs/MarketplaceProductExtra.md +33 -0
  91. data/docs/MarketplaceProductExtraAllOf.md +25 -0
  92. data/docs/MarketplaceProductPayoutInstrumentResource.md +19 -0
  93. data/docs/MarketplaceProductPayoutInstrumentUpdate.md +21 -0
  94. data/docs/MarketplaceProductResource.md +39 -0
  95. data/docs/MarketplaceProductSubResource.md +37 -0
  96. data/docs/MarketplaceProductUpdate.md +37 -0
  97. data/docs/MarketplaceProductsApi.md +116 -0
  98. data/docs/MarketplacesApi.md +227 -0
  99. data/docs/Meta.md +21 -0
  100. data/docs/MoneyResource.md +19 -0
  101. data/docs/NameResource.md +27 -0
  102. data/docs/OwnerRequest.md +21 -0
  103. data/docs/OwnerResource.md +23 -0
  104. data/docs/Pagination.md +21 -0
  105. data/docs/PatchOperation.md +16 -0
  106. data/docs/PayoutInstrumentRequest.md +29 -0
  107. data/docs/PayoutInstrumentResource.md +35 -0
  108. data/docs/PayoutInstrumentResourceCommonEntities.md +23 -0
  109. data/docs/PayoutInstrumentUpdateRequest.md +31 -0
  110. data/docs/PayoutInstrumentsApi.md +274 -0
  111. data/docs/PayoutInstrumentsResource.md +19 -0
  112. data/docs/PayoutInstrumentsResourceAllOf.md +17 -0
  113. data/docs/PayoutProductAdd.md +19 -0
  114. data/docs/PayoutProductResource.md +27 -0
  115. data/docs/PayoutProductSubResource.md +25 -0
  116. data/docs/PayoutProductSubResourceAllOf.md +23 -0
  117. data/docs/PayoutProductsApi.md +61 -0
  118. data/docs/PayoutsApi.md +227 -0
  119. data/docs/PhoneResource.md +19 -0
  120. data/docs/PriceSettingResource.md +29 -0
  121. data/docs/PrimaryContactResource.md +35 -0
  122. data/docs/Product.md +16 -0
  123. data/docs/ProductRead.md +17 -0
  124. data/docs/ProductWrite.md +17 -0
  125. data/docs/ProfileResource.md +35 -0
  126. data/docs/PropertyHistoryResource.md +27 -0
  127. data/docs/PropertyInfoResource.md +23 -0
  128. data/docs/PropertyOwnerResource.md +31 -0
  129. data/docs/PropertyResource.md +27 -0
  130. data/docs/PropertyTrackerResource.md +23 -0
  131. data/docs/RegistrationResource.md +21 -0
  132. data/docs/ReservationSettingResource.md +19 -0
  133. data/docs/Resource.md +17 -0
  134. data/docs/SocialNetworkResource.md +19 -0
  135. data/docs/StatusReasonResource.md +23 -0
  136. data/docs/StatusRequest.md +17 -0
  137. data/docs/StatusResource.md +21 -0
  138. data/docs/StaySettingResource.md +19 -0
  139. data/docs/SuspensionReasonResource.md +17 -0
  140. data/docs/TravelerResource.md +23 -0
  141. data/git_push.sh +55 -0
  142. data/lib/yapstone-so/api/assets_api.rb +335 -0
  143. data/lib/yapstone-so/api/authentication_api.rb +92 -0
  144. data/lib/yapstone-so/api/business_applicants_api.rb +339 -0
  145. data/lib/yapstone-so/api/contracts_api.rb +284 -0
  146. data/lib/yapstone-so/api/individual_applicants_api.rb +339 -0
  147. data/lib/yapstone-so/api/instruments_api.rb +332 -0
  148. data/lib/yapstone-so/api/marketplace_products_api.rb +154 -0
  149. data/lib/yapstone-so/api/marketplaces_api.rb +304 -0
  150. data/lib/yapstone-so/api/payout_instruments_api.rb +332 -0
  151. data/lib/yapstone-so/api/payout_products_api.rb +84 -0
  152. data/lib/yapstone-so/api/payouts_api.rb +304 -0
  153. data/lib/yapstone-so/api_client.rb +386 -0
  154. data/lib/yapstone-so/api_error.rb +57 -0
  155. data/lib/yapstone-so/configuration.rb +249 -0
  156. data/lib/yapstone-so/models/abstract_entity.rb +232 -0
  157. data/lib/yapstone-so/models/action_resource.rb +238 -0
  158. data/lib/yapstone-so/models/action_status_resource.rb +260 -0
  159. data/lib/yapstone-so/models/address_resource.rb +444 -0
  160. data/lib/yapstone-so/models/applicant_consent_request.rb +317 -0
  161. data/lib/yapstone-so/models/applicant_consent_resource.rb +271 -0
  162. data/lib/yapstone-so/models/applicant_consent_type.rb +39 -0
  163. data/lib/yapstone-so/models/applicant_resource.rb +391 -0
  164. data/lib/yapstone-so/models/asset_request.rb +325 -0
  165. data/lib/yapstone-so/models/asset_request_all_of.rb +199 -0
  166. data/lib/yapstone-so/models/asset_request_common.rb +305 -0
  167. data/lib/yapstone-so/models/asset_resource.rb +344 -0
  168. data/lib/yapstone-so/models/asset_resource_all_of.rb +206 -0
  169. data/lib/yapstone-so/models/asset_update_request.rb +334 -0
  170. data/lib/yapstone-so/models/asset_update_request_all_of.rb +208 -0
  171. data/lib/yapstone-so/models/assets_resource.rb +225 -0
  172. data/lib/yapstone-so/models/assets_resource_all_of.rb +204 -0
  173. data/lib/yapstone-so/models/bank_account_data_resource.rb +228 -0
  174. data/lib/yapstone-so/models/bank_account_resource.rb +334 -0
  175. data/lib/yapstone-so/models/beneficial_owner_request.rb +293 -0
  176. data/lib/yapstone-so/models/beneficial_owner_resource.rb +312 -0
  177. data/lib/yapstone-so/models/beneficial_owners_patch.rb +221 -0
  178. data/lib/yapstone-so/models/business_applicant_admin_fields_resource.rb +198 -0
  179. data/lib/yapstone-so/models/business_applicant_admin_resource.rb +442 -0
  180. data/lib/yapstone-so/models/business_applicant_request.rb +375 -0
  181. data/lib/yapstone-so/models/business_applicant_resource.rb +239 -0
  182. data/lib/yapstone-so/models/business_applicant_resource_all_of.rb +226 -0
  183. data/lib/yapstone-so/models/business_applicant_update_request.rb +360 -0
  184. data/lib/yapstone-so/models/business_applicants_resource.rb +225 -0
  185. data/lib/yapstone-so/models/business_applicants_resource_all_of.rb +204 -0
  186. data/lib/yapstone-so/models/business_id_type.rb +37 -0
  187. data/lib/yapstone-so/models/business_identification_resource.rb +267 -0
  188. data/lib/yapstone-so/models/business_owner_resource.rb +231 -0
  189. data/lib/yapstone-so/models/business_profile_resource.rb +416 -0
  190. data/lib/yapstone-so/models/business_update_identification_resource.rb +253 -0
  191. data/lib/yapstone-so/models/capability_resource.rb +249 -0
  192. data/lib/yapstone-so/models/card_data_resource.rb +382 -0
  193. data/lib/yapstone-so/models/consent.rb +329 -0
  194. data/lib/yapstone-so/models/consent_request.rb +318 -0
  195. data/lib/yapstone-so/models/consent_resource.rb +272 -0
  196. data/lib/yapstone-so/models/consent_type.rb +36 -0
  197. data/lib/yapstone-so/models/contract_create_request.rb +260 -0
  198. data/lib/yapstone-so/models/contract_resource.rb +270 -0
  199. data/lib/yapstone-so/models/contract_resource_dto.rb +205 -0
  200. data/lib/yapstone-so/models/contract_resource_dto_all_of.rb +198 -0
  201. data/lib/yapstone-so/models/contract_update_request.rb +250 -0
  202. data/lib/yapstone-so/models/customer_history_resource.rb +206 -0
  203. data/lib/yapstone-so/models/deactivate_request.rb +228 -0
  204. data/lib/yapstone-so/models/deactivate_response.rb +221 -0
  205. data/lib/yapstone-so/models/direct_debit_consent_resource.rb +252 -0
  206. data/lib/yapstone-so/models/direct_debit_frequency_type.rb +36 -0
  207. data/lib/yapstone-so/models/direct_debit_scheme_type.rb +37 -0
  208. data/lib/yapstone-so/models/direct_debt_capability_resource.rb +283 -0
  209. data/lib/yapstone-so/models/entities_resource.rb +202 -0
  210. data/lib/yapstone-so/models/entity_history_resource.rb +200 -0
  211. data/lib/yapstone-so/models/entity_product_status_resource.rb +206 -0
  212. data/lib/yapstone-so/models/entity_update_event.rb +230 -0
  213. data/lib/yapstone-so/models/entity_updated_attribute.rb +218 -0
  214. data/lib/yapstone-so/models/errors.rb +205 -0
  215. data/lib/yapstone-so/models/expiration_date_resource.rb +238 -0
  216. data/lib/yapstone-so/models/gender.rb +37 -0
  217. data/lib/yapstone-so/models/gov_identification_resource.rb +336 -0
  218. data/lib/yapstone-so/models/gov_identification_update_resource.rb +322 -0
  219. data/lib/yapstone-so/models/government_id_type.rb +43 -0
  220. data/lib/yapstone-so/models/individual_applicant_admin_fields_resource.rb +198 -0
  221. data/lib/yapstone-so/models/individual_applicant_admin_resource.rb +411 -0
  222. data/lib/yapstone-so/models/individual_applicant_request.rb +345 -0
  223. data/lib/yapstone-so/models/individual_applicant_resource.rb +207 -0
  224. data/lib/yapstone-so/models/individual_applicant_update_request.rb +330 -0
  225. data/lib/yapstone-so/models/individual_applicants_resource.rb +225 -0
  226. data/lib/yapstone-so/models/individual_applicants_resource_all_of.rb +204 -0
  227. data/lib/yapstone-so/models/individual_owner_resource.rb +296 -0
  228. data/lib/yapstone-so/models/inline_response200.rb +232 -0
  229. data/lib/yapstone-so/models/issuer_scope.rb +39 -0
  230. data/lib/yapstone-so/models/market_place_applicant_resource.rb +197 -0
  231. data/lib/yapstone-so/models/market_place_property_resource.rb +261 -0
  232. data/lib/yapstone-so/models/marketplace_product_add.rb +293 -0
  233. data/lib/yapstone-so/models/marketplace_product_basic.rb +261 -0
  234. data/lib/yapstone-so/models/marketplace_product_extra.rb +328 -0
  235. data/lib/yapstone-so/models/marketplace_product_extra_all_of.rb +268 -0
  236. data/lib/yapstone-so/models/marketplace_product_payout_instrument_resource.rb +217 -0
  237. data/lib/yapstone-so/models/marketplace_product_payout_instrument_update.rb +233 -0
  238. data/lib/yapstone-so/models/marketplace_product_resource.rb +363 -0
  239. data/lib/yapstone-so/models/marketplace_product_sub_resource.rb +353 -0
  240. data/lib/yapstone-so/models/marketplace_product_update.rb +352 -0
  241. data/lib/yapstone-so/models/meta.rb +231 -0
  242. data/lib/yapstone-so/models/money_resource.rb +218 -0
  243. data/lib/yapstone-so/models/name_resource.rb +444 -0
  244. data/lib/yapstone-so/models/owner_request.rb +305 -0
  245. data/lib/yapstone-so/models/owner_resource.rb +315 -0
  246. data/lib/yapstone-so/models/pagination.rb +224 -0
  247. data/lib/yapstone-so/models/patch_operation.rb +37 -0
  248. data/lib/yapstone-so/models/payout_instrument_request.rb +340 -0
  249. data/lib/yapstone-so/models/payout_instrument_resource.rb +371 -0
  250. data/lib/yapstone-so/models/payout_instrument_resource_common_entities.rb +300 -0
  251. data/lib/yapstone-so/models/payout_instrument_update_request.rb +349 -0
  252. data/lib/yapstone-so/models/payout_instruments_resource.rb +225 -0
  253. data/lib/yapstone-so/models/payout_instruments_resource_all_of.rb +204 -0
  254. data/lib/yapstone-so/models/payout_product_add.rb +217 -0
  255. data/lib/yapstone-so/models/payout_product_resource.rb +255 -0
  256. data/lib/yapstone-so/models/payout_product_sub_resource.rb +245 -0
  257. data/lib/yapstone-so/models/payout_product_sub_resource_all_of.rb +224 -0
  258. data/lib/yapstone-so/models/phone_resource.rb +228 -0
  259. data/lib/yapstone-so/models/price_setting_resource.rb +301 -0
  260. data/lib/yapstone-so/models/primary_contact_resource.rb +417 -0
  261. data/lib/yapstone-so/models/product.rb +36 -0
  262. data/lib/yapstone-so/models/product_read.rb +199 -0
  263. data/lib/yapstone-so/models/product_write.rb +199 -0
  264. data/lib/yapstone-so/models/profile_resource.rb +422 -0
  265. data/lib/yapstone-so/models/property_history_resource.rb +245 -0
  266. data/lib/yapstone-so/models/property_info_resource.rb +229 -0
  267. data/lib/yapstone-so/models/property_owner_resource.rb +341 -0
  268. data/lib/yapstone-so/models/property_resource.rb +315 -0
  269. data/lib/yapstone-so/models/property_tracker_resource.rb +228 -0
  270. data/lib/yapstone-so/models/registration_resource.rb +253 -0
  271. data/lib/yapstone-so/models/reservation_setting_resource.rb +206 -0
  272. data/lib/yapstone-so/models/resource.rb +198 -0
  273. data/lib/yapstone-so/models/social_network_resource.rb +291 -0
  274. data/lib/yapstone-so/models/status_reason_resource.rb +267 -0
  275. data/lib/yapstone-so/models/status_request.rb +232 -0
  276. data/lib/yapstone-so/models/status_resource.rb +259 -0
  277. data/lib/yapstone-so/models/stay_setting_resource.rb +208 -0
  278. data/lib/yapstone-so/models/suspension_reason_resource.rb +198 -0
  279. data/lib/yapstone-so/models/traveler_resource.rb +278 -0
  280. data/lib/yapstone-so/version.rb +15 -0
  281. data/lib/yapstone-so.rb +174 -0
  282. data/spec/api/assets_api_spec.rb +93 -0
  283. data/spec/api/authentication_api_spec.rb +48 -0
  284. data/spec/api/business_applicants_api_spec.rb +93 -0
  285. data/spec/api/contracts_api_spec.rb +84 -0
  286. data/spec/api/individual_applicants_api_spec.rb +93 -0
  287. data/spec/api/instruments_api_spec.rb +92 -0
  288. data/spec/api/marketplace_products_api_spec.rb +60 -0
  289. data/spec/api/marketplaces_api_spec.rb +85 -0
  290. data/spec/api/payout_instruments_api_spec.rb +92 -0
  291. data/spec/api/payout_products_api_spec.rb +47 -0
  292. data/spec/api/payouts_api_spec.rb +85 -0
  293. data/spec/api_client_spec.rb +226 -0
  294. data/spec/configuration_spec.rb +42 -0
  295. data/spec/models/abstract_entity_spec.rb +41 -0
  296. data/spec/models/action_resource_spec.rb +65 -0
  297. data/spec/models/action_status_resource_spec.rb +57 -0
  298. data/spec/models/address_resource_spec.rb +83 -0
  299. data/spec/models/applicant_consent_request_spec.rb +65 -0
  300. data/spec/models/applicant_consent_resource_spec.rb +71 -0
  301. data/spec/models/applicant_consent_type_spec.rb +35 -0
  302. data/spec/models/applicant_resource_spec.rb +107 -0
  303. data/spec/models/asset_request_all_of_spec.rb +41 -0
  304. data/spec/models/asset_request_common_spec.rb +63 -0
  305. data/spec/models/asset_request_spec.rb +69 -0
  306. data/spec/models/asset_resource_all_of_spec.rb +47 -0
  307. data/spec/models/asset_resource_spec.rb +81 -0
  308. data/spec/models/asset_update_request_all_of_spec.rb +47 -0
  309. data/spec/models/asset_update_request_spec.rb +75 -0
  310. data/spec/models/assets_resource_all_of_spec.rb +41 -0
  311. data/spec/models/assets_resource_spec.rb +47 -0
  312. data/spec/models/bank_account_data_resource_spec.rb +59 -0
  313. data/spec/models/bank_account_resource_spec.rb +69 -0
  314. data/spec/models/beneficial_owner_request_spec.rb +71 -0
  315. data/spec/models/beneficial_owner_resource_spec.rb +83 -0
  316. data/spec/models/beneficial_owners_patch_spec.rb +53 -0
  317. data/spec/models/business_applicant_admin_fields_resource_spec.rb +41 -0
  318. data/spec/models/business_applicant_admin_resource_spec.rb +137 -0
  319. data/spec/models/business_applicant_request_spec.rb +107 -0
  320. data/spec/models/business_applicant_resource_all_of_spec.rb +59 -0
  321. data/spec/models/business_applicant_resource_spec.rb +59 -0
  322. data/spec/models/business_applicant_update_request_spec.rb +113 -0
  323. data/spec/models/business_applicants_resource_all_of_spec.rb +41 -0
  324. data/spec/models/business_applicants_resource_spec.rb +47 -0
  325. data/spec/models/business_id_type_spec.rb +35 -0
  326. data/spec/models/business_identification_resource_spec.rb +65 -0
  327. data/spec/models/business_owner_resource_spec.rb +41 -0
  328. data/spec/models/business_profile_resource_spec.rb +93 -0
  329. data/spec/models/business_update_identification_resource_spec.rb +65 -0
  330. data/spec/models/capability_resource_spec.rb +51 -0
  331. data/spec/models/card_data_resource_spec.rb +107 -0
  332. data/spec/models/consent_request_spec.rb +65 -0
  333. data/spec/models/consent_resource_spec.rb +71 -0
  334. data/spec/models/consent_spec.rb +69 -0
  335. data/spec/models/consent_type_spec.rb +35 -0
  336. data/spec/models/contract_create_request_spec.rb +53 -0
  337. data/spec/models/contract_resource_dto_all_of_spec.rb +41 -0
  338. data/spec/models/contract_resource_dto_spec.rb +41 -0
  339. data/spec/models/contract_resource_spec.rb +59 -0
  340. data/spec/models/contract_update_request_spec.rb +47 -0
  341. data/spec/models/customer_history_resource_spec.rb +47 -0
  342. data/spec/models/deactivate_request_spec.rb +47 -0
  343. data/spec/models/deactivate_response_spec.rb +53 -0
  344. data/spec/models/direct_debit_consent_resource_spec.rb +51 -0
  345. data/spec/models/direct_debit_frequency_type_spec.rb +35 -0
  346. data/spec/models/direct_debit_scheme_type_spec.rb +35 -0
  347. data/spec/models/direct_debt_capability_resource_spec.rb +67 -0
  348. data/spec/models/entities_resource_spec.rb +41 -0
  349. data/spec/models/entity_history_resource_spec.rb +41 -0
  350. data/spec/models/entity_product_status_resource_spec.rb +47 -0
  351. data/spec/models/entity_update_event_spec.rb +59 -0
  352. data/spec/models/entity_updated_attribute_spec.rb +53 -0
  353. data/spec/models/errors_spec.rb +47 -0
  354. data/spec/models/expiration_date_resource_spec.rb +47 -0
  355. data/spec/models/gender_spec.rb +35 -0
  356. data/spec/models/gov_identification_resource_spec.rb +77 -0
  357. data/spec/models/gov_identification_update_resource_spec.rb +77 -0
  358. data/spec/models/government_id_type_spec.rb +35 -0
  359. data/spec/models/individual_applicant_admin_fields_resource_spec.rb +41 -0
  360. data/spec/models/individual_applicant_admin_resource_spec.rb +119 -0
  361. data/spec/models/individual_applicant_request_spec.rb +89 -0
  362. data/spec/models/individual_applicant_resource_spec.rb +41 -0
  363. data/spec/models/individual_applicant_update_request_spec.rb +95 -0
  364. data/spec/models/individual_applicants_resource_all_of_spec.rb +41 -0
  365. data/spec/models/individual_applicants_resource_spec.rb +47 -0
  366. data/spec/models/individual_owner_resource_spec.rb +47 -0
  367. data/spec/models/inline_response200_spec.rb +65 -0
  368. data/spec/models/issuer_scope_spec.rb +35 -0
  369. data/spec/models/market_place_applicant_resource_spec.rb +41 -0
  370. data/spec/models/market_place_property_resource_spec.rb +71 -0
  371. data/spec/models/marketplace_product_add_spec.rb +75 -0
  372. data/spec/models/marketplace_product_basic_spec.rb +63 -0
  373. data/spec/models/marketplace_product_extra_all_of_spec.rb +69 -0
  374. data/spec/models/marketplace_product_extra_spec.rb +97 -0
  375. data/spec/models/marketplace_product_payout_instrument_resource_spec.rb +47 -0
  376. data/spec/models/marketplace_product_payout_instrument_update_spec.rb +53 -0
  377. data/spec/models/marketplace_product_resource_spec.rb +115 -0
  378. data/spec/models/marketplace_product_sub_resource_spec.rb +109 -0
  379. data/spec/models/marketplace_product_update_spec.rb +109 -0
  380. data/spec/models/meta_spec.rb +53 -0
  381. data/spec/models/money_resource_spec.rb +47 -0
  382. data/spec/models/name_resource_spec.rb +75 -0
  383. data/spec/models/owner_request_spec.rb +53 -0
  384. data/spec/models/owner_resource_spec.rb +59 -0
  385. data/spec/models/pagination_spec.rb +53 -0
  386. data/spec/models/patch_operation_spec.rb +35 -0
  387. data/spec/models/payout_instrument_request_spec.rb +81 -0
  388. data/spec/models/payout_instrument_resource_common_entities_spec.rb +63 -0
  389. data/spec/models/payout_instrument_resource_spec.rb +99 -0
  390. data/spec/models/payout_instrument_update_request_spec.rb +87 -0
  391. data/spec/models/payout_instruments_resource_all_of_spec.rb +41 -0
  392. data/spec/models/payout_instruments_resource_spec.rb +47 -0
  393. data/spec/models/payout_product_add_spec.rb +47 -0
  394. data/spec/models/payout_product_resource_spec.rb +71 -0
  395. data/spec/models/payout_product_sub_resource_all_of_spec.rb +59 -0
  396. data/spec/models/payout_product_sub_resource_spec.rb +65 -0
  397. data/spec/models/phone_resource_spec.rb +47 -0
  398. data/spec/models/price_setting_resource_spec.rb +85 -0
  399. data/spec/models/primary_contact_resource_spec.rb +95 -0
  400. data/spec/models/product_read_spec.rb +41 -0
  401. data/spec/models/product_spec.rb +35 -0
  402. data/spec/models/product_write_spec.rb +41 -0
  403. data/spec/models/profile_resource_spec.rb +95 -0
  404. data/spec/models/property_history_resource_spec.rb +71 -0
  405. data/spec/models/property_info_resource_spec.rb +59 -0
  406. data/spec/models/property_owner_resource_spec.rb +83 -0
  407. data/spec/models/property_resource_spec.rb +71 -0
  408. data/spec/models/property_tracker_resource_spec.rb +59 -0
  409. data/spec/models/registration_resource_spec.rb +53 -0
  410. data/spec/models/reservation_setting_resource_spec.rb +47 -0
  411. data/spec/models/resource_spec.rb +41 -0
  412. data/spec/models/social_network_resource_spec.rb +51 -0
  413. data/spec/models/status_reason_resource_spec.rb +63 -0
  414. data/spec/models/status_request_spec.rb +45 -0
  415. data/spec/models/status_resource_spec.rb +57 -0
  416. data/spec/models/stay_setting_resource_spec.rb +47 -0
  417. data/spec/models/suspension_reason_resource_spec.rb +41 -0
  418. data/spec/models/traveler_resource_spec.rb +59 -0
  419. data/spec/spec_helper.rb +111 -0
  420. data/yapstone-so.gemspec +45 -0
  421. metadata +781 -0
@@ -0,0 +1,375 @@
1
+ =begin
2
+ #Yapstone Staged On-Boarding Services
3
+
4
+ #Set of API's that allow clients to onboard with Yapstone.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ # The Business Applicant Resource request. Contains all of the required fields to create an Business Applicant resource.
17
+ class BusinessApplicantRequest
18
+ attr_accessor :primary_contact
19
+
20
+ attr_accessor :business_profile
21
+
22
+ # The partners externalId id for the Business Applicant.
23
+ attr_accessor :external_id
24
+
25
+ attr_accessor :mkt_place_applicant
26
+
27
+ # A list of social networks the applicant belongs to.
28
+ attr_accessor :social_networks
29
+
30
+ # language used to communicate
31
+ attr_accessor :language
32
+
33
+ # brand id of market place
34
+ attr_accessor :brand
35
+
36
+ attr_accessor :consents
37
+
38
+ # The reportingTag for the applicant.
39
+ attr_accessor :reporting_tag
40
+
41
+ attr_accessor :principal_owner
42
+
43
+ # A list of additional beneficial owners
44
+ attr_accessor :additional_owners
45
+
46
+ # Products requested by marketplace.
47
+ attr_accessor :products
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'primary_contact' => :'primaryContact',
53
+ :'business_profile' => :'businessProfile',
54
+ :'external_id' => :'externalId',
55
+ :'mkt_place_applicant' => :'mktPlaceApplicant',
56
+ :'social_networks' => :'socialNetworks',
57
+ :'language' => :'language',
58
+ :'brand' => :'brand',
59
+ :'consents' => :'consents',
60
+ :'reporting_tag' => :'reportingTag',
61
+ :'principal_owner' => :'principalOwner',
62
+ :'additional_owners' => :'additionalOwners',
63
+ :'products' => :'products'
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'primary_contact' => :'PrimaryContactResource',
71
+ :'business_profile' => :'BusinessProfileResource',
72
+ :'external_id' => :'String',
73
+ :'mkt_place_applicant' => :'MarketPlaceApplicantResource',
74
+ :'social_networks' => :'Array<SocialNetworkResource>',
75
+ :'language' => :'String',
76
+ :'brand' => :'String',
77
+ :'consents' => :'Array<ApplicantConsentRequest>',
78
+ :'reporting_tag' => :'String',
79
+ :'principal_owner' => :'BeneficialOwnerRequest',
80
+ :'additional_owners' => :'Array<BeneficialOwnerRequest>',
81
+ :'products' => :'Array<Product>'
82
+ }
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::BusinessApplicantRequest` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::BusinessApplicantRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'primary_contact')
101
+ self.primary_contact = attributes[:'primary_contact']
102
+ end
103
+
104
+ if attributes.key?(:'business_profile')
105
+ self.business_profile = attributes[:'business_profile']
106
+ end
107
+
108
+ if attributes.key?(:'external_id')
109
+ self.external_id = attributes[:'external_id']
110
+ end
111
+
112
+ if attributes.key?(:'mkt_place_applicant')
113
+ self.mkt_place_applicant = attributes[:'mkt_place_applicant']
114
+ end
115
+
116
+ if attributes.key?(:'social_networks')
117
+ if (value = attributes[:'social_networks']).is_a?(Array)
118
+ self.social_networks = value
119
+ end
120
+ end
121
+
122
+ if attributes.key?(:'language')
123
+ self.language = attributes[:'language']
124
+ end
125
+
126
+ if attributes.key?(:'brand')
127
+ self.brand = attributes[:'brand']
128
+ end
129
+
130
+ if attributes.key?(:'consents')
131
+ if (value = attributes[:'consents']).is_a?(Array)
132
+ self.consents = value
133
+ end
134
+ end
135
+
136
+ if attributes.key?(:'reporting_tag')
137
+ self.reporting_tag = attributes[:'reporting_tag']
138
+ end
139
+
140
+ if attributes.key?(:'principal_owner')
141
+ self.principal_owner = attributes[:'principal_owner']
142
+ end
143
+
144
+ if attributes.key?(:'additional_owners')
145
+ if (value = attributes[:'additional_owners']).is_a?(Array)
146
+ self.additional_owners = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'products')
151
+ if (value = attributes[:'products']).is_a?(Array)
152
+ self.products = value
153
+ end
154
+ end
155
+ end
156
+
157
+ # Show invalid properties with the reasons. Usually used together with valid?
158
+ # @return Array for valid properties with the reasons
159
+ def list_invalid_properties
160
+ invalid_properties = Array.new
161
+ if @business_profile.nil?
162
+ invalid_properties.push('invalid value for "business_profile", business_profile cannot be nil.')
163
+ end
164
+
165
+ if !@external_id.nil? && @external_id.to_s.length > 255
166
+ invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.')
167
+ end
168
+
169
+ if !@external_id.nil? && @external_id.to_s.length < 1
170
+ invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 1.')
171
+ end
172
+
173
+ pattern = Regexp.new(/.*[^\s].*/)
174
+ if !@external_id.nil? && @external_id !~ pattern
175
+ invalid_properties.push("invalid value for \"external_id\", must conform to the pattern #{pattern}.")
176
+ end
177
+
178
+ if !@reporting_tag.nil? && @reporting_tag.to_s.length > 100
179
+ invalid_properties.push('invalid value for "reporting_tag", the character length must be smaller than or equal to 100.')
180
+ end
181
+
182
+ if !@reporting_tag.nil? && @reporting_tag.to_s.length < 2
183
+ invalid_properties.push('invalid value for "reporting_tag", the character length must be great than or equal to 2.')
184
+ end
185
+
186
+ invalid_properties
187
+ end
188
+
189
+ # Check to see if the all the properties in the model are valid
190
+ # @return true if the model is valid
191
+ def valid?
192
+ return false if @business_profile.nil?
193
+ return false if !@external_id.nil? && @external_id.to_s.length > 255
194
+ return false if !@external_id.nil? && @external_id.to_s.length < 1
195
+ return false if !@external_id.nil? && @external_id !~ Regexp.new(/.*[^\s].*/)
196
+ return false if !@reporting_tag.nil? && @reporting_tag.to_s.length > 100
197
+ return false if !@reporting_tag.nil? && @reporting_tag.to_s.length < 2
198
+ true
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] external_id Value to be assigned
203
+ def external_id=(external_id)
204
+ if !external_id.nil? && external_id.to_s.length > 255
205
+ fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.'
206
+ end
207
+
208
+ if !external_id.nil? && external_id.to_s.length < 1
209
+ fail ArgumentError, 'invalid value for "external_id", the character length must be great than or equal to 1.'
210
+ end
211
+
212
+ pattern = Regexp.new(/.*[^\s].*/)
213
+ if !external_id.nil? && external_id !~ pattern
214
+ fail ArgumentError, "invalid value for \"external_id\", must conform to the pattern #{pattern}."
215
+ end
216
+
217
+ @external_id = external_id
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] reporting_tag Value to be assigned
222
+ def reporting_tag=(reporting_tag)
223
+ if !reporting_tag.nil? && reporting_tag.to_s.length > 100
224
+ fail ArgumentError, 'invalid value for "reporting_tag", the character length must be smaller than or equal to 100.'
225
+ end
226
+
227
+ if !reporting_tag.nil? && reporting_tag.to_s.length < 2
228
+ fail ArgumentError, 'invalid value for "reporting_tag", the character length must be great than or equal to 2.'
229
+ end
230
+
231
+ @reporting_tag = reporting_tag
232
+ end
233
+
234
+ # Checks equality by comparing each attribute.
235
+ # @param [Object] Object to be compared
236
+ def ==(o)
237
+ return true if self.equal?(o)
238
+ self.class == o.class &&
239
+ primary_contact == o.primary_contact &&
240
+ business_profile == o.business_profile &&
241
+ external_id == o.external_id &&
242
+ mkt_place_applicant == o.mkt_place_applicant &&
243
+ social_networks == o.social_networks &&
244
+ language == o.language &&
245
+ brand == o.brand &&
246
+ consents == o.consents &&
247
+ reporting_tag == o.reporting_tag &&
248
+ principal_owner == o.principal_owner &&
249
+ additional_owners == o.additional_owners &&
250
+ products == o.products
251
+ end
252
+
253
+ # @see the `==` method
254
+ # @param [Object] Object to be compared
255
+ def eql?(o)
256
+ self == o
257
+ end
258
+
259
+ # Calculates hash code according to all attributes.
260
+ # @return [Integer] Hash code
261
+ def hash
262
+ [primary_contact, business_profile, external_id, mkt_place_applicant, social_networks, language, brand, consents, reporting_tag, principal_owner, additional_owners, products].hash
263
+ end
264
+
265
+ # Builds the object from hash
266
+ # @param [Hash] attributes Model attributes in the form of hash
267
+ # @return [Object] Returns the model itself
268
+ def self.build_from_hash(attributes)
269
+ new.build_from_hash(attributes)
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def build_from_hash(attributes)
276
+ return nil unless attributes.is_a?(Hash)
277
+ self.class.openapi_types.each_pair do |key, type|
278
+ if type =~ /\AArray<(.*)>/i
279
+ # check to ensure the input is an array given that the attribute
280
+ # is documented as an array but the input is not
281
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
282
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
283
+ end
284
+ elsif !attributes[self.class.attribute_map[key]].nil?
285
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
286
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
287
+ end
288
+
289
+ self
290
+ end
291
+
292
+ # Deserializes the data based on type
293
+ # @param string type Data type
294
+ # @param string value Value to be deserialized
295
+ # @return [Object] Deserialized data
296
+ def _deserialize(type, value)
297
+ case type.to_sym
298
+ when :DateTime
299
+ DateTime.parse(value)
300
+ when :Date
301
+ Date.parse(value)
302
+ when :String
303
+ value.to_s
304
+ when :Integer
305
+ value.to_i
306
+ when :Float
307
+ value.to_f
308
+ when :Boolean
309
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
310
+ true
311
+ else
312
+ false
313
+ end
314
+ when :Object
315
+ # generic object (usually a Hash), return directly
316
+ value
317
+ when /\AArray<(?<inner_type>.+)>\z/
318
+ inner_type = Regexp.last_match[:inner_type]
319
+ value.map { |v| _deserialize(inner_type, v) }
320
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
321
+ k_type = Regexp.last_match[:k_type]
322
+ v_type = Regexp.last_match[:v_type]
323
+ {}.tap do |hash|
324
+ value.each do |k, v|
325
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
326
+ end
327
+ end
328
+ else # model
329
+ Yapstone.const_get(type).build_from_hash(value)
330
+ end
331
+ end
332
+
333
+ # Returns the string representation of the object
334
+ # @return [String] String presentation of the object
335
+ def to_s
336
+ to_hash.to_s
337
+ end
338
+
339
+ # to_body is an alias to to_hash (backward compatibility)
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_body
342
+ to_hash
343
+ end
344
+
345
+ # Returns the object in the form of hash
346
+ # @return [Hash] Returns the object in the form of hash
347
+ def to_hash
348
+ hash = {}
349
+ self.class.attribute_map.each_pair do |attr, param|
350
+ value = self.send(attr)
351
+ next if value.nil?
352
+ hash[param] = _to_hash(value)
353
+ end
354
+ hash
355
+ end
356
+
357
+ # Outputs non-array value in the form of hash
358
+ # For object, use to_hash. Otherwise, just return the value
359
+ # @param [Object] value Any valid value
360
+ # @return [Hash] Returns the value in the form of hash
361
+ def _to_hash(value)
362
+ if value.is_a?(Array)
363
+ value.compact.map { |v| _to_hash(v) }
364
+ elsif value.is_a?(Hash)
365
+ {}.tap do |hash|
366
+ value.each { |k, v| hash[k] = _to_hash(v) }
367
+ end
368
+ elsif value.respond_to? :to_hash
369
+ value.to_hash
370
+ else
371
+ value
372
+ end
373
+ end
374
+ end
375
+ end
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #Yapstone Staged On-Boarding Services
3
+
4
+ #Set of API's that allow clients to onboard with Yapstone.
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Yapstone
16
+ # The Business Applicant resource.
17
+ class BusinessApplicantResource < ApplicantResource
18
+ attr_accessor :primary_contact
19
+
20
+ attr_accessor :business_profile
21
+
22
+ attr_accessor :principal_owner
23
+
24
+ # A list of additional beneficial owners
25
+ attr_accessor :additional_owners
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'primary_contact' => :'primaryContact',
31
+ :'business_profile' => :'businessProfile',
32
+ :'principal_owner' => :'principalOwner',
33
+ :'additional_owners' => :'additionalOwners'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'primary_contact' => :'ProfileResource',
41
+ :'business_profile' => :'BusinessProfileResource',
42
+ :'principal_owner' => :'BeneficialOwnerResource',
43
+ :'additional_owners' => :'Array<BeneficialOwnerResource>'
44
+ }
45
+ end
46
+
47
+ # List of class defined in allOf (OpenAPI v3)
48
+ def self.openapi_all_of
49
+ [
50
+ :'ApplicantResource',
51
+ :'BusinessApplicantResourceAllOf'
52
+ ]
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::BusinessApplicantResource` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::BusinessApplicantResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ # call parent's initialize
71
+ super(attributes)
72
+
73
+ if attributes.key?(:'primary_contact')
74
+ self.primary_contact = attributes[:'primary_contact']
75
+ end
76
+
77
+ if attributes.key?(:'business_profile')
78
+ self.business_profile = attributes[:'business_profile']
79
+ end
80
+
81
+ if attributes.key?(:'principal_owner')
82
+ self.principal_owner = attributes[:'principal_owner']
83
+ end
84
+
85
+ if attributes.key?(:'additional_owners')
86
+ if (value = attributes[:'additional_owners']).is_a?(Array)
87
+ self.additional_owners = value
88
+ end
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = super
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ true && super
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ primary_contact == o.primary_contact &&
111
+ business_profile == o.business_profile &&
112
+ principal_owner == o.principal_owner &&
113
+ additional_owners == o.additional_owners && super(o)
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [primary_contact, business_profile, principal_owner, additional_owners].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ new.build_from_hash(attributes)
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ super(attributes)
141
+ self.class.openapi_types.each_pair do |key, type|
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :DateTime
163
+ DateTime.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :Boolean
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ Yapstone.const_get(type).build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = super
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ next if value.nil?
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end
238
+ end
239
+ end