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.
- checksums.yaml +4 -4
- data/Gemfile +28 -0
- data/Gemfile.lock +34 -0
- data/LICENSE +201 -0
- data/README.md +552 -0
- data/Rakefile +31 -0
- data/docs/AccessToken.md +11 -0
- data/docs/Address.md +20 -0
- data/docs/AddressApi.md +520 -0
- data/docs/AddressAssignment.md +12 -0
- data/docs/AdminAddressApi.md +324 -0
- data/docs/AdminUserApi.md +324 -0
- data/docs/AdminUserGroupApi.md +482 -0
- data/docs/ApprovalRule.md +13 -0
- data/docs/ApprovalRuleApi.md +342 -0
- data/docs/BaseSpec.md +16 -0
- data/docs/Buyer.md +12 -0
- data/docs/BuyerAddress.md +23 -0
- data/docs/BuyerApi.md +324 -0
- data/docs/BuyerCreditCard.md +16 -0
- data/docs/BuyerProduct.md +23 -0
- data/docs/BuyerShipment.md +19 -0
- data/docs/BuyerSpec.md +17 -0
- data/docs/Catalog.md +13 -0
- data/docs/CatalogApi.md +640 -0
- data/docs/CatalogAssignment.md +11 -0
- data/docs/Category.md +15 -0
- data/docs/CategoryApi.md +690 -0
- data/docs/CategoryAssignment.md +12 -0
- data/docs/CategoryProductAssignment.md +10 -0
- data/docs/CostCenter.md +11 -0
- data/docs/CostCenterApi.md +516 -0
- data/docs/CostCenterAssignment.md +9 -0
- data/docs/CreditCard.md +15 -0
- data/docs/CreditCardApi.md +516 -0
- data/docs/CreditCardAssignment.md +10 -0
- data/docs/ImpersonateTokenRequest.md +9 -0
- data/docs/ImpersonationConfig.md +16 -0
- data/docs/ImpersonationConfigApi.md +324 -0
- data/docs/Inventory.md +13 -0
- data/docs/LineItem.md +24 -0
- data/docs/LineItemApi.md +478 -0
- data/docs/LineItemProduct.md +16 -0
- data/docs/LineItemSpec.md +11 -0
- data/docs/ListAddress.md +9 -0
- data/docs/ListAddressAssignment.md +9 -0
- data/docs/ListApprovalRule.md +9 -0
- data/docs/ListArgs.md +13 -0
- data/docs/ListBuyer.md +9 -0
- data/docs/ListBuyerAddress.md +9 -0
- data/docs/ListBuyerCreditCard.md +9 -0
- data/docs/ListBuyerProduct.md +9 -0
- data/docs/ListBuyerShipment.md +9 -0
- data/docs/ListBuyerSpec.md +9 -0
- data/docs/ListCatalog.md +9 -0
- data/docs/ListCatalogAssignment.md +9 -0
- data/docs/ListCategory.md +9 -0
- data/docs/ListCategoryAssignment.md +9 -0
- data/docs/ListCategoryProductAssignment.md +9 -0
- data/docs/ListCostCenter.md +9 -0
- data/docs/ListCostCenterAssignment.md +9 -0
- data/docs/ListCreditCard.md +9 -0
- data/docs/ListCreditCardAssignment.md +9 -0
- data/docs/ListImpersonationConfig.md +9 -0
- data/docs/ListLineItem.md +9 -0
- data/docs/ListMessageCCListenerAssignment.md +9 -0
- data/docs/ListMessageConfig.md +9 -0
- data/docs/ListMessageSender.md +9 -0
- data/docs/ListMessageSenderAssignment.md +9 -0
- data/docs/ListOrder.md +9 -0
- data/docs/ListOrderApproval.md +9 -0
- data/docs/ListOrderPromotion.md +9 -0
- data/docs/ListPayment.md +9 -0
- data/docs/ListPriceSchedule.md +9 -0
- data/docs/ListProduct.md +9 -0
- data/docs/ListProductAssignment.md +9 -0
- data/docs/ListProductCatalogAssignment.md +9 -0
- data/docs/ListPromotion.md +9 -0
- data/docs/ListPromotionAssignment.md +9 -0
- data/docs/ListSecurityProfile.md +9 -0
- data/docs/ListSecurityProfileAssignment.md +9 -0
- data/docs/ListShipment.md +9 -0
- data/docs/ListShipmentItem.md +9 -0
- data/docs/ListSpec.md +9 -0
- data/docs/ListSpecOption.md +9 -0
- data/docs/ListSpecProductAssignment.md +9 -0
- data/docs/ListSpendingAccount.md +9 -0
- data/docs/ListSpendingAccountAssignment.md +9 -0
- data/docs/ListSupplier.md +9 -0
- data/docs/ListUser.md +9 -0
- data/docs/ListUserGroup.md +9 -0
- data/docs/ListUserGroupAssignment.md +9 -0
- data/docs/ListVariant.md +9 -0
- data/docs/MeApi.md +2002 -0
- data/docs/MeBuyer.md +9 -0
- data/docs/MeUser.md +19 -0
- data/docs/MessageCCListenerAssignment.md +13 -0
- data/docs/MessageConfig.md +14 -0
- data/docs/MessageSender.md +10 -0
- data/docs/MessageSenderAssignment.md +11 -0
- data/docs/MessageSendersApi.md +398 -0
- data/docs/Meta.md +12 -0
- data/docs/Order.md +30 -0
- data/docs/OrderApi.md +1161 -0
- data/docs/OrderApproval.md +14 -0
- data/docs/OrderApprovalInfo.md +9 -0
- data/docs/OrderPromotion.md +22 -0
- data/docs/PasswordReset.md +10 -0
- data/docs/PasswordResetApi.md +109 -0
- data/docs/PasswordResetRequest.md +11 -0
- data/docs/Payment.md +17 -0
- data/docs/PaymentApi.md +418 -0
- data/docs/PaymentTransaction.md +15 -0
- data/docs/PriceBreak.md +9 -0
- data/docs/PriceSchedule.md +17 -0
- data/docs/PriceScheduleApi.md +429 -0
- data/docs/Product.md +23 -0
- data/docs/ProductApi.md +953 -0
- data/docs/ProductAssignment.md +11 -0
- data/docs/ProductBase.md +22 -0
- data/docs/ProductCatalogAssignment.md +9 -0
- data/docs/Promotion.md +21 -0
- data/docs/PromotionApi.md +494 -0
- data/docs/PromotionAssignment.md +10 -0
- data/docs/SecurityProfile.md +10 -0
- data/docs/SecurityProfileApi.md +292 -0
- data/docs/SecurityProfileAssignment.md +12 -0
- data/docs/Shipment.md +20 -0
- data/docs/ShipmentApi.md +554 -0
- data/docs/ShipmentItem.md +16 -0
- data/docs/Spec.md +17 -0
- data/docs/SpecApi.md +820 -0
- data/docs/SpecOption.md +14 -0
- data/docs/SpecProductAssignment.md +11 -0
- data/docs/SpendingAccount.md +15 -0
- data/docs/SpendingAccountApi.md +516 -0
- data/docs/SpendingAccountAssignment.md +11 -0
- data/docs/Supplier.md +11 -0
- data/docs/SupplierApi.md +324 -0
- data/docs/SupplierUserApi.md +400 -0
- data/docs/SupplierUserGroupApi.md +509 -0
- data/docs/TokenPasswordReset.md +8 -0
- data/docs/User.md +18 -0
- data/docs/UserApi.md +400 -0
- data/docs/UserGroup.md +11 -0
- data/docs/UserGroupApi.md +509 -0
- data/docs/UserGroupAssignment.md +9 -0
- data/docs/Variant.md +12 -0
- data/git_push.sh +67 -0
- data/lib/order_cloud.rb +193 -0
- data/lib/order_cloud/api/address_api.rb +628 -0
- data/lib/order_cloud/api/admin_address_api.rb +397 -0
- data/lib/order_cloud/api/admin_user_api.rb +397 -0
- data/lib/order_cloud/api/admin_user_group_api.rb +578 -0
- data/lib/order_cloud/api/approval_rule_api.rb +421 -0
- data/lib/order_cloud/api/auth_api.rb +138 -0
- data/lib/order_cloud/api/buyer_api.rb +397 -0
- data/lib/order_cloud/api/catalog_api.rb +760 -0
- data/lib/order_cloud/api/category_api.rb +826 -0
- data/lib/order_cloud/api/cost_center_api.rb +622 -0
- data/lib/order_cloud/api/credit_card_api.rb +622 -0
- data/lib/order_cloud/api/impersonation_config_api.rb +397 -0
- data/lib/order_cloud/api/line_item_api.rb +583 -0
- data/lib/order_cloud/api/me_api.rb +2345 -0
- data/lib/order_cloud/api/message_senders_api.rb +484 -0
- data/lib/order_cloud/api/order_api.rb +1377 -0
- data/lib/order_cloud/api/password_reset_api.rb +150 -0
- data/lib/order_cloud/api/payment_api.rb +513 -0
- data/lib/order_cloud/api/price_schedule_api.rb +519 -0
- data/lib/order_cloud/api/product_api.rb +1126 -0
- data/lib/order_cloud/api/promotion_api.rb +594 -0
- data/lib/order_cloud/api/security_profile_api.rb +363 -0
- data/lib/order_cloud/api/shipment_api.rb +665 -0
- data/lib/order_cloud/api/spec_api.rb +971 -0
- data/lib/order_cloud/api/spending_account_api.rb +622 -0
- data/lib/order_cloud/api/supplier_api.rb +397 -0
- data/lib/order_cloud/api/supplier_user_api.rb +489 -0
- data/lib/order_cloud/api/supplier_user_group_api.rb +614 -0
- data/lib/order_cloud/api/user_api.rb +489 -0
- data/lib/order_cloud/api/user_group_api.rb +614 -0
- data/lib/order_cloud/api_client.rb +385 -0
- data/lib/order_cloud/api_error.rb +47 -0
- data/lib/order_cloud/configuration.rb +245 -0
- data/lib/order_cloud/models/access_token.rb +226 -0
- data/lib/order_cloud/models/address.rb +307 -0
- data/lib/order_cloud/models/address_assignment.rb +235 -0
- data/lib/order_cloud/models/approval_rule.rb +244 -0
- data/lib/order_cloud/models/base_spec.rb +271 -0
- data/lib/order_cloud/models/buyer.rb +235 -0
- data/lib/order_cloud/models/buyer_address.rb +334 -0
- data/lib/order_cloud/models/buyer_credit_card.rb +271 -0
- data/lib/order_cloud/models/buyer_product.rb +334 -0
- data/lib/order_cloud/models/buyer_shipment.rb +298 -0
- data/lib/order_cloud/models/buyer_spec.rb +282 -0
- data/lib/order_cloud/models/catalog.rb +244 -0
- data/lib/order_cloud/models/catalog_assignment.rb +226 -0
- data/lib/order_cloud/models/category.rb +262 -0
- data/lib/order_cloud/models/category_assignment.rb +235 -0
- data/lib/order_cloud/models/category_product_assignment.rb +217 -0
- data/lib/order_cloud/models/cost_center.rb +226 -0
- data/lib/order_cloud/models/cost_center_assignment.rb +208 -0
- data/lib/order_cloud/models/credit_card.rb +262 -0
- data/lib/order_cloud/models/credit_card_assignment.rb +217 -0
- data/lib/order_cloud/models/impersonate_token_request.rb +210 -0
- data/lib/order_cloud/models/impersonation_config.rb +271 -0
- data/lib/order_cloud/models/inventory.rb +244 -0
- data/lib/order_cloud/models/line_item.rb +345 -0
- data/lib/order_cloud/models/line_item_product.rb +271 -0
- data/lib/order_cloud/models/line_item_spec.rb +226 -0
- data/lib/order_cloud/models/list_address.rb +210 -0
- data/lib/order_cloud/models/list_address_assignment.rb +210 -0
- data/lib/order_cloud/models/list_approval_rule.rb +210 -0
- data/lib/order_cloud/models/list_args.rb +248 -0
- data/lib/order_cloud/models/list_buyer.rb +210 -0
- data/lib/order_cloud/models/list_buyer_address.rb +210 -0
- data/lib/order_cloud/models/list_buyer_credit_card.rb +210 -0
- data/lib/order_cloud/models/list_buyer_product.rb +210 -0
- data/lib/order_cloud/models/list_buyer_shipment.rb +210 -0
- data/lib/order_cloud/models/list_buyer_spec.rb +210 -0
- data/lib/order_cloud/models/list_catalog.rb +210 -0
- data/lib/order_cloud/models/list_catalog_assignment.rb +210 -0
- data/lib/order_cloud/models/list_category.rb +210 -0
- data/lib/order_cloud/models/list_category_assignment.rb +210 -0
- data/lib/order_cloud/models/list_category_product_assignment.rb +210 -0
- data/lib/order_cloud/models/list_cost_center.rb +210 -0
- data/lib/order_cloud/models/list_cost_center_assignment.rb +210 -0
- data/lib/order_cloud/models/list_credit_card.rb +210 -0
- data/lib/order_cloud/models/list_credit_card_assignment.rb +210 -0
- data/lib/order_cloud/models/list_impersonation_config.rb +210 -0
- data/lib/order_cloud/models/list_line_item.rb +210 -0
- data/lib/order_cloud/models/list_message_cc_listener_assignment.rb +210 -0
- data/lib/order_cloud/models/list_message_config.rb +210 -0
- data/lib/order_cloud/models/list_message_sender.rb +210 -0
- data/lib/order_cloud/models/list_message_sender_assignment.rb +210 -0
- data/lib/order_cloud/models/list_order.rb +210 -0
- data/lib/order_cloud/models/list_order_approval.rb +210 -0
- data/lib/order_cloud/models/list_order_promotion.rb +210 -0
- data/lib/order_cloud/models/list_payment.rb +210 -0
- data/lib/order_cloud/models/list_price_schedule.rb +210 -0
- data/lib/order_cloud/models/list_product.rb +210 -0
- data/lib/order_cloud/models/list_product_assignment.rb +210 -0
- data/lib/order_cloud/models/list_product_catalog_assignment.rb +210 -0
- data/lib/order_cloud/models/list_promotion.rb +210 -0
- data/lib/order_cloud/models/list_promotion_assignment.rb +210 -0
- data/lib/order_cloud/models/list_security_profile.rb +210 -0
- data/lib/order_cloud/models/list_security_profile_assignment.rb +210 -0
- data/lib/order_cloud/models/list_shipment.rb +210 -0
- data/lib/order_cloud/models/list_shipment_item.rb +210 -0
- data/lib/order_cloud/models/list_spec.rb +210 -0
- data/lib/order_cloud/models/list_spec_option.rb +210 -0
- data/lib/order_cloud/models/list_spec_product_assignment.rb +210 -0
- data/lib/order_cloud/models/list_spending_account.rb +210 -0
- data/lib/order_cloud/models/list_spending_account_assignment.rb +210 -0
- data/lib/order_cloud/models/list_supplier.rb +210 -0
- data/lib/order_cloud/models/list_user.rb +210 -0
- data/lib/order_cloud/models/list_user_group.rb +210 -0
- data/lib/order_cloud/models/list_user_group_assignment.rb +210 -0
- data/lib/order_cloud/models/list_variant.rb +210 -0
- data/lib/order_cloud/models/me_buyer.rb +208 -0
- data/lib/order_cloud/models/me_user.rb +300 -0
- data/lib/order_cloud/models/message_cc_listener_assignment.rb +244 -0
- data/lib/order_cloud/models/message_config.rb +255 -0
- data/lib/order_cloud/models/message_sender.rb +219 -0
- data/lib/order_cloud/models/message_sender_assignment.rb +226 -0
- data/lib/order_cloud/models/meta.rb +237 -0
- data/lib/order_cloud/models/order.rb +397 -0
- data/lib/order_cloud/models/order_approval.rb +253 -0
- data/lib/order_cloud/models/order_approval_info.rb +208 -0
- data/lib/order_cloud/models/order_promotion.rb +325 -0
- data/lib/order_cloud/models/password_reset.rb +217 -0
- data/lib/order_cloud/models/password_reset_request.rb +226 -0
- data/lib/order_cloud/models/payment.rb +282 -0
- data/lib/order_cloud/models/payment_transaction.rb +262 -0
- data/lib/order_cloud/models/price_break.rb +208 -0
- data/lib/order_cloud/models/price_schedule.rb +282 -0
- data/lib/order_cloud/models/product.rb +334 -0
- data/lib/order_cloud/models/product_assignment.rb +226 -0
- data/lib/order_cloud/models/product_base.rb +325 -0
- data/lib/order_cloud/models/product_catalog_assignment.rb +208 -0
- data/lib/order_cloud/models/promotion.rb +316 -0
- data/lib/order_cloud/models/promotion_assignment.rb +217 -0
- data/lib/order_cloud/models/security_profile.rb +219 -0
- data/lib/order_cloud/models/security_profile_assignment.rb +235 -0
- data/lib/order_cloud/models/shipment.rb +307 -0
- data/lib/order_cloud/models/shipment_item.rb +273 -0
- data/lib/order_cloud/models/spec.rb +280 -0
- data/lib/order_cloud/models/spec_option.rb +253 -0
- data/lib/order_cloud/models/spec_product_assignment.rb +226 -0
- data/lib/order_cloud/models/spending_account.rb +262 -0
- data/lib/order_cloud/models/spending_account_assignment.rb +226 -0
- data/lib/order_cloud/models/supplier.rb +226 -0
- data/lib/order_cloud/models/token_password_reset.rb +199 -0
- data/lib/order_cloud/models/user.rb +291 -0
- data/lib/order_cloud/models/user_group.rb +226 -0
- data/lib/order_cloud/models/user_group_assignment.rb +208 -0
- data/lib/order_cloud/models/variant.rb +235 -0
- data/lib/order_cloud/version.rb +26 -0
- data/order_cloud-1.0.56.gem +0 -0
- data/order_cloud.gemspec +56 -0
- data/spec/api/address_api_spec.rb +179 -0
- data/spec/api/admin_address_api_spec.rb +125 -0
- data/spec/api/admin_user_api_spec.rb +125 -0
- data/spec/api/admin_user_group_api_spec.rb +165 -0
- data/spec/api/approval_rule_api_spec.rb +131 -0
- data/spec/api/auth_api_spec.rb +165 -0
- data/spec/api/buyer_api_spec.rb +125 -0
- data/spec/api/catalog_api_spec.rb +205 -0
- data/spec/api/category_api_spec.rb +223 -0
- data/spec/api/cost_center_api_spec.rb +177 -0
- data/spec/api/credit_card_api_spec.rb +177 -0
- data/spec/api/impersonation_config_api_spec.rb +125 -0
- data/spec/api/line_item_api_spec.rb +167 -0
- data/spec/api/me_api_spec.rb +568 -0
- data/spec/api/message_senders_api_spec.rb +149 -0
- data/spec/api/order_api_spec.rb +344 -0
- data/spec/api/password_reset_api_spec.rb +71 -0
- data/spec/api/payment_api_spec.rb +152 -0
- data/spec/api/price_schedule_api_spec.rb +151 -0
- data/spec/api/product_api_spec.rb +290 -0
- data/spec/api/promotion_api_spec.rb +170 -0
- data/spec/api/security_profile_api_spec.rb +122 -0
- data/spec/api/shipment_api_spec.rb +185 -0
- data/spec/api/spec_api_spec.rb +252 -0
- data/spec/api/spending_account_api_spec.rb +177 -0
- data/spec/api/supplier_api_spec.rb +125 -0
- data/spec/api/supplier_user_api_spec.rb +146 -0
- data/spec/api/supplier_user_group_api_spec.rb +174 -0
- data/spec/api/user_api_spec.rb +146 -0
- data/spec/api/user_group_api_spec.rb +174 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +80 -0
- data/spec/models/access_token_spec.rb +71 -0
- data/spec/models/address_assignment_spec.rb +77 -0
- data/spec/models/address_spec.rb +125 -0
- data/spec/models/approval_rule_spec.rb +83 -0
- data/spec/models/base_spec_spec.rb +101 -0
- data/spec/models/buyer_address_spec.rb +143 -0
- data/spec/models/buyer_credit_card_spec.rb +101 -0
- data/spec/models/buyer_product_spec.rb +143 -0
- data/spec/models/buyer_shipment_spec.rb +119 -0
- data/spec/models/buyer_spec.rb +77 -0
- data/spec/models/buyer_spec_spec.rb +107 -0
- data/spec/models/catalog_assignment_spec.rb +71 -0
- data/spec/models/catalog_spec.rb +83 -0
- data/spec/models/category_assignment_spec.rb +77 -0
- data/spec/models/category_product_assignment_spec.rb +65 -0
- data/spec/models/category_spec.rb +95 -0
- data/spec/models/cost_center_assignment_spec.rb +59 -0
- data/spec/models/cost_center_spec.rb +71 -0
- data/spec/models/credit_card_assignment_spec.rb +65 -0
- data/spec/models/credit_card_spec.rb +95 -0
- data/spec/models/impersonate_token_request_spec.rb +59 -0
- data/spec/models/impersonation_config_spec.rb +101 -0
- data/spec/models/inventory_spec.rb +83 -0
- data/spec/models/line_item_product_spec.rb +101 -0
- data/spec/models/line_item_spec.rb +149 -0
- data/spec/models/line_item_spec_spec.rb +71 -0
- data/spec/models/list_address_assignment_spec.rb +59 -0
- data/spec/models/list_address_spec.rb +59 -0
- data/spec/models/list_approval_rule_spec.rb +59 -0
- data/spec/models/list_args_spec.rb +83 -0
- data/spec/models/list_buyer_address_spec.rb +59 -0
- data/spec/models/list_buyer_credit_card_spec.rb +59 -0
- data/spec/models/list_buyer_product_spec.rb +59 -0
- data/spec/models/list_buyer_shipment_spec.rb +59 -0
- data/spec/models/list_buyer_spec.rb +59 -0
- data/spec/models/list_buyer_spec_spec.rb +59 -0
- data/spec/models/list_catalog_assignment_spec.rb +59 -0
- data/spec/models/list_catalog_spec.rb +59 -0
- data/spec/models/list_category_assignment_spec.rb +59 -0
- data/spec/models/list_category_product_assignment_spec.rb +59 -0
- data/spec/models/list_category_spec.rb +59 -0
- data/spec/models/list_cost_center_assignment_spec.rb +59 -0
- data/spec/models/list_cost_center_spec.rb +59 -0
- data/spec/models/list_credit_card_assignment_spec.rb +59 -0
- data/spec/models/list_credit_card_spec.rb +59 -0
- data/spec/models/list_impersonation_config_spec.rb +59 -0
- data/spec/models/list_line_item_spec.rb +59 -0
- data/spec/models/list_message_cc_listener_assignment_spec.rb +59 -0
- data/spec/models/list_message_config_spec.rb +59 -0
- data/spec/models/list_message_sender_assignment_spec.rb +59 -0
- data/spec/models/list_message_sender_spec.rb +59 -0
- data/spec/models/list_order_approval_spec.rb +59 -0
- data/spec/models/list_order_promotion_spec.rb +59 -0
- data/spec/models/list_order_spec.rb +59 -0
- data/spec/models/list_payment_spec.rb +59 -0
- data/spec/models/list_price_schedule_spec.rb +59 -0
- data/spec/models/list_product_assignment_spec.rb +59 -0
- data/spec/models/list_product_catalog_assignment_spec.rb +59 -0
- data/spec/models/list_product_spec.rb +59 -0
- data/spec/models/list_promotion_assignment_spec.rb +59 -0
- data/spec/models/list_promotion_spec.rb +59 -0
- data/spec/models/list_security_profile_assignment_spec.rb +59 -0
- data/spec/models/list_security_profile_spec.rb +59 -0
- data/spec/models/list_shipment_item_spec.rb +59 -0
- data/spec/models/list_shipment_spec.rb +59 -0
- data/spec/models/list_spec_option_spec.rb +59 -0
- data/spec/models/list_spec_product_assignment_spec.rb +59 -0
- data/spec/models/list_spec_spec.rb +59 -0
- data/spec/models/list_spending_account_assignment_spec.rb +59 -0
- data/spec/models/list_spending_account_spec.rb +59 -0
- data/spec/models/list_supplier_spec.rb +59 -0
- data/spec/models/list_user_group_assignment_spec.rb +59 -0
- data/spec/models/list_user_group_spec.rb +59 -0
- data/spec/models/list_user_spec.rb +59 -0
- data/spec/models/list_variant_spec.rb +59 -0
- data/spec/models/me_buyer_spec.rb +59 -0
- data/spec/models/me_user_spec.rb +119 -0
- data/spec/models/message_cc_listener_assignment_spec.rb +83 -0
- data/spec/models/message_config_spec.rb +89 -0
- data/spec/models/message_sender_assignment_spec.rb +71 -0
- data/spec/models/message_sender_spec.rb +65 -0
- data/spec/models/meta_spec.rb +77 -0
- data/spec/models/order_approval_info_spec.rb +59 -0
- data/spec/models/order_approval_spec.rb +89 -0
- data/spec/models/order_promotion_spec.rb +137 -0
- data/spec/models/order_spec.rb +185 -0
- data/spec/models/password_reset_request_spec.rb +71 -0
- data/spec/models/password_reset_spec.rb +65 -0
- data/spec/models/payment_spec.rb +107 -0
- data/spec/models/payment_transaction_spec.rb +95 -0
- data/spec/models/price_break_spec.rb +59 -0
- data/spec/models/price_schedule_spec.rb +107 -0
- data/spec/models/product_assignment_spec.rb +71 -0
- data/spec/models/product_base_spec.rb +137 -0
- data/spec/models/product_catalog_assignment_spec.rb +59 -0
- data/spec/models/product_spec.rb +143 -0
- data/spec/models/promotion_assignment_spec.rb +65 -0
- data/spec/models/promotion_spec.rb +131 -0
- data/spec/models/security_profile_assignment_spec.rb +77 -0
- data/spec/models/security_profile_spec.rb +65 -0
- data/spec/models/shipment_item_spec.rb +101 -0
- data/spec/models/shipment_spec.rb +125 -0
- data/spec/models/spec_option_spec.rb +89 -0
- data/spec/models/spec_product_assignment_spec.rb +71 -0
- data/spec/models/spec_spec.rb +107 -0
- data/spec/models/spending_account_assignment_spec.rb +71 -0
- data/spec/models/spending_account_spec.rb +95 -0
- data/spec/models/supplier_spec.rb +71 -0
- data/spec/models/token_password_reset_spec.rb +53 -0
- data/spec/models/user_group_assignment_spec.rb +59 -0
- data/spec/models/user_group_spec.rb +71 -0
- data/spec/models/user_spec.rb +113 -0
- data/spec/models/variant_spec.rb +77 -0
- data/spec/spec_helper.rb +122 -0
- metadata +596 -6
@@ -0,0 +1,210 @@
|
|
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 ListCreditCard
|
29
|
+
attr_accessor :items
|
30
|
+
|
31
|
+
attr_accessor :meta
|
32
|
+
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'items' => :'Items',
|
38
|
+
:'meta' => :'Meta'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.swagger_types
|
44
|
+
{
|
45
|
+
:'items' => :'Array<CreditCard>',
|
46
|
+
:'meta' => :'Meta'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
57
|
+
|
58
|
+
if attributes.has_key?(:'Items')
|
59
|
+
if (value = attributes[:'Items']).is_a?(Array)
|
60
|
+
self.items = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'Meta')
|
65
|
+
self.meta = attributes[:'Meta']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properies with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
items == o.items &&
|
89
|
+
meta == o.meta
|
90
|
+
end
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def eql?(o)
|
95
|
+
self == o
|
96
|
+
end
|
97
|
+
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Fixnum] Hash code
|
100
|
+
def hash
|
101
|
+
[items, meta].hash
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.swagger_types.each_pair do |key, type|
|
110
|
+
if type =~ /^Array<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
119
|
+
end
|
120
|
+
|
121
|
+
self
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def _deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :DateTime
|
131
|
+
DateTime.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :BOOLEAN
|
141
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
temp_model = OrderCloud.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
next if value.nil?
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map{ |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
end
|
@@ -0,0 +1,210 @@
|
|
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 ListCreditCardAssignment
|
29
|
+
attr_accessor :items
|
30
|
+
|
31
|
+
attr_accessor :meta
|
32
|
+
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'items' => :'Items',
|
38
|
+
:'meta' => :'Meta'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.swagger_types
|
44
|
+
{
|
45
|
+
:'items' => :'Array<CreditCardAssignment>',
|
46
|
+
:'meta' => :'Meta'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
57
|
+
|
58
|
+
if attributes.has_key?(:'Items')
|
59
|
+
if (value = attributes[:'Items']).is_a?(Array)
|
60
|
+
self.items = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'Meta')
|
65
|
+
self.meta = attributes[:'Meta']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properies with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
items == o.items &&
|
89
|
+
meta == o.meta
|
90
|
+
end
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def eql?(o)
|
95
|
+
self == o
|
96
|
+
end
|
97
|
+
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Fixnum] Hash code
|
100
|
+
def hash
|
101
|
+
[items, meta].hash
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.swagger_types.each_pair do |key, type|
|
110
|
+
if type =~ /^Array<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
119
|
+
end
|
120
|
+
|
121
|
+
self
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def _deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :DateTime
|
131
|
+
DateTime.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :BOOLEAN
|
141
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
temp_model = OrderCloud.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
next if value.nil?
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map{ |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
end
|
@@ -0,0 +1,210 @@
|
|
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 ListImpersonationConfig
|
29
|
+
attr_accessor :items
|
30
|
+
|
31
|
+
attr_accessor :meta
|
32
|
+
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'items' => :'Items',
|
38
|
+
:'meta' => :'Meta'
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.swagger_types
|
44
|
+
{
|
45
|
+
:'items' => :'Array<ImpersonationConfig>',
|
46
|
+
:'meta' => :'Meta'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
57
|
+
|
58
|
+
if attributes.has_key?(:'Items')
|
59
|
+
if (value = attributes[:'Items']).is_a?(Array)
|
60
|
+
self.items = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'Meta')
|
65
|
+
self.meta = attributes[:'Meta']
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
+
# @return Array for valid properies with the reasons
|
72
|
+
def list_invalid_properties
|
73
|
+
invalid_properties = Array.new
|
74
|
+
return invalid_properties
|
75
|
+
end
|
76
|
+
|
77
|
+
# Check to see if the all the properties in the model are valid
|
78
|
+
# @return true if the model is valid
|
79
|
+
def valid?
|
80
|
+
return true
|
81
|
+
end
|
82
|
+
|
83
|
+
# Checks equality by comparing each attribute.
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def ==(o)
|
86
|
+
return true if self.equal?(o)
|
87
|
+
self.class == o.class &&
|
88
|
+
items == o.items &&
|
89
|
+
meta == o.meta
|
90
|
+
end
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def eql?(o)
|
95
|
+
self == o
|
96
|
+
end
|
97
|
+
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Fixnum] Hash code
|
100
|
+
def hash
|
101
|
+
[items, meta].hash
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.swagger_types.each_pair do |key, type|
|
110
|
+
if type =~ /^Array<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
119
|
+
end
|
120
|
+
|
121
|
+
self
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def _deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :DateTime
|
131
|
+
DateTime.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :BOOLEAN
|
141
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
temp_model = OrderCloud.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
next if value.nil?
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map{ |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
end
|