order_cloud 0.0.6 → 1.0.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- metadata +45 -594
- data/Gemfile +0 -28
- data/Gemfile.lock +0 -34
- data/LICENSE +0 -201
- data/README.md +0 -498
- data/Rakefile +0 -31
- data/docs/AccessToken.md +0 -10
- data/docs/Address.md +0 -20
- data/docs/AddressApi.md +0 -520
- data/docs/AddressAssignment.md +0 -12
- data/docs/AdminAddressApi.md +0 -324
- data/docs/AdminCompany.md +0 -10
- data/docs/AdminModelOnView.md +0 -7
- data/docs/AdminUserApi.md +0 -323
- data/docs/AdminUserGroupApi.md +0 -482
- data/docs/ApprovalRule.md +0 -20
- data/docs/ApprovalRuleApi.md +0 -342
- data/docs/BaseSpec.md +0 -15
- data/docs/Buyer.md +0 -11
- data/docs/BuyerAddress.md +0 -11
- data/docs/BuyerApi.md +0 -324
- data/docs/BuyerCreditCard.md +0 -9
- data/docs/BuyerProduct.md +0 -9
- data/docs/BuyerSpec.md +0 -9
- data/docs/Category.md +0 -15
- data/docs/CategoryApi.md +0 -685
- data/docs/CategoryAssignment.md +0 -10
- data/docs/CategoryProductAssignment.md +0 -10
- data/docs/CostCenter.md +0 -11
- data/docs/CostCenterApi.md +0 -516
- data/docs/CostCenterAssignment.md +0 -10
- data/docs/CreditCard.md +0 -15
- data/docs/CreditCardApi.md +0 -516
- data/docs/CreditCardAssignment.md +0 -10
- data/docs/EmailTemplate.md +0 -12
- data/docs/EmailTemplateApi.md +0 -223
- data/docs/File.md +0 -10
- data/docs/ImpersonateTokenRequest.md +0 -9
- data/docs/Inventory.md +0 -12
- data/docs/LineItem.md +0 -23
- data/docs/LineItemApi.md +0 -478
- data/docs/LineItemSpec.md +0 -11
- data/docs/ListAddress.md +0 -9
- data/docs/ListAddressAssignment.md +0 -9
- data/docs/ListAdminCompany.md +0 -9
- data/docs/ListApprovalRule.md +0 -9
- data/docs/ListBuyer.md +0 -9
- data/docs/ListBuyerAddress.md +0 -9
- data/docs/ListBuyerCreditCard.md +0 -9
- data/docs/ListBuyerProduct.md +0 -9
- data/docs/ListBuyerSpec.md +0 -9
- data/docs/ListCategory.md +0 -9
- data/docs/ListCategoryAssignment.md +0 -9
- data/docs/ListCategoryProductAssignment.md +0 -9
- data/docs/ListCostCenter.md +0 -9
- data/docs/ListCostCenterAssignment.md +0 -9
- data/docs/ListCreditCard.md +0 -9
- data/docs/ListCreditCardAssignment.md +0 -9
- data/docs/ListFile.md +0 -9
- data/docs/ListInventory.md +0 -9
- data/docs/ListLineItem.md +0 -9
- data/docs/ListMessageCCListenerAssignment.md +0 -9
- data/docs/ListMessageConfig.md +0 -9
- data/docs/ListMessageSender.md +0 -9
- data/docs/ListMessageSenderAssignment.md +0 -9
- data/docs/ListOrder.md +0 -9
- data/docs/ListOrderApproval.md +0 -9
- data/docs/ListOrderPromotion.md +0 -9
- data/docs/ListPayment.md +0 -9
- data/docs/ListPriceSchedule.md +0 -9
- data/docs/ListProduct.md +0 -9
- data/docs/ListProductAssignment.md +0 -9
- data/docs/ListPromotion.md +0 -9
- data/docs/ListPromotionAssignment.md +0 -9
- data/docs/ListSecurityProfile.md +0 -9
- data/docs/ListSecurityProfileAssignment.md +0 -9
- data/docs/ListShipment.md +0 -9
- data/docs/ListSpec.md +0 -9
- data/docs/ListSpecOption.md +0 -9
- data/docs/ListSpecProductAssignment.md +0 -9
- data/docs/ListSpendingAccount.md +0 -9
- data/docs/ListSpendingAccountAssignment.md +0 -9
- data/docs/ListUser.md +0 -9
- data/docs/ListUserGroup.md +0 -9
- data/docs/ListUserGroupAssignment.md +0 -9
- data/docs/ListVariant.md +0 -9
- data/docs/ListWebHook.md +0 -9
- data/docs/ListWebHookRoute.md +0 -9
- data/docs/ListXpIndex.md +0 -9
- data/docs/MeApi.md +0 -1488
- data/docs/MessageCCListenerAssignment.md +0 -13
- data/docs/MessageConfig.md +0 -11
- data/docs/MessageSender.md +0 -10
- data/docs/MessageSenderAssignment.md +0 -12
- data/docs/MessageSendersApi.md +0 -398
- data/docs/Meta.md +0 -12
- data/docs/Order.md +0 -31
- data/docs/OrderApi.md +0 -1277
- data/docs/OrderApproval.md +0 -16
- data/docs/OrderPromotion.md +0 -8
- data/docs/PasswordReset.md +0 -10
- data/docs/PasswordResetApi.md +0 -109
- data/docs/PasswordResetRequest.md +0 -11
- data/docs/Payment.md +0 -16
- data/docs/PaymentApi.md +0 -601
- data/docs/PaymentTransaction.md +0 -15
- data/docs/PingResponse.md +0 -8
- data/docs/PriceBreak.md +0 -9
- data/docs/PriceSchedule.md +0 -18
- data/docs/PriceScheduleApi.md +0 -429
- data/docs/Product.md +0 -26
- data/docs/ProductApi.md +0 -1116
- data/docs/ProductAssignment.md +0 -13
- data/docs/Promotion.md +0 -21
- data/docs/PromotionApi.md +0 -495
- data/docs/PromotionAssignment.md +0 -11
- data/docs/SecurityProfile.md +0 -11
- data/docs/SecurityProfileApi.md +0 -290
- data/docs/SecurityProfileAssignment.md +0 -11
- data/docs/Shipment.md +0 -14
- data/docs/ShipmentApi.md +0 -459
- data/docs/ShipmentItem.md +0 -10
- data/docs/Spec.md +0 -8
- data/docs/SpecApi.md +0 -816
- data/docs/SpecOption.md +0 -14
- data/docs/SpecProductAssignment.md +0 -10
- data/docs/SpendingAccount.md +0 -15
- data/docs/SpendingAccountApi.md +0 -516
- data/docs/SpendingAccountAssignment.md +0 -11
- data/docs/User.md +0 -18
- data/docs/UserApi.md +0 -400
- data/docs/UserGroup.md +0 -11
- data/docs/UserGroupApi.md +0 -509
- data/docs/UserGroupAssignment.md +0 -9
- data/docs/Variant.md +0 -12
- data/docs/WebHook.md +0 -18
- data/docs/WebHookRoute.md +0 -10
- data/docs/XpIndex.md +0 -9
- data/git_push.sh +0 -67
- data/lib/order_cloud.rb +0 -183
- data/lib/order_cloud/api/address_api.rb +0 -628
- data/lib/order_cloud/api/admin_address_api.rb +0 -397
- data/lib/order_cloud/api/admin_user_api.rb +0 -396
- data/lib/order_cloud/api/admin_user_group_api.rb +0 -578
- data/lib/order_cloud/api/approval_rule_api.rb +0 -421
- data/lib/order_cloud/api/buyer_api.rb +0 -397
- data/lib/order_cloud/api/category_api.rb +0 -818
- data/lib/order_cloud/api/cost_center_api.rb +0 -622
- data/lib/order_cloud/api/credit_card_api.rb +0 -622
- data/lib/order_cloud/api/email_template_api.rb +0 -283
- data/lib/order_cloud/api/line_item_api.rb +0 -583
- data/lib/order_cloud/api/me_api.rb +0 -1747
- data/lib/order_cloud/api/message_senders_api.rb +0 -484
- data/lib/order_cloud/api/order_api.rb +0 -1509
- data/lib/order_cloud/api/password_reset_api.rb +0 -150
- data/lib/order_cloud/api/payment_api.rb +0 -728
- data/lib/order_cloud/api/price_schedule_api.rb +0 -519
- data/lib/order_cloud/api/product_api.rb +0 -1312
- data/lib/order_cloud/api/promotion_api.rb +0 -596
- data/lib/order_cloud/api/security_profile_api.rb +0 -361
- data/lib/order_cloud/api/shipment_api.rb +0 -558
- data/lib/order_cloud/api/spec_api.rb +0 -965
- data/lib/order_cloud/api/spending_account_api.rb +0 -622
- data/lib/order_cloud/api/user_api.rb +0 -489
- data/lib/order_cloud/api/user_group_api.rb +0 -614
- data/lib/order_cloud/api_auth.rb +0 -108
- data/lib/order_cloud/api_client.rb +0 -385
- data/lib/order_cloud/api_error.rb +0 -47
- data/lib/order_cloud/configuration.rb +0 -245
- data/lib/order_cloud/models/access_token.rb +0 -217
- data/lib/order_cloud/models/address.rb +0 -307
- data/lib/order_cloud/models/address_assignment.rb +0 -235
- data/lib/order_cloud/models/admin_company.rb +0 -217
- data/lib/order_cloud/models/admin_model_on_view.rb +0 -190
- data/lib/order_cloud/models/approval_rule.rb +0 -307
- data/lib/order_cloud/models/base_spec.rb +0 -262
- data/lib/order_cloud/models/buyer.rb +0 -226
- data/lib/order_cloud/models/buyer_address.rb +0 -226
- data/lib/order_cloud/models/buyer_credit_card.rb +0 -208
- data/lib/order_cloud/models/buyer_product.rb +0 -208
- data/lib/order_cloud/models/buyer_spec.rb +0 -210
- data/lib/order_cloud/models/category.rb +0 -262
- data/lib/order_cloud/models/category_assignment.rb +0 -217
- data/lib/order_cloud/models/category_product_assignment.rb +0 -217
- data/lib/order_cloud/models/cost_center.rb +0 -226
- data/lib/order_cloud/models/cost_center_assignment.rb +0 -217
- data/lib/order_cloud/models/credit_card.rb +0 -262
- data/lib/order_cloud/models/credit_card_assignment.rb +0 -217
- data/lib/order_cloud/models/email_template.rb +0 -235
- data/lib/order_cloud/models/file.rb +0 -217
- data/lib/order_cloud/models/impersonate_token_request.rb +0 -208
- data/lib/order_cloud/models/inventory.rb +0 -235
- data/lib/order_cloud/models/line_item.rb +0 -336
- data/lib/order_cloud/models/line_item_spec.rb +0 -226
- data/lib/order_cloud/models/list_address.rb +0 -210
- data/lib/order_cloud/models/list_address_assignment.rb +0 -210
- data/lib/order_cloud/models/list_admin_company.rb +0 -210
- data/lib/order_cloud/models/list_approval_rule.rb +0 -210
- data/lib/order_cloud/models/list_buyer.rb +0 -210
- data/lib/order_cloud/models/list_buyer_address.rb +0 -210
- data/lib/order_cloud/models/list_buyer_credit_card.rb +0 -210
- data/lib/order_cloud/models/list_buyer_product.rb +0 -210
- data/lib/order_cloud/models/list_buyer_spec.rb +0 -210
- data/lib/order_cloud/models/list_category.rb +0 -210
- data/lib/order_cloud/models/list_category_assignment.rb +0 -210
- data/lib/order_cloud/models/list_category_product_assignment.rb +0 -210
- data/lib/order_cloud/models/list_cost_center.rb +0 -210
- data/lib/order_cloud/models/list_cost_center_assignment.rb +0 -210
- data/lib/order_cloud/models/list_credit_card.rb +0 -210
- data/lib/order_cloud/models/list_credit_card_assignment.rb +0 -210
- data/lib/order_cloud/models/list_file.rb +0 -210
- data/lib/order_cloud/models/list_inventory.rb +0 -210
- data/lib/order_cloud/models/list_line_item.rb +0 -210
- data/lib/order_cloud/models/list_message_cc_listener_assignment.rb +0 -210
- data/lib/order_cloud/models/list_message_config.rb +0 -210
- data/lib/order_cloud/models/list_message_sender.rb +0 -210
- data/lib/order_cloud/models/list_message_sender_assignment.rb +0 -210
- data/lib/order_cloud/models/list_order.rb +0 -210
- data/lib/order_cloud/models/list_order_approval.rb +0 -210
- data/lib/order_cloud/models/list_order_promotion.rb +0 -210
- data/lib/order_cloud/models/list_payment.rb +0 -210
- data/lib/order_cloud/models/list_price_schedule.rb +0 -210
- data/lib/order_cloud/models/list_product.rb +0 -210
- data/lib/order_cloud/models/list_product_assignment.rb +0 -210
- data/lib/order_cloud/models/list_promotion.rb +0 -210
- data/lib/order_cloud/models/list_promotion_assignment.rb +0 -210
- data/lib/order_cloud/models/list_security_profile.rb +0 -210
- data/lib/order_cloud/models/list_security_profile_assignment.rb +0 -210
- data/lib/order_cloud/models/list_shipment.rb +0 -210
- data/lib/order_cloud/models/list_spec.rb +0 -210
- data/lib/order_cloud/models/list_spec_option.rb +0 -210
- data/lib/order_cloud/models/list_spec_product_assignment.rb +0 -210
- data/lib/order_cloud/models/list_spending_account.rb +0 -210
- data/lib/order_cloud/models/list_spending_account_assignment.rb +0 -210
- data/lib/order_cloud/models/list_user.rb +0 -210
- data/lib/order_cloud/models/list_user_group.rb +0 -210
- data/lib/order_cloud/models/list_user_group_assignment.rb +0 -210
- data/lib/order_cloud/models/list_variant.rb +0 -210
- data/lib/order_cloud/models/list_web_hook.rb +0 -210
- data/lib/order_cloud/models/list_web_hook_route.rb +0 -210
- data/lib/order_cloud/models/list_xp_index.rb +0 -210
- data/lib/order_cloud/models/message_cc_listener_assignment.rb +0 -244
- data/lib/order_cloud/models/message_config.rb +0 -226
- data/lib/order_cloud/models/message_sender.rb +0 -217
- data/lib/order_cloud/models/message_sender_assignment.rb +0 -235
- data/lib/order_cloud/models/meta.rb +0 -237
- data/lib/order_cloud/models/order.rb +0 -406
- data/lib/order_cloud/models/order_approval.rb +0 -271
- data/lib/order_cloud/models/order_promotion.rb +0 -199
- data/lib/order_cloud/models/password_reset.rb +0 -217
- data/lib/order_cloud/models/password_reset_request.rb +0 -226
- data/lib/order_cloud/models/payment.rb +0 -273
- data/lib/order_cloud/models/payment_transaction.rb +0 -262
- data/lib/order_cloud/models/ping_response.rb +0 -199
- data/lib/order_cloud/models/price_break.rb +0 -208
- data/lib/order_cloud/models/price_schedule.rb +0 -291
- data/lib/order_cloud/models/product.rb +0 -361
- data/lib/order_cloud/models/product_assignment.rb +0 -244
- data/lib/order_cloud/models/promotion.rb +0 -316
- data/lib/order_cloud/models/promotion_assignment.rb +0 -226
- data/lib/order_cloud/models/security_profile.rb +0 -228
- data/lib/order_cloud/models/security_profile_assignment.rb +0 -226
- data/lib/order_cloud/models/shipment.rb +0 -255
- data/lib/order_cloud/models/shipment_item.rb +0 -217
- data/lib/order_cloud/models/spec.rb +0 -199
- data/lib/order_cloud/models/spec_option.rb +0 -253
- data/lib/order_cloud/models/spec_product_assignment.rb +0 -217
- data/lib/order_cloud/models/spending_account.rb +0 -262
- data/lib/order_cloud/models/spending_account_assignment.rb +0 -226
- data/lib/order_cloud/models/user.rb +0 -291
- data/lib/order_cloud/models/user_group.rb +0 -226
- data/lib/order_cloud/models/user_group_assignment.rb +0 -208
- data/lib/order_cloud/models/variant.rb +0 -235
- data/lib/order_cloud/models/web_hook.rb +0 -289
- data/lib/order_cloud/models/web_hook_route.rb +0 -217
- data/lib/order_cloud/models/xp_index.rb +0 -208
- data/lib/order_cloud/version.rb +0 -26
- data/order_cloud.gemspec +0 -56
- data/spec/api/address_api_spec.rb +0 -179
- data/spec/api/admin_address_api_spec.rb +0 -125
- data/spec/api/admin_user_api_spec.rb +0 -125
- data/spec/api/admin_user_group_api_spec.rb +0 -165
- data/spec/api/approval_rule_api_spec.rb +0 -131
- data/spec/api/buyer_api_spec.rb +0 -125
- data/spec/api/category_api_spec.rb +0 -221
- data/spec/api/cost_center_api_spec.rb +0 -177
- data/spec/api/credit_card_api_spec.rb +0 -177
- data/spec/api/email_template_api_spec.rb +0 -100
- data/spec/api/line_item_api_spec.rb +0 -167
- data/spec/api/me_api_spec.rb +0 -431
- data/spec/api/message_senders_api_spec.rb +0 -149
- data/spec/api/order_api_spec.rb +0 -375
- data/spec/api/password_reset_api_spec.rb +0 -71
- data/spec/api/payment_api_spec.rb +0 -199
- data/spec/api/price_schedule_api_spec.rb +0 -151
- data/spec/api/product_api_spec.rb +0 -330
- data/spec/api/promotion_api_spec.rb +0 -170
- data/spec/api/security_profile_api_spec.rb +0 -120
- data/spec/api/shipment_api_spec.rb +0 -161
- data/spec/api/spec_api_spec.rb +0 -250
- data/spec/api/spending_account_api_spec.rb +0 -177
- data/spec/api/user_api_spec.rb +0 -146
- data/spec/api/user_group_api_spec.rb +0 -174
- data/spec/api_auth_spec.rb +0 -165
- data/spec/api_client_spec.rb +0 -237
- data/spec/configuration_spec.rb +0 -80
- data/spec/models/access_token_spec.rb +0 -65
- data/spec/models/address_assignment_spec.rb +0 -77
- data/spec/models/address_spec.rb +0 -125
- data/spec/models/admin_company_spec.rb +0 -65
- data/spec/models/admin_model_on_view_spec.rb +0 -47
- data/spec/models/approval_rule_spec.rb +0 -125
- data/spec/models/base_spec_spec.rb +0 -95
- data/spec/models/buyer_address_spec.rb +0 -71
- data/spec/models/buyer_credit_card_spec.rb +0 -59
- data/spec/models/buyer_product_spec.rb +0 -59
- data/spec/models/buyer_spec.rb +0 -71
- data/spec/models/buyer_spec_spec.rb +0 -59
- data/spec/models/category_assignment_spec.rb +0 -65
- data/spec/models/category_product_assignment_spec.rb +0 -65
- data/spec/models/category_spec.rb +0 -95
- data/spec/models/cost_center_assignment_spec.rb +0 -65
- data/spec/models/cost_center_spec.rb +0 -71
- data/spec/models/credit_card_assignment_spec.rb +0 -65
- data/spec/models/credit_card_spec.rb +0 -95
- data/spec/models/email_template_spec.rb +0 -77
- data/spec/models/file_spec.rb +0 -65
- data/spec/models/impersonate_token_request_spec.rb +0 -59
- data/spec/models/inventory_spec.rb +0 -77
- data/spec/models/line_item_spec.rb +0 -143
- data/spec/models/line_item_spec_spec.rb +0 -71
- data/spec/models/list_address_assignment_spec.rb +0 -59
- data/spec/models/list_address_spec.rb +0 -59
- data/spec/models/list_admin_company_spec.rb +0 -59
- data/spec/models/list_approval_rule_spec.rb +0 -59
- data/spec/models/list_buyer_address_spec.rb +0 -59
- data/spec/models/list_buyer_credit_card_spec.rb +0 -59
- data/spec/models/list_buyer_product_spec.rb +0 -59
- data/spec/models/list_buyer_spec.rb +0 -59
- data/spec/models/list_buyer_spec_spec.rb +0 -59
- data/spec/models/list_category_assignment_spec.rb +0 -59
- data/spec/models/list_category_product_assignment_spec.rb +0 -59
- data/spec/models/list_category_spec.rb +0 -59
- data/spec/models/list_cost_center_assignment_spec.rb +0 -59
- data/spec/models/list_cost_center_spec.rb +0 -59
- data/spec/models/list_credit_card_assignment_spec.rb +0 -59
- data/spec/models/list_credit_card_spec.rb +0 -59
- data/spec/models/list_file_spec.rb +0 -59
- data/spec/models/list_inventory_spec.rb +0 -59
- data/spec/models/list_line_item_spec.rb +0 -59
- data/spec/models/list_message_cc_listener_assignment_spec.rb +0 -59
- data/spec/models/list_message_config_spec.rb +0 -59
- data/spec/models/list_message_sender_assignment_spec.rb +0 -59
- data/spec/models/list_message_sender_spec.rb +0 -59
- data/spec/models/list_order_approval_spec.rb +0 -59
- data/spec/models/list_order_promotion_spec.rb +0 -59
- data/spec/models/list_order_spec.rb +0 -59
- data/spec/models/list_payment_spec.rb +0 -59
- data/spec/models/list_price_schedule_spec.rb +0 -59
- data/spec/models/list_product_assignment_spec.rb +0 -59
- data/spec/models/list_product_spec.rb +0 -59
- data/spec/models/list_promotion_assignment_spec.rb +0 -59
- data/spec/models/list_promotion_spec.rb +0 -59
- data/spec/models/list_security_profile_assignment_spec.rb +0 -59
- data/spec/models/list_security_profile_spec.rb +0 -59
- data/spec/models/list_shipment_spec.rb +0 -59
- data/spec/models/list_spec_option_spec.rb +0 -59
- data/spec/models/list_spec_product_assignment_spec.rb +0 -59
- data/spec/models/list_spec_spec.rb +0 -59
- data/spec/models/list_spending_account_assignment_spec.rb +0 -59
- data/spec/models/list_spending_account_spec.rb +0 -59
- data/spec/models/list_user_group_assignment_spec.rb +0 -59
- data/spec/models/list_user_group_spec.rb +0 -59
- data/spec/models/list_user_spec.rb +0 -59
- data/spec/models/list_variant_spec.rb +0 -59
- data/spec/models/list_web_hook_route_spec.rb +0 -59
- data/spec/models/list_web_hook_spec.rb +0 -59
- data/spec/models/list_xp_index_spec.rb +0 -59
- data/spec/models/message_cc_listener_assignment_spec.rb +0 -83
- data/spec/models/message_config_spec.rb +0 -71
- data/spec/models/message_sender_assignment_spec.rb +0 -77
- data/spec/models/message_sender_spec.rb +0 -65
- data/spec/models/meta_spec.rb +0 -77
- data/spec/models/order_approval_spec.rb +0 -101
- data/spec/models/order_promotion_spec.rb +0 -53
- data/spec/models/order_spec.rb +0 -191
- data/spec/models/password_reset_request_spec.rb +0 -71
- data/spec/models/password_reset_spec.rb +0 -65
- data/spec/models/payment_spec.rb +0 -101
- data/spec/models/payment_transaction_spec.rb +0 -95
- data/spec/models/ping_response_spec.rb +0 -53
- data/spec/models/price_break_spec.rb +0 -59
- data/spec/models/price_schedule_spec.rb +0 -113
- data/spec/models/product_assignment_spec.rb +0 -83
- data/spec/models/product_spec.rb +0 -161
- data/spec/models/promotion_assignment_spec.rb +0 -71
- data/spec/models/promotion_spec.rb +0 -131
- data/spec/models/security_profile_assignment_spec.rb +0 -71
- data/spec/models/security_profile_spec.rb +0 -71
- data/spec/models/shipment_item_spec.rb +0 -65
- data/spec/models/shipment_spec.rb +0 -89
- data/spec/models/spec_option_spec.rb +0 -89
- data/spec/models/spec_product_assignment_spec.rb +0 -65
- data/spec/models/spec_spec.rb +0 -53
- data/spec/models/spending_account_assignment_spec.rb +0 -71
- data/spec/models/spending_account_spec.rb +0 -95
- data/spec/models/user_group_assignment_spec.rb +0 -59
- data/spec/models/user_group_spec.rb +0 -71
- data/spec/models/user_spec.rb +0 -113
- data/spec/models/variant_spec.rb +0 -77
- data/spec/models/web_hook_route_spec.rb +0 -65
- data/spec/models/web_hook_spec.rb +0 -113
- data/spec/models/xp_index_spec.rb +0 -59
- data/spec/spec_helper.rb +0 -122
@@ -1,237 +0,0 @@
|
|
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 Meta
|
29
|
-
attr_accessor :page
|
30
|
-
|
31
|
-
attr_accessor :page_size
|
32
|
-
|
33
|
-
attr_accessor :total_count
|
34
|
-
|
35
|
-
attr_accessor :total_pages
|
36
|
-
|
37
|
-
attr_accessor :item_range
|
38
|
-
|
39
|
-
|
40
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
-
def self.attribute_map
|
42
|
-
{
|
43
|
-
:'page' => :'Page',
|
44
|
-
:'page_size' => :'PageSize',
|
45
|
-
:'total_count' => :'TotalCount',
|
46
|
-
:'total_pages' => :'TotalPages',
|
47
|
-
:'item_range' => :'ItemRange'
|
48
|
-
}
|
49
|
-
end
|
50
|
-
|
51
|
-
# Attribute type mapping.
|
52
|
-
def self.swagger_types
|
53
|
-
{
|
54
|
-
:'page' => :'Integer',
|
55
|
-
:'page_size' => :'Integer',
|
56
|
-
:'total_count' => :'Integer',
|
57
|
-
:'total_pages' => :'Integer',
|
58
|
-
:'item_range' => :'Array<Integer>'
|
59
|
-
}
|
60
|
-
end
|
61
|
-
|
62
|
-
# Initializes the object
|
63
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
-
def initialize(attributes = {})
|
65
|
-
return unless attributes.is_a?(Hash)
|
66
|
-
|
67
|
-
# convert string to symbol for hash key
|
68
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
69
|
-
|
70
|
-
if attributes.has_key?(:'Page')
|
71
|
-
self.page = attributes[:'Page']
|
72
|
-
end
|
73
|
-
|
74
|
-
if attributes.has_key?(:'PageSize')
|
75
|
-
self.page_size = attributes[:'PageSize']
|
76
|
-
end
|
77
|
-
|
78
|
-
if attributes.has_key?(:'TotalCount')
|
79
|
-
self.total_count = attributes[:'TotalCount']
|
80
|
-
end
|
81
|
-
|
82
|
-
if attributes.has_key?(:'TotalPages')
|
83
|
-
self.total_pages = attributes[:'TotalPages']
|
84
|
-
end
|
85
|
-
|
86
|
-
if attributes.has_key?(:'ItemRange')
|
87
|
-
if (value = attributes[:'ItemRange']).is_a?(Array)
|
88
|
-
self.item_range = value
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
93
|
-
|
94
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
95
|
-
# @return Array for valid properies with the reasons
|
96
|
-
def list_invalid_properties
|
97
|
-
invalid_properties = Array.new
|
98
|
-
return invalid_properties
|
99
|
-
end
|
100
|
-
|
101
|
-
# Check to see if the all the properties in the model are valid
|
102
|
-
# @return true if the model is valid
|
103
|
-
def valid?
|
104
|
-
return true
|
105
|
-
end
|
106
|
-
|
107
|
-
# Checks equality by comparing each attribute.
|
108
|
-
# @param [Object] Object to be compared
|
109
|
-
def ==(o)
|
110
|
-
return true if self.equal?(o)
|
111
|
-
self.class == o.class &&
|
112
|
-
page == o.page &&
|
113
|
-
page_size == o.page_size &&
|
114
|
-
total_count == o.total_count &&
|
115
|
-
total_pages == o.total_pages &&
|
116
|
-
item_range == o.item_range
|
117
|
-
end
|
118
|
-
|
119
|
-
# @see the `==` method
|
120
|
-
# @param [Object] Object to be compared
|
121
|
-
def eql?(o)
|
122
|
-
self == o
|
123
|
-
end
|
124
|
-
|
125
|
-
# Calculates hash code according to all attributes.
|
126
|
-
# @return [Fixnum] Hash code
|
127
|
-
def hash
|
128
|
-
[page, page_size, total_count, total_pages, item_range].hash
|
129
|
-
end
|
130
|
-
|
131
|
-
# Builds the object from hash
|
132
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
-
# @return [Object] Returns the model itself
|
134
|
-
def build_from_hash(attributes)
|
135
|
-
return nil unless attributes.is_a?(Hash)
|
136
|
-
self.class.swagger_types.each_pair do |key, type|
|
137
|
-
if type =~ /^Array<(.*)>/i
|
138
|
-
# check to ensure the input is an array given that the the attribute
|
139
|
-
# is documented as an array but the input is not
|
140
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
141
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
142
|
-
end
|
143
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
144
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
145
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
146
|
-
end
|
147
|
-
|
148
|
-
self
|
149
|
-
end
|
150
|
-
|
151
|
-
# Deserializes the data based on type
|
152
|
-
# @param string type Data type
|
153
|
-
# @param string value Value to be deserialized
|
154
|
-
# @return [Object] Deserialized data
|
155
|
-
def _deserialize(type, value)
|
156
|
-
case type.to_sym
|
157
|
-
when :DateTime
|
158
|
-
DateTime.parse(value)
|
159
|
-
when :Date
|
160
|
-
Date.parse(value)
|
161
|
-
when :String
|
162
|
-
value.to_s
|
163
|
-
when :Integer
|
164
|
-
value.to_i
|
165
|
-
when :Float
|
166
|
-
value.to_f
|
167
|
-
when :BOOLEAN
|
168
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
169
|
-
true
|
170
|
-
else
|
171
|
-
false
|
172
|
-
end
|
173
|
-
when :Object
|
174
|
-
# generic object (usually a Hash), return directly
|
175
|
-
value
|
176
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
-
inner_type = Regexp.last_match[:inner_type]
|
178
|
-
value.map { |v| _deserialize(inner_type, v) }
|
179
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
180
|
-
k_type = Regexp.last_match[:k_type]
|
181
|
-
v_type = Regexp.last_match[:v_type]
|
182
|
-
{}.tap do |hash|
|
183
|
-
value.each do |k, v|
|
184
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
-
end
|
186
|
-
end
|
187
|
-
else # model
|
188
|
-
temp_model = OrderCloud.const_get(type).new
|
189
|
-
temp_model.build_from_hash(value)
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
# Returns the string representation of the object
|
194
|
-
# @return [String] String presentation of the object
|
195
|
-
def to_s
|
196
|
-
to_hash.to_s
|
197
|
-
end
|
198
|
-
|
199
|
-
# to_body is an alias to to_hash (backward compatibility)
|
200
|
-
# @return [Hash] Returns the object in the form of hash
|
201
|
-
def to_body
|
202
|
-
to_hash
|
203
|
-
end
|
204
|
-
|
205
|
-
# Returns the object in the form of hash
|
206
|
-
# @return [Hash] Returns the object in the form of hash
|
207
|
-
def to_hash
|
208
|
-
hash = {}
|
209
|
-
self.class.attribute_map.each_pair do |attr, param|
|
210
|
-
value = self.send(attr)
|
211
|
-
next if value.nil?
|
212
|
-
hash[param] = _to_hash(value)
|
213
|
-
end
|
214
|
-
hash
|
215
|
-
end
|
216
|
-
|
217
|
-
# Outputs non-array value in the form of hash
|
218
|
-
# For object, use to_hash. Otherwise, just return the value
|
219
|
-
# @param [Object] value Any valid value
|
220
|
-
# @return [Hash] Returns the value in the form of hash
|
221
|
-
def _to_hash(value)
|
222
|
-
if value.is_a?(Array)
|
223
|
-
value.compact.map{ |v| _to_hash(v) }
|
224
|
-
elsif value.is_a?(Hash)
|
225
|
-
{}.tap do |hash|
|
226
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
227
|
-
end
|
228
|
-
elsif value.respond_to? :to_hash
|
229
|
-
value.to_hash
|
230
|
-
else
|
231
|
-
value
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
235
|
-
end
|
236
|
-
|
237
|
-
end
|
@@ -1,406 +0,0 @@
|
|
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 Order
|
29
|
-
attr_accessor :id
|
30
|
-
|
31
|
-
attr_accessor :type
|
32
|
-
|
33
|
-
attr_accessor :from_user_id
|
34
|
-
|
35
|
-
attr_accessor :from_user_first_name
|
36
|
-
|
37
|
-
attr_accessor :from_user_last_name
|
38
|
-
|
39
|
-
attr_accessor :billing_address_id
|
40
|
-
|
41
|
-
attr_accessor :billing_address
|
42
|
-
|
43
|
-
attr_accessor :shipping_address_id
|
44
|
-
|
45
|
-
attr_accessor :comments
|
46
|
-
|
47
|
-
attr_accessor :line_item_count
|
48
|
-
|
49
|
-
attr_accessor :status
|
50
|
-
|
51
|
-
attr_accessor :date_created
|
52
|
-
|
53
|
-
attr_accessor :date_submitted
|
54
|
-
|
55
|
-
attr_accessor :date_approved
|
56
|
-
|
57
|
-
attr_accessor :date_declined
|
58
|
-
|
59
|
-
attr_accessor :date_canceled
|
60
|
-
|
61
|
-
attr_accessor :date_completed
|
62
|
-
|
63
|
-
attr_accessor :subtotal
|
64
|
-
|
65
|
-
attr_accessor :shipping_cost
|
66
|
-
|
67
|
-
attr_accessor :tax_cost
|
68
|
-
|
69
|
-
attr_accessor :promotion_discount
|
70
|
-
|
71
|
-
attr_accessor :total
|
72
|
-
|
73
|
-
attr_accessor :is_submitted
|
74
|
-
|
75
|
-
attr_accessor :xp
|
76
|
-
|
77
|
-
|
78
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
79
|
-
def self.attribute_map
|
80
|
-
{
|
81
|
-
:'id' => :'ID',
|
82
|
-
:'type' => :'Type',
|
83
|
-
:'from_user_id' => :'FromUserID',
|
84
|
-
:'from_user_first_name' => :'FromUserFirstName',
|
85
|
-
:'from_user_last_name' => :'FromUserLastName',
|
86
|
-
:'billing_address_id' => :'BillingAddressID',
|
87
|
-
:'billing_address' => :'BillingAddress',
|
88
|
-
:'shipping_address_id' => :'ShippingAddressID',
|
89
|
-
:'comments' => :'Comments',
|
90
|
-
:'line_item_count' => :'LineItemCount',
|
91
|
-
:'status' => :'Status',
|
92
|
-
:'date_created' => :'DateCreated',
|
93
|
-
:'date_submitted' => :'DateSubmitted',
|
94
|
-
:'date_approved' => :'DateApproved',
|
95
|
-
:'date_declined' => :'DateDeclined',
|
96
|
-
:'date_canceled' => :'DateCanceled',
|
97
|
-
:'date_completed' => :'DateCompleted',
|
98
|
-
:'subtotal' => :'Subtotal',
|
99
|
-
:'shipping_cost' => :'ShippingCost',
|
100
|
-
:'tax_cost' => :'TaxCost',
|
101
|
-
:'promotion_discount' => :'PromotionDiscount',
|
102
|
-
:'total' => :'Total',
|
103
|
-
:'is_submitted' => :'IsSubmitted',
|
104
|
-
:'xp' => :'xp'
|
105
|
-
}
|
106
|
-
end
|
107
|
-
|
108
|
-
# Attribute type mapping.
|
109
|
-
def self.swagger_types
|
110
|
-
{
|
111
|
-
:'id' => :'String',
|
112
|
-
:'type' => :'String',
|
113
|
-
:'from_user_id' => :'String',
|
114
|
-
:'from_user_first_name' => :'String',
|
115
|
-
:'from_user_last_name' => :'String',
|
116
|
-
:'billing_address_id' => :'String',
|
117
|
-
:'billing_address' => :'Address',
|
118
|
-
:'shipping_address_id' => :'String',
|
119
|
-
:'comments' => :'String',
|
120
|
-
:'line_item_count' => :'Integer',
|
121
|
-
:'status' => :'String',
|
122
|
-
:'date_created' => :'String',
|
123
|
-
:'date_submitted' => :'String',
|
124
|
-
:'date_approved' => :'String',
|
125
|
-
:'date_declined' => :'String',
|
126
|
-
:'date_canceled' => :'String',
|
127
|
-
:'date_completed' => :'String',
|
128
|
-
:'subtotal' => :'Float',
|
129
|
-
:'shipping_cost' => :'Float',
|
130
|
-
:'tax_cost' => :'Float',
|
131
|
-
:'promotion_discount' => :'Float',
|
132
|
-
:'total' => :'Float',
|
133
|
-
:'is_submitted' => :'BOOLEAN',
|
134
|
-
:'xp' => :'Object'
|
135
|
-
}
|
136
|
-
end
|
137
|
-
|
138
|
-
# Initializes the object
|
139
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
-
def initialize(attributes = {})
|
141
|
-
return unless attributes.is_a?(Hash)
|
142
|
-
|
143
|
-
# convert string to symbol for hash key
|
144
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
145
|
-
|
146
|
-
if attributes.has_key?(:'ID')
|
147
|
-
self.id = attributes[:'ID']
|
148
|
-
end
|
149
|
-
|
150
|
-
if attributes.has_key?(:'Type')
|
151
|
-
self.type = attributes[:'Type']
|
152
|
-
end
|
153
|
-
|
154
|
-
if attributes.has_key?(:'FromUserID')
|
155
|
-
self.from_user_id = attributes[:'FromUserID']
|
156
|
-
end
|
157
|
-
|
158
|
-
if attributes.has_key?(:'FromUserFirstName')
|
159
|
-
self.from_user_first_name = attributes[:'FromUserFirstName']
|
160
|
-
end
|
161
|
-
|
162
|
-
if attributes.has_key?(:'FromUserLastName')
|
163
|
-
self.from_user_last_name = attributes[:'FromUserLastName']
|
164
|
-
end
|
165
|
-
|
166
|
-
if attributes.has_key?(:'BillingAddressID')
|
167
|
-
self.billing_address_id = attributes[:'BillingAddressID']
|
168
|
-
end
|
169
|
-
|
170
|
-
if attributes.has_key?(:'BillingAddress')
|
171
|
-
self.billing_address = attributes[:'BillingAddress']
|
172
|
-
end
|
173
|
-
|
174
|
-
if attributes.has_key?(:'ShippingAddressID')
|
175
|
-
self.shipping_address_id = attributes[:'ShippingAddressID']
|
176
|
-
end
|
177
|
-
|
178
|
-
if attributes.has_key?(:'Comments')
|
179
|
-
self.comments = attributes[:'Comments']
|
180
|
-
end
|
181
|
-
|
182
|
-
if attributes.has_key?(:'LineItemCount')
|
183
|
-
self.line_item_count = attributes[:'LineItemCount']
|
184
|
-
end
|
185
|
-
|
186
|
-
if attributes.has_key?(:'Status')
|
187
|
-
self.status = attributes[:'Status']
|
188
|
-
end
|
189
|
-
|
190
|
-
if attributes.has_key?(:'DateCreated')
|
191
|
-
self.date_created = attributes[:'DateCreated']
|
192
|
-
end
|
193
|
-
|
194
|
-
if attributes.has_key?(:'DateSubmitted')
|
195
|
-
self.date_submitted = attributes[:'DateSubmitted']
|
196
|
-
end
|
197
|
-
|
198
|
-
if attributes.has_key?(:'DateApproved')
|
199
|
-
self.date_approved = attributes[:'DateApproved']
|
200
|
-
end
|
201
|
-
|
202
|
-
if attributes.has_key?(:'DateDeclined')
|
203
|
-
self.date_declined = attributes[:'DateDeclined']
|
204
|
-
end
|
205
|
-
|
206
|
-
if attributes.has_key?(:'DateCanceled')
|
207
|
-
self.date_canceled = attributes[:'DateCanceled']
|
208
|
-
end
|
209
|
-
|
210
|
-
if attributes.has_key?(:'DateCompleted')
|
211
|
-
self.date_completed = attributes[:'DateCompleted']
|
212
|
-
end
|
213
|
-
|
214
|
-
if attributes.has_key?(:'Subtotal')
|
215
|
-
self.subtotal = attributes[:'Subtotal']
|
216
|
-
end
|
217
|
-
|
218
|
-
if attributes.has_key?(:'ShippingCost')
|
219
|
-
self.shipping_cost = attributes[:'ShippingCost']
|
220
|
-
end
|
221
|
-
|
222
|
-
if attributes.has_key?(:'TaxCost')
|
223
|
-
self.tax_cost = attributes[:'TaxCost']
|
224
|
-
end
|
225
|
-
|
226
|
-
if attributes.has_key?(:'PromotionDiscount')
|
227
|
-
self.promotion_discount = attributes[:'PromotionDiscount']
|
228
|
-
end
|
229
|
-
|
230
|
-
if attributes.has_key?(:'Total')
|
231
|
-
self.total = attributes[:'Total']
|
232
|
-
end
|
233
|
-
|
234
|
-
if attributes.has_key?(:'IsSubmitted')
|
235
|
-
self.is_submitted = attributes[:'IsSubmitted']
|
236
|
-
end
|
237
|
-
|
238
|
-
if attributes.has_key?(:'xp')
|
239
|
-
self.xp = attributes[:'xp']
|
240
|
-
end
|
241
|
-
|
242
|
-
end
|
243
|
-
|
244
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
245
|
-
# @return Array for valid properies with the reasons
|
246
|
-
def list_invalid_properties
|
247
|
-
invalid_properties = Array.new
|
248
|
-
return invalid_properties
|
249
|
-
end
|
250
|
-
|
251
|
-
# Check to see if the all the properties in the model are valid
|
252
|
-
# @return true if the model is valid
|
253
|
-
def valid?
|
254
|
-
return true
|
255
|
-
end
|
256
|
-
|
257
|
-
# Checks equality by comparing each attribute.
|
258
|
-
# @param [Object] Object to be compared
|
259
|
-
def ==(o)
|
260
|
-
return true if self.equal?(o)
|
261
|
-
self.class == o.class &&
|
262
|
-
id == o.id &&
|
263
|
-
type == o.type &&
|
264
|
-
from_user_id == o.from_user_id &&
|
265
|
-
from_user_first_name == o.from_user_first_name &&
|
266
|
-
from_user_last_name == o.from_user_last_name &&
|
267
|
-
billing_address_id == o.billing_address_id &&
|
268
|
-
billing_address == o.billing_address &&
|
269
|
-
shipping_address_id == o.shipping_address_id &&
|
270
|
-
comments == o.comments &&
|
271
|
-
line_item_count == o.line_item_count &&
|
272
|
-
status == o.status &&
|
273
|
-
date_created == o.date_created &&
|
274
|
-
date_submitted == o.date_submitted &&
|
275
|
-
date_approved == o.date_approved &&
|
276
|
-
date_declined == o.date_declined &&
|
277
|
-
date_canceled == o.date_canceled &&
|
278
|
-
date_completed == o.date_completed &&
|
279
|
-
subtotal == o.subtotal &&
|
280
|
-
shipping_cost == o.shipping_cost &&
|
281
|
-
tax_cost == o.tax_cost &&
|
282
|
-
promotion_discount == o.promotion_discount &&
|
283
|
-
total == o.total &&
|
284
|
-
is_submitted == o.is_submitted &&
|
285
|
-
xp == o.xp
|
286
|
-
end
|
287
|
-
|
288
|
-
# @see the `==` method
|
289
|
-
# @param [Object] Object to be compared
|
290
|
-
def eql?(o)
|
291
|
-
self == o
|
292
|
-
end
|
293
|
-
|
294
|
-
# Calculates hash code according to all attributes.
|
295
|
-
# @return [Fixnum] Hash code
|
296
|
-
def hash
|
297
|
-
[id, type, from_user_id, from_user_first_name, from_user_last_name, billing_address_id, billing_address, shipping_address_id, comments, line_item_count, status, date_created, date_submitted, date_approved, date_declined, date_canceled, date_completed, subtotal, shipping_cost, tax_cost, promotion_discount, total, is_submitted, xp].hash
|
298
|
-
end
|
299
|
-
|
300
|
-
# Builds the object from hash
|
301
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
302
|
-
# @return [Object] Returns the model itself
|
303
|
-
def build_from_hash(attributes)
|
304
|
-
return nil unless attributes.is_a?(Hash)
|
305
|
-
self.class.swagger_types.each_pair do |key, type|
|
306
|
-
if type =~ /^Array<(.*)>/i
|
307
|
-
# check to ensure the input is an array given that the the attribute
|
308
|
-
# is documented as an array but the input is not
|
309
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
310
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
311
|
-
end
|
312
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
313
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
314
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
315
|
-
end
|
316
|
-
|
317
|
-
self
|
318
|
-
end
|
319
|
-
|
320
|
-
# Deserializes the data based on type
|
321
|
-
# @param string type Data type
|
322
|
-
# @param string value Value to be deserialized
|
323
|
-
# @return [Object] Deserialized data
|
324
|
-
def _deserialize(type, value)
|
325
|
-
case type.to_sym
|
326
|
-
when :DateTime
|
327
|
-
DateTime.parse(value)
|
328
|
-
when :Date
|
329
|
-
Date.parse(value)
|
330
|
-
when :String
|
331
|
-
value.to_s
|
332
|
-
when :Integer
|
333
|
-
value.to_i
|
334
|
-
when :Float
|
335
|
-
value.to_f
|
336
|
-
when :BOOLEAN
|
337
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
338
|
-
true
|
339
|
-
else
|
340
|
-
false
|
341
|
-
end
|
342
|
-
when :Object
|
343
|
-
# generic object (usually a Hash), return directly
|
344
|
-
value
|
345
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
346
|
-
inner_type = Regexp.last_match[:inner_type]
|
347
|
-
value.map { |v| _deserialize(inner_type, v) }
|
348
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
349
|
-
k_type = Regexp.last_match[:k_type]
|
350
|
-
v_type = Regexp.last_match[:v_type]
|
351
|
-
{}.tap do |hash|
|
352
|
-
value.each do |k, v|
|
353
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
354
|
-
end
|
355
|
-
end
|
356
|
-
else # model
|
357
|
-
temp_model = OrderCloud.const_get(type).new
|
358
|
-
temp_model.build_from_hash(value)
|
359
|
-
end
|
360
|
-
end
|
361
|
-
|
362
|
-
# Returns the string representation of the object
|
363
|
-
# @return [String] String presentation of the object
|
364
|
-
def to_s
|
365
|
-
to_hash.to_s
|
366
|
-
end
|
367
|
-
|
368
|
-
# to_body is an alias to to_hash (backward compatibility)
|
369
|
-
# @return [Hash] Returns the object in the form of hash
|
370
|
-
def to_body
|
371
|
-
to_hash
|
372
|
-
end
|
373
|
-
|
374
|
-
# Returns the object in the form of hash
|
375
|
-
# @return [Hash] Returns the object in the form of hash
|
376
|
-
def to_hash
|
377
|
-
hash = {}
|
378
|
-
self.class.attribute_map.each_pair do |attr, param|
|
379
|
-
value = self.send(attr)
|
380
|
-
next if value.nil?
|
381
|
-
hash[param] = _to_hash(value)
|
382
|
-
end
|
383
|
-
hash
|
384
|
-
end
|
385
|
-
|
386
|
-
# Outputs non-array value in the form of hash
|
387
|
-
# For object, use to_hash. Otherwise, just return the value
|
388
|
-
# @param [Object] value Any valid value
|
389
|
-
# @return [Hash] Returns the value in the form of hash
|
390
|
-
def _to_hash(value)
|
391
|
-
if value.is_a?(Array)
|
392
|
-
value.compact.map{ |v| _to_hash(v) }
|
393
|
-
elsif value.is_a?(Hash)
|
394
|
-
{}.tap do |hash|
|
395
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
396
|
-
end
|
397
|
-
elsif value.respond_to? :to_hash
|
398
|
-
value.to_hash
|
399
|
-
else
|
400
|
-
value
|
401
|
-
end
|
402
|
-
end
|
403
|
-
|
404
|
-
end
|
405
|
-
|
406
|
-
end
|