korona-cloud-client 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +71 -4
  3. data/docs/AddressInformation.md +2 -0
  4. data/docs/Cashier.md +16 -6
  5. data/docs/CashierRole.md +27 -0
  6. data/docs/CashierRolesApi.md +402 -0
  7. data/docs/CashiersApi.md +286 -2
  8. data/docs/CloudSubscriptionDetails.md +19 -0
  9. data/docs/CurrenciesApi.md +166 -0
  10. data/docs/Customer.md +5 -1
  11. data/docs/EconomicZonesApi.md +166 -0
  12. data/docs/FiscalTransaction.md +43 -0
  13. data/docs/FiscalUnit.md +51 -0
  14. data/docs/FiscalUnitCertificateInfo.md +19 -0
  15. data/docs/FiscalUnitState.md +27 -0
  16. data/docs/FiscalUnitStateUsageLevel.md +23 -0
  17. data/docs/FiscalUnitStateUsageLevelValue.md +19 -0
  18. data/docs/FiscalUnitStateVersionInfo.md +21 -0
  19. data/docs/FiscalUnitsApi.md +299 -0
  20. data/docs/InfoTextsApi.md +166 -0
  21. data/docs/KoronaAccount.md +2 -0
  22. data/docs/OrganizationalUnit.md +9 -7
  23. data/docs/PaymentMethod.md +2 -0
  24. data/docs/PointsOfSaleApi.md +6 -2
  25. data/docs/Pos.md +10 -4
  26. data/docs/PriceGroupsApi.md +166 -0
  27. data/docs/ProductionType.md +33 -0
  28. data/docs/ProductionTypesApi.md +294 -0
  29. data/docs/Receipt.md +18 -8
  30. data/docs/ReceiptItem.md +3 -1
  31. data/docs/ReceiptMaxRevisions.md +27 -0
  32. data/docs/ReceiptsApi.md +9 -3
  33. data/docs/ResultListCashierRole.md +27 -0
  34. data/docs/ResultListFiscalUnit.md +27 -0
  35. data/docs/ResultListProductionType.md +27 -0
  36. data/docs/ResultListStockOrder.md +27 -0
  37. data/docs/SalesTax.md +2 -0
  38. data/docs/SalesTaxesApi.md +166 -0
  39. data/docs/SectorsApi.md +54 -0
  40. data/docs/Service.md +19 -0
  41. data/docs/StockOrder.md +73 -0
  42. data/docs/StockOrderItem.md +39 -0
  43. data/docs/StockOrdersApi.md +195 -0
  44. data/docs/StockReceipt.md +4 -0
  45. data/docs/SuppliersApi.md +166 -0
  46. data/docs/TicketingApi.md +223 -3
  47. data/docs/VoidedReceiptItem.md +25 -0
  48. data/korona-cloud-client-1.0.1.gem +0 -0
  49. data/korona-cloud-client.gemspec +2 -2
  50. data/lib/korona-cloud-client.rb +24 -1
  51. data/lib/korona-cloud-client/api/accounts_api.rb +1 -1
  52. data/lib/korona-cloud-client/api/additional_receipt_info_types_api.rb +1 -1
  53. data/lib/korona-cloud-client/api/assortments_api.rb +1 -1
  54. data/lib/korona-cloud-client/api/cashier_roles_api.rb +513 -0
  55. data/lib/korona-cloud-client/api/cashiers_api.rb +366 -1
  56. data/lib/korona-cloud-client/api/commodity_groups_api.rb +1 -1
  57. data/lib/korona-cloud-client/api/currencies_api.rb +208 -1
  58. data/lib/korona-cloud-client/api/customer_groups_api.rb +1 -1
  59. data/lib/korona-cloud-client/api/customer_orders_api.rb +1 -1
  60. data/lib/korona-cloud-client/api/customers_api.rb +1 -1
  61. data/lib/korona-cloud-client/api/delivery_notes_api.rb +1 -1
  62. data/lib/korona-cloud-client/api/economic_zones_api.rb +208 -1
  63. data/lib/korona-cloud-client/api/external_system_calls_api.rb +1 -1
  64. data/lib/korona-cloud-client/api/fiscal_units_api.rb +389 -0
  65. data/lib/korona-cloud-client/api/images_api.rb +1 -1
  66. data/lib/korona-cloud-client/api/info_texts_api.rb +208 -1
  67. data/lib/korona-cloud-client/api/inventories_api.rb +1 -1
  68. data/lib/korona-cloud-client/api/korona_account_api.rb +1 -1
  69. data/lib/korona-cloud-client/api/organizational_units_api.rb +1 -1
  70. data/lib/korona-cloud-client/api/payment_methods_api.rb +1 -1
  71. data/lib/korona-cloud-client/api/points_of_sale_api.rb +7 -1
  72. data/lib/korona-cloud-client/api/price_groups_api.rb +208 -1
  73. data/lib/korona-cloud-client/api/production_types_api.rb +373 -0
  74. data/lib/korona-cloud-client/api/products_api.rb +1 -1
  75. data/lib/korona-cloud-client/api/receipts_api.rb +7 -1
  76. data/lib/korona-cloud-client/api/sales_taxes_api.rb +208 -1
  77. data/lib/korona-cloud-client/api/sectors_api.rb +69 -1
  78. data/lib/korona-cloud-client/api/statistics_api.rb +1 -1
  79. data/lib/korona-cloud-client/api/stock_orders_api.rb +257 -0
  80. data/lib/korona-cloud-client/api/stock_receipts_api.rb +1 -1
  81. data/lib/korona-cloud-client/api/suppliers_api.rb +208 -1
  82. data/lib/korona-cloud-client/api/tags_api.rb +1 -1
  83. data/lib/korona-cloud-client/api/ticket_creation_api.rb +1 -1
  84. data/lib/korona-cloud-client/api/ticketing_api.rb +277 -4
  85. data/lib/korona-cloud-client/api/time_tracking_api.rb +1 -1
  86. data/lib/korona-cloud-client/api_client.rb +1 -1
  87. data/lib/korona-cloud-client/api_error.rb +1 -1
  88. data/lib/korona-cloud-client/configuration.rb +1 -1
  89. data/lib/korona-cloud-client/models/account.rb +1 -1
  90. data/lib/korona-cloud-client/models/account_summary.rb +1 -1
  91. data/lib/korona-cloud-client/models/account_transaction.rb +1 -1
  92. data/lib/korona-cloud-client/models/add_or_update_result.rb +1 -1
  93. data/lib/korona-cloud-client/models/additional_info.rb +1 -1
  94. data/lib/korona-cloud-client/models/additional_receipt_info_type.rb +1 -1
  95. data/lib/korona-cloud-client/models/address_information.rb +11 -2
  96. data/lib/korona-cloud-client/models/admission.rb +1 -1
  97. data/lib/korona-cloud-client/models/amount.rb +1 -1
  98. data/lib/korona-cloud-client/models/amount_count_data.rb +1 -1
  99. data/lib/korona-cloud-client/models/assortment.rb +1 -1
  100. data/lib/korona-cloud-client/models/attendance.rb +1 -1
  101. data/lib/korona-cloud-client/models/bad_request_error.rb +1 -1
  102. data/lib/korona-cloud-client/models/capacity.rb +1 -1
  103. data/lib/korona-cloud-client/models/cashier.rb +55 -10
  104. data/lib/korona-cloud-client/models/cashier_role.rb +279 -0
  105. data/lib/korona-cloud-client/models/cashier_summary.rb +1 -1
  106. data/lib/korona-cloud-client/models/category.rb +1 -1
  107. data/lib/korona-cloud-client/models/cloud_subscription.rb +1 -1
  108. data/lib/korona-cloud-client/models/cloud_subscription_details.rb +249 -0
  109. data/lib/korona-cloud-client/models/commodity_group.rb +1 -1
  110. data/lib/korona-cloud-client/models/commodity_group_summary.rb +1 -1
  111. data/lib/korona-cloud-client/models/company_identification.rb +1 -1
  112. data/lib/korona-cloud-client/models/creation_task.rb +1 -1
  113. data/lib/korona-cloud-client/models/currency.rb +1 -1
  114. data/lib/korona-cloud-client/models/currency_denomination.rb +1 -1
  115. data/lib/korona-cloud-client/models/currency_exchange_rate.rb +1 -1
  116. data/lib/korona-cloud-client/models/customer.rb +23 -5
  117. data/lib/korona-cloud-client/models/customer_card.rb +1 -1
  118. data/lib/korona-cloud-client/models/customer_data.rb +1 -1
  119. data/lib/korona-cloud-client/models/customer_group.rb +1 -1
  120. data/lib/korona-cloud-client/models/customer_group_summary.rb +1 -1
  121. data/lib/korona-cloud-client/models/customer_information.rb +1 -1
  122. data/lib/korona-cloud-client/models/customer_order.rb +1 -1
  123. data/lib/korona-cloud-client/models/day_rating.rb +1 -1
  124. data/lib/korona-cloud-client/models/day_time_period.rb +1 -1
  125. data/lib/korona-cloud-client/models/delivery_note.rb +1 -1
  126. data/lib/korona-cloud-client/models/delivery_note_item.rb +1 -1
  127. data/lib/korona-cloud-client/models/deposit.rb +1 -1
  128. data/lib/korona-cloud-client/models/device_information.rb +1 -1
  129. data/lib/korona-cloud-client/models/discount.rb +1 -1
  130. data/lib/korona-cloud-client/models/economic_zone.rb +1 -1
  131. data/lib/korona-cloud-client/models/end_of_day_statement.rb +1 -1
  132. data/lib/korona-cloud-client/models/end_of_day_statement_summary.rb +1 -1
  133. data/lib/korona-cloud-client/models/entry_gate.rb +1 -1
  134. data/lib/korona-cloud-client/models/event.rb +1 -1
  135. data/lib/korona-cloud-client/models/external_system_call.rb +1 -1
  136. data/lib/korona-cloud-client/models/fiscal_transaction.rb +342 -0
  137. data/lib/korona-cloud-client/models/fiscal_unit.rb +415 -0
  138. data/lib/korona-cloud-client/models/fiscal_unit_certificate_info.rb +233 -0
  139. data/lib/korona-cloud-client/models/fiscal_unit_state.rb +287 -0
  140. data/lib/korona-cloud-client/models/fiscal_unit_state_usage_level.rb +233 -0
  141. data/lib/korona-cloud-client/models/fiscal_unit_state_usage_level_value.rb +215 -0
  142. data/lib/korona-cloud-client/models/fiscal_unit_state_version_info.rb +224 -0
  143. data/lib/korona-cloud-client/models/forbidden_error.rb +1 -1
  144. data/lib/korona-cloud-client/models/geo_location.rb +1 -1
  145. data/lib/korona-cloud-client/models/info_text.rb +1 -1
  146. data/lib/korona-cloud-client/models/interval.rb +1 -1
  147. data/lib/korona-cloud-client/models/inventory.rb +1 -1
  148. data/lib/korona-cloud-client/models/inventory_list.rb +1 -1
  149. data/lib/korona-cloud-client/models/inventory_list_item.rb +1 -1
  150. data/lib/korona-cloud-client/models/inventory_list_item_stock.rb +1 -1
  151. data/lib/korona-cloud-client/models/korona_account.rb +13 -2
  152. data/lib/korona-cloud-client/models/media_url.rb +1 -1
  153. data/lib/korona-cloud-client/models/method_not_allowed_error.rb +1 -1
  154. data/lib/korona-cloud-client/models/model_reference.rb +1 -1
  155. data/lib/korona-cloud-client/models/not_found_error.rb +1 -1
  156. data/lib/korona-cloud-client/models/opening_hours.rb +1 -1
  157. data/lib/korona-cloud-client/models/organizational_unit.rb +43 -34
  158. data/lib/korona-cloud-client/models/payment.rb +1 -1
  159. data/lib/korona-cloud-client/models/payment_method.rb +11 -2
  160. data/lib/korona-cloud-client/models/payment_summary.rb +1 -1
  161. data/lib/korona-cloud-client/models/period.rb +1 -1
  162. data/lib/korona-cloud-client/models/period_list_top_seller.rb +1 -1
  163. data/lib/korona-cloud-client/models/period_map_string_revenue_data.rb +1 -1
  164. data/lib/korona-cloud-client/models/period_object.rb +1 -1
  165. data/lib/korona-cloud-client/models/period_revenue_data.rb +1 -1
  166. data/lib/korona-cloud-client/models/pos.rb +44 -17
  167. data/lib/korona-cloud-client/models/price_group.rb +1 -1
  168. data/lib/korona-cloud-client/models/product.rb +1 -1
  169. data/lib/korona-cloud-client/models/product_code.rb +1 -1
  170. data/lib/korona-cloud-client/models/product_description.rb +1 -1
  171. data/lib/korona-cloud-client/models/product_price.rb +1 -1
  172. data/lib/korona-cloud-client/models/product_stock.rb +1 -1
  173. data/lib/korona-cloud-client/models/product_subproduct.rb +1 -1
  174. data/lib/korona-cloud-client/models/product_supplier_price.rb +1 -1
  175. data/lib/korona-cloud-client/models/product_transfer_involved_party_information.rb +1 -1
  176. data/lib/korona-cloud-client/models/product_transfer_involved_party_information_data.rb +1 -1
  177. data/lib/korona-cloud-client/models/production_type.rb +328 -0
  178. data/lib/korona-cloud-client/models/rating.rb +1 -1
  179. data/lib/korona-cloud-client/models/receipt.rb +82 -31
  180. data/lib/korona-cloud-client/models/receipt_item.rb +14 -5
  181. data/lib/korona-cloud-client/models/receipt_max_revisions.rb +251 -0
  182. data/lib/korona-cloud-client/models/result_list.rb +1 -1
  183. data/lib/korona-cloud-client/models/result_list_account.rb +1 -1
  184. data/lib/korona-cloud-client/models/result_list_additional_receipt_info_type.rb +1 -1
  185. data/lib/korona-cloud-client/models/result_list_assortment.rb +1 -1
  186. data/lib/korona-cloud-client/models/result_list_attendance.rb +1 -1
  187. data/lib/korona-cloud-client/models/result_list_cashier.rb +1 -1
  188. data/lib/korona-cloud-client/models/result_list_cashier_role.rb +291 -0
  189. data/lib/korona-cloud-client/models/result_list_commodity_group.rb +1 -1
  190. data/lib/korona-cloud-client/models/result_list_creation_task.rb +1 -1
  191. data/lib/korona-cloud-client/models/result_list_currency.rb +1 -1
  192. data/lib/korona-cloud-client/models/result_list_customer.rb +1 -1
  193. data/lib/korona-cloud-client/models/result_list_customer_group.rb +1 -1
  194. data/lib/korona-cloud-client/models/result_list_customer_order.rb +1 -1
  195. data/lib/korona-cloud-client/models/result_list_day_rating.rb +1 -1
  196. data/lib/korona-cloud-client/models/result_list_delivery_note.rb +1 -1
  197. data/lib/korona-cloud-client/models/result_list_economic_zone.rb +1 -1
  198. data/lib/korona-cloud-client/models/result_list_end_of_day_statement.rb +1 -1
  199. data/lib/korona-cloud-client/models/result_list_entry_gate.rb +1 -1
  200. data/lib/korona-cloud-client/models/result_list_event.rb +1 -1
  201. data/lib/korona-cloud-client/models/result_list_external_system_call.rb +1 -1
  202. data/lib/korona-cloud-client/models/result_list_fiscal_unit.rb +291 -0
  203. data/lib/korona-cloud-client/models/result_list_info_text.rb +1 -1
  204. data/lib/korona-cloud-client/models/result_list_inventory.rb +1 -1
  205. data/lib/korona-cloud-client/models/result_list_inventory_list.rb +1 -1
  206. data/lib/korona-cloud-client/models/result_list_inventory_list_item.rb +1 -1
  207. data/lib/korona-cloud-client/models/result_list_organizational_unit.rb +1 -1
  208. data/lib/korona-cloud-client/models/result_list_payment_method.rb +1 -1
  209. data/lib/korona-cloud-client/models/result_list_pos.rb +1 -1
  210. data/lib/korona-cloud-client/models/result_list_price_group.rb +1 -1
  211. data/lib/korona-cloud-client/models/result_list_product.rb +1 -1
  212. data/lib/korona-cloud-client/models/result_list_product_stock.rb +1 -1
  213. data/lib/korona-cloud-client/models/result_list_production_type.rb +291 -0
  214. data/lib/korona-cloud-client/models/result_list_receipt.rb +1 -1
  215. data/lib/korona-cloud-client/models/result_list_sales_tax.rb +1 -1
  216. data/lib/korona-cloud-client/models/result_list_sector.rb +1 -1
  217. data/lib/korona-cloud-client/models/result_list_stock_order.rb +291 -0
  218. data/lib/korona-cloud-client/models/result_list_stock_receipt.rb +1 -1
  219. data/lib/korona-cloud-client/models/result_list_stock_receipt_item.rb +1 -1
  220. data/lib/korona-cloud-client/models/result_list_supplier.rb +1 -1
  221. data/lib/korona-cloud-client/models/result_list_tag.rb +1 -1
  222. data/lib/korona-cloud-client/models/result_list_ticket.rb +1 -1
  223. data/lib/korona-cloud-client/models/result_list_ticket_definition.rb +1 -1
  224. data/lib/korona-cloud-client/models/result_list_time_tracking_entity.rb +1 -1
  225. data/lib/korona-cloud-client/models/result_list_time_tracking_entry.rb +1 -1
  226. data/lib/korona-cloud-client/models/revenue_data.rb +1 -1
  227. data/lib/korona-cloud-client/models/sales_tax.rb +45 -2
  228. data/lib/korona-cloud-client/models/sales_tax_rate.rb +1 -1
  229. data/lib/korona-cloud-client/models/sector.rb +1 -1
  230. data/lib/korona-cloud-client/models/sector_revenue_account_item.rb +1 -1
  231. data/lib/korona-cloud-client/models/sector_sales_tax_item.rb +1 -1
  232. data/lib/korona-cloud-client/models/service.rb +249 -0
  233. data/lib/korona-cloud-client/models/signature.rb +1 -1
  234. data/lib/korona-cloud-client/models/statistic.rb +1 -1
  235. data/lib/korona-cloud-client/models/statistic_list_top_seller.rb +1 -1
  236. data/lib/korona-cloud-client/models/statistic_map_string_revenue_data.rb +1 -1
  237. data/lib/korona-cloud-client/models/statistic_revenue_data.rb +1 -1
  238. data/lib/korona-cloud-client/models/stock_order.rb +498 -0
  239. data/lib/korona-cloud-client/models/stock_order_item.rb +305 -0
  240. data/lib/korona-cloud-client/models/stock_receipt.rb +20 -2
  241. data/lib/korona-cloud-client/models/stock_receipt_item.rb +1 -1
  242. data/lib/korona-cloud-client/models/stock_receipt_item_amount.rb +1 -1
  243. data/lib/korona-cloud-client/models/stock_receipt_item_identification.rb +1 -1
  244. data/lib/korona-cloud-client/models/stock_receipt_item_purchase_price.rb +1 -1
  245. data/lib/korona-cloud-client/models/supplier.rb +1 -1
  246. data/lib/korona-cloud-client/models/supplier_contact.rb +1 -1
  247. data/lib/korona-cloud-client/models/supplier_contact_person.rb +1 -1
  248. data/lib/korona-cloud-client/models/supplier_payment_information.rb +1 -1
  249. data/lib/korona-cloud-client/models/tag.rb +1 -1
  250. data/lib/korona-cloud-client/models/tax_payment.rb +1 -1
  251. data/lib/korona-cloud-client/models/tax_summary.rb +1 -1
  252. data/lib/korona-cloud-client/models/ticket.rb +1 -1
  253. data/lib/korona-cloud-client/models/ticket_data.rb +1 -1
  254. data/lib/korona-cloud-client/models/ticket_definition.rb +1 -1
  255. data/lib/korona-cloud-client/models/ticket_personalization.rb +1 -1
  256. data/lib/korona-cloud-client/models/time_period.rb +1 -1
  257. data/lib/korona-cloud-client/models/time_tracking_entity.rb +1 -1
  258. data/lib/korona-cloud-client/models/time_tracking_entry.rb +1 -1
  259. data/lib/korona-cloud-client/models/too_many_requests_error.rb +1 -1
  260. data/lib/korona-cloud-client/models/top_seller.rb +1 -1
  261. data/lib/korona-cloud-client/models/total_period.rb +1 -1
  262. data/lib/korona-cloud-client/models/total_price.rb +1 -1
  263. data/lib/korona-cloud-client/models/validity.rb +1 -1
  264. data/lib/korona-cloud-client/models/voided_receipt_item.rb +242 -0
  265. data/lib/korona-cloud-client/models/weather.rb +1 -1
  266. data/lib/korona-cloud-client/version.rb +2 -2
  267. data/spec/api/cashier_roles_api_spec.rb +126 -0
  268. data/spec/api/fiscal_units_api_spec.rb +104 -0
  269. data/spec/api/production_types_api_spec.rb +101 -0
  270. data/spec/api/stock_orders_api_spec.rb +83 -0
  271. data/spec/models/cashier_role_spec.rb +75 -0
  272. data/spec/models/cloud_subscription_details_spec.rb +51 -0
  273. data/spec/models/fiscal_transaction_spec.rb +119 -0
  274. data/spec/models/fiscal_unit_certificate_info_spec.rb +47 -0
  275. data/spec/models/fiscal_unit_spec.rb +147 -0
  276. data/spec/models/fiscal_unit_state_spec.rb +75 -0
  277. data/spec/models/fiscal_unit_state_usage_level_spec.rb +59 -0
  278. data/spec/models/fiscal_unit_state_usage_level_value_spec.rb +47 -0
  279. data/spec/models/fiscal_unit_state_version_info_spec.rb +53 -0
  280. data/spec/models/production_type_spec.rb +97 -0
  281. data/spec/models/receipt_max_revisions_spec.rb +71 -0
  282. data/spec/models/result_list_cashier_role_spec.rb +71 -0
  283. data/spec/models/result_list_fiscal_unit_spec.rb +71 -0
  284. data/spec/models/result_list_production_type_spec.rb +71 -0
  285. data/spec/models/result_list_stock_order_spec.rb +71 -0
  286. data/spec/models/service_spec.rb +51 -0
  287. data/spec/models/stock_order_item_spec.rb +107 -0
  288. data/spec/models/stock_order_spec.rb +213 -0
  289. data/spec/models/voided_receipt_item_spec.rb +65 -0
  290. metadata +96 -3
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -0,0 +1,249 @@
1
+ =begin
2
+ #KORONA.cloud API v3
3
+
4
+ #Our api provides access to our cloud services
5
+
6
+ The version of the OpenAPI document: 2.14.7
7
+ Contact: support@combase.net
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module KoronaCloudClient
16
+ class Service
17
+ attr_accessor :parameter
18
+
19
+ attr_accessor :type
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'parameter' => :'parameter',
47
+ :'type' => :'type'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'parameter' => :'String',
55
+ :'type' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaCloudClient::Service` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KoronaCloudClient::Service`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'parameter')
81
+ self.parameter = attributes[:'parameter']
82
+ end
83
+
84
+ if attributes.key?(:'type')
85
+ self.type = attributes[:'type']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ type_validator = EnumAttributeValidator.new('String', ["CASH", "MERCHANTWARE", "MERCURY", "LEGACY_ZVT", "KORONA_PREPAID", "CREDIT_AUTHORIZATION_TERMINAL"])
100
+ return false unless type_validator.valid?(@type)
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method checking allowed values (enum).
105
+ # @param [Object] type Object to be assigned
106
+ def type=(type)
107
+ validator = EnumAttributeValidator.new('String', ["CASH", "MERCHANTWARE", "MERCURY", "LEGACY_ZVT", "KORONA_PREPAID", "CREDIT_AUTHORIZATION_TERMINAL"])
108
+ unless validator.valid?(type)
109
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
110
+ end
111
+ @type = type
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ parameter == o.parameter &&
120
+ type == o.type
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [parameter, type].hash
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 self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ self.class.openapi_types.each_pair do |key, type|
148
+ if type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ DateTime.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :Boolean
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ KoronaCloudClient.const_get(type).build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+ end
249
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Our api provides access to our cloud services
5
5
 
