order_cloud 1.0.45.pre.staging → 1.0.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (446) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +28 -0
  3. data/Gemfile.lock +34 -0
  4. data/LICENSE +201 -0
  5. data/README.md +552 -0
  6. data/Rakefile +31 -0
  7. data/docs/AccessToken.md +11 -0
  8. data/docs/Address.md +20 -0
  9. data/docs/AddressApi.md +520 -0
  10. data/docs/AddressAssignment.md +12 -0
  11. data/docs/AdminAddressApi.md +324 -0
  12. data/docs/AdminUserApi.md +324 -0
  13. data/docs/AdminUserGroupApi.md +482 -0
  14. data/docs/ApprovalRule.md +13 -0
  15. data/docs/ApprovalRuleApi.md +342 -0
  16. data/docs/BaseSpec.md +16 -0
  17. data/docs/Buyer.md +12 -0
  18. data/docs/BuyerAddress.md +23 -0
  19. data/docs/BuyerApi.md +324 -0
  20. data/docs/BuyerCreditCard.md +16 -0
  21. data/docs/BuyerProduct.md +23 -0
  22. data/docs/BuyerShipment.md +19 -0
  23. data/docs/BuyerSpec.md +17 -0
  24. data/docs/Catalog.md +13 -0
  25. data/docs/CatalogApi.md +640 -0
  26. data/docs/CatalogAssignment.md +11 -0
  27. data/docs/Category.md +15 -0
  28. data/docs/CategoryApi.md +690 -0
  29. data/docs/CategoryAssignment.md +12 -0
  30. data/docs/CategoryProductAssignment.md +10 -0
  31. data/docs/CostCenter.md +11 -0
  32. data/docs/CostCenterApi.md +516 -0
  33. data/docs/CostCenterAssignment.md +9 -0
  34. data/docs/CreditCard.md +15 -0
  35. data/docs/CreditCardApi.md +516 -0
  36. data/docs/CreditCardAssignment.md +10 -0
  37. data/docs/ImpersonateTokenRequest.md +9 -0
  38. data/docs/ImpersonationConfig.md +16 -0
  39. data/docs/ImpersonationConfigApi.md +324 -0
  40. data/docs/Inventory.md +13 -0
  41. data/docs/LineItem.md +24 -0
  42. data/docs/LineItemApi.md +478 -0
  43. data/docs/LineItemProduct.md +16 -0
  44. data/docs/LineItemSpec.md +11 -0
  45. data/docs/ListAddress.md +9 -0
  46. data/docs/ListAddressAssignment.md +9 -0
  47. data/docs/ListApprovalRule.md +9 -0
  48. data/docs/ListArgs.md +13 -0
  49. data/docs/ListBuyer.md +9 -0
  50. data/docs/ListBuyerAddress.md +9 -0
  51. data/docs/ListBuyerCreditCard.md +9 -0
  52. data/docs/ListBuyerProduct.md +9 -0
  53. data/docs/ListBuyerShipment.md +9 -0
  54. data/docs/ListBuyerSpec.md +9 -0
  55. data/docs/ListCatalog.md +9 -0
  56. data/docs/ListCatalogAssignment.md +9 -0
  57. data/docs/ListCategory.md +9 -0
  58. data/docs/ListCategoryAssignment.md +9 -0
  59. data/docs/ListCategoryProductAssignment.md +9 -0
  60. data/docs/ListCostCenter.md +9 -0
  61. data/docs/ListCostCenterAssignment.md +9 -0
  62. data/docs/ListCreditCard.md +9 -0
  63. data/docs/ListCreditCardAssignment.md +9 -0
  64. data/docs/ListImpersonationConfig.md +9 -0
  65. data/docs/ListLineItem.md +9 -0
  66. data/docs/ListMessageCCListenerAssignment.md +9 -0
  67. data/docs/ListMessageConfig.md +9 -0
  68. data/docs/ListMessageSender.md +9 -0
  69. data/docs/ListMessageSenderAssignment.md +9 -0
  70. data/docs/ListOrder.md +9 -0
  71. data/docs/ListOrderApproval.md +9 -0
  72. data/docs/ListOrderPromotion.md +9 -0
  73. data/docs/ListPayment.md +9 -0
  74. data/docs/ListPriceSchedule.md +9 -0
  75. data/docs/ListProduct.md +9 -0
  76. data/docs/ListProductAssignment.md +9 -0
  77. data/docs/ListProductCatalogAssignment.md +9 -0
  78. data/docs/ListPromotion.md +9 -0
  79. data/docs/ListPromotionAssignment.md +9 -0
  80. data/docs/ListSecurityProfile.md +9 -0
  81. data/docs/ListSecurityProfileAssignment.md +9 -0
  82. data/docs/ListShipment.md +9 -0
  83. data/docs/ListShipmentItem.md +9 -0
  84. data/docs/ListSpec.md +9 -0
  85. data/docs/ListSpecOption.md +9 -0
  86. data/docs/ListSpecProductAssignment.md +9 -0
  87. data/docs/ListSpendingAccount.md +9 -0
  88. data/docs/ListSpendingAccountAssignment.md +9 -0
  89. data/docs/ListSupplier.md +9 -0
  90. data/docs/ListUser.md +9 -0
  91. data/docs/ListUserGroup.md +9 -0
  92. data/docs/ListUserGroupAssignment.md +9 -0
  93. data/docs/ListVariant.md +9 -0
  94. data/docs/MeApi.md +2002 -0
  95. data/docs/MeBuyer.md +9 -0
  96. data/docs/MeUser.md +19 -0
  97. data/docs/MessageCCListenerAssignment.md +13 -0
  98. data/docs/MessageConfig.md +14 -0
  99. data/docs/MessageSender.md +10 -0
  100. data/docs/MessageSenderAssignment.md +11 -0
  101. data/docs/MessageSendersApi.md +398 -0
  102. data/docs/Meta.md +12 -0
  103. data/docs/Order.md +30 -0
  104. data/docs/OrderApi.md +1161 -0
  105. data/docs/OrderApproval.md +14 -0
  106. data/docs/OrderApprovalInfo.md +9 -0
  107. data/docs/OrderPromotion.md +22 -0
  108. data/docs/PasswordReset.md +10 -0
  109. data/docs/PasswordResetApi.md +109 -0
  110. data/docs/PasswordResetRequest.md +11 -0
  111. data/docs/Payment.md +17 -0
  112. data/docs/PaymentApi.md +418 -0
  113. data/docs/PaymentTransaction.md +15 -0
  114. data/docs/PriceBreak.md +9 -0
  115. data/docs/PriceSchedule.md +17 -0
  116. data/docs/PriceScheduleApi.md +429 -0
  117. data/docs/Product.md +23 -0
  118. data/docs/ProductApi.md +953 -0
  119. data/docs/ProductAssignment.md +11 -0
  120. data/docs/ProductBase.md +22 -0
  121. data/docs/ProductCatalogAssignment.md +9 -0
  122. data/docs/Promotion.md +21 -0
  123. data/docs/PromotionApi.md +494 -0
  124. data/docs/PromotionAssignment.md +10 -0
  125. data/docs/SecurityProfile.md +10 -0
  126. data/docs/SecurityProfileApi.md +292 -0
  127. data/docs/SecurityProfileAssignment.md +12 -0
  128. data/docs/Shipment.md +20 -0
  129. data/docs/ShipmentApi.md +554 -0
  130. data/docs/ShipmentItem.md +16 -0
  131. data/docs/Spec.md +17 -0
  132. data/docs/SpecApi.md +820 -0
  133. data/docs/SpecOption.md +14 -0
  134. data/docs/SpecProductAssignment.md +11 -0
  135. data/docs/SpendingAccount.md +15 -0
  136. data/docs/SpendingAccountApi.md +516 -0
  137. data/docs/SpendingAccountAssignment.md +11 -0
  138. data/docs/Supplier.md +11 -0
  139. data/docs/SupplierApi.md +324 -0
  140. data/docs/SupplierUserApi.md +400 -0
  141. data/docs/SupplierUserGroupApi.md +509 -0
  142. data/docs/TokenPasswordReset.md +8 -0
  143. data/docs/User.md +18 -0
  144. data/docs/UserApi.md +400 -0
  145. data/docs/UserGroup.md +11 -0
  146. data/docs/UserGroupApi.md +509 -0
  147. data/docs/UserGroupAssignment.md +9 -0
  148. data/docs/Variant.md +12 -0
  149. data/git_push.sh +67 -0
  150. data/lib/order_cloud.rb +193 -0
  151. data/lib/order_cloud/api/address_api.rb +628 -0
  152. data/lib/order_cloud/api/admin_address_api.rb +397 -0
  153. data/lib/order_cloud/api/admin_user_api.rb +397 -0
  154. data/lib/order_cloud/api/admin_user_group_api.rb +578 -0
  155. data/lib/order_cloud/api/approval_rule_api.rb +421 -0
  156. data/lib/order_cloud/api/auth_api.rb +138 -0
  157. data/lib/order_cloud/api/buyer_api.rb +397 -0
  158. data/lib/order_cloud/api/catalog_api.rb +760 -0
  159. data/lib/order_cloud/api/category_api.rb +826 -0
  160. data/lib/order_cloud/api/cost_center_api.rb +622 -0
  161. data/lib/order_cloud/api/credit_card_api.rb +622 -0
  162. data/lib/order_cloud/api/impersonation_config_api.rb +397 -0
  163. data/lib/order_cloud/api/line_item_api.rb +583 -0
  164. data/lib/order_cloud/api/me_api.rb +2345 -0
  165. data/lib/order_cloud/api/message_senders_api.rb +484 -0
  166. data/lib/order_cloud/api/order_api.rb +1377 -0
  167. data/lib/order_cloud/api/password_reset_api.rb +150 -0
  168. data/lib/order_cloud/api/payment_api.rb +513 -0
  169. data/lib/order_cloud/api/price_schedule_api.rb +519 -0
  170. data/lib/order_cloud/api/product_api.rb +1126 -0
  171. data/lib/order_cloud/api/promotion_api.rb +594 -0
  172. data/lib/order_cloud/api/security_profile_api.rb +363 -0
  173. data/lib/order_cloud/api/shipment_api.rb +665 -0
  174. data/lib/order_cloud/api/spec_api.rb +971 -0
  175. data/lib/order_cloud/api/spending_account_api.rb +622 -0
  176. data/lib/order_cloud/api/supplier_api.rb +397 -0
  177. data/lib/order_cloud/api/supplier_user_api.rb +489 -0
  178. data/lib/order_cloud/api/supplier_user_group_api.rb +614 -0
  179. data/lib/order_cloud/api/user_api.rb +489 -0
  180. data/lib/order_cloud/api/user_group_api.rb +614 -0
  181. data/lib/order_cloud/api_client.rb +385 -0
  182. data/lib/order_cloud/api_error.rb +47 -0
  183. data/lib/order_cloud/configuration.rb +245 -0
  184. data/lib/order_cloud/models/access_token.rb +226 -0
  185. data/lib/order_cloud/models/address.rb +307 -0
  186. data/lib/order_cloud/models/address_assignment.rb +235 -0
  187. data/lib/order_cloud/models/approval_rule.rb +244 -0
  188. data/lib/order_cloud/models/base_spec.rb +271 -0
  189. data/lib/order_cloud/models/buyer.rb +235 -0
  190. data/lib/order_cloud/models/buyer_address.rb +334 -0
  191. data/lib/order_cloud/models/buyer_credit_card.rb +271 -0
  192. data/lib/order_cloud/models/buyer_product.rb +334 -0
  193. data/lib/order_cloud/models/buyer_shipment.rb +298 -0
  194. data/lib/order_cloud/models/buyer_spec.rb +282 -0
  195. data/lib/order_cloud/models/catalog.rb +244 -0
  196. data/lib/order_cloud/models/catalog_assignment.rb +226 -0
  197. data/lib/order_cloud/models/category.rb +262 -0
  198. data/lib/order_cloud/models/category_assignment.rb +235 -0
  199. data/lib/order_cloud/models/category_product_assignment.rb +217 -0
  200. data/lib/order_cloud/models/cost_center.rb +226 -0
  201. data/lib/order_cloud/models/cost_center_assignment.rb +208 -0
  202. data/lib/order_cloud/models/credit_card.rb +262 -0
  203. data/lib/order_cloud/models/credit_card_assignment.rb +217 -0
  204. data/lib/order_cloud/models/impersonate_token_request.rb +210 -0
  205. data/lib/order_cloud/models/impersonation_config.rb +271 -0
  206. data/lib/order_cloud/models/inventory.rb +244 -0
  207. data/lib/order_cloud/models/line_item.rb +345 -0
  208. data/lib/order_cloud/models/line_item_product.rb +271 -0
  209. data/lib/order_cloud/models/line_item_spec.rb +226 -0
  210. data/lib/order_cloud/models/list_address.rb +210 -0
  211. data/lib/order_cloud/models/list_address_assignment.rb +210 -0
  212. data/lib/order_cloud/models/list_approval_rule.rb +210 -0
  213. data/lib/order_cloud/models/list_args.rb +248 -0
  214. data/lib/order_cloud/models/list_buyer.rb +210 -0
  215. data/lib/order_cloud/models/list_buyer_address.rb +210 -0
  216. data/lib/order_cloud/models/list_buyer_credit_card.rb +210 -0
  217. data/lib/order_cloud/models/list_buyer_product.rb +210 -0
  218. data/lib/order_cloud/models/list_buyer_shipment.rb +210 -0
  219. data/lib/order_cloud/models/list_buyer_spec.rb +210 -0
  220. data/lib/order_cloud/models/list_catalog.rb +210 -0
  221. data/lib/order_cloud/models/list_catalog_assignment.rb +210 -0
  222. data/lib/order_cloud/models/list_category.rb +210 -0
  223. data/lib/order_cloud/models/list_category_assignment.rb +210 -0
  224. data/lib/order_cloud/models/list_category_product_assignment.rb +210 -0
  225. data/lib/order_cloud/models/list_cost_center.rb +210 -0
  226. data/lib/order_cloud/models/list_cost_center_assignment.rb +210 -0
  227. data/lib/order_cloud/models/list_credit_card.rb +210 -0
  228. data/lib/order_cloud/models/list_credit_card_assignment.rb +210 -0
  229. data/lib/order_cloud/models/list_impersonation_config.rb +210 -0
  230. data/lib/order_cloud/models/list_line_item.rb +210 -0
  231. data/lib/order_cloud/models/list_message_cc_listener_assignment.rb +210 -0
  232. data/lib/order_cloud/models/list_message_config.rb +210 -0
  233. data/lib/order_cloud/models/list_message_sender.rb +210 -0
  234. data/lib/order_cloud/models/list_message_sender_assignment.rb +210 -0
  235. data/lib/order_cloud/models/list_order.rb +210 -0
  236. data/lib/order_cloud/models/list_order_approval.rb +210 -0
  237. data/lib/order_cloud/models/list_order_promotion.rb +210 -0
  238. data/lib/order_cloud/models/list_payment.rb +210 -0
  239. data/lib/order_cloud/models/list_price_schedule.rb +210 -0
  240. data/lib/order_cloud/models/list_product.rb +210 -0
  241. data/lib/order_cloud/models/list_product_assignment.rb +210 -0
  242. data/lib/order_cloud/models/list_product_catalog_assignment.rb +210 -0
  243. data/lib/order_cloud/models/list_promotion.rb +210 -0
  244. data/lib/order_cloud/models/list_promotion_assignment.rb +210 -0
  245. data/lib/order_cloud/models/list_security_profile.rb +210 -0
  246. data/lib/order_cloud/models/list_security_profile_assignment.rb +210 -0
  247. data/lib/order_cloud/models/list_shipment.rb +210 -0
  248. data/lib/order_cloud/models/list_shipment_item.rb +210 -0
  249. data/lib/order_cloud/models/list_spec.rb +210 -0
  250. data/lib/order_cloud/models/list_spec_option.rb +210 -0
  251. data/lib/order_cloud/models/list_spec_product_assignment.rb +210 -0
  252. data/lib/order_cloud/models/list_spending_account.rb +210 -0
  253. data/lib/order_cloud/models/list_spending_account_assignment.rb +210 -0
  254. data/lib/order_cloud/models/list_supplier.rb +210 -0
  255. data/lib/order_cloud/models/list_user.rb +210 -0
  256. data/lib/order_cloud/models/list_user_group.rb +210 -0
  257. data/lib/order_cloud/models/list_user_group_assignment.rb +210 -0
  258. data/lib/order_cloud/models/list_variant.rb +210 -0
  259. data/lib/order_cloud/models/me_buyer.rb +208 -0
  260. data/lib/order_cloud/models/me_user.rb +300 -0
  261. data/lib/order_cloud/models/message_cc_listener_assignment.rb +244 -0
  262. data/lib/order_cloud/models/message_config.rb +255 -0
  263. data/lib/order_cloud/models/message_sender.rb +219 -0
  264. data/lib/order_cloud/models/message_sender_assignment.rb +226 -0
  265. data/lib/order_cloud/models/meta.rb +237 -0
  266. data/lib/order_cloud/models/order.rb +397 -0
  267. data/lib/order_cloud/models/order_approval.rb +253 -0
  268. data/lib/order_cloud/models/order_approval_info.rb +208 -0
  269. data/lib/order_cloud/models/order_promotion.rb +325 -0
  270. data/lib/order_cloud/models/password_reset.rb +217 -0
  271. data/lib/order_cloud/models/password_reset_request.rb +226 -0
  272. data/lib/order_cloud/models/payment.rb +282 -0
  273. data/lib/order_cloud/models/payment_transaction.rb +262 -0
  274. data/lib/order_cloud/models/price_break.rb +208 -0
  275. data/lib/order_cloud/models/price_schedule.rb +282 -0
  276. data/lib/order_cloud/models/product.rb +334 -0
  277. data/lib/order_cloud/models/product_assignment.rb +226 -0
  278. data/lib/order_cloud/models/product_base.rb +325 -0
  279. data/lib/order_cloud/models/product_catalog_assignment.rb +208 -0
  280. data/lib/order_cloud/models/promotion.rb +316 -0
  281. data/lib/order_cloud/models/promotion_assignment.rb +217 -0
  282. data/lib/order_cloud/models/security_profile.rb +219 -0
  283. data/lib/order_cloud/models/security_profile_assignment.rb +235 -0
  284. data/lib/order_cloud/models/shipment.rb +307 -0
  285. data/lib/order_cloud/models/shipment_item.rb +273 -0
  286. data/lib/order_cloud/models/spec.rb +280 -0
  287. data/lib/order_cloud/models/spec_option.rb +253 -0
  288. data/lib/order_cloud/models/spec_product_assignment.rb +226 -0
  289. data/lib/order_cloud/models/spending_account.rb +262 -0
  290. data/lib/order_cloud/models/spending_account_assignment.rb +226 -0
  291. data/lib/order_cloud/models/supplier.rb +226 -0
  292. data/lib/order_cloud/models/token_password_reset.rb +199 -0
  293. data/lib/order_cloud/models/user.rb +291 -0
  294. data/lib/order_cloud/models/user_group.rb +226 -0
  295. data/lib/order_cloud/models/user_group_assignment.rb +208 -0
  296. data/lib/order_cloud/models/variant.rb +235 -0
  297. data/lib/order_cloud/version.rb +26 -0
  298. data/order_cloud-1.0.56.gem +0 -0
  299. data/order_cloud.gemspec +56 -0
  300. data/spec/api/address_api_spec.rb +179 -0
  301. data/spec/api/admin_address_api_spec.rb +125 -0
  302. data/spec/api/admin_user_api_spec.rb +125 -0
  303. data/spec/api/admin_user_group_api_spec.rb +165 -0
  304. data/spec/api/approval_rule_api_spec.rb +131 -0
  305. data/spec/api/auth_api_spec.rb +165 -0
  306. data/spec/api/buyer_api_spec.rb +125 -0
  307. data/spec/api/catalog_api_spec.rb +205 -0
  308. data/spec/api/category_api_spec.rb +223 -0
  309. data/spec/api/cost_center_api_spec.rb +177 -0
  310. data/spec/api/credit_card_api_spec.rb +177 -0
  311. data/spec/api/impersonation_config_api_spec.rb +125 -0
  312. data/spec/api/line_item_api_spec.rb +167 -0
  313. data/spec/api/me_api_spec.rb +568 -0
  314. data/spec/api/message_senders_api_spec.rb +149 -0
  315. data/spec/api/order_api_spec.rb +344 -0
  316. data/spec/api/password_reset_api_spec.rb +71 -0
  317. data/spec/api/payment_api_spec.rb +152 -0
  318. data/spec/api/price_schedule_api_spec.rb +151 -0
  319. data/spec/api/product_api_spec.rb +290 -0
  320. data/spec/api/promotion_api_spec.rb +170 -0
  321. data/spec/api/security_profile_api_spec.rb +122 -0
  322. data/spec/api/shipment_api_spec.rb +185 -0
  323. data/spec/api/spec_api_spec.rb +252 -0
  324. data/spec/api/spending_account_api_spec.rb +177 -0
  325. data/spec/api/supplier_api_spec.rb +125 -0
  326. data/spec/api/supplier_user_api_spec.rb +146 -0
  327. data/spec/api/supplier_user_group_api_spec.rb +174 -0
  328. data/spec/api/user_api_spec.rb +146 -0
  329. data/spec/api/user_group_api_spec.rb +174 -0
  330. data/spec/api_client_spec.rb +237 -0
  331. data/spec/configuration_spec.rb +80 -0
  332. data/spec/models/access_token_spec.rb +71 -0
  333. data/spec/models/address_assignment_spec.rb +77 -0
  334. data/spec/models/address_spec.rb +125 -0
  335. data/spec/models/approval_rule_spec.rb +83 -0
  336. data/spec/models/base_spec_spec.rb +101 -0
  337. data/spec/models/buyer_address_spec.rb +143 -0
  338. data/spec/models/buyer_credit_card_spec.rb +101 -0
  339. data/spec/models/buyer_product_spec.rb +143 -0
  340. data/spec/models/buyer_shipment_spec.rb +119 -0
  341. data/spec/models/buyer_spec.rb +77 -0
  342. data/spec/models/buyer_spec_spec.rb +107 -0
  343. data/spec/models/catalog_assignment_spec.rb +71 -0
  344. data/spec/models/catalog_spec.rb +83 -0
  345. data/spec/models/category_assignment_spec.rb +77 -0
  346. data/spec/models/category_product_assignment_spec.rb +65 -0
  347. data/spec/models/category_spec.rb +95 -0
  348. data/spec/models/cost_center_assignment_spec.rb +59 -0
  349. data/spec/models/cost_center_spec.rb +71 -0
  350. data/spec/models/credit_card_assignment_spec.rb +65 -0
  351. data/spec/models/credit_card_spec.rb +95 -0
  352. data/spec/models/impersonate_token_request_spec.rb +59 -0
  353. data/spec/models/impersonation_config_spec.rb +101 -0
  354. data/spec/models/inventory_spec.rb +83 -0
  355. data/spec/models/line_item_product_spec.rb +101 -0
  356. data/spec/models/line_item_spec.rb +149 -0
  357. data/spec/models/line_item_spec_spec.rb +71 -0
  358. data/spec/models/list_address_assignment_spec.rb +59 -0
  359. data/spec/models/list_address_spec.rb +59 -0
  360. data/spec/models/list_approval_rule_spec.rb +59 -0
  361. data/spec/models/list_args_spec.rb +83 -0
  362. data/spec/models/list_buyer_address_spec.rb +59 -0
  363. data/spec/models/list_buyer_credit_card_spec.rb +59 -0
  364. data/spec/models/list_buyer_product_spec.rb +59 -0
  365. data/spec/models/list_buyer_shipment_spec.rb +59 -0
  366. data/spec/models/list_buyer_spec.rb +59 -0
  367. data/spec/models/list_buyer_spec_spec.rb +59 -0
  368. data/spec/models/list_catalog_assignment_spec.rb +59 -0
  369. data/spec/models/list_catalog_spec.rb +59 -0
  370. data/spec/models/list_category_assignment_spec.rb +59 -0
  371. data/spec/models/list_category_product_assignment_spec.rb +59 -0
  372. data/spec/models/list_category_spec.rb +59 -0
  373. data/spec/models/list_cost_center_assignment_spec.rb +59 -0
  374. data/spec/models/list_cost_center_spec.rb +59 -0
  375. data/spec/models/list_credit_card_assignment_spec.rb +59 -0
  376. data/spec/models/list_credit_card_spec.rb +59 -0
  377. data/spec/models/list_impersonation_config_spec.rb +59 -0
  378. data/spec/models/list_line_item_spec.rb +59 -0
  379. data/spec/models/list_message_cc_listener_assignment_spec.rb +59 -0
  380. data/spec/models/list_message_config_spec.rb +59 -0
  381. data/spec/models/list_message_sender_assignment_spec.rb +59 -0
  382. data/spec/models/list_message_sender_spec.rb +59 -0
  383. data/spec/models/list_order_approval_spec.rb +59 -0
  384. data/spec/models/list_order_promotion_spec.rb +59 -0
  385. data/spec/models/list_order_spec.rb +59 -0
  386. data/spec/models/list_payment_spec.rb +59 -0
  387. data/spec/models/list_price_schedule_spec.rb +59 -0
  388. data/spec/models/list_product_assignment_spec.rb +59 -0
  389. data/spec/models/list_product_catalog_assignment_spec.rb +59 -0
  390. data/spec/models/list_product_spec.rb +59 -0
  391. data/spec/models/list_promotion_assignment_spec.rb +59 -0
  392. data/spec/models/list_promotion_spec.rb +59 -0
  393. data/spec/models/list_security_profile_assignment_spec.rb +59 -0
  394. data/spec/models/list_security_profile_spec.rb +59 -0
  395. data/spec/models/list_shipment_item_spec.rb +59 -0
  396. data/spec/models/list_shipment_spec.rb +59 -0
  397. data/spec/models/list_spec_option_spec.rb +59 -0
  398. data/spec/models/list_spec_product_assignment_spec.rb +59 -0
  399. data/spec/models/list_spec_spec.rb +59 -0
  400. data/spec/models/list_spending_account_assignment_spec.rb +59 -0
  401. data/spec/models/list_spending_account_spec.rb +59 -0
  402. data/spec/models/list_supplier_spec.rb +59 -0
  403. data/spec/models/list_user_group_assignment_spec.rb +59 -0
  404. data/spec/models/list_user_group_spec.rb +59 -0
  405. data/spec/models/list_user_spec.rb +59 -0
  406. data/spec/models/list_variant_spec.rb +59 -0
  407. data/spec/models/me_buyer_spec.rb +59 -0
  408. data/spec/models/me_user_spec.rb +119 -0
  409. data/spec/models/message_cc_listener_assignment_spec.rb +83 -0
  410. data/spec/models/message_config_spec.rb +89 -0
  411. data/spec/models/message_sender_assignment_spec.rb +71 -0
  412. data/spec/models/message_sender_spec.rb +65 -0
  413. data/spec/models/meta_spec.rb +77 -0
  414. data/spec/models/order_approval_info_spec.rb +59 -0
  415. data/spec/models/order_approval_spec.rb +89 -0
  416. data/spec/models/order_promotion_spec.rb +137 -0
  417. data/spec/models/order_spec.rb +185 -0
  418. data/spec/models/password_reset_request_spec.rb +71 -0
  419. data/spec/models/password_reset_spec.rb +65 -0
  420. data/spec/models/payment_spec.rb +107 -0
  421. data/spec/models/payment_transaction_spec.rb +95 -0
  422. data/spec/models/price_break_spec.rb +59 -0
  423. data/spec/models/price_schedule_spec.rb +107 -0
  424. data/spec/models/product_assignment_spec.rb +71 -0
  425. data/spec/models/product_base_spec.rb +137 -0
  426. data/spec/models/product_catalog_assignment_spec.rb +59 -0
  427. data/spec/models/product_spec.rb +143 -0
  428. data/spec/models/promotion_assignment_spec.rb +65 -0
  429. data/spec/models/promotion_spec.rb +131 -0
  430. data/spec/models/security_profile_assignment_spec.rb +77 -0
  431. data/spec/models/security_profile_spec.rb +65 -0
  432. data/spec/models/shipment_item_spec.rb +101 -0
  433. data/spec/models/shipment_spec.rb +125 -0
  434. data/spec/models/spec_option_spec.rb +89 -0
  435. data/spec/models/spec_product_assignment_spec.rb +71 -0
  436. data/spec/models/spec_spec.rb +107 -0
  437. data/spec/models/spending_account_assignment_spec.rb +71 -0
  438. data/spec/models/spending_account_spec.rb +95 -0
  439. data/spec/models/supplier_spec.rb +71 -0
  440. data/spec/models/token_password_reset_spec.rb +53 -0
  441. data/spec/models/user_group_assignment_spec.rb +59 -0
  442. data/spec/models/user_group_spec.rb +71 -0
  443. data/spec/models/user_spec.rb +113 -0
  444. data/spec/models/variant_spec.rb +77 -0
  445. data/spec/spec_helper.rb +122 -0
  446. metadata +596 -6
