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,198 @@
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
+ # Internal attributes to be updated by Admin for Business Applicant
17
+ class BusinessApplicantAdminFieldsResource
18
+ # value for graduation policy
19
+ attr_accessor :auto_graduated
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'auto_graduated' => :'autoGraduated'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'auto_graduated' => :'Boolean'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ if (!attributes.is_a?(Hash))
39
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::BusinessApplicantAdminFieldsResource` initialize method"
40
+ end
41
+
42
+ # check to see if the attribute exists and convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h|
44
+ if (!self.class.attribute_map.key?(k.to_sym))
45
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::BusinessApplicantAdminFieldsResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
46
+ end
47
+ h[k.to_sym] = v
48
+ }
49
+
50
+ if attributes.key?(:'auto_graduated')
51
+ self.auto_graduated = attributes[:'auto_graduated']
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class &&
73
+ auto_graduated == o.auto_graduated
74
+ end
75
+
76
+ # @see the `==` method
77
+ # @param [Object] Object to be compared
78
+ def eql?(o)
79
+ self == o
80
+ end
81
+
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Integer] Hash code
84
+ def hash
85
+ [auto_graduated].hash
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def self.build_from_hash(attributes)
92
+ new.build_from_hash(attributes)
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.openapi_types.each_pair do |key, type|
101
+ if type =~ /\AArray<(.*)>/i
102
+ # check to ensure the input is an array given that the attribute
103
+ # is documented as an array but the input is not
104
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
105
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
106
+ end
107
+ elsif !attributes[self.class.attribute_map[key]].nil?
108
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
109
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
110
+ end
111
+
112
+ self
113
+ end
114
+
115
+ # Deserializes the data based on type
116
+ # @param string type Data type
117
+ # @param string value Value to be deserialized
118
+ # @return [Object] Deserialized data
119
+ def _deserialize(type, value)
120
+ case type.to_sym
121
+ when :DateTime
122
+ DateTime.parse(value)
123
+ when :Date
124
+ Date.parse(value)
125
+ when :String
126
+ value.to_s
127
+ when :Integer
128
+ value.to_i
129
+ when :Float
130
+ value.to_f
131
+ when :Boolean
132
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
133
+ true
134
+ else
135
+ false
136
+ end
137
+ when :Object
138
+ # generic object (usually a Hash), return directly
139
+ value
140
+ when /\AArray<(?<inner_type>.+)>\z/
141
+ inner_type = Regexp.last_match[:inner_type]
142
+ value.map { |v| _deserialize(inner_type, v) }
143
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
144
+ k_type = Regexp.last_match[:k_type]
145
+ v_type = Regexp.last_match[:v_type]
146
+ {}.tap do |hash|
147
+ value.each do |k, v|
148
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
149
+ end
150
+ end
151
+ else # model
152
+ Yapstone.const_get(type).build_from_hash(value)
153
+ end
154
+ end
155
+
156
+ # Returns the string representation of the object
157
+ # @return [String] String presentation of the object
158
+ def to_s
159
+ to_hash.to_s
160
+ end
161
+
162
+ # to_body is an alias to to_hash (backward compatibility)
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_body
165
+ to_hash
166
+ end
167
+
168
+ # Returns the object in the form of hash
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_hash
171
+ hash = {}
172
+ self.class.attribute_map.each_pair do |attr, param|
173
+ value = self.send(attr)
174
+ next if value.nil?
175
+ hash[param] = _to_hash(value)
176
+ end
177
+ hash
178
+ end
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map { |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+ end
198
+ end
@@ -0,0 +1,442 @@
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 BusinessApplicantAdminResource
18
+ # The resource identifier for the applicant.
19
+ attr_accessor :id
20
+
21
+ attr_accessor :status
22
+
23
+ attr_accessor :type
24
+
25
+ # The partners externalId id for the Applicant.
26
+ attr_accessor :external_id
27
+
28
+ attr_accessor :mkt_place_applicant
29
+
30
+ # A list of social networks the applicant belongs to.
31
+ attr_accessor :social_networks
32
+
33
+ # supported language
34
+ attr_accessor :language
35
+
36
+ # brand id
37
+ attr_accessor :brand
38
+
39
+ attr_accessor :consents
40
+
41
+ # The reportingTag for the applicant.
42
+ attr_accessor :reporting_tag
43
+
44
+ # At the time of creation, value is defaulted to False.
45
+ attr_accessor :no_post_booking
46
+
47
+ # Products requested by marketplace.
48
+ attr_accessor :products
49
+
50
+ attr_accessor :primary_contact
51
+
52
+ attr_accessor :business_profile
53
+
54
+ attr_accessor :principal_owner
55
+
56
+ # A list of additional beneficial owners
57
+ attr_accessor :additional_owners
58
+
59
+ # value for graduation policy
60
+ attr_accessor :auto_graduated
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'id' => :'id',
66
+ :'status' => :'status',
67
+ :'type' => :'type',
68
+ :'external_id' => :'externalId',
69
+ :'mkt_place_applicant' => :'mktPlaceApplicant',
70
+ :'social_networks' => :'socialNetworks',
71
+ :'language' => :'language',
72
+ :'brand' => :'brand',
73
+ :'consents' => :'consents',
74
+ :'reporting_tag' => :'reportingTag',
75
+ :'no_post_booking' => :'noPostBooking',
76
+ :'products' => :'products',
77
+ :'primary_contact' => :'primaryContact',
78
+ :'business_profile' => :'businessProfile',
79
+ :'principal_owner' => :'principalOwner',
80
+ :'additional_owners' => :'additionalOwners',
81
+ :'auto_graduated' => :'autoGraduated'
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'id' => :'String',
89
+ :'status' => :'EntityProductStatusResource',
90
+ :'type' => :'String',
91
+ :'external_id' => :'String',
92
+ :'mkt_place_applicant' => :'MarketPlaceApplicantResource',
93
+ :'social_networks' => :'Array<SocialNetworkResource>',
94
+ :'language' => :'String',
95
+ :'brand' => :'String',
96
+ :'consents' => :'Array<ApplicantConsentResource>',
97
+ :'reporting_tag' => :'String',
98
+ :'no_post_booking' => :'Boolean',
99
+ :'products' => :'Array<Product>',
100
+ :'primary_contact' => :'ProfileResource',
101
+ :'business_profile' => :'BusinessProfileResource',
102
+ :'principal_owner' => :'BeneficialOwnerResource',
103
+ :'additional_owners' => :'Array<BeneficialOwnerResource>',
104
+ :'auto_graduated' => :'Boolean'
105
+ }
106
+ end
107
+
108
+ # List of class defined in allOf (OpenAPI v3)
109
+ def self.openapi_all_of
110
+ [
111
+ :'BusinessApplicantResource'
112
+ ]
113
+ end
114
+
115
+ # Initializes the object
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ def initialize(attributes = {})
118
+ if (!attributes.is_a?(Hash))
119
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Yapstone::BusinessApplicantAdminResource` initialize method"
120
+ end
121
+
122
+ # check to see if the attribute exists and convert string to symbol for hash key
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!self.class.attribute_map.key?(k.to_sym))
125
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Yapstone::BusinessApplicantAdminResource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
126
+ end
127
+ h[k.to_sym] = v
128
+ }
129
+
130
+ if attributes.key?(:'id')
131
+ self.id = attributes[:'id']
132
+ end
133
+
134
+ if attributes.key?(:'status')
135
+ self.status = attributes[:'status']
136
+ end
137
+
138
+ if attributes.key?(:'type')
139
+ self.type = attributes[:'type']
140
+ end
141
+
142
+ if attributes.key?(:'external_id')
143
+ self.external_id = attributes[:'external_id']
144
+ end
145
+
146
+ if attributes.key?(:'mkt_place_applicant')
147
+ self.mkt_place_applicant = attributes[:'mkt_place_applicant']
148
+ end
149
+
150
+ if attributes.key?(:'social_networks')
151
+ if (value = attributes[:'social_networks']).is_a?(Array)
152
+ self.social_networks = value
153
+ end
154
+ end
155
+
156
+ if attributes.key?(:'language')
157
+ self.language = attributes[:'language']
158
+ end
159
+
160
+ if attributes.key?(:'brand')
161
+ self.brand = attributes[:'brand']
162
+ end
163
+
164
+ if attributes.key?(:'consents')
165
+ if (value = attributes[:'consents']).is_a?(Array)
166
+ self.consents = value
167
+ end
168
+ end
169
+
170
+ if attributes.key?(:'reporting_tag')
171
+ self.reporting_tag = attributes[:'reporting_tag']
172
+ end
173
+
174
+ if attributes.key?(:'no_post_booking')
175
+ self.no_post_booking = attributes[:'no_post_booking']
176
+ else
177
+ self.no_post_booking = false
178
+ end
179
+
180
+ if attributes.key?(:'products')
181
+ if (value = attributes[:'products']).is_a?(Array)
182
+ self.products = value
183
+ end
184
+ end
185
+
186
+ if attributes.key?(:'primary_contact')
187
+ self.primary_contact = attributes[:'primary_contact']
188
+ end
189
+
190
+ if attributes.key?(:'business_profile')
191
+ self.business_profile = attributes[:'business_profile']
192
+ end
193
+
194
+ if attributes.key?(:'principal_owner')
195
+ self.principal_owner = attributes[:'principal_owner']
196
+ end
197
+
198
+ if attributes.key?(:'additional_owners')
199
+ if (value = attributes[:'additional_owners']).is_a?(Array)
200
+ self.additional_owners = value
201
+ end
202
+ end
203
+
204
+ if attributes.key?(:'auto_graduated')
205
+ self.auto_graduated = attributes[:'auto_graduated']
206
+ end
207
+ end
208
+
209
+ # Show invalid properties with the reasons. Usually used together with valid?
210
+ # @return Array for valid properties with the reasons
211
+ def list_invalid_properties
212
+ invalid_properties = Array.new
213
+ if @type.nil?
214
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
215
+ end
216
+
217
+ if !@external_id.nil? && @external_id.to_s.length > 255
218
+ invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.')
219
+ end
220
+
221
+ if !@external_id.nil? && @external_id.to_s.length < 1
222
+ invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 1.')
223
+ end
224
+
225
+ pattern = Regexp.new(/.*[^\s].*/)
226
+ if !@external_id.nil? && @external_id !~ pattern
227
+ invalid_properties.push("invalid value for \"external_id\", must conform to the pattern #{pattern}.")
228
+ end
229
+
230
+ if @language.nil?
231
+ invalid_properties.push('invalid value for "language", language cannot be nil.')
232
+ end
233
+
234
+ if @brand.nil?
235
+ invalid_properties.push('invalid value for "brand", brand cannot be nil.')
236
+ end
237
+
238
+ if !@reporting_tag.nil? && @reporting_tag.to_s.length > 100
239
+ invalid_properties.push('invalid value for "reporting_tag", the character length must be smaller than or equal to 100.')
240
+ end
241
+
242
+ if !@reporting_tag.nil? && @reporting_tag.to_s.length < 2
243
+ invalid_properties.push('invalid value for "reporting_tag", the character length must be great than or equal to 2.')
244
+ end
245
+
246
+ invalid_properties
247
+ end
248
+
249
+ # Check to see if the all the properties in the model are valid
250
+ # @return true if the model is valid
251
+ def valid?
252
+ return false if @type.nil?
253
+ return false if !@external_id.nil? && @external_id.to_s.length > 255
254
+ return false if !@external_id.nil? && @external_id.to_s.length < 1
255
+ return false if !@external_id.nil? && @external_id !~ Regexp.new(/.*[^\s].*/)
256
+ return false if @language.nil?
257
+ return false if @brand.nil?
258
+ return false if !@reporting_tag.nil? && @reporting_tag.to_s.length > 100
259
+ return false if !@reporting_tag.nil? && @reporting_tag.to_s.length < 2
260
+ true
261
+ end
262
+
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] external_id Value to be assigned
265
+ def external_id=(external_id)
266
+ if !external_id.nil? && external_id.to_s.length > 255
267
+ fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.'
268
+ end
269
+
270
+ if !external_id.nil? && external_id.to_s.length < 1
271
+ fail ArgumentError, 'invalid value for "external_id", the character length must be great than or equal to 1.'
272
+ end
273
+
274
+ pattern = Regexp.new(/.*[^\s].*/)
275
+ if !external_id.nil? && external_id !~ pattern
276
+ fail ArgumentError, "invalid value for \"external_id\", must conform to the pattern #{pattern}."
277
+ end
278
+
279
+ @external_id = external_id
280
+ end
281
+
282
+ # Custom attribute writer method with validation
283
+ # @param [Object] reporting_tag Value to be assigned
284
+ def reporting_tag=(reporting_tag)
285
+ if !reporting_tag.nil? && reporting_tag.to_s.length > 100
286
+ fail ArgumentError, 'invalid value for "reporting_tag", the character length must be smaller than or equal to 100.'
287
+ end
288
+
289
+ if !reporting_tag.nil? && reporting_tag.to_s.length < 2
290
+ fail ArgumentError, 'invalid value for "reporting_tag", the character length must be great than or equal to 2.'
291
+ end
292
+
293
+ @reporting_tag = reporting_tag
294
+ end
295
+
296
+ # Checks equality by comparing each attribute.
297
+ # @param [Object] Object to be compared
298
+ def ==(o)
299
+ return true if self.equal?(o)
300
+ self.class == o.class &&
301
+ id == o.id &&
302
+ status == o.status &&
303
+ type == o.type &&
304
+ external_id == o.external_id &&
305
+ mkt_place_applicant == o.mkt_place_applicant &&
306
+ social_networks == o.social_networks &&
307
+ language == o.language &&
308
+ brand == o.brand &&
309
+ consents == o.consents &&
310
+ reporting_tag == o.reporting_tag &&
311
+ no_post_booking == o.no_post_booking &&
312
+ products == o.products &&
313
+ primary_contact == o.primary_contact &&
314
+ business_profile == o.business_profile &&
315
+ principal_owner == o.principal_owner &&
316
+ additional_owners == o.additional_owners &&
317
+ auto_graduated == o.auto_graduated
318
+ end
319
+
320
+ # @see the `==` method
321
+ # @param [Object] Object to be compared
322
+ def eql?(o)
323
+ self == o
324
+ end
325
+
326
+ # Calculates hash code according to all attributes.
327
+ # @return [Integer] Hash code
328
+ def hash
329
+ [id, status, type, external_id, mkt_place_applicant, social_networks, language, brand, consents, reporting_tag, no_post_booking, products, primary_contact, business_profile, principal_owner, additional_owners, auto_graduated].hash
330
+ end
331
+
332
+ # Builds the object from hash
333
+ # @param [Hash] attributes Model attributes in the form of hash
334
+ # @return [Object] Returns the model itself
335
+ def self.build_from_hash(attributes)
336
+ new.build_from_hash(attributes)
337
+ end
338
+
339
+ # Builds the object from hash
340
+ # @param [Hash] attributes Model attributes in the form of hash
341
+ # @return [Object] Returns the model itself
342
+ def build_from_hash(attributes)
343
+ return nil unless attributes.is_a?(Hash)
344
+ self.class.openapi_types.each_pair do |key, type|
345
+ if type =~ /\AArray<(.*)>/i
346
+ # check to ensure the input is an array given that the attribute
347
+ # is documented as an array but the input is not
348
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
349
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
350
+ end
351
+ elsif !attributes[self.class.attribute_map[key]].nil?
352
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
353
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
354
+ end
355
+
356
+ self
357
+ end
358
+
359
+ # Deserializes the data based on type
360
+ # @param string type Data type
361
+ # @param string value Value to be deserialized
362
+ # @return [Object] Deserialized data
363
+ def _deserialize(type, value)
364
+ case type.to_sym
365
+ when :DateTime
366
+ DateTime.parse(value)
367
+ when :Date
368
+ Date.parse(value)
369
+ when :String
370
+ value.to_s
371
+ when :Integer
372
+ value.to_i
373
+ when :Float
374
+ value.to_f
375
+ when :Boolean
376
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
377
+ true
378
+ else
379
+ false
380
+ end
381
+ when :Object
382
+ # generic object (usually a Hash), return directly
383
+ value
384
+ when /\AArray<(?<inner_type>.+)>\z/
385
+ inner_type = Regexp.last_match[:inner_type]
386
+ value.map { |v| _deserialize(inner_type, v) }
387
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
388
+ k_type = Regexp.last_match[:k_type]
389
+ v_type = Regexp.last_match[:v_type]
390
+ {}.tap do |hash|
391
+ value.each do |k, v|
392
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
393
+ end
394
+ end
395
+ else # model
396
+ Yapstone.const_get(type).build_from_hash(value)
397
+ end
398
+ end
399
+
400
+ # Returns the string representation of the object
401
+ # @return [String] String presentation of the object
402
+ def to_s
403
+ to_hash.to_s
404
+ end
405
+
406
+ # to_body is an alias to to_hash (backward compatibility)
407
+ # @return [Hash] Returns the object in the form of hash
408
+ def to_body
409
+ to_hash
410
+ end
411
+
412
+ # Returns the object in the form of hash
413
+ # @return [Hash] Returns the object in the form of hash
414
+ def to_hash
415
+ hash = {}
416
+ self.class.attribute_map.each_pair do |attr, param|
417
+ value = self.send(attr)
418
+ next if value.nil?
419
+ hash[param] = _to_hash(value)
420
+ end
421
+ hash
422
+ end
423
+
424
+ # Outputs non-array value in the form of hash
425
+ # For object, use to_hash. Otherwise, just return the value
426
+ # @param [Object] value Any valid value
427
+ # @return [Hash] Returns the value in the form of hash
428
+ def _to_hash(value)
429
+ if value.is_a?(Array)
430
+ value.compact.map { |v| _to_hash(v) }
431
+ elsif value.is_a?(Hash)
432
+ {}.tap do |hash|
433
+ value.each { |k, v| hash[k] = _to_hash(v) }
434
+ end
435
+ elsif value.respond_to? :to_hash
436
+ value.to_hash
437
+ else
438
+ value
439
+ end
440
+ end
441
+ end
442
+ end