6
- The version of the OpenAPI document: 2.13.40
6
+ The version of the OpenAPI document: 2.14.7
7
7
  Contact: support@combase.net
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.0
@@ -0,0 +1,498 @@
1
+ =begin
2
+ #KORONA.cloud API v3
3
+
4
+ #Our api provides access to our cloud services
5
+
6
+ The version of the OpenAPI document: 2.14.7
7
+ Contact: support@combase.net
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module KoronaCloudClient
16
+ class StockOrder
17
+ # indicates whether the object is active for use or not
18
+ attr_accessor :active
19
+
20
+ # global object uuid (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
21
+ attr_accessor :id
22
+
23
+ # number of the object, like it is set in backoffice; will be removed when active=false
24
+ attr_accessor :number
25
+
26
+ # the revision number of the object. revision numbers are unique per object-type. there is is no object of the same type with identical revision numbers.
27
+ attr_accessor :revision
28
+
29
+ attr_accessor :booking_time
30
+
31
+ attr_accessor :booking_user
32
+
33
+ attr_accessor :booking_api_user
34
+
35
+ attr_accessor :cashier
36
+
37
+ attr_accessor :create_time
38
+
39
+ attr_accessor :create_user
40
+
41
+ attr_accessor :customer
42
+
43
+ attr_accessor :description
44
+
45
+ attr_accessor :items_count
46
+
47
+ attr_accessor :organizational_unit
48
+
49
+ attr_accessor :party_information
50
+
51
+ attr_accessor :point_of_sale
52
+
53
+ attr_accessor :source_organizational_unit
54
+
55
+ attr_accessor :supplier
56
+
57
+ attr_accessor :comment
58
+
59
+ attr_accessor :deposit
60
+
61
+ attr_accessor :pickup_date
62
+
63
+ attr_accessor :store_order
64
+
65
+ attr_accessor :special_offer_code
66
+
67
+ attr_accessor :shipping_condition
68
+
69
+ attr_accessor :shipping_supplier_information
70
+
71
+ attr_accessor :expected_from_date
72
+
73
+ attr_accessor :expected_to_date
74
+
75
+ attr_accessor :items
76
+
77
+ attr_accessor :status
78
+
79
+ class EnumAttributeValidator
80
+ attr_reader :datatype
81
+ attr_reader :allowable_values
82
+
83
+ def initialize(datatype, allowable_values)
84
+ @allowable_values = allowable_values.map do |value|
85
+ case datatype.to_s
86
+ when /Integer/i
87
+ value.to_i
88
+ when /Float/i
89
+ value.to_f
90
+ else
91
+ value
92
+ end
93
+ end
94
+ end
95
+
96
+ def valid?(value)
97
+ !value || allowable_values.include?(value)
98
+ end
99
+ end
100
+
101
+ # Attribute mapping from ruby-style variable name to JSON key.
102
+ def self.attribute_map
103
+ {
104
+ :'active' => :'active',
105
+ :'id' => :'id',
106
+ :'number' => :'number',
107
+ :'revision' => :'revision',
108
+ :'booking_time' => :'bookingTime',
109
+ :'booking_user' => :'bookingUser',
110
+ :'booking_api_user' => :'bookingApiUser',
111
+ :'cashier' => :'cashier',
112
+ :'create_time' => :'createTime',
113
+ :'create_user' => :'createUser',
114
+ :'customer' => :'customer',
115
+ :'description' => :'description',
116
+ :'items_count' => :'itemsCount',
117
+ :'organizational_unit' => :'organizationalUnit',
118
+ :'party_information' => :'partyInformation',
119
+ :'point_of_sale' => :'pointOfSale',
120
+ :'source_organizational_unit' => :'sourceOrganizationalUnit',
121
+ :'supplier' => :'supplier',
122
+ :'comment' => :'comment',
123
+ :'deposit' => :'deposit',
124
+ :'pickup_date' => :'pickupDate',
125
+ :'store_order' => :'storeOrder',
126
+ :'special_offer_code' => :'specialOfferCode',
127
+ :'shipping_condition' => :'shippingCondition',
128
+ :'shipping_supplier_information' => :'shippingSupplierInformation',
129
+ :'expected_from_date' => :'expectedFromDate',
130
+ :'expected_to_date' => :'expectedToDate',
131
+ :'items' => :'items',
132
+ :'status' => :'status'
133
+ }
134
+ end
135
+
136
+ # Attribute type mapping.
137
+ def self.openapi_types
138
+ {
139
+ :'active' => :'Boolean',
140
+ :'id' => :'String',
141
+ :'number' => :'String',
142
+ :'revision' => :'Integer',
143
+ :'booking_time' => :'DateTime',
144
+ :'booking_user' => :'ModelReference',
145
+ :'booking_api_user' => :'ModelReference',
146
+ :'cashier' => :'ModelReference',
147
+ :'create_time' => :'DateTime',
148
+ :'create_user' => :'ModelReference',
149
+ :'customer' => :'ModelReference',
150
+ :'description' => :'String',
151
+ :'items_count' => :'Integer',
152
+ :'organizational_unit' => :'ModelReference',
153
+ :'party_information' => :'ProductTransferInvolvedPartyInformation',
154
+ :'point_of_sale' => :'ModelReference',
155
+ :'source_organizational_unit' => :'ModelReference',
156
+ :'supplier' => :'ModelReference',
157
+ :'comment' => :'String',
158
+ :'deposit' => :'Float',
159
+ :'pickup_date' => :'DateTime',
160
+ :'store_order' => :'ModelReference',
161
+ :'special_offer_code' => :'String',
162
+ :'shipping_condition' => :'String',
163
+ :'shipping_supplier_information' => :'String',
164
+ :'expected_from_date' => :'DateTime',
165
+ :'expected_to_date' => :'DateTime',
166
+ :'items' => :'Array<StockOrderItem>',
167
+ :'status' => :'String'
168
+ }
169
+ end
170
+
171
+ # List of attributes with nullable: true
172
+ def self.openapi_nullable
173
+ Set.new([
174
+ ])
175
+ end
176
+
177
+ # Initializes the object
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ def initialize(attributes = {})
180
+ if (!attributes.is_a?(Hash))
181
+ fail ArgumentError, "The input argument (attributes) must be a hash in `KoronaCloudClient::StockOrder` initialize method"
182
+ end
183
+
184
+ # check to see if the attribute exists and convert string to symbol for hash key
185
+ attributes = attributes.each_with_object({}) { |(k, v), h|
186
+ if (!self.class.attribute_map.key?(k.to_sym))
187
+ fail ArgumentError, "`#{k}` is not a valid attribute in `KoronaCloudClient::StockOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
188
+ end
189
+ h[k.to_sym] = v
190
+ }
191
+
192
+ if attributes.key?(:'active')
193
+ self.active = attributes[:'active']
194
+ end
195
+
196
+ if attributes.key?(:'id')
197
+ self.id = attributes[:'id']
198
+ end
199
+
200
+ if attributes.key?(:'number')
201
+ self.number = attributes[:'number']
202
+ end
203
+
204
+ if attributes.key?(:'revision')
205
+ self.revision = attributes[:'revision']
206
+ end
207
+
208
+ if attributes.key?(:'booking_time')
209
+ self.booking_time = attributes[:'booking_time']
210
+ end
211
+
212
+ if attributes.key?(:'booking_user')
213
+ self.booking_user = attributes[:'booking_user']
214
+ end
215
+
216
+ if attributes.key?(:'booking_api_user')
217
+ self.booking_api_user = attributes[:'booking_api_user']
218
+ end
219
+
220
+ if attributes.key?(:'cashier')
221
+ self.cashier = attributes[:'cashier']
222
+ end
223
+
224
+ if attributes.key?(:'create_time')
225
+ self.create_time = attributes[:'create_time']
226
+ end
227
+
228
+ if attributes.key?(:'create_user')
229
+ self.create_user = attributes[:'create_user']
230
+ end
231
+
232
+ if attributes.key?(:'customer')
233
+ self.customer = attributes[:'customer']
234
+ end
235
+
236
+ if attributes.key?(:'description')
237
+ self.description = attributes[:'description']
238
+ end
239
+
240
+ if attributes.key?(:'items_count')
241
+ self.items_count = attributes[:'items_count']
242
+ end
243
+
244
+ if attributes.key?(:'organizational_unit')
245
+ self.organizational_unit = attributes[:'organizational_unit']
246
+ end
247
+
248
+ if attributes.key?(:'party_information')
249
+ self.party_information = attributes[:'party_information']
250
+ end
251
+
252
+ if attributes.key?(:'point_of_sale')
253
+ self.point_of_sale = attributes[:'point_of_sale']
254
+ end
255
+
256
+ if attributes.key?(:'source_organizational_unit')
257
+ self.source_organizational_unit = attributes[:'source_organizational_unit']
258
+ end
259
+
260
+ if attributes.key?(:'supplier')
261
+ self.supplier = attributes[:'supplier']
262
+ end
263
+
264
+ if attributes.key?(:'comment')
265
+ self.comment = attributes[:'comment']
266
+ end
267
+
268
+ if attributes.key?(:'deposit')
269
+ self.deposit = attributes[:'deposit']
270
+ end
271
+
272
+ if attributes.key?(:'pickup_date')
273
+ self.pickup_date = attributes[:'pickup_date']
274
+ end
275
+
276
+ if attributes.key?(:'store_order')
277
+ self.store_order = attributes[:'store_order']
278
+ end
279
+
280
+ if attributes.key?(:'special_offer_code')
281
+ self.special_offer_code = attributes[:'special_offer_code']
282
+ end
283
+
284
+ if attributes.key?(:'shipping_condition')
285
+ self.shipping_condition = attributes[:'shipping_condition']
286
+ end
287
+
288
+ if attributes.key?(:'shipping_supplier_information')
289
+ self.shipping_supplier_information = attributes[:'shipping_supplier_information']
290
+ end
291
+
292
+ if attributes.key?(:'expected_from_date')
293
+ self.expected_from_date = attributes[:'expected_from_date']
294
+ end
295
+
296
+ if attributes.key?(:'expected_to_date')
297
+ self.expected_to_date = attributes[:'expected_to_date']
298
+ end
299
+
300
+ if attributes.key?(:'items')
301
+ if (value = attributes[:'items']).is_a?(Array)
302
+ self.items = value
303
+ end
304
+ end
305
+
306
+ if attributes.key?(:'status')
307
+ self.status = attributes[:'status']
308
+ end
309
+ end
310
+
311
+ # Show invalid properties with the reasons. Usually used together with valid?
312
+ # @return Array for valid properties with the reasons
313
+ def list_invalid_properties
314
+ invalid_properties = Array.new
315
+ invalid_properties
316
+ end
317
+
318
+ # Check to see if the all the properties in the model are valid
319
+ # @return true if the model is valid
320
+ def valid?
321
+ status_validator = EnumAttributeValidator.new('String', ["BOOKED", "IN_PROGRESS"])
322
+ return false unless status_validator.valid?(@status)
323
+ true
324
+ end
325
+
326
+ # Custom attribute writer method checking allowed values (enum).
327
+ # @param [Object] status Object to be assigned
328
+ def status=(status)
329
+ validator = EnumAttributeValidator.new('String', ["BOOKED", "IN_PROGRESS"])
330
+ unless validator.valid?(status)
331
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
332
+ end
333
+ @status = status
334
+ end
335
+
336
+ # Checks equality by comparing each attribute.
337
+ # @param [Object] Object to be compared
338
+ def ==(o)
339
+ return true if self.equal?(o)
340
+ self.class == o.class &&
341
+ active == o.active &&
342
+ id == o.id &&
343
+ number == o.number &&
344
+ revision == o.revision &&
345
+ booking_time == o.booking_time &&
346
+ booking_user == o.booking_user &&
347
+ booking_api_user == o.booking_api_user &&
348
+ cashier == o.cashier &&
349
+ create_time == o.create_time &&
350
+ create_user == o.create_user &&
351
+ customer == o.customer &&
352
+ description == o.description &&
353
+ items_count == o.items_count &&
354
+ organizational_unit == o.organizational_unit &&
355
+ party_information == o.party_information &&
356
+ point_of_sale == o.point_of_sale &&
357
+ source_organizational_unit == o.source_organizational_unit &&
358
+ supplier == o.supplier &&
359
+ comment == o.comment &&
360
+ deposit == o.deposit &&
361
+ pickup_date == o.pickup_date &&
362
+ store_order == o.store_order &&
363
+ special_offer_code == o.special_offer_code &&
364
+ shipping_condition == o.shipping_condition &&
365
+ shipping_supplier_information == o.shipping_supplier_information &&
366
+ expected_from_date == o.expected_from_date &&
367
+ expected_to_date == o.expected_to_date &&
368
+ items == o.items &&
369
+ status == o.status
370
+ end
371
+
372
+ # @see the `==` method
373
+ # @param [Object] Object to be compared
374
+ def eql?(o)
375
+ self == o
376
+ end
377
+
378
+ # Calculates hash code according to all attributes.
379
+ # @return [Integer] Hash code
380
+ def hash
381
+ [active, id, number, revision, booking_time, booking_user, booking_api_user, cashier, create_time, create_user, customer, description, items_count, organizational_unit, party_information, point_of_sale, source_organizational_unit, supplier, comment, deposit, pickup_date, store_order, special_offer_code, shipping_condition, shipping_supplier_information, expected_from_date, expected_to_date, items, status].hash
382
+ end
383
+
384
+ # Builds the object from hash
385
+ # @param [Hash] attributes Model attributes in the form of hash
386
+ # @return [Object] Returns the model itself
387
+ def self.build_from_hash(attributes)
388
+ new.build_from_hash(attributes)
389
+ end
390
+
391
+ # Builds the object from hash
392
+ # @param [Hash] attributes Model attributes in the form of hash
393
+ # @return [Object] Returns the model itself
394
+ def build_from_hash(attributes)
395
+ return nil unless attributes.is_a?(Hash)
396
+ self.class.openapi_types.each_pair do |key, type|
397
+ if type =~ /\AArray<(.*)>/i
398
+ # check to ensure the input is an array given that the attribute
399
+ # is documented as an array but the input is not
400
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
401
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
402
+ end
403
+ elsif !attributes[self.class.attribute_map[key]].nil?
404
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
405
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
406
+ end
407
+
408
+ self
409
+ end
410
+
411
+ # Deserializes the data based on type
412
+ # @param string type Data type
413
+ # @param string value Value to be deserialized
414
+ # @return [Object] Deserialized data
415
+ def _deserialize(type, value)
416
+ case type.to_sym
417
+ when :DateTime
418
+ DateTime.parse(value)
419
+ when :Date
420
+ Date.parse(value)
421
+ when :String
422
+ value.to_s
423
+ when :Integer
424
+ value.to_i
425
+ when :Float
426
+ value.to_f
427
+ when :Boolean
428
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
429
+ true
430
+ else
431
+ false
432
+ end
433
+ when :Object
434
+ # generic object (usually a Hash), return directly
435
+ value
436
+ when /\AArray<(?<inner_type>.+)>\z/
437
+ inner_type = Regexp.last_match[:inner_type]
438
+ value.map { |v| _deserialize(inner_type, v) }
439
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
440
+ k_type = Regexp.last_match[:k_type]
441
+ v_type = Regexp.last_match[:v_type]
442
+ {}.tap do |hash|
443
+ value.each do |k, v|
444
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
445
+ end
446
+ end
447
+ else # model
448
+ KoronaCloudClient.const_get(type).build_from_hash(value)
449
+ end
450
+ end
451
+
452
+ # Returns the string representation of the object
453
+ # @return [String] String presentation of the object
454
+ def to_s
455
+ to_hash.to_s
456
+ end
457
+
458
+ # to_body is an alias to to_hash (backward compatibility)
459
+ # @return [Hash] Returns the object in the form of hash
460
+ def to_body
461
+ to_hash
462
+ end
463
+
464
+ # Returns the object in the form of hash
465
+ # @return [Hash] Returns the object in the form of hash
466
+ def to_hash
467
+ hash = {}
468
+ self.class.attribute_map.each_pair do |attr, param|
469
+ value = self.send(attr)
470
+ if value.nil?
471
+ is_nullable = self.class.openapi_nullable.include?(attr)
472
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
473
+ end
474
+
475
+ hash[param] = _to_hash(value)
476
+ end
477
+ hash
478
+ end
479
+
480
+ # Outputs non-array value in the form of hash
481
+ # For object, use to_hash. Otherwise, just return the value
482
+ # @param [Object] value Any valid value
483
+ # @return [Hash] Returns the value in the form of hash
484
+ def _to_hash(value)
485
+ if value.is_a?(Array)
486
+ value.compact.map { |v| _to_hash(v) }
487
+ elsif value.is_a?(Hash)
488
+ {}.tap do |hash|
489
+ value.each { |k, v| hash[k] = _to_hash(v) }
490
+ end
491
+ elsif value.respond_to? :to_hash
492
+ value.to_hash
493
+ else
494
+ value
495
+ end
496
+ end
497
+ end
498
+ end