@@ -0,0 +1,282 @@
1
+ =begin
2
+ #OrderCloud
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+ Contact: ordercloud@four51.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module OrderCloud
27
+
28
+ class PriceSchedule
29
+ attr_accessor :id
30
+
31
+ attr_accessor :name
32
+
33
+ attr_accessor :apply_tax
34
+
35
+ attr_accessor :apply_shipping
36
+
37
+ attr_accessor :min_quantity
38
+
39
+ attr_accessor :max_quantity
40
+
41
+ attr_accessor :use_cumulative_quantity
42
+
43
+ attr_accessor :restricted_quantity
44
+
45
+ attr_accessor :price_breaks
46
+
47
+ attr_accessor :xp
48
+
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'id' => :'ID',
54
+ :'name' => :'Name',
55
+ :'apply_tax' => :'ApplyTax',
56
+ :'apply_shipping' => :'ApplyShipping',
57
+ :'min_quantity' => :'MinQuantity',
58
+ :'max_quantity' => :'MaxQuantity',
59
+ :'use_cumulative_quantity' => :'UseCumulativeQuantity',
60
+ :'restricted_quantity' => :'RestrictedQuantity',
61
+ :'price_breaks' => :'PriceBreaks',
62
+ :'xp' => :'xp'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'id' => :'String',
70
+ :'name' => :'String',
71
+ :'apply_tax' => :'BOOLEAN',
72
+ :'apply_shipping' => :'BOOLEAN',
73
+ :'min_quantity' => :'Integer',
74
+ :'max_quantity' => :'Integer',
75
+ :'use_cumulative_quantity' => :'BOOLEAN',
76
+ :'restricted_quantity' => :'BOOLEAN',
77
+ :'price_breaks' => :'Array<PriceBreak>',
78
+ :'xp' => :'Object'
79
+ }
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ return unless attributes.is_a?(Hash)
86
+
87
+ # convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
89
+
90
+ if attributes.has_key?(:'ID')
91
+ self.id = attributes[:'ID']
92
+ end
93
+
94
+ if attributes.has_key?(:'Name')
95
+ self.name = attributes[:'Name']
96
+ end
97
+
98
+ if attributes.has_key?(:'ApplyTax')
99
+ self.apply_tax = attributes[:'ApplyTax']
100
+ end
101
+
102
+ if attributes.has_key?(:'ApplyShipping')
103
+ self.apply_shipping = attributes[:'ApplyShipping']
104
+ end
105
+
106
+ if attributes.has_key?(:'MinQuantity')
107
+ self.min_quantity = attributes[:'MinQuantity']
108
+ end
109
+
110
+ if attributes.has_key?(:'MaxQuantity')
111
+ self.max_quantity = attributes[:'MaxQuantity']
112
+ end
113
+
114
+ if attributes.has_key?(:'UseCumulativeQuantity')
115
+ self.use_cumulative_quantity = attributes[:'UseCumulativeQuantity']
116
+ end
117
+
118
+ if attributes.has_key?(:'RestrictedQuantity')
119
+ self.restricted_quantity = attributes[:'RestrictedQuantity']
120
+ end
121
+
122
+ if attributes.has_key?(:'PriceBreaks')
123
+ if (value = attributes[:'PriceBreaks']).is_a?(Array)
124
+ self.price_breaks = value
125
+ end
126
+ end
127
+
128
+ if attributes.has_key?(:'xp')
129
+ self.xp = attributes[:'xp']
130
+ end
131
+
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properies with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ return invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return true
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ id == o.id &&
153
+ name == o.name &&
154
+ apply_tax == o.apply_tax &&
155
+ apply_shipping == o.apply_shipping &&
156
+ min_quantity == o.min_quantity &&
157
+ max_quantity == o.max_quantity &&
158
+ use_cumulative_quantity == o.use_cumulative_quantity &&
159
+ restricted_quantity == o.restricted_quantity &&
160
+ price_breaks == o.price_breaks &&
161
+ xp == o.xp
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Fixnum] Hash code
172
+ def hash
173
+ [id, name, apply_tax, apply_shipping, min_quantity, max_quantity, use_cumulative_quantity, restricted_quantity, price_breaks, xp].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ self.class.swagger_types.each_pair do |key, type|
182
+ if type =~ /^Array<(.*)>/i
183
+ # check to ensure the input is an array given that the the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
186
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
187
+ end
188
+ elsif !attributes[self.class.attribute_map[key]].nil?
189
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
190
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def _deserialize(type, value)
201
+ case type.to_sym
202
+ when :DateTime
203
+ DateTime.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :BOOLEAN
213
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ temp_model = OrderCloud.const_get(type).new
234
+ temp_model.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ next if value.nil?
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map{ |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+
282
+ end
@@ -0,0 +1,334 @@
1
+ =begin
2
+ #OrderCloud
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: 1.0
7
+ Contact: ordercloud@four51.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'date'
25
+
26
+ module OrderCloud
27
+
28
+ class Product
29
+ attr_accessor :default_price_schedule_id
30
+
31
+ attr_accessor :id
32
+
33
+ attr_accessor :name
34
+
35
+ attr_accessor :description
36
+
37
+ attr_accessor :quantity_multiplier
38
+
39
+ attr_accessor :ship_weight
40
+
41
+ attr_accessor :ship_height
42
+
43
+ attr_accessor :ship_width
44
+
45
+ attr_accessor :ship_length
46
+
47
+ attr_accessor :active
48
+
49
+ attr_accessor :spec_count
50
+
51
+ attr_accessor :xp
52
+
53
+ attr_accessor :variant_count
54
+
55
+ attr_accessor :ship_from_address_id
56
+
57
+ attr_accessor :inventory
58
+
59
+ attr_accessor :auto_forward_supplier_id
60
+
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'default_price_schedule_id' => :'DefaultPriceScheduleID',
66
+ :'id' => :'ID',
67
+ :'name' => :'Name',
68
+ :'description' => :'Description',
69
+ :'quantity_multiplier' => :'QuantityMultiplier',
70
+ :'ship_weight' => :'ShipWeight',
71
+ :'ship_height' => :'ShipHeight',
72
+ :'ship_width' => :'ShipWidth',
73
+ :'ship_length' => :'ShipLength',
74
+ :'active' => :'Active',
75
+ :'spec_count' => :'SpecCount',
76
+ :'xp' => :'xp',
77
+ :'variant_count' => :'VariantCount',
78
+ :'ship_from_address_id' => :'ShipFromAddressID',
79
+ :'inventory' => :'Inventory',
80
+ :'auto_forward_supplier_id' => :'AutoForwardSupplierID'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.swagger_types
86
+ {
87
+ :'default_price_schedule_id' => :'String',
88
+ :'id' => :'String',
89
+ :'name' => :'String',
90
+ :'description' => :'String',
91
+ :'quantity_multiplier' => :'Integer',
92
+ :'ship_weight' => :'Float',
93
+ :'ship_height' => :'Float',
94
+ :'ship_width' => :'Float',
95
+ :'ship_length' => :'Float',
96
+ :'active' => :'BOOLEAN',
97
+ :'spec_count' => :'Integer',
98
+ :'xp' => :'Object',
99
+ :'variant_count' => :'Integer',
100
+ :'ship_from_address_id' => :'String',
101
+ :'inventory' => :'Inventory',
102
+ :'auto_forward_supplier_id' => :'String'
103
+ }
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ return unless attributes.is_a?(Hash)
110
+
111
+ # convert string to symbol for hash key
112
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
113
+
114
+ if attributes.has_key?(:'DefaultPriceScheduleID')
115
+ self.default_price_schedule_id = attributes[:'DefaultPriceScheduleID']
116
+ end
117
+
118
+ if attributes.has_key?(:'ID')
119
+ self.id = attributes[:'ID']
120
+ end
121
+
122
+ if attributes.has_key?(:'Name')
123
+ self.name = attributes[:'Name']
124
+ end
125
+
126
+ if attributes.has_key?(:'Description')
127
+ self.description = attributes[:'Description']
128
+ end
129
+
130
+ if attributes.has_key?(:'QuantityMultiplier')
131
+ self.quantity_multiplier = attributes[:'QuantityMultiplier']
132
+ end
133
+
134
+ if attributes.has_key?(:'ShipWeight')
135
+ self.ship_weight = attributes[:'ShipWeight']
136
+ end
137
+
138
+ if attributes.has_key?(:'ShipHeight')
139
+ self.ship_height = attributes[:'ShipHeight']
140
+ end
141
+
142
+ if attributes.has_key?(:'ShipWidth')
143
+ self.ship_width = attributes[:'ShipWidth']
144
+ end
145
+
146
+ if attributes.has_key?(:'ShipLength')
147
+ self.ship_length = attributes[:'ShipLength']
148
+ end
149
+
150
+ if attributes.has_key?(:'Active')
151
+ self.active = attributes[:'Active']
152
+ end
153
+
154
+ if attributes.has_key?(:'SpecCount')
155
+ self.spec_count = attributes[:'SpecCount']
156
+ end
157
+
158
+ if attributes.has_key?(:'xp')
159
+ self.xp = attributes[:'xp']
160
+ end
161
+
162
+ if attributes.has_key?(:'VariantCount')
163
+ self.variant_count = attributes[:'VariantCount']
164
+ end
165
+
166
+ if attributes.has_key?(:'ShipFromAddressID')
167
+ self.ship_from_address_id = attributes[:'ShipFromAddressID']
168
+ end
169
+
170
+ if attributes.has_key?(:'Inventory')
171
+ self.inventory = attributes[:'Inventory']
172
+ end
173
+
174
+ if attributes.has_key?(:'AutoForwardSupplierID')
175
+ self.auto_forward_supplier_id = attributes[:'AutoForwardSupplierID']
176
+ end
177
+
178
+ end
179
+
180
+ # Show invalid properties with the reasons. Usually used together with valid?
181
+ # @return Array for valid properies with the reasons
182
+ def list_invalid_properties
183
+ invalid_properties = Array.new
184
+ return invalid_properties
185
+ end
186
+
187
+ # Check to see if the all the properties in the model are valid
188
+ # @return true if the model is valid
189
+ def valid?
190
+ return true
191
+ end
192
+
193
+ # Checks equality by comparing each attribute.
194
+ # @param [Object] Object to be compared
195
+ def ==(o)
196
+ return true if self.equal?(o)
197
+ self.class == o.class &&
198
+ default_price_schedule_id == o.default_price_schedule_id &&
199
+ id == o.id &&
200
+ name == o.name &&
201
+ description == o.description &&
202
+ quantity_multiplier == o.quantity_multiplier &&
203
+ ship_weight == o.ship_weight &&
204
+ ship_height == o.ship_height &&
205
+ ship_width == o.ship_width &&
206
+ ship_length == o.ship_length &&
207
+ active == o.active &&
208
+ spec_count == o.spec_count &&
209
+ xp == o.xp &&
210
+ variant_count == o.variant_count &&
211
+ ship_from_address_id == o.ship_from_address_id &&
212
+ inventory == o.inventory &&
213
+ auto_forward_supplier_id == o.auto_forward_supplier_id
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Fixnum] Hash code
224
+ def hash
225
+ [default_price_schedule_id, id, name, description, quantity_multiplier, ship_weight, ship_height, ship_width, ship_length, active, spec_count, xp, variant_count, ship_from_address_id, inventory, auto_forward_supplier_id].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def build_from_hash(attributes)
232
+ return nil unless attributes.is_a?(Hash)
233
+ self.class.swagger_types.each_pair do |key, type|
234
+ if type =~ /^Array<(.*)>/i
235
+ # check to ensure the input is an array given that the the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
238
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
239
+ end
240
+ elsif !attributes[self.class.attribute_map[key]].nil?
241
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
242
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
243
+ end
244
+
245
+ self
246
+ end
247
+
248
+ # Deserializes the data based on type
249
+ # @param string type Data type
250
+ # @param string value Value to be deserialized
251
+ # @return [Object] Deserialized data
252
+ def _deserialize(type, value)
253
+ case type.to_sym
254
+ when :DateTime
255
+ DateTime.parse(value)
256
+ when :Date
257
+ Date.parse(value)
258
+ when :String
259
+ value.to_s
260
+ when :Integer
261
+ value.to_i
262
+ when :Float
263
+ value.to_f
264
+ when :BOOLEAN
265
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
266
+ true
267
+ else
268
+ false
269
+ end
270
+ when :Object
271
+ # generic object (usually a Hash), return directly
272
+ value
273
+ when /\AArray<(?<inner_type>.+)>\z/
274
+ inner_type = Regexp.last_match[:inner_type]
275
+ value.map { |v| _deserialize(inner_type, v) }
276
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
277
+ k_type = Regexp.last_match[:k_type]
278
+ v_type = Regexp.last_match[:v_type]
279
+ {}.tap do |hash|
280
+ value.each do |k, v|
281
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
282
+ end
283
+ end
284
+ else # model
285
+ temp_model = OrderCloud.const_get(type).new
286
+ temp_model.build_from_hash(value)
287
+ end
288
+ end
289
+
290
+ # Returns the string representation of the object
291
+ # @return [String] String presentation of the object
292
+ def to_s
293
+ to_hash.to_s
294
+ end
295
+
296
+ # to_body is an alias to to_hash (backward compatibility)
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_body
299
+ to_hash
300
+ end
301
+
302
+ # Returns the object in the form of hash
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_hash
305
+ hash = {}
306
+ self.class.attribute_map.each_pair do |attr, param|
307
+ value = self.send(attr)
308
+ next if value.nil?
309
+ hash[param] = _to_hash(value)
310
+ end
311
+ hash
312
+ end
313
+
314
+ # Outputs non-array value in the form of hash
315
+ # For object, use to_hash. Otherwise, just return the value
316
+ # @param [Object] value Any valid value
317
+ # @return [Hash] Returns the value in the form of hash
318
+ def _to_hash(value)
319
+ if value.is_a?(Array)
320
+ value.compact.map{ |v| _to_hash(v) }
321
+ elsif value.is_a?(Hash)
322
+ {}.tap do |hash|
323
+ value.each { |k, v| hash[k] = _to_hash(v) }
324
+ end
325
+ elsif value.respond_to? :to_hash
326
+ value.to_hash
327
+ else
328
+ value
329
+ end
330
+ end
331
+
332
+ end
333
+
334
+ end