From de0c20ed6ba17703835d48e123a674cb27da1ec9 Mon Sep 17 00:00:00 2001 From: rknepp Date: Wed, 12 Oct 2022 12:42:59 -0400 Subject: [PATCH] 2022-10-12 build --- README.md | 81 +- docs/Api/DropInCheckoutLinksApi.md | 208 ++ docs/Api/DropInCheckoutSessionsApi.md | 71 + docs/Api/DropInShippingQuotesApi.md | 66 + docs/Api/FilesApi.md | 63 + docs/Api/FulfillmentsApi.md | 4 +- docs/Api/LogisticsReturnsApi.md | 218 ++ docs/Api/OrdersApi.md | 2 +- docs/Api/ReturnsApi.md | 32 +- docs/Api/ShippingLabelsApi.md | 139 ++ docs/Api/ShippingQuotesApi.md | 10 +- docs/Api/StoreCreditCalloutApi.md | 70 + docs/Model/Attributes.md | 15 + docs/Model/Billing1.md | 16 + docs/Model/Business.md | 12 + docs/Model/Checkout.md | 1 + docs/Model/CheckoutLinkDetails.md | 16 + docs/Model/CheckoutRequest.md | 1 + docs/Model/CheckoutTaxIdentifierRequest.md | 2 +- docs/Model/CountrySpecification.md | 2 + .../CreateDropInCheckoutTokenResponse.md | 13 + docs/Model/CreateReturnsResponse.md | 21 + docs/Model/DropInCheckoutLink.md | 11 + docs/Model/DropInCheckoutLinkResponse.md | 13 + docs/Model/DropInCheckoutRequest.md | 32 + docs/Model/DropInCheckoutSession.md | 26 + docs/Model/DropInOptionsRequest.md | 13 + docs/Model/DropInSku.md | 18 + docs/Model/FileContent.md | 12 + docs/Model/FulfillmentOrder.md | 21 + docs/Model/GLAddress.md | 16 + docs/Model/GLShipFrom.md | 12 + docs/Model/Individual.md | 12 + docs/Model/IntegrationAddress.md | 16 + docs/Model/IntegrationShippingMethod.md | 13 + docs/Model/IntegrationStoreCredit.md | 15 + docs/Model/IntegrationStoreCreditRequest.md | 15 + docs/Model/InvoiceAttributeInfo.md | 13 + docs/Model/InvoiceAttributes.md | 17 + docs/Model/InvoiceItem.md | 1 + docs/Model/InvoiceItemRequest.md | 1 + docs/Model/ItemShipping.md | 12 + docs/Model/LabelResponse.md | 14 + docs/Model/ListCheckoutLinksResponse.md | 12 + docs/Model/ListReturnsResponse1.md | 12 + docs/Model/ListShippingLabel.md | 12 + docs/Model/Order.md | 1 + docs/Model/OrderDetails.md | 55 + docs/Model/OrderItem.md | 4 +- docs/Model/OrderItem1.md | 28 + docs/Model/OrderRequest.md | 1 + docs/Model/PackageRequest.md | 15 + docs/Model/Plan.md | 1 + docs/Model/ProductDetails.md | 20 + docs/Model/ProductItemRequest.md | 4 +- docs/Model/Redirects.md | 12 + docs/Model/RequestReturnsItem.md | 13 + docs/Model/ReturnItem.md | 10 +- docs/Model/ReturnItemRequest.md | 12 + docs/Model/ReturnRequest.md | 7 +- docs/Model/ReturnResponse.md | 14 +- docs/Model/ReturnsAddress.md | 16 + docs/Model/ReturnsItem.md | 16 + docs/Model/ReturnsLocation.md | 14 + docs/Model/ReturnsRequest.md | 15 + docs/Model/ReturnsResponse.md | 23 + docs/Model/SalesTransaction.md | 3 + docs/Model/ShipFrom1.md | 12 + docs/Model/Shipping.md | 8 +- docs/Model/Shipping1.md | 16 + docs/Model/ShippingChoice.md | 1 + docs/Model/ShippingLabelRequest.md | 16 + docs/Model/ShippingLabelResponse.md | 14 + docs/Model/ShippingMethodQuote.md | 13 + docs/Model/ShippingMethodQuoteItemRequest.md | 14 + docs/Model/ShippingMethodQuoteItemResponse.md | 12 + docs/Model/ShippingMethodQuoteRequest.md | 15 + docs/Model/ShippingMethodQuoteResponse.md | 13 + docs/Model/ShippingQuote.md | 17 +- docs/Model/ShippingQuoteFees.md | 12 + docs/Model/ShippingQuoteFeesDetails.md | 12 + docs/Model/ShippingQuoteRequest.md | 4 +- docs/Model/ShippingQuoteResponse.md | 2 +- docs/Model/ShippingRequest.md | 1 + docs/Model/Sku.md | 1 - docs/Model/SkuGroup.md | 4 +- docs/Model/SkuItem.md | 6 +- docs/Model/SkuItemRequest.md | 19 + docs/Model/SkuRequest.md | 1 - docs/Model/SkuRequestItem.md | 3 +- docs/Model/SkuUpsertRequest.md | 1 - docs/Model/Source.md | 2 + docs/Model/StateTransitions.md | 7 +- docs/Model/Subscription.md | 3 +- docs/Model/SubscriptionItems.md | 1 + docs/Model/SubscriptionStateTransitions.md | 15 + docs/Model/TaxIdentifier1.md | 20 + docs/Model/TaxIdentifiersInfo.md | 15 + docs/Model/UpdateCheckoutRequest.md | 3 +- docs/Model/UpdateReturnsItem.md | 14 + docs/Model/UpdateReturnsRequest.md | 14 + docs/Model/UpdateSkuRequest.md | 1 - lib/Api/DropInCheckoutLinksApi.php | 1544 ++++++++++++++ lib/Api/DropInCheckoutSessionsApi.php | 636 ++++++ lib/Api/DropInShippingQuotesApi.php | 612 ++++++ lib/Api/FilesApi.php | 302 +++ lib/Api/FulfillmentsApi.php | 14 +- lib/Api/LogisticsReturnsApi.php | 1776 +++++++++++++++++ lib/Api/ReturnsApi.php | 120 +- lib/Api/ShippingLabelsApi.php | 1194 +++++++++++ lib/Api/ShippingQuotesApi.php | 28 +- lib/Api/StoreCreditCalloutApi.php | 444 +++++ lib/Configuration.php | 46 +- lib/HeaderSelector.php | 14 + lib/Model/Attributes.php | 416 ++++ lib/Model/Billing1.php | 450 +++++ lib/Model/Business.php | 362 ++++ lib/Model/Cancel.php | 2 + lib/Model/Checkout.php | 30 + lib/Model/CheckoutLinkDetails.php | 446 +++++ lib/Model/CheckoutRequest.php | 30 + lib/Model/CheckoutTaxIdentifierRequest.php | 2 +- lib/Model/CountrySpecification.php | 60 + .../CreateDropInCheckoutTokenResponse.php | 356 ++++ lib/Model/CreateReturnsResponse.php | 632 ++++++ lib/Model/DropInCheckoutLink.php | 296 +++ lib/Model/DropInCheckoutLinkResponse.php | 356 ++++ lib/Model/DropInCheckoutRequest.php | 1018 ++++++++++ lib/Model/DropInCheckoutSession.php | 746 +++++++ lib/Model/DropInOptionsRequest.php | 356 ++++ lib/Model/DropInSku.php | 506 +++++ lib/Model/FileContent.php | 326 +++ lib/Model/FulfillmentOrder.php | 596 ++++++ lib/Model/GLAddress.php | 447 +++++ lib/Model/GLShipFrom.php | 327 +++ lib/Model/Individual.php | 368 ++++ lib/Model/IntegrationAddress.php | 446 +++++ lib/Model/IntegrationShippingMethod.php | 365 ++++ lib/Model/IntegrationStoreCredit.php | 416 ++++ lib/Model/IntegrationStoreCreditRequest.php | 416 ++++ lib/Model/InvoiceAttributeInfo.php | 356 ++++ lib/Model/InvoiceAttributes.php | 522 +++++ lib/Model/InvoiceItem.php | 30 + lib/Model/InvoiceItemRequest.php | 30 + lib/Model/ItemShipping.php | 326 +++ lib/Model/LabelResponse.php | 420 ++++ lib/Model/ListCheckoutLinksResponse.php | 326 +++ lib/Model/ListReturnsResponse1.php | 326 +++ lib/Model/ListShippingLabel.php | 326 +++ lib/Model/Order.php | 30 + lib/Model/OrderDetails.php | 1704 ++++++++++++++++ lib/Model/OrderItem.php | 86 +- lib/Model/OrderItem1.php | 850 ++++++++ lib/Model/OrderRequest.php | 30 + lib/Model/PackageRequest.php | 422 ++++ lib/Model/Plan.php | 30 + lib/Model/ProductDetails.php | 606 ++++++ lib/Model/ProductItemRequest.php | 63 +- lib/Model/Redirects.php | 326 +++ lib/Model/RequestReturnsItem.php | 359 ++++ lib/Model/ReturnItem.php | 155 +- lib/Model/ReturnItemRequest.php | 332 +++ lib/Model/ReturnRequest.php | 109 +- lib/Model/ReturnResponse.php | 286 +-- lib/Model/ReturnsAddress.php | 461 +++++ lib/Model/ReturnsItem.php | 482 +++++ lib/Model/ReturnsLocation.php | 389 ++++ lib/Model/ReturnsRequest.php | 430 ++++ lib/Model/ReturnsResponse.php | 692 +++++++ lib/Model/SalesTransaction.php | 100 +- lib/Model/ShipFrom1.php | 327 +++ lib/Model/Shipping.php | 9 +- lib/Model/Shipping1.php | 446 +++++ lib/Model/ShippingChoice.php | 78 +- lib/Model/ShippingLabelRequest.php | 492 +++++ lib/Model/ShippingLabelResponse.php | 386 ++++ lib/Model/ShippingMethodQuote.php | 356 ++++ lib/Model/ShippingMethodQuoteItemRequest.php | 395 ++++ lib/Model/ShippingMethodQuoteItemResponse.php | 326 +++ lib/Model/ShippingMethodQuoteRequest.php | 428 ++++ lib/Model/ShippingMethodQuoteResponse.php | 356 ++++ lib/Model/ShippingQuote.php | 276 +-- lib/Model/ShippingQuoteFees.php | 326 +++ lib/Model/ShippingQuoteFeesDetails.php | 326 +++ lib/Model/ShippingQuoteRequest.php | 76 +- lib/Model/ShippingQuoteResponse.php | 28 +- lib/Model/ShippingRequest.php | 76 +- lib/Model/Sku.php | 30 - lib/Model/SkuGroup.php | 4 +- lib/Model/SkuItem.php | 88 +- lib/Model/SkuItemRequest.php | 536 +++++ lib/Model/SkuRequest.php | 30 - lib/Model/SkuRequestItem.php | 37 +- lib/Model/SkuUpsertRequest.php | 30 - lib/Model/Source.php | 64 + lib/Model/StateTransitions.php | 84 +- lib/Model/Subscription.php | 38 +- lib/Model/SubscriptionItems.php | 30 + lib/Model/SubscriptionStateTransitions.php | 416 ++++ lib/Model/TaxIdentifier1.php | 604 ++++++ lib/Model/TaxIdentifiersInfo.php | 452 +++++ lib/Model/UpdateCheckoutRequest.php | 74 +- lib/Model/UpdateReturnsItem.php | 426 ++++ lib/Model/UpdateReturnsRequest.php | 420 ++++ lib/Model/UpdateSkuRequest.php | 30 - lib/ObjectSerializer.php | 4 +- 206 files changed, 36149 insertions(+), 1058 deletions(-) create mode 100644 docs/Api/DropInCheckoutLinksApi.md create mode 100644 docs/Api/DropInCheckoutSessionsApi.md create mode 100644 docs/Api/DropInShippingQuotesApi.md create mode 100644 docs/Api/LogisticsReturnsApi.md create mode 100644 docs/Api/ShippingLabelsApi.md create mode 100644 docs/Api/StoreCreditCalloutApi.md create mode 100644 docs/Model/Attributes.md create mode 100644 docs/Model/Billing1.md create mode 100644 docs/Model/Business.md create mode 100644 docs/Model/CheckoutLinkDetails.md create mode 100644 docs/Model/CreateDropInCheckoutTokenResponse.md create mode 100644 docs/Model/CreateReturnsResponse.md create mode 100644 docs/Model/DropInCheckoutLink.md create mode 100644 docs/Model/DropInCheckoutLinkResponse.md create mode 100644 docs/Model/DropInCheckoutRequest.md create mode 100644 docs/Model/DropInCheckoutSession.md create mode 100644 docs/Model/DropInOptionsRequest.md create mode 100644 docs/Model/DropInSku.md create mode 100644 docs/Model/FileContent.md create mode 100644 docs/Model/FulfillmentOrder.md create mode 100644 docs/Model/GLAddress.md create mode 100644 docs/Model/GLShipFrom.md create mode 100644 docs/Model/Individual.md create mode 100644 docs/Model/IntegrationAddress.md create mode 100644 docs/Model/IntegrationShippingMethod.md create mode 100644 docs/Model/IntegrationStoreCredit.md create mode 100644 docs/Model/IntegrationStoreCreditRequest.md create mode 100644 docs/Model/InvoiceAttributeInfo.md create mode 100644 docs/Model/InvoiceAttributes.md create mode 100644 docs/Model/ItemShipping.md create mode 100644 docs/Model/LabelResponse.md create mode 100644 docs/Model/ListCheckoutLinksResponse.md create mode 100644 docs/Model/ListReturnsResponse1.md create mode 100644 docs/Model/ListShippingLabel.md create mode 100644 docs/Model/OrderDetails.md create mode 100644 docs/Model/OrderItem1.md create mode 100644 docs/Model/PackageRequest.md create mode 100644 docs/Model/ProductDetails.md create mode 100644 docs/Model/Redirects.md create mode 100644 docs/Model/RequestReturnsItem.md create mode 100644 docs/Model/ReturnItemRequest.md create mode 100644 docs/Model/ReturnsAddress.md create mode 100644 docs/Model/ReturnsItem.md create mode 100644 docs/Model/ReturnsLocation.md create mode 100644 docs/Model/ReturnsRequest.md create mode 100644 docs/Model/ReturnsResponse.md create mode 100644 docs/Model/ShipFrom1.md create mode 100644 docs/Model/Shipping1.md create mode 100644 docs/Model/ShippingLabelRequest.md create mode 100644 docs/Model/ShippingLabelResponse.md create mode 100644 docs/Model/ShippingMethodQuote.md create mode 100644 docs/Model/ShippingMethodQuoteItemRequest.md create mode 100644 docs/Model/ShippingMethodQuoteItemResponse.md create mode 100644 docs/Model/ShippingMethodQuoteRequest.md create mode 100644 docs/Model/ShippingMethodQuoteResponse.md create mode 100644 docs/Model/ShippingQuoteFees.md create mode 100644 docs/Model/ShippingQuoteFeesDetails.md create mode 100644 docs/Model/SkuItemRequest.md create mode 100644 docs/Model/SubscriptionStateTransitions.md create mode 100644 docs/Model/TaxIdentifier1.md create mode 100644 docs/Model/TaxIdentifiersInfo.md create mode 100644 docs/Model/UpdateReturnsItem.md create mode 100644 docs/Model/UpdateReturnsRequest.md create mode 100644 lib/Api/DropInCheckoutLinksApi.php create mode 100644 lib/Api/DropInCheckoutSessionsApi.php create mode 100644 lib/Api/DropInShippingQuotesApi.php create mode 100644 lib/Api/LogisticsReturnsApi.php create mode 100644 lib/Api/ShippingLabelsApi.php create mode 100644 lib/Api/StoreCreditCalloutApi.php create mode 100644 lib/Model/Attributes.php create mode 100644 lib/Model/Billing1.php create mode 100644 lib/Model/Business.php create mode 100644 lib/Model/CheckoutLinkDetails.php create mode 100644 lib/Model/CreateDropInCheckoutTokenResponse.php create mode 100644 lib/Model/CreateReturnsResponse.php create mode 100644 lib/Model/DropInCheckoutLink.php create mode 100644 lib/Model/DropInCheckoutLinkResponse.php create mode 100644 lib/Model/DropInCheckoutRequest.php create mode 100644 lib/Model/DropInCheckoutSession.php create mode 100644 lib/Model/DropInOptionsRequest.php create mode 100644 lib/Model/DropInSku.php create mode 100644 lib/Model/FileContent.php create mode 100644 lib/Model/FulfillmentOrder.php create mode 100644 lib/Model/GLAddress.php create mode 100644 lib/Model/GLShipFrom.php create mode 100644 lib/Model/Individual.php create mode 100644 lib/Model/IntegrationAddress.php create mode 100644 lib/Model/IntegrationShippingMethod.php create mode 100644 lib/Model/IntegrationStoreCredit.php create mode 100644 lib/Model/IntegrationStoreCreditRequest.php create mode 100644 lib/Model/InvoiceAttributeInfo.php create mode 100644 lib/Model/InvoiceAttributes.php create mode 100644 lib/Model/ItemShipping.php create mode 100644 lib/Model/LabelResponse.php create mode 100644 lib/Model/ListCheckoutLinksResponse.php create mode 100644 lib/Model/ListReturnsResponse1.php create mode 100644 lib/Model/ListShippingLabel.php create mode 100644 lib/Model/OrderDetails.php create mode 100644 lib/Model/OrderItem1.php create mode 100644 lib/Model/PackageRequest.php create mode 100644 lib/Model/ProductDetails.php create mode 100644 lib/Model/Redirects.php create mode 100644 lib/Model/RequestReturnsItem.php create mode 100644 lib/Model/ReturnItemRequest.php create mode 100644 lib/Model/ReturnsAddress.php create mode 100644 lib/Model/ReturnsItem.php create mode 100644 lib/Model/ReturnsLocation.php create mode 100644 lib/Model/ReturnsRequest.php create mode 100644 lib/Model/ReturnsResponse.php create mode 100644 lib/Model/ShipFrom1.php create mode 100644 lib/Model/Shipping1.php create mode 100644 lib/Model/ShippingLabelRequest.php create mode 100644 lib/Model/ShippingLabelResponse.php create mode 100644 lib/Model/ShippingMethodQuote.php create mode 100644 lib/Model/ShippingMethodQuoteItemRequest.php create mode 100644 lib/Model/ShippingMethodQuoteItemResponse.php create mode 100644 lib/Model/ShippingMethodQuoteRequest.php create mode 100644 lib/Model/ShippingMethodQuoteResponse.php create mode 100644 lib/Model/ShippingQuoteFees.php create mode 100644 lib/Model/ShippingQuoteFeesDetails.php create mode 100644 lib/Model/SkuItemRequest.php create mode 100644 lib/Model/SubscriptionStateTransitions.php create mode 100644 lib/Model/TaxIdentifier1.php create mode 100644 lib/Model/TaxIdentifiersInfo.php create mode 100644 lib/Model/UpdateReturnsItem.php create mode 100644 lib/Model/UpdateReturnsRequest.php diff --git a/README.md b/README.md index 92379f9..7ba0277 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Use this SDK to integrate [Digital River API](https://docs.digitalriver.com/digi This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 2021 +- API version: 2022 - Package version: 1.0.0 - Build package: org.openapitools.codegen.languages.PhpClientCodegen @@ -158,6 +158,11 @@ Class | Method | HTTP request | Description *CustomersApi* | [**listCustomers**](docs/Api/CustomersApi.md#listcustomers) | **GET** /customers | Returns a list of customers *CustomersApi* | [**retrieveCustomers**](docs/Api/CustomersApi.md#retrievecustomers) | **GET** /customers/{id} | Gets a customer by ID *CustomersApi* | [**updateCustomers**](docs/Api/CustomersApi.md#updatecustomers) | **POST** /customers/{id} | Updates an existing customer +*DropInCheckoutLinksApi* | [**createDropInCheckoutLink**](docs/Api/DropInCheckoutLinksApi.md#createdropincheckoutlink) | **POST** /drop-in/checkout-links | Creates a new Drop-in checkout link +*DropInCheckoutLinksApi* | [**deleteDropInCheckoutLinks**](docs/Api/DropInCheckoutLinksApi.md#deletedropincheckoutlinks) | **DELETE** /drop-in/checkout-links/{id} | Deletes a Drop-in checkout link by ID. +*DropInCheckoutLinksApi* | [**listDropInCheckoutLink**](docs/Api/DropInCheckoutLinksApi.md#listdropincheckoutlink) | **GET** /drop-in/checkout-links | List Drop-in checkout links +*DropInCheckoutSessionsApi* | [**createDropInCheckoutSession**](docs/Api/DropInCheckoutSessionsApi.md#createdropincheckoutsession) | **POST** /drop-in/checkout-sessions | Creates a new Drop-in checkout session +*DropInShippingQuotesApi* | [**listShippingMethodQuotes**](docs/Api/DropInShippingQuotesApi.md#listshippingmethodquotes) | **POST** /checkout/shipping-quotes | Returns shipping method quotes *EventsApi* | [**listEvents**](docs/Api/EventsApi.md#listevents) | **GET** /events | Returns a list of events *EventsApi* | [**retrieveEvents**](docs/Api/EventsApi.md#retrieveevents) | **GET** /events/{id} | Gets an event by identifier *FeesApi* | [**createFees**](docs/Api/FeesApi.md#createfees) | **POST** /fees | Creates a fee @@ -172,6 +177,7 @@ Class | Method | HTTP request | Description *FileLinksApi* | [**updateFileLinks**](docs/Api/FileLinksApi.md#updatefilelinks) | **POST** /file-links/{id} | Updates a file link *FilesApi* | [**createFiles**](docs/Api/FilesApi.md#createfiles) | **POST** /files | Creates a file. *FilesApi* | [**deleteFiles**](docs/Api/FilesApi.md#deletefiles) | **DELETE** /files/{id} | Deletes a file by ID. +*FilesApi* | [**downloadFiles**](docs/Api/FilesApi.md#downloadfiles) | **GET** /files/{id}/content | Gets file content by ID. *FilesApi* | [**listFiles**](docs/Api/FilesApi.md#listfiles) | **GET** /files | Returns a list of files. *FilesApi* | [**retrieveFiles**](docs/Api/FilesApi.md#retrievefiles) | **GET** /files/{id} | Gets a file by ID. *FulfillmentCancellationsApi* | [**createFulfillmentCancellations**](docs/Api/FulfillmentCancellationsApi.md#createfulfillmentcancellations) | **POST** /fulfillment-cancellations | Creates a cancellation @@ -201,6 +207,9 @@ Class | Method | HTTP request | Description *InvoicesApi* | [**retrieveInvoices**](docs/Api/InvoicesApi.md#retrieveinvoices) | **GET** /invoices/{id} | Gets an invoice by identifier *InvoicesApi* | [**updateInvoices**](docs/Api/InvoicesApi.md#updateinvoices) | **POST** /invoices/{id} | Updates an existing invoice *InvoicesApi* | [**voidInvoices**](docs/Api/InvoicesApi.md#voidinvoices) | **POST** /invoices/{id}/void | Voids an existing invoice +*LogisticsReturnsApi* | [**createLogisticsReturns**](docs/Api/LogisticsReturnsApi.md#createlogisticsreturns) | **POST** /logistics-returns | Creates a return +*LogisticsReturnsApi* | [**listLogisticsReturns**](docs/Api/LogisticsReturnsApi.md#listlogisticsreturns) | **GET** /logistics-returns | Returns a list of returns +*LogisticsReturnsApi* | [**retrieveLogisticsReturns**](docs/Api/LogisticsReturnsApi.md#retrievelogisticsreturns) | **GET** /logistics-returns/{id} | Gets a return by ID *OrdersApi* | [**createOrders**](docs/Api/OrdersApi.md#createorders) | **POST** /orders | Creates a new order. *OrdersApi* | [**listOrders**](docs/Api/OrdersApi.md#listorders) | **GET** /orders | Returns a list of orders. *OrdersApi* | [**retrieveOrders**](docs/Api/OrdersApi.md#retrieveorders) | **GET** /orders/{id} | Gets an order by ID. @@ -235,10 +244,13 @@ Class | Method | HTTP request | Description *SalesTransactionsApi* | [**retrieveSalesTransactions**](docs/Api/SalesTransactionsApi.md#retrievesalestransactions) | **GET** /sales-transactions/{id} | Gets a sales transaction by ID. *ShipmentsApi* | [**listShipments**](docs/Api/ShipmentsApi.md#listshipments) | **GET** /shipments | Returns a list of shipments *ShipmentsApi* | [**retrieveShipments**](docs/Api/ShipmentsApi.md#retrieveshipments) | **GET** /shipments/{id} | Gets a shipment by ID. -*ShippingQuotesApi* | [**listShippingQuotes**](docs/Api/ShippingQuotesApi.md#listshippingquotes) | **POST** /shipping-quotes | Returns shipping quotes +*ShippingLabelsApi* | [**createShippingLabel**](docs/Api/ShippingLabelsApi.md#createshippinglabel) | **POST** /shipping-labels | Returns shipping label +*ShippingLabelsApi* | [**listShippingLabel**](docs/Api/ShippingLabelsApi.md#listshippinglabel) | **GET** /shipping-labels | Returns shipping label +*ShippingQuotesApi* | [**postShippingQuotes**](docs/Api/ShippingQuotesApi.md#postshippingquotes) | **POST** /shipping-quotes | Returns shipping quotes *SkuGroupsApi* | [**listSkuGroups**](docs/Api/SkuGroupsApi.md#listskugroups) | **GET** /sku-groups | Returns a list of SKU Groups *SourcesApi* | [**createSources**](docs/Api/SourcesApi.md#createsources) | **POST** /sources | Posts a source *SourcesApi* | [**retrieveSources**](docs/Api/SourcesApi.md#retrievesources) | **GET** /sources/{id} | Gets a source by identifier +*StoreCreditCalloutApi* | [**storeCreditsCallout**](docs/Api/StoreCreditCalloutApi.md#storecreditscallout) | **POST** /checkouts/store-credits | Store credit callout *SubscriptionsApi* | [**deleteSubscriptions**](docs/Api/SubscriptionsApi.md#deletesubscriptions) | **DELETE** /subscriptions/{id} | Deletes a Subscription by ID *SubscriptionsApi* | [**listSubscriptions**](docs/Api/SubscriptionsApi.md#listsubscriptions) | **GET** /subscriptions | Returns a list of Subscriptions *SubscriptionsApi* | [**retrieveSubscriptions**](docs/Api/SubscriptionsApi.md#retrievesubscriptions) | **GET** /subscriptions/{id} | Gets a Subscription by ID @@ -260,19 +272,24 @@ Class | Method | HTTP request | Description - [AdditionalBillingAddressInfo](docs/Model/AdditionalBillingAddressInfo.md) - [Address](docs/Model/Address.md) - [Applicability](docs/Model/Applicability.md) + - [Attributes](docs/Model/Attributes.md) - [BPay](docs/Model/BPay.md) - [Battery](docs/Model/Battery.md) - [Billing](docs/Model/Billing.md) + - [Billing1](docs/Model/Billing1.md) + - [Business](docs/Model/Business.md) - [Cancel](docs/Model/Cancel.md) - [Capture](docs/Model/Capture.md) - [Charge](docs/Model/Charge.md) - [ChargeType](docs/Model/ChargeType.md) - [Charges](docs/Model/Charges.md) - [Checkout](docs/Model/Checkout.md) + - [CheckoutLinkDetails](docs/Model/CheckoutLinkDetails.md) - [CheckoutRequest](docs/Model/CheckoutRequest.md) - [CheckoutTaxIdentifierRequest](docs/Model/CheckoutTaxIdentifierRequest.md) - [CountrySpecification](docs/Model/CountrySpecification.md) - - [CreateReturnResponse](docs/Model/CreateReturnResponse.md) + - [CreateDropInCheckoutTokenResponse](docs/Model/CreateDropInCheckoutTokenResponse.md) + - [CreateReturnsResponse](docs/Model/CreateReturnsResponse.md) - [CreditCard](docs/Model/CreditCard.md) - [CreditSource](docs/Model/CreditSource.md) - [Customer](docs/Model/Customer.md) @@ -284,6 +301,12 @@ Class | Method | HTTP request | Description - [DirectDebitRedirect](docs/Model/DirectDebitRedirect.md) - [Disclosure](docs/Model/Disclosure.md) - [Discount](docs/Model/Discount.md) + - [DropInCheckoutLink](docs/Model/DropInCheckoutLink.md) + - [DropInCheckoutLinkResponse](docs/Model/DropInCheckoutLinkResponse.md) + - [DropInCheckoutRequest](docs/Model/DropInCheckoutRequest.md) + - [DropInCheckoutSession](docs/Model/DropInCheckoutSession.md) + - [DropInOptionsRequest](docs/Model/DropInOptionsRequest.md) + - [DropInSku](docs/Model/DropInSku.md) - [Duties](docs/Model/Duties.md) - [Error](docs/Model/Error.md) - [Errors](docs/Model/Errors.md) @@ -295,6 +318,7 @@ Class | Method | HTTP request | Description - [FeeUpdateRequest](docs/Model/FeeUpdateRequest.md) - [Fees](docs/Model/Fees.md) - [File](docs/Model/File.md) + - [FileContent](docs/Model/FileContent.md) - [FileJsonRequest](docs/Model/FileJsonRequest.md) - [FileLink](docs/Model/FileLink.md) - [FileLinkRequest](docs/Model/FileLinkRequest.md) @@ -302,9 +326,12 @@ Class | Method | HTTP request | Description - [FileRequest](docs/Model/FileRequest.md) - [FraudStateTransitions](docs/Model/FraudStateTransitions.md) - [Fulfillment](docs/Model/Fulfillment.md) + - [FulfillmentOrder](docs/Model/FulfillmentOrder.md) - [FulfillmentRequest](docs/Model/FulfillmentRequest.md) - [FulfillmentRequestItem](docs/Model/FulfillmentRequestItem.md) - [FulfillmentResponseItem](docs/Model/FulfillmentResponseItem.md) + - [GLAddress](docs/Model/GLAddress.md) + - [GLShipFrom](docs/Model/GLShipFrom.md) - [GlobalFulfillmentAddress](docs/Model/GlobalFulfillmentAddress.md) - [GlobalFulfillmentCancellationItemRequest](docs/Model/GlobalFulfillmentCancellationItemRequest.md) - [GlobalFulfillmentCancellationItemResponse](docs/Model/GlobalFulfillmentCancellationItemResponse.md) @@ -321,28 +348,38 @@ Class | Method | HTTP request | Description - [GooglePay](docs/Model/GooglePay.md) - [HTTPAuthorization](docs/Model/HTTPAuthorization.md) - [ImporterTax](docs/Model/ImporterTax.md) + - [Individual](docs/Model/Individual.md) - [InlineResponse200](docs/Model/InlineResponse200.md) - [InlineResponse2001](docs/Model/InlineResponse2001.md) - [InlineResponse2002](docs/Model/InlineResponse2002.md) - [InlineResponse2003](docs/Model/InlineResponse2003.md) - [InlineResponse2004](docs/Model/InlineResponse2004.md) - [InlineResponse2005](docs/Model/InlineResponse2005.md) + - [IntegrationAddress](docs/Model/IntegrationAddress.md) + - [IntegrationShippingMethod](docs/Model/IntegrationShippingMethod.md) + - [IntegrationStoreCredit](docs/Model/IntegrationStoreCredit.md) + - [IntegrationStoreCreditRequest](docs/Model/IntegrationStoreCreditRequest.md) - [InternetBankPayment](docs/Model/InternetBankPayment.md) - [InventoryItem](docs/Model/InventoryItem.md) - [InventoryItemRequest](docs/Model/InventoryItemRequest.md) - [InventoryItemUpdateRequest](docs/Model/InventoryItemUpdateRequest.md) - [InventoryLevel](docs/Model/InventoryLevel.md) - [Invoice](docs/Model/Invoice.md) + - [InvoiceAttributeInfo](docs/Model/InvoiceAttributeInfo.md) + - [InvoiceAttributes](docs/Model/InvoiceAttributes.md) - [InvoiceItem](docs/Model/InvoiceItem.md) - [InvoiceItemRequest](docs/Model/InvoiceItemRequest.md) - [InvoiceRequest](docs/Model/InvoiceRequest.md) + - [ItemShipping](docs/Model/ItemShipping.md) - [Klarna](docs/Model/Klarna.md) - [KlarnaAddress](docs/Model/KlarnaAddress.md) - [KlarnaRecurring](docs/Model/KlarnaRecurring.md) - [KlarnaShipping](docs/Model/KlarnaShipping.md) - [Konbini](docs/Model/Konbini.md) + - [LabelResponse](docs/Model/LabelResponse.md) - [LineItem](docs/Model/LineItem.md) - [LineItemRequest](docs/Model/LineItemRequest.md) + - [ListCheckoutLinksResponse](docs/Model/ListCheckoutLinksResponse.md) - [ListCheckoutsResponse](docs/Model/ListCheckoutsResponse.md) - [ListCountrySpecsResponse](docs/Model/ListCountrySpecsResponse.md) - [ListCustomersResponse](docs/Model/ListCustomersResponse.md) @@ -359,21 +396,26 @@ Class | Method | HTTP request | Description - [ListPlansResponse](docs/Model/ListPlansResponse.md) - [ListRefundsResponse](docs/Model/ListRefundsResponse.md) - [ListReturnsResponse](docs/Model/ListReturnsResponse.md) + - [ListReturnsResponse1](docs/Model/ListReturnsResponse1.md) - [ListSalesSummariesResponse](docs/Model/ListSalesSummariesResponse.md) - [ListSalesTransactionsResponse](docs/Model/ListSalesTransactionsResponse.md) + - [ListShippingLabel](docs/Model/ListShippingLabel.md) - [ListSkuGroupsResponse](docs/Model/ListSkuGroupsResponse.md) - [ListSkusResponse](docs/Model/ListSkusResponse.md) - [ListSubscriptionsResponse](docs/Model/ListSubscriptionsResponse.md) - [Location](docs/Model/Location.md) - [OAUTHTokenInfo](docs/Model/OAUTHTokenInfo.md) - [Order](docs/Model/Order.md) + - [OrderDetails](docs/Model/OrderDetails.md) - [OrderItem](docs/Model/OrderItem.md) + - [OrderItem1](docs/Model/OrderItem1.md) - [OrderItemStateTransitions](docs/Model/OrderItemStateTransitions.md) - [OrderRefund](docs/Model/OrderRefund.md) - [OrderRequest](docs/Model/OrderRequest.md) - [OrderStateTransitions](docs/Model/OrderStateTransitions.md) - [Organization](docs/Model/Organization.md) - [Owner](docs/Model/Owner.md) + - [PackageRequest](docs/Model/PackageRequest.md) - [PayPal](docs/Model/PayPal.md) - [PayPalToken](docs/Model/PayPalToken.md) - [PaycoResponse](docs/Model/PaycoResponse.md) @@ -383,40 +425,55 @@ Class | Method | HTTP request | Description - [PayoutTransaction](docs/Model/PayoutTransaction.md) - [Plan](docs/Model/Plan.md) - [PlanRequest](docs/Model/PlanRequest.md) - - [ProductItem](docs/Model/ProductItem.md) + - [ProductDetails](docs/Model/ProductDetails.md) - [ProductItemRequest](docs/Model/ProductItemRequest.md) - [PurchaseLocation](docs/Model/PurchaseLocation.md) - [Redirect](docs/Model/Redirect.md) + - [Redirects](docs/Model/Redirects.md) - [Refund](docs/Model/Refund.md) - [RefundCharges](docs/Model/RefundCharges.md) - [RefundItem](docs/Model/RefundItem.md) - [RefundItemRequest](docs/Model/RefundItemRequest.md) - [RefundRequest](docs/Model/RefundRequest.md) - - [RequestReturnItem](docs/Model/RequestReturnItem.md) + - [RequestReturnsItem](docs/Model/RequestReturnsItem.md) - [Reservation](docs/Model/Reservation.md) - [ReservationAddress](docs/Model/ReservationAddress.md) - [ReservationInventoryItem](docs/Model/ReservationInventoryItem.md) - [ReservationRequest](docs/Model/ReservationRequest.md) - [ReservationShipping](docs/Model/ReservationShipping.md) - [ReservationShippingChoice](docs/Model/ReservationShippingChoice.md) - - [ReturnAddress](docs/Model/ReturnAddress.md) - [ReturnItem](docs/Model/ReturnItem.md) - - [ReturnLocation](docs/Model/ReturnLocation.md) + - [ReturnItemRequest](docs/Model/ReturnItemRequest.md) - [ReturnRequest](docs/Model/ReturnRequest.md) - [ReturnResponse](docs/Model/ReturnResponse.md) + - [ReturnsAddress](docs/Model/ReturnsAddress.md) + - [ReturnsItem](docs/Model/ReturnsItem.md) + - [ReturnsLocation](docs/Model/ReturnsLocation.md) + - [ReturnsRequest](docs/Model/ReturnsRequest.md) + - [ReturnsResponse](docs/Model/ReturnsResponse.md) - [SalesSummary](docs/Model/SalesSummary.md) - [SalesTransaction](docs/Model/SalesTransaction.md) - [SellingEntity](docs/Model/SellingEntity.md) - [Session](docs/Model/Session.md) - [ShipFrom](docs/Model/ShipFrom.md) + - [ShipFrom1](docs/Model/ShipFrom1.md) - [Shipment](docs/Model/Shipment.md) - [ShipmentItem](docs/Model/ShipmentItem.md) - [ShipmentUnitAttributes](docs/Model/ShipmentUnitAttributes.md) - [Shipping](docs/Model/Shipping.md) + - [Shipping1](docs/Model/Shipping1.md) - [ShippingChoice](docs/Model/ShippingChoice.md) + - [ShippingLabelRequest](docs/Model/ShippingLabelRequest.md) + - [ShippingLabelResponse](docs/Model/ShippingLabelResponse.md) - [ShippingMethod](docs/Model/ShippingMethod.md) + - [ShippingMethodQuote](docs/Model/ShippingMethodQuote.md) + - [ShippingMethodQuoteItemRequest](docs/Model/ShippingMethodQuoteItemRequest.md) + - [ShippingMethodQuoteItemResponse](docs/Model/ShippingMethodQuoteItemResponse.md) + - [ShippingMethodQuoteRequest](docs/Model/ShippingMethodQuoteRequest.md) + - [ShippingMethodQuoteResponse](docs/Model/ShippingMethodQuoteResponse.md) - [ShippingQuote](docs/Model/ShippingQuote.md) - - [ShippingQuoteAddress](docs/Model/ShippingQuoteAddress.md) + - [ShippingQuoteFees](docs/Model/ShippingQuoteFees.md) + - [ShippingQuoteFeesDetails](docs/Model/ShippingQuoteFeesDetails.md) - [ShippingQuoteRequest](docs/Model/ShippingQuoteRequest.md) - [ShippingQuoteResponse](docs/Model/ShippingQuoteResponse.md) - [ShippingRequest](docs/Model/ShippingRequest.md) @@ -424,6 +481,7 @@ Class | Method | HTTP request | Description - [SkuDiscount](docs/Model/SkuDiscount.md) - [SkuGroup](docs/Model/SkuGroup.md) - [SkuItem](docs/Model/SkuItem.md) + - [SkuItemRequest](docs/Model/SkuItemRequest.md) - [SkuRequest](docs/Model/SkuRequest.md) - [SkuRequestItem](docs/Model/SkuRequestItem.md) - [SkuUpdateRequestItem](docs/Model/SkuUpdateRequestItem.md) @@ -433,12 +491,15 @@ Class | Method | HTTP request | Description - [Subscription](docs/Model/Subscription.md) - [SubscriptionInfo](docs/Model/SubscriptionInfo.md) - [SubscriptionItems](docs/Model/SubscriptionItems.md) + - [SubscriptionStateTransitions](docs/Model/SubscriptionStateTransitions.md) - [Tax](docs/Model/Tax.md) - [TaxCertificate](docs/Model/TaxCertificate.md) - [TaxDetail](docs/Model/TaxDetail.md) - [TaxIdentifier](docs/Model/TaxIdentifier.md) + - [TaxIdentifier1](docs/Model/TaxIdentifier1.md) - [TaxIdentifierRequest](docs/Model/TaxIdentifierRequest.md) - [TaxIdentifierStateTransitions](docs/Model/TaxIdentifierStateTransitions.md) + - [TaxIdentifiersInfo](docs/Model/TaxIdentifiersInfo.md) - [TokenInformation](docs/Model/TokenInformation.md) - [Tracking](docs/Model/Tracking.md) - [UnitAttributes](docs/Model/UnitAttributes.md) @@ -449,8 +510,8 @@ Class | Method | HTTP request | Description - [UpdateOrderRequest](docs/Model/UpdateOrderRequest.md) - [UpdatePlanRequest](docs/Model/UpdatePlanRequest.md) - [UpdateRefundRequest](docs/Model/UpdateRefundRequest.md) - - [UpdateReturnItem](docs/Model/UpdateReturnItem.md) - - [UpdateReturnRequest](docs/Model/UpdateReturnRequest.md) + - [UpdateReturnsItem](docs/Model/UpdateReturnsItem.md) + - [UpdateReturnsRequest](docs/Model/UpdateReturnsRequest.md) - [UpdateSkuRequest](docs/Model/UpdateSkuRequest.md) - [UpdateSubscriptionRequest](docs/Model/UpdateSubscriptionRequest.md) - [UpdateTaxIdentifierRequest](docs/Model/UpdateTaxIdentifierRequest.md) diff --git a/docs/Api/DropInCheckoutLinksApi.md b/docs/Api/DropInCheckoutLinksApi.md new file mode 100644 index 0000000..c6edb61 --- /dev/null +++ b/docs/Api/DropInCheckoutLinksApi.md @@ -0,0 +1,208 @@ +# DigitalRiver\ApiSdk\DropInCheckoutLinksApi + +All URIs are relative to *https://api.digitalriver.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createDropInCheckoutLink**](DropInCheckoutLinksApi.md#createDropInCheckoutLink) | **POST** /drop-in/checkout-links | Creates a new Drop-in checkout link +[**deleteDropInCheckoutLinks**](DropInCheckoutLinksApi.md#deleteDropInCheckoutLinks) | **DELETE** /drop-in/checkout-links/{id} | Deletes a Drop-in checkout link by ID. +[**listDropInCheckoutLink**](DropInCheckoutLinksApi.md#listDropInCheckoutLink) | **GET** /drop-in/checkout-links | List Drop-in checkout links + + + +## createDropInCheckoutLink + +> \DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse createDropInCheckoutLink($drop_in_checkout_link) + +Creates a new Drop-in checkout link + +Creates a new Drop-in checkout link + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\DropInCheckoutLinksApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$drop_in_checkout_link = new \DigitalRiver\ApiSdk\Model\DropInCheckoutLink(); // \DigitalRiver\ApiSdk\Model\DropInCheckoutLink | +// Refer \DigitalRiver\ApiSdk\Model\DropInCheckoutLink::$setters in digital-river-php/lib/Model/DropInCheckoutLink.php to set the properties. + +try { + $result = $apiInstance->createDropInCheckoutLink($drop_in_checkout_link); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DropInCheckoutLinksApi->createDropInCheckoutLink: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **drop_in_checkout_link** | [**\DigitalRiver\ApiSdk\Model\DropInCheckoutLink**](../Model/DropInCheckoutLink.md)| | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse**](../Model/DropInCheckoutLinkResponse.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## deleteDropInCheckoutLinks + +> deleteDropInCheckoutLinks($id) + +Deletes a Drop-in checkout link by ID. + +Deletes the checkout link so it cannot be used after this operation. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\DropInCheckoutLinksApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Link ID + + +try { + $apiInstance->deleteDropInCheckoutLinks($id); +} catch (Exception $e) { + echo 'Exception when calling DropInCheckoutLinksApi->deleteDropInCheckoutLinks: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| Link ID | + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listDropInCheckoutLink + +> \DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse listDropInCheckoutLink($created_time, $ending_before, $starting_after, $limit, $ids) + +List Drop-in checkout links + +Get all checkout links. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\DropInCheckoutLinksApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$created_time = createdTime[gt]=2020-09-22T12:09:44Z; // map[string,\DateTime] | A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**—return values where the createdTime field equals to this timestamp - **gt**—return values where the createdTime field is after this timestamp - **gte**—return values where the createdTime field is after or equal to this timestamp - **lt**—return values where the createdTime field is before this timestamp - **lte**—return values where the createdTime field is before or equal to this timestamp +// Refer map[string,\DateTime]::$setters in digital-river-php/lib/Model/\DateTime.php to set the properties. +$ending_before = 'ending_before_example'; // string | A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. + +$starting_after = 'starting_after_example'; // string | A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. + +$limit = 56; // int | A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. + +$ids = array('ids_example'); // string[] | Only return objects with these IDs. +// Refer string[]::$setters in digital-river-php/lib/Model/string.php to set the properties. + +try { + $result = $apiInstance->listDropInCheckoutLink($created_time, $ending_before, $starting_after, $limit, $ids); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DropInCheckoutLinksApi->listDropInCheckoutLink: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **created_time** | [**map[string,\DateTime]**](../Model/\DateTime.md)| A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp | [optional] + **ending_before** | **string**| A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. | [optional] + **starting_after** | **string**| A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. | [optional] + **limit** | **int**| A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. | [optional] + **ids** | [**string[]**](../Model/string.md)| Only return objects with these IDs. | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse**](../Model/ListCheckoutLinksResponse.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/DropInCheckoutSessionsApi.md b/docs/Api/DropInCheckoutSessionsApi.md new file mode 100644 index 0000000..6a56c80 --- /dev/null +++ b/docs/Api/DropInCheckoutSessionsApi.md @@ -0,0 +1,71 @@ +# DigitalRiver\ApiSdk\DropInCheckoutSessionsApi + +All URIs are relative to *https://api.digitalriver.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createDropInCheckoutSession**](DropInCheckoutSessionsApi.md#createDropInCheckoutSession) | **POST** /drop-in/checkout-sessions | Creates a new Drop-in checkout session + + + +## createDropInCheckoutSession + +> \DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse createDropInCheckoutSession($drop_in_checkout_request) + +Creates a new Drop-in checkout session + +Creates a new Drop-in checkout session + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\DropInCheckoutSessionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$drop_in_checkout_request = new \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest(); // \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest | +// Refer \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest::$setters in digital-river-php/lib/Model/DropInCheckoutRequest.php to set the properties. + +try { + $result = $apiInstance->createDropInCheckoutSession($drop_in_checkout_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DropInCheckoutSessionsApi->createDropInCheckoutSession: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **drop_in_checkout_request** | [**\DigitalRiver\ApiSdk\Model\DropInCheckoutRequest**](../Model/DropInCheckoutRequest.md)| | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse**](../Model/CreateDropInCheckoutTokenResponse.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/DropInShippingQuotesApi.md b/docs/Api/DropInShippingQuotesApi.md new file mode 100644 index 0000000..9806056 --- /dev/null +++ b/docs/Api/DropInShippingQuotesApi.md @@ -0,0 +1,66 @@ +# DigitalRiver\ApiSdk\DropInShippingQuotesApi + +All URIs are relative to *https://api.digitalriver.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**listShippingMethodQuotes**](DropInShippingQuotesApi.md#listShippingMethodQuotes) | **POST** /checkout/shipping-quotes | Returns shipping method quotes + + + +## listShippingMethodQuotes + +> \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse listShippingMethodQuotes($shipping_method_quote_request) + +Returns shipping method quotes + +Get all available shipping method quotes + +### Example + +```php +listShippingMethodQuotes($shipping_method_quote_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DropInShippingQuotesApi->listShippingMethodQuotes: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipping_method_quote_request** | [**\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteRequest**](../Model/ShippingMethodQuoteRequest.md)| | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse**](../Model/ShippingMethodQuoteResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/FilesApi.md b/docs/Api/FilesApi.md index 06a8109..ee4ebc9 100644 --- a/docs/Api/FilesApi.md +++ b/docs/Api/FilesApi.md @@ -6,6 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**createFiles**](FilesApi.md#createFiles) | **POST** /files | Creates a file. [**deleteFiles**](FilesApi.md#deleteFiles) | **DELETE** /files/{id} | Deletes a file by ID. +[**downloadFiles**](FilesApi.md#downloadFiles) | **GET** /files/{id}/content | Gets file content by ID. [**listFiles**](FilesApi.md#listFiles) | **GET** /files | Returns a list of files. [**retrieveFiles**](FilesApi.md#retrieveFiles) | **GET** /files/{id} | Gets a file by ID. @@ -146,6 +147,68 @@ void (empty response body) [[Back to README]](../../README.md) +## downloadFiles + +> \DigitalRiver\ApiSdk\Model\FileContent downloadFiles($id) + +Gets file content by ID. + +Allows the caller to download the contents of the file associated with File resource. You must supply the unique identifier of the file. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\FilesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | File identifier. + + +try { + $result = $apiInstance->downloadFiles($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FilesApi->downloadFiles: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| File identifier. | + +### Return type + +[**\DigitalRiver\ApiSdk\Model\FileContent**](../Model/FileContent.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## listFiles > \DigitalRiver\ApiSdk\Model\ListFilesResponse listFiles($created_time, $ending_before, $starting_after, $limit, $ids, $purpose, $file_name, $title, $size, $type) diff --git a/docs/Api/FulfillmentsApi.md b/docs/Api/FulfillmentsApi.md index 845c4df..0732a32 100644 --- a/docs/Api/FulfillmentsApi.md +++ b/docs/Api/FulfillmentsApi.md @@ -160,7 +160,7 @@ Name | Type | Description | Notes ## retrieveFulfillments -> \DigitalRiver\ApiSdk\Model\Fulfillment retrieveFulfillments($id) +> \DigitalRiver\ApiSdk\Model\FulfillmentOrder retrieveFulfillments($id) Gets a Fulfillment by unique identifier @@ -204,7 +204,7 @@ Name | Type | Description | Notes ### Return type -[**\DigitalRiver\ApiSdk\Model\Fulfillment**](../Model/Fulfillment.md) +[**\DigitalRiver\ApiSdk\Model\FulfillmentOrder**](../Model/FulfillmentOrder.md) ### Authorization diff --git a/docs/Api/LogisticsReturnsApi.md b/docs/Api/LogisticsReturnsApi.md new file mode 100644 index 0000000..9608a13 --- /dev/null +++ b/docs/Api/LogisticsReturnsApi.md @@ -0,0 +1,218 @@ +# DigitalRiver\ApiSdk\LogisticsReturnsApi + +All URIs are relative to *https://api.digitalriver.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createLogisticsReturns**](LogisticsReturnsApi.md#createLogisticsReturns) | **POST** /logistics-returns | Creates a return +[**listLogisticsReturns**](LogisticsReturnsApi.md#listLogisticsReturns) | **GET** /logistics-returns | Returns a list of returns +[**retrieveLogisticsReturns**](LogisticsReturnsApi.md#retrieveLogisticsReturns) | **GET** /logistics-returns/{id} | Gets a return by ID + + + +## createLogisticsReturns + +> \DigitalRiver\ApiSdk\Model\ReturnResponse createLogisticsReturns($return_request) + +Creates a return + +Returns all or part of a previously created order. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\LogisticsReturnsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$return_request = new \DigitalRiver\ApiSdk\Model\ReturnRequest(); // \DigitalRiver\ApiSdk\Model\ReturnRequest | +// Refer \DigitalRiver\ApiSdk\Model\ReturnRequest::$setters in digital-river-php/lib/Model/ReturnRequest.php to set the properties. + +try { + $result = $apiInstance->createLogisticsReturns($return_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LogisticsReturnsApi->createLogisticsReturns: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **return_request** | [**\DigitalRiver\ApiSdk\Model\ReturnRequest**](../Model/ReturnRequest.md)| | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ReturnResponse**](../Model/ReturnResponse.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listLogisticsReturns + +> \DigitalRiver\ApiSdk\Model\ListReturnsResponse listLogisticsReturns($created_time, $ending_before, $starting_after, $limit, $ids, $order_id, $type, $rma_number) + +Returns a list of returns + +Get all returns. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\LogisticsReturnsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$created_time = createdTime[gt]=2020-09-22T12:09:44Z; // map[string,\DateTime] | A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**—return values where the createdTime field equals to this timestamp - **gt**—return values where the createdTime field is after this timestamp - **gte**—return values where the createdTime field is after or equal to this timestamp - **lt**—return values where the createdTime field is before this timestamp - **lte**—return values where the createdTime field is before or equal to this timestamp +// Refer map[string,\DateTime]::$setters in digital-river-php/lib/Model/\DateTime.php to set the properties. +$ending_before = 'ending_before_example'; // string | A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. + +$starting_after = 'starting_after_example'; // string | A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. + +$limit = 56; // int | A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. + +$ids = array('ids_example'); // string[] | Only return objects with these IDs. +// Refer string[]::$setters in digital-river-php/lib/Model/string.php to set the properties. +$order_id = 'order_id_example'; // string | The order to retrieve returns for. + +$type = 'type_example'; // string | The type of return. + +$rma_number = 'rma_number_example'; // string | + + +try { + $result = $apiInstance->listLogisticsReturns($created_time, $ending_before, $starting_after, $limit, $ids, $order_id, $type, $rma_number); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LogisticsReturnsApi->listLogisticsReturns: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **created_time** | [**map[string,\DateTime]**](../Model/\DateTime.md)| A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp | [optional] + **ending_before** | **string**| A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. | [optional] + **starting_after** | **string**| A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. | [optional] + **limit** | **int**| A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. | [optional] + **ids** | [**string[]**](../Model/string.md)| Only return objects with these IDs. | [optional] + **order_id** | **string**| The order to retrieve returns for. | [optional] + **type** | **string**| The type of return. | [optional] + **rma_number** | **string**| | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ListReturnsResponse**](../Model/ListReturnsResponse.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## retrieveLogisticsReturns + +> \DigitalRiver\ApiSdk\Model\ReturnResponse retrieveLogisticsReturns($id) + +Gets a return by ID + +Retrieves the details of a return. Supply the unique identifier of the return. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\LogisticsReturnsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string | Return ID + + +try { + $result = $apiInstance->retrieveLogisticsReturns($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling LogisticsReturnsApi->retrieveLogisticsReturns: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **string**| Return ID | + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ReturnResponse**](../Model/ReturnResponse.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/OrdersApi.md b/docs/Api/OrdersApi.md index f25d477..828bc01 100644 --- a/docs/Api/OrdersApi.md +++ b/docs/Api/OrdersApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description Creates a new order. -Creates a new order. +Creates a new order. For more details, refer to [Converting a checkout to an order](https://docs.digitalriver.com/digital-river-api/order-management/orders/creating-and-updating-an-order#creating-an-order-with-the-checkout-identifier). ### Example diff --git a/docs/Api/ReturnsApi.md b/docs/Api/ReturnsApi.md index aadf4ec..bca8f73 100644 --- a/docs/Api/ReturnsApi.md +++ b/docs/Api/ReturnsApi.md @@ -13,7 +13,7 @@ Method | HTTP request | Description ## createReturns -> \DigitalRiver\ApiSdk\Model\CreateReturnResponse createReturns($return_request) +> \DigitalRiver\ApiSdk\Model\CreateReturnsResponse createReturns($returns_request) Creates a return @@ -36,11 +36,11 @@ $apiInstance = new DigitalRiver\ApiSdk\Api\ReturnsApi( new GuzzleHttp\Client(), $config ); -$return_request = new \DigitalRiver\ApiSdk\Model\ReturnRequest(); // \DigitalRiver\ApiSdk\Model\ReturnRequest | -// Refer \DigitalRiver\ApiSdk\Model\ReturnRequest::$setters in digital-river-php/lib/Model/ReturnRequest.php to set the properties. +$returns_request = new \DigitalRiver\ApiSdk\Model\ReturnsRequest(); // \DigitalRiver\ApiSdk\Model\ReturnsRequest | +// Refer \DigitalRiver\ApiSdk\Model\ReturnsRequest::$setters in digital-river-php/lib/Model/ReturnsRequest.php to set the properties. try { - $result = $apiInstance->createReturns($return_request); + $result = $apiInstance->createReturns($returns_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReturnsApi->createReturns: ', $e->getMessage(), PHP_EOL; @@ -53,11 +53,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **return_request** | [**\DigitalRiver\ApiSdk\Model\ReturnRequest**](../Model/ReturnRequest.md)| | [optional] + **returns_request** | [**\DigitalRiver\ApiSdk\Model\ReturnsRequest**](../Model/ReturnsRequest.md)| | [optional] ### Return type -[**\DigitalRiver\ApiSdk\Model\CreateReturnResponse**](../Model/CreateReturnResponse.md) +[**\DigitalRiver\ApiSdk\Model\CreateReturnsResponse**](../Model/CreateReturnsResponse.md) ### Authorization @@ -75,7 +75,7 @@ Name | Type | Description | Notes ## listReturns -> \DigitalRiver\ApiSdk\Model\ListReturnsResponse listReturns($created_time, $ending_before, $starting_after, $limit, $ids, $state, $order_id, $sku_id) +> \DigitalRiver\ApiSdk\Model\ListReturnsResponse1 listReturns($created_time, $ending_before, $starting_after, $limit, $ids, $state, $order_id, $sku_id) Returns a list of returns @@ -140,7 +140,7 @@ Name | Type | Description | Notes ### Return type -[**\DigitalRiver\ApiSdk\Model\ListReturnsResponse**](../Model/ListReturnsResponse.md) +[**\DigitalRiver\ApiSdk\Model\ListReturnsResponse1**](../Model/ListReturnsResponse1.md) ### Authorization @@ -158,7 +158,7 @@ Name | Type | Description | Notes ## retrieveReturns -> \DigitalRiver\ApiSdk\Model\ReturnResponse retrieveReturns($id) +> \DigitalRiver\ApiSdk\Model\ReturnsResponse retrieveReturns($id) Gets a return by ID @@ -202,7 +202,7 @@ Name | Type | Description | Notes ### Return type -[**\DigitalRiver\ApiSdk\Model\ReturnResponse**](../Model/ReturnResponse.md) +[**\DigitalRiver\ApiSdk\Model\ReturnsResponse**](../Model/ReturnsResponse.md) ### Authorization @@ -220,7 +220,7 @@ Name | Type | Description | Notes ## updateReturns -> \DigitalRiver\ApiSdk\Model\ReturnResponse updateReturns($id, $update_return_request) +> \DigitalRiver\ApiSdk\Model\ReturnsResponse updateReturns($id, $update_returns_request) Updates an existing return @@ -245,11 +245,11 @@ $apiInstance = new DigitalRiver\ApiSdk\Api\ReturnsApi( ); $id = 'id_example'; // string | Return ID -$update_return_request = new \DigitalRiver\ApiSdk\Model\UpdateReturnRequest(); // \DigitalRiver\ApiSdk\Model\UpdateReturnRequest | -// Refer \DigitalRiver\ApiSdk\Model\UpdateReturnRequest::$setters in digital-river-php/lib/Model/UpdateReturnRequest.php to set the properties. +$update_returns_request = new \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest(); // \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest | +// Refer \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest::$setters in digital-river-php/lib/Model/UpdateReturnsRequest.php to set the properties. try { - $result = $apiInstance->updateReturns($id, $update_return_request); + $result = $apiInstance->updateReturns($id, $update_returns_request); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReturnsApi->updateReturns: ', $e->getMessage(), PHP_EOL; @@ -263,11 +263,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **string**| Return ID | - **update_return_request** | [**\DigitalRiver\ApiSdk\Model\UpdateReturnRequest**](../Model/UpdateReturnRequest.md)| | [optional] + **update_returns_request** | [**\DigitalRiver\ApiSdk\Model\UpdateReturnsRequest**](../Model/UpdateReturnsRequest.md)| | [optional] ### Return type -[**\DigitalRiver\ApiSdk\Model\ReturnResponse**](../Model/ReturnResponse.md) +[**\DigitalRiver\ApiSdk\Model\ReturnsResponse**](../Model/ReturnsResponse.md) ### Authorization diff --git a/docs/Api/ShippingLabelsApi.md b/docs/Api/ShippingLabelsApi.md new file mode 100644 index 0000000..ab370f0 --- /dev/null +++ b/docs/Api/ShippingLabelsApi.md @@ -0,0 +1,139 @@ +# DigitalRiver\ApiSdk\ShippingLabelsApi + +All URIs are relative to *https://api.digitalriver.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createShippingLabel**](ShippingLabelsApi.md#createShippingLabel) | **POST** /shipping-labels | Returns shipping label +[**listShippingLabel**](ShippingLabelsApi.md#listShippingLabel) | **GET** /shipping-labels | Returns shipping label + + + +## createShippingLabel + +> \DigitalRiver\ApiSdk\Model\ShippingLabelResponse createShippingLabel($shipping_label_request) + +Returns shipping label + +Create a shipping label + +### Example + +```php +createShippingLabel($shipping_label_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ShippingLabelsApi->createShippingLabel: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **shipping_label_request** | [**\DigitalRiver\ApiSdk\Model\ShippingLabelRequest**](../Model/ShippingLabelRequest.md)| | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ShippingLabelResponse**](../Model/ShippingLabelResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + +## listShippingLabel + +> \DigitalRiver\ApiSdk\Model\ListShippingLabel listShippingLabel($created_time, $ending_before, $starting_after, $limit, $ids, $order_id) + +Returns shipping label + +List shipping labels + +### Example + +```php +listShippingLabel($created_time, $ending_before, $starting_after, $limit, $ids, $order_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ShippingLabelsApi->listShippingLabel: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **created_time** | [**map[string,\DateTime]**](../Model/\DateTime.md)| A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp | [optional] + **ending_before** | **string**| A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. | [optional] + **starting_after** | **string**| A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. | [optional] + **limit** | **int**| A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. | [optional] + **ids** | [**string[]**](../Model/string.md)| Only return objects with these IDs. | [optional] + **order_id** | **string**| The order to retrieve returns for. | [optional] + +### Return type + +[**\DigitalRiver\ApiSdk\Model\ListShippingLabel**](../Model/ListShippingLabel.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Api/ShippingQuotesApi.md b/docs/Api/ShippingQuotesApi.md index 37a9759..89c9fb2 100644 --- a/docs/Api/ShippingQuotesApi.md +++ b/docs/Api/ShippingQuotesApi.md @@ -4,13 +4,13 @@ All URIs are relative to *https://api.digitalriver.com* Method | HTTP request | Description ------------- | ------------- | ------------- -[**listShippingQuotes**](ShippingQuotesApi.md#listShippingQuotes) | **POST** /shipping-quotes | Returns shipping quotes +[**postShippingQuotes**](ShippingQuotesApi.md#postShippingQuotes) | **POST** /shipping-quotes | Returns shipping quotes -## listShippingQuotes +## postShippingQuotes -> \DigitalRiver\ApiSdk\Model\ShippingQuoteResponse listShippingQuotes($shipping_quote_request) +> \DigitalRiver\ApiSdk\Model\ShippingQuoteResponse postShippingQuotes($shipping_quote_request) Returns shipping quotes @@ -32,10 +32,10 @@ $shipping_quote_request = new \DigitalRiver\ApiSdk\Model\ShippingQuoteRequest(); // Refer \DigitalRiver\ApiSdk\Model\ShippingQuoteRequest::$setters in digital-river-php/lib/Model/ShippingQuoteRequest.php to set the properties. try { - $result = $apiInstance->listShippingQuotes($shipping_quote_request); + $result = $apiInstance->postShippingQuotes($shipping_quote_request); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ShippingQuotesApi->listShippingQuotes: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ShippingQuotesApi->postShippingQuotes: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/docs/Api/StoreCreditCalloutApi.md b/docs/Api/StoreCreditCalloutApi.md new file mode 100644 index 0000000..6c70d66 --- /dev/null +++ b/docs/Api/StoreCreditCalloutApi.md @@ -0,0 +1,70 @@ +# DigitalRiver\ApiSdk\StoreCreditCalloutApi + +All URIs are relative to *https://api.digitalriver.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**storeCreditsCallout**](StoreCreditCalloutApi.md#storeCreditsCallout) | **POST** /checkouts/store-credits | Store credit callout + + + +## storeCreditsCallout + +> storeCreditsCallout($integration_store_credit_request) + +Store credit callout + +Store credit callout + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new DigitalRiver\ApiSdk\Api\StoreCreditCalloutApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$integration_store_credit_request = new \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest(); // \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest | +// Refer \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest::$setters in digital-river-php/lib/Model/IntegrationStoreCreditRequest.php to set the properties. + +try { + $apiInstance->storeCreditsCallout($integration_store_credit_request); +} catch (Exception $e) { + echo 'Exception when calling StoreCreditCalloutApi->storeCreditsCallout: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_store_credit_request** | [**\DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest**](../Model/IntegrationStoreCreditRequest.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + diff --git a/docs/Model/Attributes.md b/docs/Model/Attributes.md new file mode 100644 index 0000000..40ad24a --- /dev/null +++ b/docs/Model/Attributes.md @@ -0,0 +1,15 @@ +# # Attributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoice_title** | **string** | The title of the invoice. | [optional] +**reg_account** | **string** | The identifier for the account. | [optional] +**reg_address** | **string** | The address associated to the invoice. | [optional] +**reg_bank** | **string** | The name of the bank. | [optional] +**reg_phone** | **string** | The phone number associated to the invoice | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Billing1.md b/docs/Model/Billing1.md new file mode 100644 index 0000000..21f4226 --- /dev/null +++ b/docs/Model/Billing1.md @@ -0,0 +1,16 @@ +# # Billing1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\DigitalRiver\ApiSdk\Model\Address**](Address.md) | | +**name** | **string** | | [optional] +**phone** | **string** | | [optional] +**email** | **string** | | [optional] +**organization** | **string** | | [optional] +**additional_address_info** | [**\DigitalRiver\ApiSdk\Model\AdditionalBillingAddressInfo**](AdditionalBillingAddressInfo.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Business.md b/docs/Model/Business.md new file mode 100644 index 0000000..255a6f1 --- /dev/null +++ b/docs/Model/Business.md @@ -0,0 +1,12 @@ +# # Business + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of invoice. | [optional] +**attributes** | [**\DigitalRiver\ApiSdk\Model\Attributes[]**](Attributes.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Checkout.md b/docs/Model/Checkout.md index e8b68f5..b6d102d 100644 --- a/docs/Model/Checkout.md +++ b/docs/Model/Checkout.md @@ -28,6 +28,7 @@ Name | Type | Description | Notes **total_amount** | **double** | Represents the total charge amount. | [optional] [readonly] **discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] **tax_identifiers** | [**\DigitalRiver\ApiSdk\Model\TaxIdentifier[]**](TaxIdentifier.md) | | [optional] +**invoice_attributes** | [**\DigitalRiver\ApiSdk\Model\InvoiceAttributes**](InvoiceAttributes.md) | | [optional] **purchase_location** | [**\DigitalRiver\ApiSdk\Model\PurchaseLocation**](PurchaseLocation.md) | | [optional] **customer_type** | [**\DigitalRiver\ApiSdk\Model\CustomerType**](CustomerType.md) | | [optional] **selling_entity** | [**\DigitalRiver\ApiSdk\Model\SellingEntity**](SellingEntity.md) | | [optional] diff --git a/docs/Model/CheckoutLinkDetails.md b/docs/Model/CheckoutLinkDetails.md new file mode 100644 index 0000000..31e4ddc --- /dev/null +++ b/docs/Model/CheckoutLinkDetails.md @@ -0,0 +1,16 @@ +# # CheckoutLinkDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The link identifier. | [optional] +**link** | **string** | The domain of the hosted link | [optional] +**created_time** | [**\DateTime**](\DateTime.md) | Time when the link was created. | [optional] +**expired** | **bool** | Whether this link has already expired. | [optional] +**expires_time** | [**\DateTime**](\DateTime.md) | Time at which the link expires. | [optional] +**checkout_session** | [**\DigitalRiver\ApiSdk\Model\DropInCheckoutSession**](DropInCheckoutSession.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/CheckoutRequest.md b/docs/Model/CheckoutRequest.md index bbbd641..890fe41 100644 --- a/docs/Model/CheckoutRequest.md +++ b/docs/Model/CheckoutRequest.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **currency** | **string** | A three-letter ISO 4217 currency code. | **email** | **string** | The customer's email address. | [optional] **locale** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] +**invoice_attribute_id** | **string** | The unique identfier of the invoice attribute. | [optional] **application_id** | **string** | An arbitrary string identifier that can be used to track the application type. | [optional] **browser_ip** | **string** | The IP address of the browser used by the customer when placing the order. | [optional] **tax_identifiers** | [**\DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]**](CheckoutTaxIdentifierRequest.md) | | [optional] diff --git a/docs/Model/CheckoutTaxIdentifierRequest.md b/docs/Model/CheckoutTaxIdentifierRequest.md index 9912a12..18c7f71 100644 --- a/docs/Model/CheckoutTaxIdentifierRequest.md +++ b/docs/Model/CheckoutTaxIdentifierRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique identifier for a tax identifier | [optional] +**id** | **string** | The unique identifier of a tax identifier. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CountrySpecification.md b/docs/Model/CountrySpecification.md index 741e34e..58caccd 100644 --- a/docs/Model/CountrySpecification.md +++ b/docs/Model/CountrySpecification.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes **billing_address_only_schema** | **string** | A billing address only schema. | [optional] **individual_tax_identifiers_schemas** | **string[]** | | [optional] **business_tax_identifiers_schemas** | **string[]** | | [optional] +**tax_identifiers_info** | [**\DigitalRiver\ApiSdk\Model\TaxIdentifiersInfo**](TaxIdentifiersInfo.md) | | [optional] +**invoice_attribute_info** | [**\DigitalRiver\ApiSdk\Model\InvoiceAttributeInfo**](InvoiceAttributeInfo.md) | | [optional] **live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateDropInCheckoutTokenResponse.md b/docs/Model/CreateDropInCheckoutTokenResponse.md new file mode 100644 index 0000000..939c000 --- /dev/null +++ b/docs/Model/CreateDropInCheckoutTokenResponse.md @@ -0,0 +1,13 @@ +# # CreateDropInCheckoutTokenResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique checkout session identifier. | [optional] [readonly] +**link** | **string** | The domain of the hosted link. | [optional] +**live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/CreateReturnsResponse.md b/docs/Model/CreateReturnsResponse.md new file mode 100644 index 0000000..8583722 --- /dev/null +++ b/docs/Model/CreateReturnsResponse.md @@ -0,0 +1,21 @@ +# # CreateReturnsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier of the return. | [optional] [readonly] +**created_time** | [**\DateTime**](\DateTime.md) | Time at which the return was created. | [optional] [readonly] +**order_id** | **string** | The unique identifier of the order. | [optional] [readonly] +**currency** | **string** | Three-letter ISO currency code. | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\ReturnsItem[]**](ReturnsItem.md) | | [optional] +**reason** | **string** | The reason for the return. | [optional] +**state** | **string** | Enumeration indicating the state of the return. | [optional] +**location** | [**\DigitalRiver\ApiSdk\Model\ReturnsLocation**](ReturnsLocation.md) | | [optional] +**livemode** | **bool** | Has the value true if the object exists in live mode or the value false if the object exists in test mode. | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] +**refund_ids** | **string[]** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DropInCheckoutLink.md b/docs/Model/DropInCheckoutLink.md new file mode 100644 index 0000000..a6400e9 --- /dev/null +++ b/docs/Model/DropInCheckoutLink.md @@ -0,0 +1,11 @@ +# # DropInCheckoutLink + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**session_id** | **string** | The session identifier. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DropInCheckoutLinkResponse.md b/docs/Model/DropInCheckoutLinkResponse.md new file mode 100644 index 0000000..c858475 --- /dev/null +++ b/docs/Model/DropInCheckoutLinkResponse.md @@ -0,0 +1,13 @@ +# # DropInCheckoutLinkResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The link identifier. | [optional] +**session_id** | **string** | The session identifier. | [optional] +**link** | **string** | The domain of the hosted link | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DropInCheckoutRequest.md b/docs/Model/DropInCheckoutRequest.md new file mode 100644 index 0000000..bb2405f --- /dev/null +++ b/docs/Model/DropInCheckoutRequest.md @@ -0,0 +1,32 @@ +# # DropInCheckoutRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**upstream_id** | **string** | The upstream checkout identifier if it is different from the Digital River checkout identifier. | [optional] +**currency** | **string** | A three-letter ISO currency code. | [optional] +**customer_id** | **string** | The identifier of a registered customer. | [optional] +**language** | **string** | Language to be used by library. | [optional] +**email** | **string** | The customer's email address. | [optional] +**tax_inclusive** | **bool** | | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\SkuItemRequest[]**](SkuItemRequest.md) | | [optional] +**ship_to** | [**\DigitalRiver\ApiSdk\Model\IntegrationAddress**](IntegrationAddress.md) | | [optional] +**bill_to** | [**\DigitalRiver\ApiSdk\Model\IntegrationAddress**](IntegrationAddress.md) | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] +**discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] +**shipping_discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] +**browser_ip** | **string** | The IP address of the browser used by the customer when checking out. | [optional] +**application_id** | **string** | An arbitrary identifier that can be used to track the application type. | [optional] [readonly] +**locale** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] +**customer_type** | [**\DigitalRiver\ApiSdk\Model\CustomerType**](CustomerType.md) | | [optional] +**charge_type** | [**\DigitalRiver\ApiSdk\Model\ChargeType**](ChargeType.md) | | [optional] +**tax_identifiers** | [**\DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]**](CheckoutTaxIdentifierRequest.md) | | [optional] +**style** | [**object**](.md) | Style for drop-in | [optional] +**options** | [**\DigitalRiver\ApiSdk\Model\DropInOptionsRequest**](DropInOptionsRequest.md) | | [optional] +**redirects** | [**\DigitalRiver\ApiSdk\Model\Redirects**](Redirects.md) | | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DropInCheckoutSession.md b/docs/Model/DropInCheckoutSession.md new file mode 100644 index 0000000..8fd414e --- /dev/null +++ b/docs/Model/DropInCheckoutSession.md @@ -0,0 +1,26 @@ +# # DropInCheckoutSession + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**upstream_id** | **string** | The upstream checkout identifier if it is different from the Digital River checkout identifier. | [optional] +**currency** | **string** | A three-letter ISO currency code. | [optional] +**tax_inclusive** | **bool** | | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\SkuItemRequest[]**](SkuItemRequest.md) | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] +**discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] +**shipping_discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] +**browser_ip** | **string** | The IP address of the browser used by the customer when checking out. | [optional] +**application_id** | **string** | An arbitrary identifier that can be used to track the application type. | [optional] [readonly] +**locale** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] +**customer_type** | [**\DigitalRiver\ApiSdk\Model\CustomerType**](CustomerType.md) | | [optional] +**charge_type** | [**\DigitalRiver\ApiSdk\Model\ChargeType**](ChargeType.md) | | [optional] +**style** | [**object**](.md) | Style for drop-in | [optional] +**options** | [**\DigitalRiver\ApiSdk\Model\DropInOptionsRequest**](DropInOptionsRequest.md) | | [optional] +**redirects** | [**\DigitalRiver\ApiSdk\Model\Redirects**](Redirects.md) | | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DropInOptionsRequest.md b/docs/Model/DropInOptionsRequest.md new file mode 100644 index 0000000..f17a3c3 --- /dev/null +++ b/docs/Model/DropInOptionsRequest.md @@ -0,0 +1,13 @@ +# # DropInOptionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**addresses** | [**\DigitalRiver\ApiSdk\Model\Shipping[]**](Shipping.md) | | [optional] +**shipping_methods** | [**\DigitalRiver\ApiSdk\Model\IntegrationShippingMethod[]**](IntegrationShippingMethod.md) | | [optional] +**store_credits** | [**\DigitalRiver\ApiSdk\Model\IntegrationStoreCredit[]**](IntegrationStoreCredit.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/DropInSku.md b/docs/Model/DropInSku.md new file mode 100644 index 0000000..f4c4986 --- /dev/null +++ b/docs/Model/DropInSku.md @@ -0,0 +1,18 @@ +# # DropInSku + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The SKU's unique identifier. | [optional] +**eccn** | **string** | The export control classification number. | [optional] +**tax_code** | **string** | The designated tax code. | [optional] +**name** | **string** | The product’s name. | [optional] +**image** | **string** | An image of the product. | [optional] +**url** | **string** | A product url. | [optional] +**physical** | **bool** | Identifies whether or not a product is physical, so that the appropriate data requirements are enforced. | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/FileContent.md b/docs/Model/FileContent.md new file mode 100644 index 0000000..6dd63b3 --- /dev/null +++ b/docs/Model/FileContent.md @@ -0,0 +1,12 @@ +# # FileContent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier of the file. | [optional] +**file_name** | **string** | The name of the file. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/FulfillmentOrder.md b/docs/Model/FulfillmentOrder.md new file mode 100644 index 0000000..adf07ef --- /dev/null +++ b/docs/Model/FulfillmentOrder.md @@ -0,0 +1,21 @@ +# # FulfillmentOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier of the Fulfillment. | [optional] [readonly] +**created_time** | [**\DateTime**](\DateTime.md) | The time when the Fulfillment was created. | [optional] [readonly] +**order_id** | **string** | The unique identifier of the Order associated with this Fulfillment. | [optional] [readonly] +**order_details** | [**\DigitalRiver\ApiSdk\Model\OrderDetails**](OrderDetails.md) | | [optional] +**shipment_id** | **string** | The unique identifier associated to the shipment | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\FulfillmentResponseItem[]**](FulfillmentResponseItem.md) | An array of line items fulfilled and/or cancelled. | [optional] +**live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] +**tracking_company** | **string** | The name of the tracking company. | [optional] +**tracking_number** | **string** | A tracking number provided by the shipping company. | [optional] +**tracking_url** | **string** | The URL of the tracking page for the Fulfillment. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GLAddress.md b/docs/Model/GLAddress.md new file mode 100644 index 0000000..b4816ad --- /dev/null +++ b/docs/Model/GLAddress.md @@ -0,0 +1,16 @@ +# # GLAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line1** | **string** | The first line of the address. | [optional] +**line2** | **string** | The second line of the address. | [optional] +**city** | **string** | The city of the address. | [optional] +**postal_code** | **string** | The postal code of the address. | [optional] +**state** | **string** | The state, county, province, or region. | [optional] +**country** | **string** | A [two-letter Alpha-2 country code](https://www.iban.com/country-codes) as described in the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) international standard. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/GLShipFrom.md b/docs/Model/GLShipFrom.md new file mode 100644 index 0000000..922dbbb --- /dev/null +++ b/docs/Model/GLShipFrom.md @@ -0,0 +1,12 @@ +# # GLShipFrom + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\DigitalRiver\ApiSdk\Model\GLAddress**](GLAddress.md) | | [optional] +**additional_address_info** | [**\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo**](AdditionalAddressInfo.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Individual.md b/docs/Model/Individual.md new file mode 100644 index 0000000..6e3c1fd --- /dev/null +++ b/docs/Model/Individual.md @@ -0,0 +1,12 @@ +# # Individual + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of invoice. | [optional] +**attributes** | [**\DigitalRiver\ApiSdk\Model\Attributes**](Attributes.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/IntegrationAddress.md b/docs/Model/IntegrationAddress.md new file mode 100644 index 0000000..499d439 --- /dev/null +++ b/docs/Model/IntegrationAddress.md @@ -0,0 +1,16 @@ +# # IntegrationAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\DigitalRiver\ApiSdk\Model\Address**](Address.md) | | [optional] +**name** | **string** | The customer's name. | [optional] +**phone** | **string** | The customer's phone number. | [optional] +**email** | **string** | The customer's email address. | [optional] +**organization** | **string** | The customer's organization. | [optional] +**additional_address_info** | [**\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo**](AdditionalAddressInfo.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/IntegrationShippingMethod.md b/docs/Model/IntegrationShippingMethod.md new file mode 100644 index 0000000..71cd101 --- /dev/null +++ b/docs/Model/IntegrationShippingMethod.md @@ -0,0 +1,13 @@ +# # IntegrationShippingMethod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **double** | The shipping method's cost. | +**description** | **string** | The shipping method's description. | +**service_level** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/IntegrationStoreCredit.md b/docs/Model/IntegrationStoreCredit.md new file mode 100644 index 0000000..838a7df --- /dev/null +++ b/docs/Model/IntegrationStoreCredit.md @@ -0,0 +1,15 @@ +# # IntegrationStoreCredit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **double** | The store credit amount. | [optional] +**name** | **string** | The store credit name. | [optional] +**upstream_id** | **string** | The upstream store credit identifier. | [optional] +**icon_url** | **string** | The store credit image url. | [optional] +**last_four** | **string** | The last four digits of the store credit. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/IntegrationStoreCreditRequest.md b/docs/Model/IntegrationStoreCreditRequest.md new file mode 100644 index 0000000..cd645c9 --- /dev/null +++ b/docs/Model/IntegrationStoreCreditRequest.md @@ -0,0 +1,15 @@ +# # IntegrationStoreCreditRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **double** | The store credit amount. | [optional] +**name** | **string** | The store credit name. | [optional] +**upstream_id** | **string** | The upstream store credit identifier. | [optional] +**icon_url** | **string** | The store credit image url. | [optional] +**last_four** | **string** | The last four digits of the store credit. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/InvoiceAttributeInfo.md b/docs/Model/InvoiceAttributeInfo.md new file mode 100644 index 0000000..d9fc956 --- /dev/null +++ b/docs/Model/InvoiceAttributeInfo.md @@ -0,0 +1,13 @@ +# # InvoiceAttributeInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_required** | **bool** | Designates if the invoice attributes are required. | [optional] +**individual** | [**\DigitalRiver\ApiSdk\Model\Individual**](Individual.md) | | [optional] +**business** | [**\DigitalRiver\ApiSdk\Model\Business**](Business.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/InvoiceAttributes.md b/docs/Model/InvoiceAttributes.md new file mode 100644 index 0000000..a3b8920 --- /dev/null +++ b/docs/Model/InvoiceAttributes.md @@ -0,0 +1,17 @@ +# # InvoiceAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The ID of the invoice | [optional] +**type** | **string** | The type of invoice. | [optional] +**customer_id** | **string** | The ID of the customer. | [optional] +**atttributes** | [**\DigitalRiver\ApiSdk\Model\Attributes[]**](Attributes.md) | | [optional] +**created_time** | [**\DateTime**](\DateTime.md) | The time when the invoice attribute was created. | [optional] [readonly] +**updated_time** | [**\DateTime**](\DateTime.md) | The time when the invoice attribute was updated. | [optional] [readonly] +**live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/InvoiceItem.md b/docs/Model/InvoiceItem.md index 05a1962..a5fe9d7 100644 --- a/docs/Model/InvoiceItem.md +++ b/docs/Model/InvoiceItem.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | The identifier of the item. | [optional] **sku_id** | **string** | The identifier of the stock keeping unit (SKU). | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] **subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] **fees** | [**\DigitalRiver\ApiSdk\Model\Fees**](Fees.md) | | [optional] **quantity** | **int** | The number of items. | [optional] diff --git a/docs/Model/InvoiceItemRequest.md b/docs/Model/InvoiceItemRequest.md index 515f2d9..0f7e66a 100644 --- a/docs/Model/InvoiceItemRequest.md +++ b/docs/Model/InvoiceItemRequest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sku_id** | **string** | The identifier of the stock keeping unit (SKU). | +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] **subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] **price** | **double** | The price of an item. You are required to provide this parameter or <code>aggregatePrice</code>. | [optional] **aggregate_price** | **double** | The total price of multiple items. You are required to provide this parameter or <code>price</code>. | [optional] diff --git a/docs/Model/ItemShipping.md b/docs/Model/ItemShipping.md new file mode 100644 index 0000000..fd88278 --- /dev/null +++ b/docs/Model/ItemShipping.md @@ -0,0 +1,12 @@ +# # ItemShipping + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **double** | The shipping amount for the item. | [optional] +**tax_amount** | **double** | The tax amount associated to the item level shipping cost. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/LabelResponse.md b/docs/Model/LabelResponse.md new file mode 100644 index 0000000..1285e85 --- /dev/null +++ b/docs/Model/LabelResponse.md @@ -0,0 +1,14 @@ +# # LabelResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**height** | **int** | The label’s height in inches. | [optional] +**width** | **int** | The label’s width in inches. | [optional] +**format** | **string** | The format of the label's data file. | [optional] +**file** | **string** | The shipping label data. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ListCheckoutLinksResponse.md b/docs/Model/ListCheckoutLinksResponse.md new file mode 100644 index 0000000..997fb0f --- /dev/null +++ b/docs/Model/ListCheckoutLinksResponse.md @@ -0,0 +1,12 @@ +# # ListCheckoutLinksResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_more** | **bool** | Whether or not there are more elements available after this set. If false this set represents the end of the list. | [optional] +**data** | [**\DigitalRiver\ApiSdk\Model\CheckoutLinkDetails[]**](CheckoutLinkDetails.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ListReturnsResponse1.md b/docs/Model/ListReturnsResponse1.md new file mode 100644 index 0000000..0a830ed --- /dev/null +++ b/docs/Model/ListReturnsResponse1.md @@ -0,0 +1,12 @@ +# # ListReturnsResponse1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_more** | **bool** | Whether or not there are more elements available after this set. If false this set represents the end of the list. | [optional] +**data** | [**\DigitalRiver\ApiSdk\Model\ReturnsResponse[]**](ReturnsResponse.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ListShippingLabel.md b/docs/Model/ListShippingLabel.md new file mode 100644 index 0000000..38a81dc --- /dev/null +++ b/docs/Model/ListShippingLabel.md @@ -0,0 +1,12 @@ +# # ListShippingLabel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**has_more** | **bool** | Whether or not there are more elements available after this set. If false this set represents the end of the list. | [optional] +**data** | [**\DigitalRiver\ApiSdk\Model\ShippingLabelResponse[]**](ShippingLabelResponse.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Order.md b/docs/Model/Order.md index d88789b..e42db97 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **browser_ip** | **string** | The IP address of the browser used by the customer when placing the order. | [optional] **application_id** | **string** | An arbitrary string identifier that can be used to track the application type. | [optional] [readonly] **tax_identifiers** | [**\DigitalRiver\ApiSdk\Model\TaxIdentifier[]**](TaxIdentifier.md) | A list of the tax identifiers applied to this order. | [optional] +**invoice_attributes** | [**\DigitalRiver\ApiSdk\Model\InvoiceAttributes**](InvoiceAttributes.md) | | [optional] **ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] **ship_to** | [**\DigitalRiver\ApiSdk\Model\Shipping**](Shipping.md) | | [optional] **bill_to** | [**\DigitalRiver\ApiSdk\Model\Billing**](Billing.md) | | [optional] diff --git a/docs/Model/OrderDetails.md b/docs/Model/OrderDetails.md new file mode 100644 index 0000000..8ddc061 --- /dev/null +++ b/docs/Model/OrderDetails.md @@ -0,0 +1,55 @@ +# # OrderDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier for the order. | [optional] [readonly] +**checkout_id** | **string** | The unique identifier of the checkout submitted to create the order. | [optional] +**created_time** | [**\DateTime**](\DateTime.md) | Time at which the order was created. | [optional] [readonly] +**customer_id** | **string** | The identifier of the customer associated with this order. | [optional] +**currency** | **string** | A three-letter ISO currency code. | [optional] +**email** | **string** | The customer's email address. | [optional] +**locale** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] +**browser_ip** | **string** | The IP address of the browser used by the customer when placing the order. | [optional] +**application_id** | **string** | An arbitrary string identifier that can be used to track the application type. | [optional] [readonly] +**tax_identifiers** | [**\DigitalRiver\ApiSdk\Model\TaxIdentifier[]**](TaxIdentifier.md) | A list of the tax identifiers applied to this order. | [optional] +**invoice_attributes** | [**\DigitalRiver\ApiSdk\Model\InvoiceAttributes**](InvoiceAttributes.md) | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] +**ship_to** | [**\DigitalRiver\ApiSdk\Model\Shipping**](Shipping.md) | | [optional] +**bill_to** | [**\DigitalRiver\ApiSdk\Model\Billing**](Billing.md) | | [optional] +**organization** | [**\DigitalRiver\ApiSdk\Model\Organization**](Organization.md) | | [optional] +**subtotal** | **double** | Represents the total order amount exclusive of tax. | [optional] [readonly] +**total_tax** | **double** | Represents the total tax amount. | [optional] [readonly] +**total_importer_tax** | **double** | Represents the total tax amount from the importer of record. | [optional] +**importer_of_record_tax** | **bool** | If <code>true</code>, indicates that the tax amount is paid by the importer of record. | [optional] [readonly] +**total_fees** | **double** | Represents the total fee amount. | [optional] [readonly] +**total_duty** | **double** | Represents the total duty amount. | [optional] [readonly] +**total_discount** | **double** | Represents the total discount amount. | [optional] [readonly] +**total_shipping** | **double** | Represents the total shipping amount. | [optional] [readonly] +**total_amount** | **double** | Represents the total charge amount. | [optional] [readonly] +**discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] +**available_to_refund_amount** | **double** | The available to refund amount at the order-level. | [optional] +**refunded_amount** | **double** | Represents the total payment amount refunded. | [optional] [readonly] +**cancelled_amount** | **double** | Represents the total payment amount cancelled. | [optional] [readonly] +**captured_amount** | **double** | Represents the total payment amount captured. | [optional] [readonly] +**items** | [**\DigitalRiver\ApiSdk\Model\OrderItem[]**](OrderItem.md) | | [optional] +**invoice_pd_fs** | [**\DigitalRiver\ApiSdk\Model\File[]**](File.md) | An array of links to downloadable PDF invoices. If no invoices exist yet, the array is null. | [optional] +**credit_memo_pd_fs** | [**\DigitalRiver\ApiSdk\Model\File[]**](File.md) | An array of links to downloadable PDF credit memos. If no credit memos exist yet, the array is null. | [optional] +**request_to_be_forgotten** | **bool** | If <code>true</code> indicates a user placing an order has requested this order be forgotten. | [optional] [default to false] +**shipping_choice** | [**\DigitalRiver\ApiSdk\Model\ShippingChoice**](ShippingChoice.md) | | [optional] +**state** | **string** | The current order state. | [optional] [readonly] +**state_transitions** | [**\DigitalRiver\ApiSdk\Model\OrderStateTransitions**](OrderStateTransitions.md) | | [optional] +**fraud_state** | **string** | The fraud review state. | [optional] [readonly] +**fraud_state_transitions** | [**\DigitalRiver\ApiSdk\Model\FraudStateTransitions**](FraudStateTransitions.md) | | [optional] +**live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] +**selling_entity** | [**\DigitalRiver\ApiSdk\Model\SellingEntity**](SellingEntity.md) | | [optional] +**purchase_location** | [**\DigitalRiver\ApiSdk\Model\PurchaseLocation**](PurchaseLocation.md) | | [optional] +**customer_type** | [**\DigitalRiver\ApiSdk\Model\CustomerType**](CustomerType.md) | | [optional] +**upstream_id** | **string** | The upstream identifier. | [optional] +**updated_time** | [**\DateTime**](\DateTime.md) | Time at which the order was created. | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/OrderItem.md b/docs/Model/OrderItem.md index 3d1a480..351b502 100644 --- a/docs/Model/OrderItem.md +++ b/docs/Model/OrderItem.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | The identifier of the item. | [optional] **sku_id** | **string** | The identifier of the stock keeping unit (SKU). | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] **subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] **fees** | [**\DigitalRiver\ApiSdk\Model\Fees**](Fees.md) | | [optional] **quantity** | **int** | The number of items. | [optional] @@ -13,12 +14,13 @@ Name | Type | Description | Notes **state_transitions** | [**\DigitalRiver\ApiSdk\Model\OrderItemStateTransitions**](OrderItemStateTransitions.md) | | [optional] **amount** | **double** | The cost of the items. | [optional] **available_to_refund_amount** | **double** | The available to refund amount. | [optional] -**tariff_code** | **string** | “Harmonized Tariff Schedule” that adds 4 more country-specific digits to the end of the HS Code and is determined by individual countries of import. | [optional] +**seller_tax_identifier** | **string** | The tax identifier of the seller. | [optional] **tax** | [**\DigitalRiver\ApiSdk\Model\Tax**](Tax.md) | | [optional] **importer_tax** | [**\DigitalRiver\ApiSdk\Model\ImporterTax**](ImporterTax.md) | | [optional] **duties** | [**\DigitalRiver\ApiSdk\Model\Duties**](Duties.md) | | [optional] **discount** | [**\DigitalRiver\ApiSdk\Model\SkuDiscount**](SkuDiscount.md) | | [optional] **ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] +**shipping** | [**\DigitalRiver\ApiSdk\Model\ItemShipping**](ItemShipping.md) | | [optional] **metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrderItem1.md b/docs/Model/OrderItem1.md new file mode 100644 index 0000000..b440b03 --- /dev/null +++ b/docs/Model/OrderItem1.md @@ -0,0 +1,28 @@ +# # OrderItem1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The identifier of the item. | [optional] +**sku_id** | **string** | The identifier of the stock keeping unit (SKU). | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] +**subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] +**fees** | [**\DigitalRiver\ApiSdk\Model\Fees**](Fees.md) | | [optional] +**quantity** | **int** | The number of items. | [optional] +**state** | **string** | The current order state. | [optional] [readonly] +**state_transitions** | [**\DigitalRiver\ApiSdk\Model\OrderItemStateTransitions**](OrderItemStateTransitions.md) | | [optional] +**amount** | **double** | The cost of the items. | [optional] +**available_to_refund_amount** | **double** | The available to refund amount. | [optional] +**seller_tax_identifier** | **string** | The tax identifier of the seller. | [optional] +**tax** | [**\DigitalRiver\ApiSdk\Model\Tax**](Tax.md) | | [optional] +**importer_tax** | [**\DigitalRiver\ApiSdk\Model\ImporterTax**](ImporterTax.md) | | [optional] +**duties** | [**\DigitalRiver\ApiSdk\Model\Duties**](Duties.md) | | [optional] +**discount** | [**\DigitalRiver\ApiSdk\Model\SkuDiscount**](SkuDiscount.md) | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom1**](ShipFrom1.md) | | [optional] +**shipping** | [**\DigitalRiver\ApiSdk\Model\ItemShipping**](ItemShipping.md) | | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/OrderRequest.md b/docs/Model/OrderRequest.md index 630deae..2f513c4 100644 --- a/docs/Model/OrderRequest.md +++ b/docs/Model/OrderRequest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **currency** | **string** | A three-letter ISO 4217 currency code. | [optional] **email** | **string** | The customer's email address. | [optional] **locale** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] +**invoice_attribute_id** | **string** | The unique identfier of the invoice attribute. | [optional] **application_id** | **string** | An arbitrary string identifier that can be used to track the application type. | [optional] **browser_ip** | **string** | The IP address of the browser used by the customer when placing the order. | [optional] **ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] diff --git a/docs/Model/PackageRequest.md b/docs/Model/PackageRequest.md new file mode 100644 index 0000000..9cbf935 --- /dev/null +++ b/docs/Model/PackageRequest.md @@ -0,0 +1,15 @@ +# # PackageRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**weight** | **int** | The box’s weight. | +**weight_unit** | **string** | The box’s weight unit. | +**height** | **int** | The box’s height. | [optional] +**width** | **int** | The box’s width. | [optional] +**length** | **int** | The box’s length. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Plan.md b/docs/Model/Plan.md index 9771429..f610faa 100644 --- a/docs/Model/Plan.md +++ b/docs/Model/Plan.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **created_time** | [**\DateTime**](\DateTime.md) | The time when the Plan was created. | [optional] **name** | **string** | Describes the subscription products or services added to this plan. | [optional] **reminder_offset_days** | **int** | How many days before the opening of the invoice should the reminder event be triggered. | [optional] +**billing_optimization** | **bool** | Indicates whether billing optimization is activated. | [optional] **billing_offset_days** | **int** | The number of days before the opening of the invoice that the reminder event is triggered. | **collection_period_days** | **int** | Represents the number of days that Digital River attempts to collect payment. | **state** | **string** | The valid states of a plan. Setting a plan to <code>deactivated</code> causes all connected subscriptions to end with the current period. | [optional] diff --git a/docs/Model/ProductDetails.md b/docs/Model/ProductDetails.md new file mode 100644 index 0000000..d5ea43e --- /dev/null +++ b/docs/Model/ProductDetails.md @@ -0,0 +1,20 @@ +# # ProductDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The identifier of the product in the upstream system. | [optional] +**sku_group_id** | **string** | The identifier of the SKU group. | [optional] +**name** | **string** | The name of the product. | [optional] +**description** | **string** | The description of the product. | [optional] +**url** | **string** | The product url. | [optional] +**country_of_origin** | **string** | The country of origin of the product. | [optional] +**image** | **string** | The image of the product. | [optional] +**weight** | **double** | The weight of the product measured in the unit specified by weightUnit. | [optional] +**weight_unit** | **string** | The unit of measurement applied to the weight. | [optional] +**part_number** | **string** | The manufacturer's part number. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ProductItemRequest.md b/docs/Model/ProductItemRequest.md index e62dd35..3233805 100644 --- a/docs/Model/ProductItemRequest.md +++ b/docs/Model/ProductItemRequest.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**inventory_item_id** | **string** | The inventory item identifier. | -**price** | **double** | The unit price of the product. | +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | +**amount** | **double** | The amount of the product. | [optional] **quantity** | **int** | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Redirects.md b/docs/Model/Redirects.md new file mode 100644 index 0000000..2fd3b21 --- /dev/null +++ b/docs/Model/Redirects.md @@ -0,0 +1,12 @@ +# # Redirects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_url** | **string** | | [optional] +**cancel_url** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/RequestReturnsItem.md b/docs/Model/RequestReturnsItem.md new file mode 100644 index 0000000..448988b --- /dev/null +++ b/docs/Model/RequestReturnsItem.md @@ -0,0 +1,13 @@ +# # RequestReturnsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item_id** | **string** | The identifier of the item. | [optional] +**sku_id** | **string** | The identifier of the SKU. | [optional] +**quantity** | **int** | The number of items. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ReturnItem.md b/docs/Model/ReturnItem.md index 52d0234..fbc37e5 100644 --- a/docs/Model/ReturnItem.md +++ b/docs/Model/ReturnItem.md @@ -4,12 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**item_id** | **string** | The identifier of the item. | [optional] [readonly] -**sku_id** | **string** | The identifier of the SKU. | [optional] [readonly] -**amount** | **double** | | [optional] [readonly] -**quantity** | **int** | | [optional] [readonly] -**quantity_accepted** | **int** | | [optional] [readonly] -**state** | **string** | The current state of the return item. | [optional] [readonly] +**item_id** | **string** | The identifier of the item. | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] +**quantity** | **int** | The number of items. | +**condition** | **string** | Condition of the returned goods. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReturnItemRequest.md b/docs/Model/ReturnItemRequest.md new file mode 100644 index 0000000..07e21f6 --- /dev/null +++ b/docs/Model/ReturnItemRequest.md @@ -0,0 +1,12 @@ +# # ReturnItemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item_id** | **string** | The identifier of the item. | +**quantity** | **int** | The number of items. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ReturnRequest.md b/docs/Model/ReturnRequest.md index aa9b258..b905edc 100644 --- a/docs/Model/ReturnRequest.md +++ b/docs/Model/ReturnRequest.md @@ -4,11 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**order_id** | **string** | The unique identifier of the Order associated with the Return. | +**order_id** | **string** | The unique identifier of the order associated with the return. | +**rma_number** | **string** | The return merchandise authorization number. | **reason** | **string** | The reason for the return. | [optional] -**items** | [**\DigitalRiver\ApiSdk\Model\RequestReturnItem[]**](RequestReturnItem.md) | | -**location** | [**\DigitalRiver\ApiSdk\Model\ReturnLocation**](ReturnLocation.md) | | [optional] -**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\ReturnItemRequest[]**](ReturnItemRequest.md) | | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReturnResponse.md b/docs/Model/ReturnResponse.md index ef7dc12..ce09da0 100644 --- a/docs/Model/ReturnResponse.md +++ b/docs/Model/ReturnResponse.md @@ -6,17 +6,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | The unique identifier of the return. | [optional] [readonly] **created_time** | [**\DateTime**](\DateTime.md) | The time at which the return was created. | [optional] [readonly] -**updated_time** | [**\DateTime**](\DateTime.md) | The time at which the return was updated. | [optional] [readonly] -**order_id** | **string** | The unique identifier of the order. | [optional] [readonly] -**currency** | **string** | A three-letter ISO currency code. | [optional] -**items** | [**\DigitalRiver\ApiSdk\Model\ReturnItem[]**](ReturnItem.md) | | [optional] +**order_id** | **string** | The unique identifier of the order associated with the return. | [optional] +**rma_number** | **string** | The return merchandise authorization number. | [optional] **reason** | **string** | The reason for the return. | [optional] -**failure_reason** | **string** | An enumeration indicating the reason for the return failure, if known. | [optional] -**state** | **string** | An enumeration indicating the state of the return. | [optional] -**location** | [**\DigitalRiver\ApiSdk\Model\ReturnLocation**](ReturnLocation.md) | | [optional] +**type** | **string** | | [optional] +**return_to** | [**\DigitalRiver\ApiSdk\Model\Shipping**](Shipping.md) | | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\ReturnItem[]**](ReturnItem.md) | | [optional] **live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] -**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] -**refund_ids** | **string[]** | | [optional] [readonly] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ReturnsAddress.md b/docs/Model/ReturnsAddress.md new file mode 100644 index 0000000..e0da9e9 --- /dev/null +++ b/docs/Model/ReturnsAddress.md @@ -0,0 +1,16 @@ +# # ReturnsAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line1** | **string** | | +**line2** | **string** | | [optional] +**city** | **string** | | +**postal_code** | **string** | | +**state** | **string** | | +**country** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ReturnsItem.md b/docs/Model/ReturnsItem.md new file mode 100644 index 0000000..068e935 --- /dev/null +++ b/docs/Model/ReturnsItem.md @@ -0,0 +1,16 @@ +# # ReturnsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item_id** | **string** | The identifier of the item. | [optional] [readonly] +**sku_id** | **string** | The identifier of the SKU. | [optional] [readonly] +**amount** | **double** | | [optional] [readonly] +**quantity** | **int** | | [optional] [readonly] +**quantity_accepted** | **int** | | [optional] [readonly] +**state** | **string** | The current state of the return item. | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ReturnsLocation.md b/docs/Model/ReturnsLocation.md new file mode 100644 index 0000000..cf13109 --- /dev/null +++ b/docs/Model/ReturnsLocation.md @@ -0,0 +1,14 @@ +# # ReturnsLocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\DigitalRiver\ApiSdk\Model\ReturnsAddress**](ReturnsAddress.md) | | +**name** | **string** | | [optional] +**phone** | **string** | | [optional] +**email** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ReturnsRequest.md b/docs/Model/ReturnsRequest.md new file mode 100644 index 0000000..1c85ad9 --- /dev/null +++ b/docs/Model/ReturnsRequest.md @@ -0,0 +1,15 @@ +# # ReturnsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **string** | The unique identifier of the Order associated with the Return. | +**reason** | **string** | The reason for the return. | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\RequestReturnsItem[]**](RequestReturnsItem.md) | | +**location** | [**\DigitalRiver\ApiSdk\Model\ReturnsLocation**](ReturnsLocation.md) | | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ReturnsResponse.md b/docs/Model/ReturnsResponse.md new file mode 100644 index 0000000..6af64e1 --- /dev/null +++ b/docs/Model/ReturnsResponse.md @@ -0,0 +1,23 @@ +# # ReturnsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier of the return. | [optional] [readonly] +**created_time** | [**\DateTime**](\DateTime.md) | The time at which the return was created. | [optional] [readonly] +**updated_time** | [**\DateTime**](\DateTime.md) | The time at which the return was updated. | [optional] [readonly] +**order_id** | **string** | The unique identifier of the order. | [optional] [readonly] +**currency** | **string** | A three-letter ISO currency code. | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\ReturnsItem[]**](ReturnsItem.md) | | [optional] +**reason** | **string** | The reason for the return. | [optional] +**failure_reason** | **string** | An enumeration indicating the reason for the return failure, if known. | [optional] +**state** | **string** | An enumeration indicating the state of the return. | [optional] +**location** | [**\DigitalRiver\ApiSdk\Model\ReturnsLocation**](ReturnsLocation.md) | | [optional] +**live_mode** | **bool** | Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode. | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] +**refund_ids** | **string[]** | | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/SalesTransaction.md b/docs/Model/SalesTransaction.md index 26a419f..d67d28b 100644 --- a/docs/Model/SalesTransaction.md +++ b/docs/Model/SalesTransaction.md @@ -26,6 +26,9 @@ Name | Type | Description | Notes **ship_to_country** | **string** | Country being shipped to. | [optional] **bill_to_country** | **string** | Country listed on shopper's billing address. | [optional] **payment_type** | **string** | Type of payment used. | [optional] +**line_item_id** | **string** | The unique identiier of the line item. | [optional] +**order_metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] +**line_item_metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShipFrom1.md b/docs/Model/ShipFrom1.md new file mode 100644 index 0000000..bde3377 --- /dev/null +++ b/docs/Model/ShipFrom1.md @@ -0,0 +1,12 @@ +# # ShipFrom1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\DigitalRiver\ApiSdk\Model\Address**](Address.md) | | [optional] +**additional_address_info** | [**\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo**](AdditionalAddressInfo.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/Shipping.md b/docs/Model/Shipping.md index 0ab966d..35e46ad 100644 --- a/docs/Model/Shipping.md +++ b/docs/Model/Shipping.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **address** | [**\DigitalRiver\ApiSdk\Model\Address**](Address.md) | | [optional] -**name** | **string** | The customer's name. | [optional] -**phone** | **string** | The customer's phone number. | [optional] -**email** | **string** | The customer's email address. | [optional] -**organization** | **string** | The customer's organization. | [optional] +**name** | **string** | The recipient’s name. | [optional] +**phone** | **string** | The recipient’s phone number. | [optional] +**email** | **string** | The recipient’s email address. | [optional] +**organization** | **string** | The recipient’s organization. | [optional] **additional_address_info** | [**\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo**](AdditionalAddressInfo.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Shipping1.md b/docs/Model/Shipping1.md new file mode 100644 index 0000000..843d6dc --- /dev/null +++ b/docs/Model/Shipping1.md @@ -0,0 +1,16 @@ +# # Shipping1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | [**\DigitalRiver\ApiSdk\Model\Address**](Address.md) | | [optional] +**name** | **string** | The recipient’s name. | [optional] +**phone** | **string** | The recipient’s phone number. | [optional] +**email** | **string** | The recipient’s email address. | [optional] +**organization** | **string** | The recipient’s organization. | [optional] +**additional_address_info** | [**\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo**](AdditionalAddressInfo.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingChoice.md b/docs/Model/ShippingChoice.md index 83935ee..7f97177 100644 --- a/docs/Model/ShippingChoice.md +++ b/docs/Model/ShippingChoice.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **tax_amount** | **double** | The shipping taxable amount. | [optional] **description** | **string** | A description of the shipping choice. | [optional] **service_level** | **string** | A shipping code that represents the service level. | [optional] +**shipping_terms** | **string** | The terms of shipping. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShippingLabelRequest.md b/docs/Model/ShippingLabelRequest.md new file mode 100644 index 0000000..f6126eb --- /dev/null +++ b/docs/Model/ShippingLabelRequest.md @@ -0,0 +1,16 @@ +# # ShippingLabelRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_id** | **string** | The identifier of the order in Digital River's system. | +**label_format** | **string** | The format of the label's data file. | +**shipping_choice** | [**\DigitalRiver\ApiSdk\Model\ShippingRequest**](ShippingRequest.md) | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\GLShipFrom**](GLShipFrom.md) | | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\ProductItemRequest[]**](ProductItemRequest.md) | | +**packages** | [**\DigitalRiver\ApiSdk\Model\PackageRequest[]**](PackageRequest.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingLabelResponse.md b/docs/Model/ShippingLabelResponse.md new file mode 100644 index 0000000..824bb47 --- /dev/null +++ b/docs/Model/ShippingLabelResponse.md @@ -0,0 +1,14 @@ +# # ShippingLabelResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The shipping label identifier | [optional] +**order_id** | **string** | The identifier of the order in Digital River's system. | [optional] +**labels** | [**\DigitalRiver\ApiSdk\Model\LabelResponse[]**](LabelResponse.md) | | [optional] +**return_to** | [**\DigitalRiver\ApiSdk\Model\Shipping**](Shipping.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingMethodQuote.md b/docs/Model/ShippingMethodQuote.md new file mode 100644 index 0000000..27e5c82 --- /dev/null +++ b/docs/Model/ShippingMethodQuote.md @@ -0,0 +1,13 @@ +# # ShippingMethodQuote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | **string** | The shipping method's description. | [optional] +**service_level** | **string** | | [optional] +**amount** | **double** | The shipping method's cost. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingMethodQuoteItemRequest.md b/docs/Model/ShippingMethodQuoteItemRequest.md new file mode 100644 index 0000000..f268670 --- /dev/null +++ b/docs/Model/ShippingMethodQuoteItemRequest.md @@ -0,0 +1,14 @@ +# # ShippingMethodQuoteItemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The item identifier. | +**amount** | **double** | The price of the product. | +**quantity** | **int** | | +**sku** | [**\DigitalRiver\ApiSdk\Model\DropInSku**](DropInSku.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingMethodQuoteItemResponse.md b/docs/Model/ShippingMethodQuoteItemResponse.md new file mode 100644 index 0000000..a552e4f --- /dev/null +++ b/docs/Model/ShippingMethodQuoteItemResponse.md @@ -0,0 +1,12 @@ +# # ShippingMethodQuoteItemResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item_ids** | **string[]** | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingMethodQuoteRequest.md b/docs/Model/ShippingMethodQuoteRequest.md new file mode 100644 index 0000000..eddee54 --- /dev/null +++ b/docs/Model/ShippingMethodQuoteRequest.md @@ -0,0 +1,15 @@ +# # ShippingMethodQuoteRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**session_id** | **string** | The identifier of the checkout session associated with the shipping quotes request. | +**session_upstream_id** | **string** | The upstream identifier of the checkout session associated with the shipping quotes request. | [optional] +**currency** | **string** | A three-letter ISO currency code. | +**ship_to** | [**\DigitalRiver\ApiSdk\Model\Shipping**](Shipping.md) | | +**items** | [**\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemRequest[]**](ShippingMethodQuoteItemRequest.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingMethodQuoteResponse.md b/docs/Model/ShippingMethodQuoteResponse.md new file mode 100644 index 0000000..69d6541 --- /dev/null +++ b/docs/Model/ShippingMethodQuoteResponse.md @@ -0,0 +1,13 @@ +# # ShippingMethodQuoteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shipments** | [**\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemResponse[]**](ShippingMethodQuoteItemResponse.md) | | [optional] +**shipping_methods** | [**\DigitalRiver\ApiSdk\Model\ShippingMethodQuote[]**](ShippingMethodQuote.md) | | [optional] +**live_mode** | **bool** | Has the value true if the object exists in live mode or the value false if the object exists in test mode. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingQuote.md b/docs/Model/ShippingQuote.md index d32a7f2..cb001a9 100644 --- a/docs/Model/ShippingQuote.md +++ b/docs/Model/ShippingQuote.md @@ -4,17 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | | [optional] -**currency** | **string** | A three-letter ISO currency code. | [optional] +**id** | **string** | Shipping quote identifier | [optional] +**description** | **string** | Shipping method description | [optional] **service_level** | **string** | | [optional] -**shipping** | **double** | The shipping amount. | [optional] -**handling** | **double** | The handling amount. | [optional] -**fees** | **double** | The fee amount. | [optional] -**total** | **double** | The total shipping and handling amount. | [optional] -**signature_required_type** | **string** | Indicates whether a signature is needed upon delivery, and, if it is, what type of signature is required. | [optional] -**estimated_minimum_delivery_time** | **float** | The minimum estimated time until delivery (in minutes). | [optional] -**estimated_maximum_delivery_time** | **float** | The maximum estimated time until delivery (in minutes). | [optional] -**items** | [**\DigitalRiver\ApiSdk\Model\ProductItem[]**](ProductItem.md) | | [optional] +**estimated_delivery** | **string** | | [optional] +**shipping_terms** | **string** | The terms of shipping. | [optional] +**total_amount** | **double** | The shipping amount. | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\GLShipFrom**](GLShipFrom.md) | | [optional] +**fees** | [**\DigitalRiver\ApiSdk\Model\ShippingQuoteFees**](ShippingQuoteFees.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShippingQuoteFees.md b/docs/Model/ShippingQuoteFees.md new file mode 100644 index 0000000..b112897 --- /dev/null +++ b/docs/Model/ShippingQuoteFees.md @@ -0,0 +1,12 @@ +# # ShippingQuoteFees + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**details** | [**\DigitalRiver\ApiSdk\Model\ShippingQuoteFeesDetails[]**](ShippingQuoteFeesDetails.md) | | [optional] +**amount** | **double** | The aggregated amount of assessed fees. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingQuoteFeesDetails.md b/docs/Model/ShippingQuoteFeesDetails.md new file mode 100644 index 0000000..2db684d --- /dev/null +++ b/docs/Model/ShippingQuoteFeesDetails.md @@ -0,0 +1,12 @@ +# # ShippingQuoteFeesDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | The name of the fee. | [optional] +**amount** | **double** | The amount of the fee. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/ShippingQuoteRequest.md b/docs/Model/ShippingQuoteRequest.md index 6f8599f..a878d10 100644 --- a/docs/Model/ShippingQuoteRequest.md +++ b/docs/Model/ShippingQuoteRequest.md @@ -5,8 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **currency** | **string** | A three-letter ISO currency code. | -**ship_to** | [**\DigitalRiver\ApiSdk\Model\ShippingQuoteAddress**](ShippingQuoteAddress.md) | | +**ship_to** | [**\DigitalRiver\ApiSdk\Model\Shipping**](Shipping.md) | | +**ship_from** | [**\DigitalRiver\ApiSdk\Model\GLShipFrom**](GLShipFrom.md) | | [optional] **items** | [**\DigitalRiver\ApiSdk\Model\ProductItemRequest[]**](ProductItemRequest.md) | | +**packages** | [**\DigitalRiver\ApiSdk\Model\PackageRequest[]**](PackageRequest.md) | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ShippingQuoteResponse.md b/docs/Model/ShippingQuoteResponse.md index 46c6f87..be665bf 100644 --- a/docs/Model/ShippingQuoteResponse.md +++ b/docs/Model/ShippingQuoteResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ship_to** | [**\DigitalRiver\ApiSdk\Model\ShippingQuoteAddress**](ShippingQuoteAddress.md) | | [optional] +**currency** | **string** | A three-letter ISO currency code. | [optional] **quotes** | [**\DigitalRiver\ApiSdk\Model\ShippingQuote[]**](ShippingQuote.md) | | [optional] **live_mode** | **bool** | Has the value true if the object exists in live mode or the value false if the object exists in test mode. | [optional] diff --git a/docs/Model/ShippingRequest.md b/docs/Model/ShippingRequest.md index 89863c7..4451ddc 100644 --- a/docs/Model/ShippingRequest.md +++ b/docs/Model/ShippingRequest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **amount** | **double** | The shipping amount. | [optional] **description** | **string** | A description of the shipping choice. | [optional] **service_level** | **string** | A shipping code that represents the service level. | [optional] +**shipping_terms** | **string** | The options for paying a transaction's full landed cost amount. DDP (Delivered Duty Paid) allows customers to pay the full amount during checkout. DAP (Deliverated At Place) allows customers to pay product and shipping costs at checkout, while paying duties, fees, and import fees upon delivery. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Sku.md b/docs/Model/Sku.md index f359c3a..db5812a 100644 --- a/docs/Model/Sku.md +++ b/docs/Model/Sku.md @@ -13,7 +13,6 @@ Name | Type | Description | Notes **manufacturer_id** | **string** | The unique identifier | [optional] **managed_fulfillment** | **string** | Signifies the product is physically fulfilled by Digital River. | [optional] **physical** | **bool** | Identifies whether or not a product is physical, so that the appropriate data requirements are enforced. | [optional] -**allow_oversell** | **bool** | Determines whether customers are allowed to back order a product. | [optional] **tax_code** | **string** | The designated tax code. | [optional] **name** | **string** | The product’s name. | [optional] **description** | **string** | A description of the product. | [optional] diff --git a/docs/Model/SkuGroup.md b/docs/Model/SkuGroup.md index 620df5d..97bb3ed 100644 --- a/docs/Model/SkuGroup.md +++ b/docs/Model/SkuGroup.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | The unique identifier of the Sku Group. | [optional] -**alias** | **string** | A short usable value that represents the product code. | [optional] +**id** | **string** | The system generated unique identifier of the Sku Group. | [optional] +**alias** | **string** | A short usable value that represents the item. This value will be given to the brand. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SkuItem.md b/docs/Model/SkuItem.md index 847d7de..1526d30 100644 --- a/docs/Model/SkuItem.md +++ b/docs/Model/SkuItem.md @@ -5,17 +5,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | The identifier of the item. | [optional] -**sku_id** | **string** | The identifier of the stock keeping unit (SKU). | [optional] +**sku_id** | **string** | The identifier of the [stock keeping unit (SKU)](https://docs.digitalriver.com/digital-river-api/checkouts-and-orders/skus). | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] **subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] **fees** | [**\DigitalRiver\ApiSdk\Model\Fees**](Fees.md) | | [optional] **quantity** | **int** | The number of items. | [optional] **amount** | **double** | The cost of the items. | [optional] -**tariff_code** | **string** | “Harmonized Tariff Schedule” that adds 4 more country-specific digits to the end of the HS Code and is determined by individual countries of import. | [optional] +**seller_tax_identifier** | **string** | The tax identifier of the seller. | [optional] **tax** | [**\DigitalRiver\ApiSdk\Model\Tax**](Tax.md) | | [optional] **importer_tax** | [**\DigitalRiver\ApiSdk\Model\ImporterTax**](ImporterTax.md) | | [optional] **duties** | [**\DigitalRiver\ApiSdk\Model\Duties**](Duties.md) | | [optional] **discount** | [**\DigitalRiver\ApiSdk\Model\SkuDiscount**](SkuDiscount.md) | | [optional] **ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] +**shipping** | [**\DigitalRiver\ApiSdk\Model\ItemShipping**](ItemShipping.md) | | [optional] **metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SkuItemRequest.md b/docs/Model/SkuItemRequest.md new file mode 100644 index 0000000..09edf61 --- /dev/null +++ b/docs/Model/SkuItemRequest.md @@ -0,0 +1,19 @@ +# # SkuItemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sku_id** | **string** | The identifier of the stock keeping unit (SKU). | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] +**subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] +**price** | **double** | The price of an item. | [optional] +**aggregate_price** | **double** | The aggregate price of an item. | [optional] +**quantity** | **int** | The number of items. | [optional] +**discount** | [**\DigitalRiver\ApiSdk\Model\SkuDiscount**](SkuDiscount.md) | | [optional] +**ship_from** | [**\DigitalRiver\ApiSdk\Model\ShipFrom**](ShipFrom.md) | | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/SkuRequest.md b/docs/Model/SkuRequest.md index b9820b4..551d929 100644 --- a/docs/Model/SkuRequest.md +++ b/docs/Model/SkuRequest.md @@ -11,7 +11,6 @@ Name | Type | Description | Notes **part_number** | **string** | The manufacturer's part number. | [optional] **manufacturer_id** | **string** | The unique identifier | [optional] **managed_fulfillment** | **string** | Signifies the product is physically fulfilled by Digital River. | [optional] -**allow_oversell** | **bool** | Determines whether customers are allowed to back order a product. | [optional] **tax_code** | **string** | The designated tax code. | **name** | **string** | The product’s name. | **description** | **string** | A description of the product. | [optional] diff --git a/docs/Model/SkuRequestItem.md b/docs/Model/SkuRequestItem.md index b10a56e..2d76a88 100644 --- a/docs/Model/SkuRequestItem.md +++ b/docs/Model/SkuRequestItem.md @@ -4,7 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sku_id** | **string** | The identifier of the stock keeping unit (SKU). | +**sku_id** | **string** | The identifier of the stock keeping unit (SKU). | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] **subscription_info** | [**\DigitalRiver\ApiSdk\Model\SubscriptionInfo**](SubscriptionInfo.md) | | [optional] **price** | **double** | The price of an item. | [optional] **aggregate_price** | **double** | The total price of multiple items. | [optional] diff --git a/docs/Model/SkuUpsertRequest.md b/docs/Model/SkuUpsertRequest.md index aef0b75..449a015 100644 --- a/docs/Model/SkuUpsertRequest.md +++ b/docs/Model/SkuUpsertRequest.md @@ -10,7 +10,6 @@ Name | Type | Description | Notes **part_number** | **string** | The manufacturer's part number. | [optional] **manufacturer_id** | **string** | The unique identifier | [optional] **managed_fulfillment** | **string** | Signifies the product is physically fulfilled by Digital River. | [optional] -**allow_oversell** | **bool** | Determines whether customers are allowed to back order a product. | [optional] **tax_code** | **string** | The designated tax code. | **name** | **string** | The product’s name. | **description** | **string** | A description of the product. | [optional] diff --git a/docs/Model/Source.md b/docs/Model/Source.md index 8a44860..1ec3d0d 100644 --- a/docs/Model/Source.md +++ b/docs/Model/Source.md @@ -29,6 +29,8 @@ Name | Type | Description | Notes **klarna_credit_recurring** | [**\DigitalRiver\ApiSdk\Model\KlarnaRecurring**](KlarnaRecurring.md) | | [optional] **konbini** | [**\DigitalRiver\ApiSdk\Model\Konbini**](Konbini.md) | | [optional] **bank_transfer** | [**object**](.md) | | [optional] +**msts** | [**object**](.md) | | [optional] +**bancontact** | [**object**](.md) | | [optional] **flow** | **string** | The authentication flow of the source. | [optional] **state** | **string** | The status of the source, one of pending_funds, pending_redirect, requires_action, cancelled, chargeable, consumed or failed. You can only use chargeable sources to create a charge. | [optional] **metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] diff --git a/docs/Model/StateTransitions.md b/docs/Model/StateTransitions.md index 4dbc37f..355797e 100644 --- a/docs/Model/StateTransitions.md +++ b/docs/Model/StateTransitions.md @@ -4,10 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**activated** | [**\DateTime**](\DateTime.md) | | [optional] -**failed** | [**\DateTime**](\DateTime.md) | | [optional] -**cancelled** | [**\DateTime**](\DateTime.md) | | [optional] -**ended** | [**\DateTime**](\DateTime.md) | | [optional] +**activated** | [**\DateTime**](\DateTime.md) | Can be subscribed to, updates are restricted to some fields | [optional] +**discontinued** | [**\DateTime**](\DateTime.md) | Has active subscriptions, but not accepting new ones | [optional] +**deactivated** | [**\DateTime**](\DateTime.md) | All subscriptions will be stopped | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Subscription.md b/docs/Model/Subscription.md index 32aa05e..c3713a5 100644 --- a/docs/Model/Subscription.md +++ b/docs/Model/Subscription.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **contract_binding_until** | [**\DateTime**](\DateTime.md) | Represents the date and time when the subscription's contract expires. | [optional] **created_time** | [**\DateTime**](\DateTime.md) | The time when the Subscription was created | [optional] **updated_time** | [**\DateTime**](\DateTime.md) | The time when the Subscription was last updated. | [optional] -**state_transitions** | [**\DigitalRiver\ApiSdk\Model\StateTransitions**](StateTransitions.md) | | [optional] +**state_transitions** | [**\DigitalRiver\ApiSdk\Model\SubscriptionStateTransitions**](SubscriptionStateTransitions.md) | | [optional] **live_mode** | **bool** | Has the value true if the object exists in live mode or the value false if the object exists in test mode. | [optional] **id** | **string** | The unique identifier of the Subscription. | [optional] **billing_agreement_id** | **string** | The billing agreement identifier that is obtained from the subscription's acquisition order. | [optional] @@ -22,6 +22,7 @@ Name | Type | Description | Notes **items** | [**\DigitalRiver\ApiSdk\Model\SubscriptionItems[]**](SubscriptionItems.md) | | [optional] **current_period_end_date** | [**\DateTime**](\DateTime.md) | Represents the date and time when the subscription's current billing period ends. | [optional] **next_invoice_date** | [**\DateTime**](\DateTime.md) | Represents the date and time when Digital River next opens an invoice and starts the billing process. | [optional] +**next_reminder_date** | [**\DateTime**](\DateTime.md) | Date when the next reminder event will be sent. | [optional] **metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionItems.md b/docs/Model/SubscriptionItems.md index ee788c2..991fa0a 100644 --- a/docs/Model/SubscriptionItems.md +++ b/docs/Model/SubscriptionItems.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **price** | **double** | Gets or sets the price | [optional] **metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] **sku_id** | **string** | The identifier of the SKU. | [optional] +**product_details** | [**\DigitalRiver\ApiSdk\Model\ProductDetails**](ProductDetails.md) | | [optional] **quantity** | **int** | Gets or sets the quantity | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionStateTransitions.md b/docs/Model/SubscriptionStateTransitions.md new file mode 100644 index 0000000..2e1d2f2 --- /dev/null +++ b/docs/Model/SubscriptionStateTransitions.md @@ -0,0 +1,15 @@ +# # SubscriptionStateTransitions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**activated** | [**\DateTime**](\DateTime.md) | | [optional] +**activated_free** | [**\DateTime**](\DateTime.md) | | [optional] +**failed** | [**\DateTime**](\DateTime.md) | | [optional] +**cancelled** | [**\DateTime**](\DateTime.md) | | [optional] +**ended** | [**\DateTime**](\DateTime.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/TaxIdentifier1.md b/docs/Model/TaxIdentifier1.md new file mode 100644 index 0000000..55914b0 --- /dev/null +++ b/docs/Model/TaxIdentifier1.md @@ -0,0 +1,20 @@ +# # TaxIdentifier1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The identifier of the tax identifier. | [optional] [readonly] +**created_time** | [**\DateTime**](\DateTime.md) | The time when the tax identifier was created. | [optional] [readonly] +**customer_id** | **string** | The identifier of an existing customer. | [optional] +**type** | **string** | Type of tax identifier. | [optional] [readonly] +**value** | **string** | The tax identifier. | [optional] +**state** | **string** | The verification state. | [optional] [readonly] +**state_transitions** | [**\DigitalRiver\ApiSdk\Model\TaxIdentifierStateTransitions**](TaxIdentifierStateTransitions.md) | | [optional] +**verified_name** | **string** | The registered name of the customer with this tax identifier. | [optional] +**verified_address** | **string** | The registered address of the customer with this tax identifier. | [optional] +**updated_time** | [**\DateTime**](\DateTime.md) | The time when the tax identifier was updated. | [optional] [readonly] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/TaxIdentifiersInfo.md b/docs/Model/TaxIdentifiersInfo.md new file mode 100644 index 0000000..a07358a --- /dev/null +++ b/docs/Model/TaxIdentifiersInfo.md @@ -0,0 +1,15 @@ +# # TaxIdentifiersInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | The type of tax identifier. | [optional] +**customer_type** | **string** | The type of customer. | [optional] +**is_required** | **bool** | Indicates whether or not tax id is required. | [optional] +**format_pattern** | **string** | The format pattern of the tax id. | [optional] +**locales** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/UpdateCheckoutRequest.md b/docs/Model/UpdateCheckoutRequest.md index c87ea1b..566ac0a 100644 --- a/docs/Model/UpdateCheckoutRequest.md +++ b/docs/Model/UpdateCheckoutRequest.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **currency** | **string** | A three-letter ISO currency code. | [optional] **email** | **string** | The customer's email address. | [optional] **locale** | **string** | A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. | [optional] +**invoice_attribute_id** | **string** | The unique identfier of the invoice attribute. | [optional] **browser_ip** | **string** | The IP address of the browser used by the customer when placing the order. | [optional] **application_id** | **string** | An arbitrary string identifier that can be used to track the application type. | [optional] [readonly] **tax_identifiers** | [**\DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]**](CheckoutTaxIdentifierRequest.md) | | [optional] @@ -19,8 +20,8 @@ Name | Type | Description | Notes **shipping_discount** | [**\DigitalRiver\ApiSdk\Model\Discount**](Discount.md) | | [optional] **charge_type** | [**\DigitalRiver\ApiSdk\Model\ChargeType**](ChargeType.md) | | [optional] **customer_type** | [**\DigitalRiver\ApiSdk\Model\CustomerType**](CustomerType.md) | | [optional] -**shipping_choice** | [**\DigitalRiver\ApiSdk\Model\ShippingRequest**](ShippingRequest.md) | | [optional] **purchase_location** | [**\DigitalRiver\ApiSdk\Model\PurchaseLocation**](PurchaseLocation.md) | | [optional] +**shipping_choice** | [**\DigitalRiver\ApiSdk\Model\ShippingRequest**](ShippingRequest.md) | | [optional] **items** | [**\DigitalRiver\ApiSdk\Model\SkuUpdateRequestItem**](SkuUpdateRequestItem.md) | | [optional] **upstream_id** | **string** | The upstream identifier. | [optional] **metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] diff --git a/docs/Model/UpdateReturnsItem.md b/docs/Model/UpdateReturnsItem.md new file mode 100644 index 0000000..20e9e2d --- /dev/null +++ b/docs/Model/UpdateReturnsItem.md @@ -0,0 +1,14 @@ +# # UpdateReturnsItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item_id** | **string** | The identifier of the item. | [optional] +**sku_id** | **string** | The identifier of the SKU. | [optional] +**quantity** | **int** | | +**state** | **string** | An enumeration indicating the state of the return item. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/UpdateReturnsRequest.md b/docs/Model/UpdateReturnsRequest.md new file mode 100644 index 0000000..fc81b1c --- /dev/null +++ b/docs/Model/UpdateReturnsRequest.md @@ -0,0 +1,14 @@ +# # UpdateReturnsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**location** | [**\DigitalRiver\ApiSdk\Model\ReturnsLocation**](ReturnsLocation.md) | | [optional] +**state** | **string** | Enumeration indicating the state of the return. | [optional] +**items** | [**\DigitalRiver\ApiSdk\Model\UpdateReturnsItem[]**](UpdateReturnsItem.md) | | [optional] +**metadata** | [**map[string,AnyType]**](AnyType.md) | Key-value pairs used to store additional data. Value can be string, boolean or integer types. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + + diff --git a/docs/Model/UpdateSkuRequest.md b/docs/Model/UpdateSkuRequest.md index e882aa2..c70e8dc 100644 --- a/docs/Model/UpdateSkuRequest.md +++ b/docs/Model/UpdateSkuRequest.md @@ -10,7 +10,6 @@ Name | Type | Description | Notes **part_number** | **string** | The manufacturer's part number. | [optional] **manufacturer_id** | **string** | The unique identifier | [optional] **managed_fulfillment** | **string** | Signifies the product is physically fulfilled by Digital River. | [optional] -**allow_oversell** | **bool** | Determines whether customers are allowed to back order a product. | [optional] **tax_code** | **string** | The designated tax code. | [optional] **name** | **string** | The product’s name. | [optional] **description** | **string** | A description of the product. | [optional] diff --git a/lib/Api/DropInCheckoutLinksApi.php b/lib/Api/DropInCheckoutLinksApi.php new file mode 100644 index 0000000..d251609 --- /dev/null +++ b/lib/Api/DropInCheckoutLinksApi.php @@ -0,0 +1,1544 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createDropInCheckoutLink + * + * Creates a new Drop-in checkout link + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutLink $drop_in_checkout_link drop_in_checkout_link (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function createDropInCheckoutLink($drop_in_checkout_link = null) + { + list($response) = $this->createDropInCheckoutLinkWithHttpInfo($drop_in_checkout_link); + return $response; + } + + /** + * Operation createDropInCheckoutLinkWithHttpInfo + * + * Creates a new Drop-in checkout link + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutLink $drop_in_checkout_link (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function createDropInCheckoutLinkWithHttpInfo($drop_in_checkout_link = null) + { + $request = $this->createDropInCheckoutLinkRequest($drop_in_checkout_link); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 201: + if ('\DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDropInCheckoutLinkAsync + * + * Creates a new Drop-in checkout link + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutLink $drop_in_checkout_link (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDropInCheckoutLinkAsync($drop_in_checkout_link = null) + { + return $this->createDropInCheckoutLinkAsyncWithHttpInfo($drop_in_checkout_link) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDropInCheckoutLinkAsyncWithHttpInfo + * + * Creates a new Drop-in checkout link + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutLink $drop_in_checkout_link (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDropInCheckoutLinkAsyncWithHttpInfo($drop_in_checkout_link = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\DropInCheckoutLinkResponse'; + $request = $this->createDropInCheckoutLinkRequest($drop_in_checkout_link); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDropInCheckoutLink' + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutLink $drop_in_checkout_link (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createDropInCheckoutLinkRequest($drop_in_checkout_link = null) + { + + $resourcePath = '/drop-in/checkout-links'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($drop_in_checkout_link)) { + $_tempBody = $drop_in_checkout_link; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation deleteDropInCheckoutLinks + * + * Deletes a Drop-in checkout link by ID. + * + * @param string $id Link ID (required) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function deleteDropInCheckoutLinks($id) + { + $this->deleteDropInCheckoutLinksWithHttpInfo($id); + } + + /** + * Operation deleteDropInCheckoutLinksWithHttpInfo + * + * Deletes a Drop-in checkout link by ID. + * + * @param string $id Link ID (required) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function deleteDropInCheckoutLinksWithHttpInfo($id) + { + $request = $this->deleteDropInCheckoutLinksRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation deleteDropInCheckoutLinksAsync + * + * Deletes a Drop-in checkout link by ID. + * + * @param string $id Link ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteDropInCheckoutLinksAsync($id) + { + return $this->deleteDropInCheckoutLinksAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation deleteDropInCheckoutLinksAsyncWithHttpInfo + * + * Deletes a Drop-in checkout link by ID. + * + * @param string $id Link ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteDropInCheckoutLinksAsyncWithHttpInfo($id) + { + $returnType = ''; + $request = $this->deleteDropInCheckoutLinksRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteDropInCheckoutLinks' + * + * @param string $id Link ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function deleteDropInCheckoutLinksRequest($id) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteDropInCheckoutLinks' + ); + } + + $resourcePath = '/drop-in/checkout-links/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listDropInCheckoutLink + * + * List Drop-in checkout links + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function listDropInCheckoutLink($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null) + { + list($response) = $this->listDropInCheckoutLinkWithHttpInfo($created_time, $ending_before, $starting_after, $limit, $ids); + return $response; + } + + /** + * Operation listDropInCheckoutLinkWithHttpInfo + * + * List Drop-in checkout links + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listDropInCheckoutLinkWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null) + { + $request = $this->listDropInCheckoutLinkRequest($created_time, $ending_before, $starting_after, $limit, $ids); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listDropInCheckoutLinkAsync + * + * List Drop-in checkout links + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDropInCheckoutLinkAsync($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null) + { + return $this->listDropInCheckoutLinkAsyncWithHttpInfo($created_time, $ending_before, $starting_after, $limit, $ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listDropInCheckoutLinkAsyncWithHttpInfo + * + * List Drop-in checkout links + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listDropInCheckoutLinkAsyncWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ListCheckoutLinksResponse'; + $request = $this->listDropInCheckoutLinkRequest($created_time, $ending_before, $starting_after, $limit, $ids); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listDropInCheckoutLink' + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listDropInCheckoutLinkRequest($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null) + { + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DropInCheckoutLinksApi.listDropInCheckoutLink, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling DropInCheckoutLinksApi.listDropInCheckoutLink, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/drop-in/checkout-links'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($created_time !== null) { + if('form' === 'deepObject' && is_array($created_time)) { + foreach($created_time as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['createdTime'] = $created_time; + } + } + // query params + if ($ending_before !== null) { + if('form' === 'form' && is_array($ending_before)) { + foreach($ending_before as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['endingBefore'] = $ending_before; + } + } + // query params + if ($starting_after !== null) { + if('form' === 'form' && is_array($starting_after)) { + foreach($starting_after as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['startingAfter'] = $starting_after; + } + } + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + // query params + if ($ids !== null) { + if('form' === 'form' && is_array($ids)) { + foreach($ids as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['ids'] = $ids; + } + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/DropInCheckoutSessionsApi.php b/lib/Api/DropInCheckoutSessionsApi.php new file mode 100644 index 0000000..b6999af --- /dev/null +++ b/lib/Api/DropInCheckoutSessionsApi.php @@ -0,0 +1,636 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createDropInCheckoutSession + * + * Creates a new Drop-in checkout session + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest $drop_in_checkout_request drop_in_checkout_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function createDropInCheckoutSession($drop_in_checkout_request = null) + { + list($response) = $this->createDropInCheckoutSessionWithHttpInfo($drop_in_checkout_request); + return $response; + } + + /** + * Operation createDropInCheckoutSessionWithHttpInfo + * + * Creates a new Drop-in checkout session + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest $drop_in_checkout_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function createDropInCheckoutSessionWithHttpInfo($drop_in_checkout_request = null) + { + $request = $this->createDropInCheckoutSessionRequest($drop_in_checkout_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 201: + if ('\DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createDropInCheckoutSessionAsync + * + * Creates a new Drop-in checkout session + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest $drop_in_checkout_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDropInCheckoutSessionAsync($drop_in_checkout_request = null) + { + return $this->createDropInCheckoutSessionAsyncWithHttpInfo($drop_in_checkout_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createDropInCheckoutSessionAsyncWithHttpInfo + * + * Creates a new Drop-in checkout session + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest $drop_in_checkout_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createDropInCheckoutSessionAsyncWithHttpInfo($drop_in_checkout_request = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\CreateDropInCheckoutTokenResponse'; + $request = $this->createDropInCheckoutSessionRequest($drop_in_checkout_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createDropInCheckoutSession' + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutRequest $drop_in_checkout_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createDropInCheckoutSessionRequest($drop_in_checkout_request = null) + { + + $resourcePath = '/drop-in/checkout-sessions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($drop_in_checkout_request)) { + $_tempBody = $drop_in_checkout_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/DropInShippingQuotesApi.php b/lib/Api/DropInShippingQuotesApi.php new file mode 100644 index 0000000..cb283d5 --- /dev/null +++ b/lib/Api/DropInShippingQuotesApi.php @@ -0,0 +1,612 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation listShippingMethodQuotes + * + * Returns shipping method quotes + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteRequest $shipping_method_quote_request shipping_method_quote_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function listShippingMethodQuotes($shipping_method_quote_request = null) + { + list($response) = $this->listShippingMethodQuotesWithHttpInfo($shipping_method_quote_request); + return $response; + } + + /** + * Operation listShippingMethodQuotesWithHttpInfo + * + * Returns shipping method quotes + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteRequest $shipping_method_quote_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listShippingMethodQuotesWithHttpInfo($shipping_method_quote_request = null) + { + $request = $this->listShippingMethodQuotesRequest($shipping_method_quote_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listShippingMethodQuotesAsync + * + * Returns shipping method quotes + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteRequest $shipping_method_quote_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listShippingMethodQuotesAsync($shipping_method_quote_request = null) + { + return $this->listShippingMethodQuotesAsyncWithHttpInfo($shipping_method_quote_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listShippingMethodQuotesAsyncWithHttpInfo + * + * Returns shipping method quotes + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteRequest $shipping_method_quote_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listShippingMethodQuotesAsyncWithHttpInfo($shipping_method_quote_request = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteResponse'; + $request = $this->listShippingMethodQuotesRequest($shipping_method_quote_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listShippingMethodQuotes' + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteRequest $shipping_method_quote_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listShippingMethodQuotesRequest($shipping_method_quote_request = null) + { + + $resourcePath = '/checkout/shipping-quotes'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($shipping_method_quote_request)) { + $_tempBody = $shipping_method_quote_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/FilesApi.php b/lib/Api/FilesApi.php index 1b6a885..003c01a 100644 --- a/lib/Api/FilesApi.php +++ b/lib/Api/FilesApi.php @@ -1015,6 +1015,308 @@ protected function deleteFilesRequest($id) ); } + /** + * Operation downloadFiles + * + * Gets file content by ID. + * + * @param string $id File identifier. (required) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\FileContent|\DigitalRiver\ApiSdk\Model\Errors + */ + public function downloadFiles($id) + { + list($response) = $this->downloadFilesWithHttpInfo($id); + return $response; + } + + /** + * Operation downloadFilesWithHttpInfo + * + * Gets file content by ID. + * + * @param string $id File identifier. (required) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\FileContent|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function downloadFilesWithHttpInfo($id) + { + $request = $this->downloadFilesRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\FileContent' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\FileContent', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\FileContent'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\FileContent', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation downloadFilesAsync + * + * Gets file content by ID. + * + * @param string $id File identifier. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadFilesAsync($id) + { + return $this->downloadFilesAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation downloadFilesAsyncWithHttpInfo + * + * Gets file content by ID. + * + * @param string $id File identifier. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function downloadFilesAsyncWithHttpInfo($id) + { + $returnType = '\DigitalRiver\ApiSdk\Model\FileContent'; + $request = $this->downloadFilesRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'downloadFiles' + * + * @param string $id File identifier. (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function downloadFilesRequest($id) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling downloadFiles' + ); + } + + $resourcePath = '/files/{id}/content'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation listFiles * diff --git a/lib/Api/FulfillmentsApi.php b/lib/Api/FulfillmentsApi.php index 40b68c9..1f113a1 100644 --- a/lib/Api/FulfillmentsApi.php +++ b/lib/Api/FulfillmentsApi.php @@ -1278,7 +1278,7 @@ protected function listFulfillmentsRequest($created_time = null, $ending_before * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \DigitalRiver\ApiSdk\Model\Fulfillment|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + * @return \DigitalRiver\ApiSdk\Model\FulfillmentOrder|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors */ public function retrieveFulfillments($id) { @@ -1295,7 +1295,7 @@ public function retrieveFulfillments($id) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \DigitalRiver\ApiSdk\Model\Fulfillment|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + * @return array of \DigitalRiver\ApiSdk\Model\FulfillmentOrder|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) */ public function retrieveFulfillmentsWithHttpInfo($id) { @@ -1332,14 +1332,14 @@ public function retrieveFulfillmentsWithHttpInfo($id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DigitalRiver\ApiSdk\Model\Fulfillment' === '\SplFileObject') { + if ('\DigitalRiver\ApiSdk\Model\FulfillmentOrder' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Fulfillment', []), + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\FulfillmentOrder', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1489,7 +1489,7 @@ public function retrieveFulfillmentsWithHttpInfo($id) ]; } - $returnType = '\DigitalRiver\ApiSdk\Model\Fulfillment'; + $returnType = '\DigitalRiver\ApiSdk\Model\FulfillmentOrder'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1508,7 +1508,7 @@ public function retrieveFulfillmentsWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DigitalRiver\ApiSdk\Model\Fulfillment', + '\DigitalRiver\ApiSdk\Model\FulfillmentOrder', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1646,7 +1646,7 @@ function ($response) { */ public function retrieveFulfillmentsAsyncWithHttpInfo($id) { - $returnType = '\DigitalRiver\ApiSdk\Model\Fulfillment'; + $returnType = '\DigitalRiver\ApiSdk\Model\FulfillmentOrder'; $request = $this->retrieveFulfillmentsRequest($id); return $this->client diff --git a/lib/Api/LogisticsReturnsApi.php b/lib/Api/LogisticsReturnsApi.php new file mode 100644 index 0000000..b9debfc --- /dev/null +++ b/lib/Api/LogisticsReturnsApi.php @@ -0,0 +1,1776 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createLogisticsReturns + * + * Creates a return + * + * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request return_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function createLogisticsReturns($return_request = null) + { + list($response) = $this->createLogisticsReturnsWithHttpInfo($return_request); + return $response; + } + + /** + * Operation createLogisticsReturnsWithHttpInfo + * + * Creates a return + * + * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function createLogisticsReturnsWithHttpInfo($return_request = null) + { + $request = $this->createLogisticsReturnsRequest($return_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 201: + if ('\DigitalRiver\ApiSdk\Model\ReturnResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ReturnResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ReturnResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createLogisticsReturnsAsync + * + * Creates a return + * + * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createLogisticsReturnsAsync($return_request = null) + { + return $this->createLogisticsReturnsAsyncWithHttpInfo($return_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createLogisticsReturnsAsyncWithHttpInfo + * + * Creates a return + * + * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createLogisticsReturnsAsyncWithHttpInfo($return_request = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $request = $this->createLogisticsReturnsRequest($return_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createLogisticsReturns' + * + * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createLogisticsReturnsRequest($return_request = null) + { + + $resourcePath = '/logistics-returns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($return_request)) { + $_tempBody = $return_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listLogisticsReturns + * + * Returns a list of returns + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * @param string $type The type of return. (optional) + * @param string $rma_number rma_number (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ListReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function listLogisticsReturns($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null, $type = null, $rma_number = null) + { + list($response) = $this->listLogisticsReturnsWithHttpInfo($created_time, $ending_before, $starting_after, $limit, $ids, $order_id, $type, $rma_number); + return $response; + } + + /** + * Operation listLogisticsReturnsWithHttpInfo + * + * Returns a list of returns + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * @param string $type The type of return. (optional) + * @param string $rma_number (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ListReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listLogisticsReturnsWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null, $type = null, $rma_number = null) + { + $request = $this->listLogisticsReturnsRequest($created_time, $ending_before, $starting_after, $limit, $ids, $order_id, $type, $rma_number); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\ListReturnsResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ListReturnsResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ListReturnsResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ListReturnsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listLogisticsReturnsAsync + * + * Returns a list of returns + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * @param string $type The type of return. (optional) + * @param string $rma_number (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listLogisticsReturnsAsync($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null, $type = null, $rma_number = null) + { + return $this->listLogisticsReturnsAsyncWithHttpInfo($created_time, $ending_before, $starting_after, $limit, $ids, $order_id, $type, $rma_number) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listLogisticsReturnsAsyncWithHttpInfo + * + * Returns a list of returns + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * @param string $type The type of return. (optional) + * @param string $rma_number (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listLogisticsReturnsAsyncWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null, $type = null, $rma_number = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ListReturnsResponse'; + $request = $this->listLogisticsReturnsRequest($created_time, $ending_before, $starting_after, $limit, $ids, $order_id, $type, $rma_number); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listLogisticsReturns' + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * @param string $type The type of return. (optional) + * @param string $rma_number (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listLogisticsReturnsRequest($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null, $type = null, $rma_number = null) + { + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LogisticsReturnsApi.listLogisticsReturns, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling LogisticsReturnsApi.listLogisticsReturns, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/logistics-returns'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($created_time !== null) { + if('form' === 'deepObject' && is_array($created_time)) { + foreach($created_time as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['createdTime'] = $created_time; + } + } + // query params + if ($ending_before !== null) { + if('form' === 'form' && is_array($ending_before)) { + foreach($ending_before as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['endingBefore'] = $ending_before; + } + } + // query params + if ($starting_after !== null) { + if('form' === 'form' && is_array($starting_after)) { + foreach($starting_after as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['startingAfter'] = $starting_after; + } + } + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + // query params + if ($ids !== null) { + if('form' === 'form' && is_array($ids)) { + foreach($ids as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['ids'] = $ids; + } + } + // query params + if ($order_id !== null) { + if('form' === 'form' && is_array($order_id)) { + foreach($order_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['orderId'] = $order_id; + } + } + // query params + if ($type !== null) { + if('form' === 'form' && is_array($type)) { + foreach($type as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['type'] = $type; + } + } + // query params + if ($rma_number !== null) { + if('form' === 'form' && is_array($rma_number)) { + foreach($rma_number as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['rmaNumber'] = $rma_number; + } + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation retrieveLogisticsReturns + * + * Gets a return by ID + * + * @param string $id Return ID (required) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function retrieveLogisticsReturns($id) + { + list($response) = $this->retrieveLogisticsReturnsWithHttpInfo($id); + return $response; + } + + /** + * Operation retrieveLogisticsReturnsWithHttpInfo + * + * Gets a return by ID + * + * @param string $id Return ID (required) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function retrieveLogisticsReturnsWithHttpInfo($id) + { + $request = $this->retrieveLogisticsReturnsRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\ReturnResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ReturnResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ReturnResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation retrieveLogisticsReturnsAsync + * + * Gets a return by ID + * + * @param string $id Return ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function retrieveLogisticsReturnsAsync($id) + { + return $this->retrieveLogisticsReturnsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation retrieveLogisticsReturnsAsyncWithHttpInfo + * + * Gets a return by ID + * + * @param string $id Return ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function retrieveLogisticsReturnsAsyncWithHttpInfo($id) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $request = $this->retrieveLogisticsReturnsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'retrieveLogisticsReturns' + * + * @param string $id Return ID (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function retrieveLogisticsReturnsRequest($id) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling retrieveLogisticsReturns' + ); + } + + $resourcePath = '/logistics-returns/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ReturnsApi.php b/lib/Api/ReturnsApi.php index a322ccf..d1cce88 100644 --- a/lib/Api/ReturnsApi.php +++ b/lib/Api/ReturnsApi.php @@ -109,15 +109,15 @@ public function getConfig() * * Creates a return * - * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\ReturnsRequest $returns_request returns_request (optional) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \DigitalRiver\ApiSdk\Model\CreateReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + * @return \DigitalRiver\ApiSdk\Model\CreateReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors */ - public function createReturns($return_request = null) + public function createReturns($returns_request = null) { - list($response) = $this->createReturnsWithHttpInfo($return_request); + list($response) = $this->createReturnsWithHttpInfo($returns_request); return $response; } @@ -126,15 +126,15 @@ public function createReturns($return_request = null) * * Creates a return * - * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\ReturnsRequest $returns_request (optional) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \DigitalRiver\ApiSdk\Model\CreateReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + * @return array of \DigitalRiver\ApiSdk\Model\CreateReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) */ - public function createReturnsWithHttpInfo($return_request = null) + public function createReturnsWithHttpInfo($returns_request = null) { - $request = $this->createReturnsRequest($return_request); + $request = $this->createReturnsRequest($returns_request); try { $options = $this->createHttpClientOption(); @@ -167,14 +167,14 @@ public function createReturnsWithHttpInfo($return_request = null) $responseBody = $response->getBody(); switch($statusCode) { case 201: - if ('\DigitalRiver\ApiSdk\Model\CreateReturnResponse' === '\SplFileObject') { + if ('\DigitalRiver\ApiSdk\Model\CreateReturnsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\CreateReturnResponse', []), + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\CreateReturnsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -324,7 +324,7 @@ public function createReturnsWithHttpInfo($return_request = null) ]; } - $returnType = '\DigitalRiver\ApiSdk\Model\CreateReturnResponse'; + $returnType = '\DigitalRiver\ApiSdk\Model\CreateReturnsResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -343,7 +343,7 @@ public function createReturnsWithHttpInfo($return_request = null) case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DigitalRiver\ApiSdk\Model\CreateReturnResponse', + '\DigitalRiver\ApiSdk\Model\CreateReturnsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -454,14 +454,14 @@ public function createReturnsWithHttpInfo($return_request = null) * * Creates a return * - * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\ReturnsRequest $returns_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createReturnsAsync($return_request = null) + public function createReturnsAsync($returns_request = null) { - return $this->createReturnsAsyncWithHttpInfo($return_request) + return $this->createReturnsAsyncWithHttpInfo($returns_request) ->then( function ($response) { return $response[0]; @@ -474,15 +474,15 @@ function ($response) { * * Creates a return * - * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\ReturnsRequest $returns_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createReturnsAsyncWithHttpInfo($return_request = null) + public function createReturnsAsyncWithHttpInfo($returns_request = null) { - $returnType = '\DigitalRiver\ApiSdk\Model\CreateReturnResponse'; - $request = $this->createReturnsRequest($return_request); + $returnType = '\DigitalRiver\ApiSdk\Model\CreateReturnsResponse'; + $request = $this->createReturnsRequest($returns_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -521,12 +521,12 @@ function ($exception) { /** * Create request for operation 'createReturns' * - * @param \DigitalRiver\ApiSdk\Model\ReturnRequest $return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\ReturnsRequest $returns_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createReturnsRequest($return_request = null) + protected function createReturnsRequest($returns_request = null) { $resourcePath = '/returns'; @@ -541,8 +541,8 @@ protected function createReturnsRequest($return_request = null) // body params $_tempBody = null; - if (isset($return_request)) { - $_tempBody = $return_request; + if (isset($returns_request)) { + $_tempBody = $returns_request; } if ($multipart) { @@ -631,7 +631,7 @@ protected function createReturnsRequest($return_request = null) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \DigitalRiver\ApiSdk\Model\ListReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + * @return \DigitalRiver\ApiSdk\Model\ListReturnsResponse1|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors */ public function listReturns($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $state = null, $order_id = null, $sku_id = null) { @@ -655,7 +655,7 @@ public function listReturns($created_time = null, $ending_before = null, $starti * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \DigitalRiver\ApiSdk\Model\ListReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + * @return array of \DigitalRiver\ApiSdk\Model\ListReturnsResponse1|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) */ public function listReturnsWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $state = null, $order_id = null, $sku_id = null) { @@ -692,14 +692,14 @@ public function listReturnsWithHttpInfo($created_time = null, $ending_before = n $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DigitalRiver\ApiSdk\Model\ListReturnsResponse' === '\SplFileObject') { + if ('\DigitalRiver\ApiSdk\Model\ListReturnsResponse1' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ListReturnsResponse', []), + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ListReturnsResponse1', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -837,7 +837,7 @@ public function listReturnsWithHttpInfo($created_time = null, $ending_before = n ]; } - $returnType = '\DigitalRiver\ApiSdk\Model\ListReturnsResponse'; + $returnType = '\DigitalRiver\ApiSdk\Model\ListReturnsResponse1'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -856,7 +856,7 @@ public function listReturnsWithHttpInfo($created_time = null, $ending_before = n case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DigitalRiver\ApiSdk\Model\ListReturnsResponse', + '\DigitalRiver\ApiSdk\Model\ListReturnsResponse1', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1000,7 +1000,7 @@ function ($response) { */ public function listReturnsAsyncWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $state = null, $order_id = null, $sku_id = null) { - $returnType = '\DigitalRiver\ApiSdk\Model\ListReturnsResponse'; + $returnType = '\DigitalRiver\ApiSdk\Model\ListReturnsResponse1'; $request = $this->listReturnsRequest($created_time, $ending_before, $starting_after, $limit, $ids, $state, $order_id, $sku_id); return $this->client @@ -1242,7 +1242,7 @@ protected function listReturnsRequest($created_time = null, $ending_before = nul * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + * @return \DigitalRiver\ApiSdk\Model\ReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors */ public function retrieveReturns($id) { @@ -1259,7 +1259,7 @@ public function retrieveReturns($id) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + * @return array of \DigitalRiver\ApiSdk\Model\ReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) */ public function retrieveReturnsWithHttpInfo($id) { @@ -1296,14 +1296,14 @@ public function retrieveReturnsWithHttpInfo($id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DigitalRiver\ApiSdk\Model\ReturnResponse' === '\SplFileObject') { + if ('\DigitalRiver\ApiSdk\Model\ReturnsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ReturnResponse', []), + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ReturnsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1453,7 +1453,7 @@ public function retrieveReturnsWithHttpInfo($id) ]; } - $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnsResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1472,7 +1472,7 @@ public function retrieveReturnsWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DigitalRiver\ApiSdk\Model\ReturnResponse', + '\DigitalRiver\ApiSdk\Model\ReturnsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1610,7 +1610,7 @@ function ($response) { */ public function retrieveReturnsAsyncWithHttpInfo($id) { - $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnsResponse'; $request = $this->retrieveReturnsRequest($id); return $this->client @@ -1761,15 +1761,15 @@ protected function retrieveReturnsRequest($id) * Updates an existing return * * @param string $id Return ID (required) - * @param \DigitalRiver\ApiSdk\Model\UpdateReturnRequest $update_return_request update_return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest $update_returns_request update_returns_request (optional) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + * @return \DigitalRiver\ApiSdk\Model\ReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors */ - public function updateReturns($id, $update_return_request = null) + public function updateReturns($id, $update_returns_request = null) { - list($response) = $this->updateReturnsWithHttpInfo($id, $update_return_request); + list($response) = $this->updateReturnsWithHttpInfo($id, $update_returns_request); return $response; } @@ -1779,15 +1779,15 @@ public function updateReturns($id, $update_return_request = null) * Updates an existing return * * @param string $id Return ID (required) - * @param \DigitalRiver\ApiSdk\Model\UpdateReturnRequest $update_return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest $update_returns_request (optional) * * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \DigitalRiver\ApiSdk\Model\ReturnResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + * @return array of \DigitalRiver\ApiSdk\Model\ReturnsResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) */ - public function updateReturnsWithHttpInfo($id, $update_return_request = null) + public function updateReturnsWithHttpInfo($id, $update_returns_request = null) { - $request = $this->updateReturnsRequest($id, $update_return_request); + $request = $this->updateReturnsRequest($id, $update_returns_request); try { $options = $this->createHttpClientOption(); @@ -1820,14 +1820,14 @@ public function updateReturnsWithHttpInfo($id, $update_return_request = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\DigitalRiver\ApiSdk\Model\ReturnResponse' === '\SplFileObject') { + if ('\DigitalRiver\ApiSdk\Model\ReturnsResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ReturnResponse', []), + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ReturnsResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1989,7 +1989,7 @@ public function updateReturnsWithHttpInfo($id, $update_return_request = null) ]; } - $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnsResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2008,7 +2008,7 @@ public function updateReturnsWithHttpInfo($id, $update_return_request = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\DigitalRiver\ApiSdk\Model\ReturnResponse', + '\DigitalRiver\ApiSdk\Model\ReturnsResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2128,14 +2128,14 @@ public function updateReturnsWithHttpInfo($id, $update_return_request = null) * Updates an existing return * * @param string $id Return ID (required) - * @param \DigitalRiver\ApiSdk\Model\UpdateReturnRequest $update_return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest $update_returns_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateReturnsAsync($id, $update_return_request = null) + public function updateReturnsAsync($id, $update_returns_request = null) { - return $this->updateReturnsAsyncWithHttpInfo($id, $update_return_request) + return $this->updateReturnsAsyncWithHttpInfo($id, $update_returns_request) ->then( function ($response) { return $response[0]; @@ -2149,15 +2149,15 @@ function ($response) { * Updates an existing return * * @param string $id Return ID (required) - * @param \DigitalRiver\ApiSdk\Model\UpdateReturnRequest $update_return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest $update_returns_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateReturnsAsyncWithHttpInfo($id, $update_return_request = null) + public function updateReturnsAsyncWithHttpInfo($id, $update_returns_request = null) { - $returnType = '\DigitalRiver\ApiSdk\Model\ReturnResponse'; - $request = $this->updateReturnsRequest($id, $update_return_request); + $returnType = '\DigitalRiver\ApiSdk\Model\ReturnsResponse'; + $request = $this->updateReturnsRequest($id, $update_returns_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2197,12 +2197,12 @@ function ($exception) { * Create request for operation 'updateReturns' * * @param string $id Return ID (required) - * @param \DigitalRiver\ApiSdk\Model\UpdateReturnRequest $update_return_request (optional) + * @param \DigitalRiver\ApiSdk\Model\UpdateReturnsRequest $update_returns_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updateReturnsRequest($id, $update_return_request = null) + protected function updateReturnsRequest($id, $update_returns_request = null) { // verify the required parameter 'id' is set if ($id === null || (is_array($id) && count($id) === 0)) { @@ -2231,8 +2231,8 @@ protected function updateReturnsRequest($id, $update_return_request = null) // body params $_tempBody = null; - if (isset($update_return_request)) { - $_tempBody = $update_return_request; + if (isset($update_returns_request)) { + $_tempBody = $update_returns_request; } if ($multipart) { diff --git a/lib/Api/ShippingLabelsApi.php b/lib/Api/ShippingLabelsApi.php new file mode 100644 index 0000000..388d29d --- /dev/null +++ b/lib/Api/ShippingLabelsApi.php @@ -0,0 +1,1194 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation createShippingLabel + * + * Returns shipping label + * + * @param \DigitalRiver\ApiSdk\Model\ShippingLabelRequest $shipping_label_request shipping_label_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ShippingLabelResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function createShippingLabel($shipping_label_request = null) + { + list($response) = $this->createShippingLabelWithHttpInfo($shipping_label_request); + return $response; + } + + /** + * Operation createShippingLabelWithHttpInfo + * + * Returns shipping label + * + * @param \DigitalRiver\ApiSdk\Model\ShippingLabelRequest $shipping_label_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ShippingLabelResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function createShippingLabelWithHttpInfo($shipping_label_request = null) + { + $request = $this->createShippingLabelRequest($shipping_label_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\ShippingLabelResponse' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ShippingLabelResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ShippingLabelResponse'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ShippingLabelResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation createShippingLabelAsync + * + * Returns shipping label + * + * @param \DigitalRiver\ApiSdk\Model\ShippingLabelRequest $shipping_label_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createShippingLabelAsync($shipping_label_request = null) + { + return $this->createShippingLabelAsyncWithHttpInfo($shipping_label_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation createShippingLabelAsyncWithHttpInfo + * + * Returns shipping label + * + * @param \DigitalRiver\ApiSdk\Model\ShippingLabelRequest $shipping_label_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createShippingLabelAsyncWithHttpInfo($shipping_label_request = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ShippingLabelResponse'; + $request = $this->createShippingLabelRequest($shipping_label_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'createShippingLabel' + * + * @param \DigitalRiver\ApiSdk\Model\ShippingLabelRequest $shipping_label_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function createShippingLabelRequest($shipping_label_request = null) + { + + $resourcePath = '/shipping-labels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($shipping_label_request)) { + $_tempBody = $shipping_label_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listShippingLabel + * + * Returns shipping label + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \DigitalRiver\ApiSdk\Model\ListShippingLabel|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors + */ + public function listShippingLabel($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null) + { + list($response) = $this->listShippingLabelWithHttpInfo($created_time, $ending_before, $starting_after, $limit, $ids, $order_id); + return $response; + } + + /** + * Operation listShippingLabelWithHttpInfo + * + * Returns shipping label + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \DigitalRiver\ApiSdk\Model\ListShippingLabel|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) + */ + public function listShippingLabelWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null) + { + $request = $this->listShippingLabelRequest($created_time, $ending_before, $starting_after, $limit, $ids, $order_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\DigitalRiver\ApiSdk\Model\ListShippingLabel' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\ListShippingLabel', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 405: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 406: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 408: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 500: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 504: + if ('\DigitalRiver\ApiSdk\Model\Errors' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, '\DigitalRiver\ApiSdk\Model\Errors', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\DigitalRiver\ApiSdk\Model\ListShippingLabel'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\ListShippingLabel', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listShippingLabelAsync + * + * Returns shipping label + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listShippingLabelAsync($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null) + { + return $this->listShippingLabelAsyncWithHttpInfo($created_time, $ending_before, $starting_after, $limit, $ids, $order_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listShippingLabelAsyncWithHttpInfo + * + * Returns shipping label + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listShippingLabelAsyncWithHttpInfo($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null) + { + $returnType = '\DigitalRiver\ApiSdk\Model\ListShippingLabel'; + $request = $this->listShippingLabelRequest($created_time, $ending_before, $starting_after, $limit, $ids, $order_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = (string) $responseBody; + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listShippingLabel' + * + * @param map[string,\DateTime] $created_time A filter on the list based on the **createdTime** field. The value can be a string with an ISO-8601 UTC format datetime or it can be a dictionary with the following options: - **eq**&mdash;return values where the createdTime field equals to this timestamp - **gt**&mdash;return values where the createdTime field is after this timestamp - **gte**&mdash;return values where the createdTime field is after or equal to this timestamp - **lt**&mdash;return values where the createdTime field is before this timestamp - **lte**&mdash;return values where the createdTime field is before or equal to this timestamp (optional) + * @param string $ending_before A cursor for use in pagination. The endingBefore parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with xyz your subsequent calls can include endingBefore=xyz in order to fetch the previous page of the list. (optional) + * @param string $starting_after A cursor for use in pagination. The startingAfter parameter is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with xyz, your subsequent calls can include startingAfter=xyz in order to fetch the next page of the list. (optional) + * @param int $limit A limit on the number of objects returned. Limit can range between 1 and 100, and the default is 10. (optional) + * @param string[] $ids Only return objects with these IDs. (optional) + * @param string $order_id The order to retrieve returns for. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listShippingLabelRequest($created_time = null, $ending_before = null, $starting_after = null, $limit = null, $ids = null, $order_id = null) + { + if ($limit !== null && $limit > 100) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ShippingLabelsApi.listShippingLabel, must be smaller than or equal to 100.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling ShippingLabelsApi.listShippingLabel, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/shipping-labels'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($created_time !== null) { + if('form' === 'deepObject' && is_array($created_time)) { + foreach($created_time as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['createdTime'] = $created_time; + } + } + // query params + if ($ending_before !== null) { + if('form' === 'form' && is_array($ending_before)) { + foreach($ending_before as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['endingBefore'] = $ending_before; + } + } + // query params + if ($starting_after !== null) { + if('form' === 'form' && is_array($starting_after)) { + foreach($starting_after as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['startingAfter'] = $starting_after; + } + } + // query params + if ($limit !== null) { + if('form' === 'form' && is_array($limit)) { + foreach($limit as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['limit'] = $limit; + } + } + // query params + if ($ids !== null) { + if('form' === 'form' && is_array($ids)) { + foreach($ids as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['ids'] = $ids; + } + } + // query params + if ($order_id !== null) { + if('form' === 'form' && is_array($order_id)) { + foreach($order_id as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['orderId'] = $order_id; + } + } + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Api/ShippingQuotesApi.php b/lib/Api/ShippingQuotesApi.php index 5f9455f..782ac12 100644 --- a/lib/Api/ShippingQuotesApi.php +++ b/lib/Api/ShippingQuotesApi.php @@ -105,7 +105,7 @@ public function getConfig() } /** - * Operation listShippingQuotes + * Operation postShippingQuotes * * Returns shipping quotes * @@ -115,14 +115,14 @@ public function getConfig() * @throws \InvalidArgumentException * @return \DigitalRiver\ApiSdk\Model\ShippingQuoteResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors */ - public function listShippingQuotes($shipping_quote_request = null) + public function postShippingQuotes($shipping_quote_request = null) { - list($response) = $this->listShippingQuotesWithHttpInfo($shipping_quote_request); + list($response) = $this->postShippingQuotesWithHttpInfo($shipping_quote_request); return $response; } /** - * Operation listShippingQuotesWithHttpInfo + * Operation postShippingQuotesWithHttpInfo * * Returns shipping quotes * @@ -132,9 +132,9 @@ public function listShippingQuotes($shipping_quote_request = null) * @throws \InvalidArgumentException * @return array of \DigitalRiver\ApiSdk\Model\ShippingQuoteResponse|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors|\DigitalRiver\ApiSdk\Model\Errors, HTTP status code, HTTP response headers (array of strings) */ - public function listShippingQuotesWithHttpInfo($shipping_quote_request = null) + public function postShippingQuotesWithHttpInfo($shipping_quote_request = null) { - $request = $this->listShippingQuotesRequest($shipping_quote_request); + $request = $this->postShippingQuotesRequest($shipping_quote_request); try { $options = $this->createHttpClientOption(); @@ -430,7 +430,7 @@ public function listShippingQuotesWithHttpInfo($shipping_quote_request = null) } /** - * Operation listShippingQuotesAsync + * Operation postShippingQuotesAsync * * Returns shipping quotes * @@ -439,9 +439,9 @@ public function listShippingQuotesWithHttpInfo($shipping_quote_request = null) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listShippingQuotesAsync($shipping_quote_request = null) + public function postShippingQuotesAsync($shipping_quote_request = null) { - return $this->listShippingQuotesAsyncWithHttpInfo($shipping_quote_request) + return $this->postShippingQuotesAsyncWithHttpInfo($shipping_quote_request) ->then( function ($response) { return $response[0]; @@ -450,7 +450,7 @@ function ($response) { } /** - * Operation listShippingQuotesAsyncWithHttpInfo + * Operation postShippingQuotesAsyncWithHttpInfo * * Returns shipping quotes * @@ -459,10 +459,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listShippingQuotesAsyncWithHttpInfo($shipping_quote_request = null) + public function postShippingQuotesAsyncWithHttpInfo($shipping_quote_request = null) { $returnType = '\DigitalRiver\ApiSdk\Model\ShippingQuoteResponse'; - $request = $this->listShippingQuotesRequest($shipping_quote_request); + $request = $this->postShippingQuotesRequest($shipping_quote_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -499,14 +499,14 @@ function ($exception) { } /** - * Create request for operation 'listShippingQuotes' + * Create request for operation 'postShippingQuotes' * * @param \DigitalRiver\ApiSdk\Model\ShippingQuoteRequest $shipping_quote_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listShippingQuotesRequest($shipping_quote_request = null) + protected function postShippingQuotesRequest($shipping_quote_request = null) { $resourcePath = '/shipping-quotes'; diff --git a/lib/Api/StoreCreditCalloutApi.php b/lib/Api/StoreCreditCalloutApi.php new file mode 100644 index 0000000..d0fd9d9 --- /dev/null +++ b/lib/Api/StoreCreditCalloutApi.php @@ -0,0 +1,444 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $host_index; + } + + /** + * Set the host index + * + * @param int Host index (required) + */ + public function setHostIndex($host_index) + { + $this->hostIndex = $host_index; + } + + /** + * Get the host index + * + * @return Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation storeCreditsCallout + * + * Store credit callout + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest $integration_store_credit_request integration_store_credit_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function storeCreditsCallout($integration_store_credit_request = null) + { + $this->storeCreditsCalloutWithHttpInfo($integration_store_credit_request); + } + + /** + * Operation storeCreditsCalloutWithHttpInfo + * + * Store credit callout + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest $integration_store_credit_request (optional) + * + * @throws \DigitalRiver\ApiSdk\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function storeCreditsCalloutWithHttpInfo($integration_store_credit_request = null) + { + $request = $this->storeCreditsCalloutRequest($integration_store_credit_request); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 405: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 406: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 408: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 500: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 504: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\DigitalRiver\ApiSdk\Model\Errors', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation storeCreditsCalloutAsync + * + * Store credit callout + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest $integration_store_credit_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function storeCreditsCalloutAsync($integration_store_credit_request = null) + { + return $this->storeCreditsCalloutAsyncWithHttpInfo($integration_store_credit_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation storeCreditsCalloutAsyncWithHttpInfo + * + * Store credit callout + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest $integration_store_credit_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function storeCreditsCalloutAsyncWithHttpInfo($integration_store_credit_request = null) + { + $returnType = ''; + $request = $this->storeCreditsCalloutRequest($integration_store_credit_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'storeCreditsCallout' + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationStoreCreditRequest $integration_store_credit_request (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function storeCreditsCalloutRequest($integration_store_credit_request = null) + { + + $resourcePath = '/checkouts/store-credits'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + // body params + $_tempBody = null; + if (isset($integration_store_credit_request)) { + $_tempBody = $integration_store_credit_request; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires Bearer authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + //$query = \GuzzleHttp\Psr7\build_query($queryParams); + //this is changed for supporting deepobject in url in the form /skus?createdTime[lt]=2020-09-22T12:09:44Z + $query = http_build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/lib/Configuration.php b/lib/Configuration.php index 2cb36c0..e5a0139 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -51,6 +51,13 @@ class Configuration */ protected $accessToken = ''; + /** + * Associate array to store custom headers + * + * @var string[] + */ + protected $customHeaders = []; + /** * Username for HTTP basic authentication * @@ -182,7 +189,30 @@ public function getAccessToken() { return $this->accessToken; } + + /** + * Sets the custom headers for troubleshooting + * + * @param array $customHeaders Custom headers for troubleshooting + * + * @return $this + */ + public function setCustomHeaders($customHeaders) + { + $this->customHeaders = $customHeaders; + return $this; + } + /** + * Gets the custom headers for troubleshooting + * + * @return array Custom headers for troubleshooting + */ + public function getCustomHeaders() + { + return $this->customHeaders; + } + /** * Sets the username for HTTP basic authentication * @@ -385,7 +415,7 @@ public static function toDebugReport() $report = 'PHP SDK (DigitalRiver\ApiSdk) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 2021' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 2022' . PHP_EOL; $report .= ' SDK Package Version: 1.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; @@ -461,6 +491,10 @@ public function getHostSettings() "url" => "https://api.digitalriver.com", "description" => "No description provided", ], + [ + "url" => "https://api.digitalriver.com", + "description" => "No description provided", + ], [ "url" => "https://virtserver.swaggerhub.com/pwehr/FulfillmentCancellations/1.0.0", "description" => "SwaggerHub API Auto Mocking", @@ -489,6 +523,10 @@ public function getHostSettings() "url" => "https://api.digitalriver.com", "description" => "No description provided", ], + [ + "url" => "/", + "description" => "No description provided", + ], [ "url" => "https://api.digitalriver.com", "description" => "No description provided", @@ -502,7 +540,7 @@ public function getHostSettings() "description" => "SwaggerHub API Auto Mocking", ], [ - "url" => "https://api.digitalriver.com", + "url" => "https://www.digitalriver.com/docs/digital-river-api-reference/", "description" => "No description provided", ], [ @@ -529,6 +567,10 @@ public function getHostSettings() "url" => "https://virtserver.swaggerhub.com/DigitalRiverX/Shipments/master", "description" => "SwaggerHub API Auto Mocking", ], + [ + "url" => "/", + "description" => "No description provided", + ], [ "url" => "https://virtserver.swaggerhub.com/DigitalRiverX/ShippingQuotes/master", "description" => "SwaggerHub API Auto Mocking", diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index 274e59e..461070e 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -18,6 +18,7 @@ namespace DigitalRiver\ApiSdk; use \Exception; +use DigitalRiver\ApiSdk\Configuration; /** * ApiException Class Doc Comment @@ -29,7 +30,12 @@ */ class HeaderSelector { + private $config; + public function __construct() { + $this->config = Configuration::getDefaultConfiguration(); + } + /** * @param string[] $accept * @param string[] $contentTypes @@ -45,6 +51,14 @@ public function selectHeaders($accept, $contentTypes) } $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + + $customHeaders = $this->config->getCustomHeaders(); + if ($customHeaders) { + $headers = array_merge( + $headers, + $customHeaders + ); + } return $headers; } diff --git a/lib/Model/Attributes.php b/lib/Model/Attributes.php new file mode 100644 index 0000000..ae3ba9c --- /dev/null +++ b/lib/Model/Attributes.php @@ -0,0 +1,416 @@ + 'string', + 'reg_account' => 'string', + 'reg_address' => 'string', + 'reg_bank' => 'string', + 'reg_phone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'invoice_title' => null, + 'reg_account' => null, + 'reg_address' => null, + 'reg_bank' => null, + 'reg_phone' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'invoice_title' => 'invoiceTitle', + 'reg_account' => 'regAccount', + 'reg_address' => 'regAddress', + 'reg_bank' => 'regBank', + 'reg_phone' => 'regPhone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'invoice_title' => 'setInvoiceTitle', + 'reg_account' => 'setRegAccount', + 'reg_address' => 'setRegAddress', + 'reg_bank' => 'setRegBank', + 'reg_phone' => 'setRegPhone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'invoice_title' => 'getInvoiceTitle', + 'reg_account' => 'getRegAccount', + 'reg_address' => 'getRegAddress', + 'reg_bank' => 'getRegBank', + 'reg_phone' => 'getRegPhone' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['invoice_title'] = isset($data['invoice_title']) ? $data['invoice_title'] : null; + $this->container['reg_account'] = isset($data['reg_account']) ? $data['reg_account'] : null; + $this->container['reg_address'] = isset($data['reg_address']) ? $data['reg_address'] : null; + $this->container['reg_bank'] = isset($data['reg_bank']) ? $data['reg_bank'] : null; + $this->container['reg_phone'] = isset($data['reg_phone']) ? $data['reg_phone'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets invoice_title + * + * @return string|null + */ + public function getInvoiceTitle() + { + return $this->container['invoice_title']; + } + + /** + * Sets invoice_title + * + * @param string|null $invoice_title The title of the invoice. + * + * @return $this + */ + public function setInvoiceTitle($invoice_title) + { + $this->container['invoice_title'] = $invoice_title; + + return $this; + } + + /** + * Gets reg_account + * + * @return string|null + */ + public function getRegAccount() + { + return $this->container['reg_account']; + } + + /** + * Sets reg_account + * + * @param string|null $reg_account The identifier for the account. + * + * @return $this + */ + public function setRegAccount($reg_account) + { + $this->container['reg_account'] = $reg_account; + + return $this; + } + + /** + * Gets reg_address + * + * @return string|null + */ + public function getRegAddress() + { + return $this->container['reg_address']; + } + + /** + * Sets reg_address + * + * @param string|null $reg_address The address associated to the invoice. + * + * @return $this + */ + public function setRegAddress($reg_address) + { + $this->container['reg_address'] = $reg_address; + + return $this; + } + + /** + * Gets reg_bank + * + * @return string|null + */ + public function getRegBank() + { + return $this->container['reg_bank']; + } + + /** + * Sets reg_bank + * + * @param string|null $reg_bank The name of the bank. + * + * @return $this + */ + public function setRegBank($reg_bank) + { + $this->container['reg_bank'] = $reg_bank; + + return $this; + } + + /** + * Gets reg_phone + * + * @return string|null + */ + public function getRegPhone() + { + return $this->container['reg_phone']; + } + + /** + * Sets reg_phone + * + * @param string|null $reg_phone The phone number associated to the invoice + * + * @return $this + */ + public function setRegPhone($reg_phone) + { + $this->container['reg_phone'] = $reg_phone; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Billing1.php b/lib/Model/Billing1.php new file mode 100644 index 0000000..178b7ac --- /dev/null +++ b/lib/Model/Billing1.php @@ -0,0 +1,450 @@ + '\DigitalRiver\ApiSdk\Model\Address', + 'name' => 'string', + 'phone' => 'string', + 'email' => 'string', + 'organization' => 'string', + 'additional_address_info' => '\DigitalRiver\ApiSdk\Model\AdditionalBillingAddressInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'address' => null, + 'name' => null, + 'phone' => null, + 'email' => 'email', + 'organization' => null, + 'additional_address_info' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'name' => 'name', + 'phone' => 'phone', + 'email' => 'email', + 'organization' => 'organization', + 'additional_address_info' => 'additionalAddressInfo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'name' => 'setName', + 'phone' => 'setPhone', + 'email' => 'setEmail', + 'organization' => 'setOrganization', + 'additional_address_info' => 'setAdditionalAddressInfo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'name' => 'getName', + 'phone' => 'getPhone', + 'email' => 'getEmail', + 'organization' => 'getOrganization', + 'additional_address_info' => 'getAdditionalAddressInfo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['organization'] = isset($data['organization']) ? $data['organization'] : null; + $this->container['additional_address_info'] = isset($data['additional_address_info']) ? $data['additional_address_info'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \DigitalRiver\ApiSdk\Model\Address + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \DigitalRiver\ApiSdk\Model\Address $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone phone + * + * @return $this + */ + public function setPhone($phone) + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization organization + * + * @return $this + */ + public function setOrganization($organization) + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets additional_address_info + * + * @return \DigitalRiver\ApiSdk\Model\AdditionalBillingAddressInfo|null + */ + public function getAdditionalAddressInfo() + { + return $this->container['additional_address_info']; + } + + /** + * Sets additional_address_info + * + * @param \DigitalRiver\ApiSdk\Model\AdditionalBillingAddressInfo|null $additional_address_info additional_address_info + * + * @return $this + */ + public function setAdditionalAddressInfo($additional_address_info) + { + $this->container['additional_address_info'] = $additional_address_info; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Business.php b/lib/Model/Business.php new file mode 100644 index 0000000..c60f921 --- /dev/null +++ b/lib/Model/Business.php @@ -0,0 +1,362 @@ + 'string', + 'attributes' => '\DigitalRiver\ApiSdk\Model\Attributes[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'attributes' => 'getAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPE_GENERAL = 'cn_business_general'; + const TYPE_SPECIAL = 'cn_business_special'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + $allowable = [ + self::TYPE_GENERAL, + self::TYPE_SPECIAL, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + + if (!is_null($this->container['type']) && !in_array(strtolower($this->container['type']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of invoice. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array(strtolower($type), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets attributes + * + * @return \DigitalRiver\ApiSdk\Model\Attributes[]|null + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \DigitalRiver\ApiSdk\Model\Attributes[]|null $attributes attributes + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Cancel.php b/lib/Model/Cancel.php index c4255de..2576e03 100644 --- a/lib/Model/Cancel.php +++ b/lib/Model/Cancel.php @@ -179,6 +179,7 @@ public function getModelName() } const STATE_PENDING = 'pending'; + const STATE_PENDING_INFORMATION = 'pending_information'; const STATE_COMPLETE = 'complete'; const STATE_FAILED = 'failed'; @@ -193,6 +194,7 @@ public function getStateAllowableValues() { $allowable = [ self::STATE_PENDING, + self::STATE_PENDING_INFORMATION, self::STATE_COMPLETE, self::STATE_FAILED, ]; diff --git a/lib/Model/Checkout.php b/lib/Model/Checkout.php index d549613..77ee968 100644 --- a/lib/Model/Checkout.php +++ b/lib/Model/Checkout.php @@ -70,6 +70,7 @@ class Checkout implements ModelInterface, ArrayAccess 'total_amount' => 'double', 'discount' => '\DigitalRiver\ApiSdk\Model\Discount', 'tax_identifiers' => '\DigitalRiver\ApiSdk\Model\TaxIdentifier[]', + 'invoice_attributes' => '\DigitalRiver\ApiSdk\Model\InvoiceAttributes', 'purchase_location' => '\DigitalRiver\ApiSdk\Model\PurchaseLocation', 'customer_type' => '\DigitalRiver\ApiSdk\Model\CustomerType', 'selling_entity' => '\DigitalRiver\ApiSdk\Model\SellingEntity', @@ -111,6 +112,7 @@ class Checkout implements ModelInterface, ArrayAccess 'total_amount' => 'double', 'discount' => null, 'tax_identifiers' => null, + 'invoice_attributes' => null, 'purchase_location' => null, 'customer_type' => null, 'selling_entity' => null, @@ -173,6 +175,7 @@ public static function openAPIFormats() 'total_amount' => 'totalAmount', 'discount' => 'discount', 'tax_identifiers' => 'taxIdentifiers', + 'invoice_attributes' => 'invoiceAttributes', 'purchase_location' => 'purchaseLocation', 'customer_type' => 'customerType', 'selling_entity' => 'sellingEntity', @@ -214,6 +217,7 @@ public static function openAPIFormats() 'total_amount' => 'setTotalAmount', 'discount' => 'setDiscount', 'tax_identifiers' => 'setTaxIdentifiers', + 'invoice_attributes' => 'setInvoiceAttributes', 'purchase_location' => 'setPurchaseLocation', 'customer_type' => 'setCustomerType', 'selling_entity' => 'setSellingEntity', @@ -255,6 +259,7 @@ public static function openAPIFormats() 'total_amount' => 'getTotalAmount', 'discount' => 'getDiscount', 'tax_identifiers' => 'getTaxIdentifiers', + 'invoice_attributes' => 'getInvoiceAttributes', 'purchase_location' => 'getPurchaseLocation', 'customer_type' => 'getCustomerType', 'selling_entity' => 'getSellingEntity', @@ -350,6 +355,7 @@ public function __construct(array $data = null) $this->container['total_amount'] = isset($data['total_amount']) ? $data['total_amount'] : null; $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; $this->container['tax_identifiers'] = isset($data['tax_identifiers']) ? $data['tax_identifiers'] : null; + $this->container['invoice_attributes'] = isset($data['invoice_attributes']) ? $data['invoice_attributes'] : null; $this->container['purchase_location'] = isset($data['purchase_location']) ? $data['purchase_location'] : null; $this->container['customer_type'] = isset($data['customer_type']) ? $data['customer_type'] : null; $this->container['selling_entity'] = isset($data['selling_entity']) ? $data['selling_entity'] : null; @@ -961,6 +967,30 @@ public function setTaxIdentifiers($tax_identifiers) return $this; } + /** + * Gets invoice_attributes + * + * @return \DigitalRiver\ApiSdk\Model\InvoiceAttributes|null + */ + public function getInvoiceAttributes() + { + return $this->container['invoice_attributes']; + } + + /** + * Sets invoice_attributes + * + * @param \DigitalRiver\ApiSdk\Model\InvoiceAttributes|null $invoice_attributes invoice_attributes + * + * @return $this + */ + public function setInvoiceAttributes($invoice_attributes) + { + $this->container['invoice_attributes'] = $invoice_attributes; + + return $this; + } + /** * Gets purchase_location * diff --git a/lib/Model/CheckoutLinkDetails.php b/lib/Model/CheckoutLinkDetails.php new file mode 100644 index 0000000..3bdb3dc --- /dev/null +++ b/lib/Model/CheckoutLinkDetails.php @@ -0,0 +1,446 @@ + 'string', + 'link' => 'string', + 'created_time' => '\DateTime', + 'expired' => 'bool', + 'expires_time' => '\DateTime', + 'checkout_session' => '\DigitalRiver\ApiSdk\Model\DropInCheckoutSession' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'link' => null, + 'created_time' => 'date-time', + 'expired' => null, + 'expires_time' => 'date-time', + 'checkout_session' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'link' => 'link', + 'created_time' => 'createdTime', + 'expired' => 'expired', + 'expires_time' => 'expiresTime', + 'checkout_session' => 'checkoutSession' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'link' => 'setLink', + 'created_time' => 'setCreatedTime', + 'expired' => 'setExpired', + 'expires_time' => 'setExpiresTime', + 'checkout_session' => 'setCheckoutSession' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'link' => 'getLink', + 'created_time' => 'getCreatedTime', + 'expired' => 'getExpired', + 'expires_time' => 'getExpiresTime', + 'checkout_session' => 'getCheckoutSession' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['link'] = isset($data['link']) ? $data['link'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['expired'] = isset($data['expired']) ? $data['expired'] : null; + $this->container['expires_time'] = isset($data['expires_time']) ? $data['expires_time'] : null; + $this->container['checkout_session'] = isset($data['checkout_session']) ? $data['checkout_session'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The link identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link The domain of the hosted link + * + * @return $this + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time Time when the link was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets expired + * + * @return bool|null + */ + public function getExpired() + { + return $this->container['expired']; + } + + /** + * Sets expired + * + * @param bool|null $expired Whether this link has already expired. + * + * @return $this + */ + public function setExpired($expired) + { + $this->container['expired'] = $expired; + + return $this; + } + + /** + * Gets expires_time + * + * @return \DateTime|null + */ + public function getExpiresTime() + { + return $this->container['expires_time']; + } + + /** + * Sets expires_time + * + * @param \DateTime|null $expires_time Time at which the link expires. + * + * @return $this + */ + public function setExpiresTime($expires_time) + { + $this->container['expires_time'] = $expires_time; + + return $this; + } + + /** + * Gets checkout_session + * + * @return \DigitalRiver\ApiSdk\Model\DropInCheckoutSession|null + */ + public function getCheckoutSession() + { + return $this->container['checkout_session']; + } + + /** + * Sets checkout_session + * + * @param \DigitalRiver\ApiSdk\Model\DropInCheckoutSession|null $checkout_session checkout_session + * + * @return $this + */ + public function setCheckoutSession($checkout_session) + { + $this->container['checkout_session'] = $checkout_session; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CheckoutRequest.php b/lib/Model/CheckoutRequest.php index f75496f..b6e6bd6 100644 --- a/lib/Model/CheckoutRequest.php +++ b/lib/Model/CheckoutRequest.php @@ -51,6 +51,7 @@ class CheckoutRequest implements ModelInterface, ArrayAccess 'currency' => 'string', 'email' => 'string', 'locale' => 'string', + 'invoice_attribute_id' => 'string', 'application_id' => 'string', 'browser_ip' => 'string', 'tax_identifiers' => '\DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]', @@ -81,6 +82,7 @@ class CheckoutRequest implements ModelInterface, ArrayAccess 'currency' => null, 'email' => 'email', 'locale' => null, + 'invoice_attribute_id' => null, 'application_id' => null, 'browser_ip' => null, 'tax_identifiers' => null, @@ -132,6 +134,7 @@ public static function openAPIFormats() 'currency' => 'currency', 'email' => 'email', 'locale' => 'locale', + 'invoice_attribute_id' => 'invoiceAttributeId', 'application_id' => 'applicationId', 'browser_ip' => 'browserIp', 'tax_identifiers' => 'taxIdentifiers', @@ -162,6 +165,7 @@ public static function openAPIFormats() 'currency' => 'setCurrency', 'email' => 'setEmail', 'locale' => 'setLocale', + 'invoice_attribute_id' => 'setInvoiceAttributeId', 'application_id' => 'setApplicationId', 'browser_ip' => 'setBrowserIp', 'tax_identifiers' => 'setTaxIdentifiers', @@ -192,6 +196,7 @@ public static function openAPIFormats() 'currency' => 'getCurrency', 'email' => 'getEmail', 'locale' => 'getLocale', + 'invoice_attribute_id' => 'getInvoiceAttributeId', 'application_id' => 'getApplicationId', 'browser_ip' => 'getBrowserIp', 'tax_identifiers' => 'getTaxIdentifiers', @@ -276,6 +281,7 @@ public function __construct(array $data = null) $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['invoice_attribute_id'] = isset($data['invoice_attribute_id']) ? $data['invoice_attribute_id'] : null; $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; $this->container['tax_identifiers'] = isset($data['tax_identifiers']) ? $data['tax_identifiers'] : null; @@ -445,6 +451,30 @@ public function setLocale($locale) return $this; } + /** + * Gets invoice_attribute_id + * + * @return string|null + */ + public function getInvoiceAttributeId() + { + return $this->container['invoice_attribute_id']; + } + + /** + * Sets invoice_attribute_id + * + * @param string|null $invoice_attribute_id The unique identfier of the invoice attribute. + * + * @return $this + */ + public function setInvoiceAttributeId($invoice_attribute_id) + { + $this->container['invoice_attribute_id'] = $invoice_attribute_id; + + return $this; + } + /** * Gets application_id * diff --git a/lib/Model/CheckoutTaxIdentifierRequest.php b/lib/Model/CheckoutTaxIdentifierRequest.php index 345e015..9984fb6 100644 --- a/lib/Model/CheckoutTaxIdentifierRequest.php +++ b/lib/Model/CheckoutTaxIdentifierRequest.php @@ -206,7 +206,7 @@ public function getId() /** * Sets id * - * @param string|null $id Unique identifier for a tax identifier + * @param string|null $id The unique identifier of a tax identifier. * * @return $this */ diff --git a/lib/Model/CountrySpecification.php b/lib/Model/CountrySpecification.php index f745bc9..4328360 100644 --- a/lib/Model/CountrySpecification.php +++ b/lib/Model/CountrySpecification.php @@ -53,6 +53,8 @@ class CountrySpecification implements ModelInterface, ArrayAccess 'billing_address_only_schema' => 'string', 'individual_tax_identifiers_schemas' => 'string[]', 'business_tax_identifiers_schemas' => 'string[]', + 'tax_identifiers_info' => '\DigitalRiver\ApiSdk\Model\TaxIdentifiersInfo', + 'invoice_attribute_info' => '\DigitalRiver\ApiSdk\Model\InvoiceAttributeInfo', 'live_mode' => 'bool' ]; @@ -69,6 +71,8 @@ class CountrySpecification implements ModelInterface, ArrayAccess 'billing_address_only_schema' => null, 'individual_tax_identifiers_schemas' => null, 'business_tax_identifiers_schemas' => null, + 'tax_identifiers_info' => null, + 'invoice_attribute_info' => null, 'live_mode' => null ]; @@ -106,6 +110,8 @@ public static function openAPIFormats() 'billing_address_only_schema' => 'billingAddressOnlySchema', 'individual_tax_identifiers_schemas' => 'individualTaxIdentifiersSchemas', 'business_tax_identifiers_schemas' => 'businessTaxIdentifiersSchemas', + 'tax_identifiers_info' => 'taxIdentifiersInfo', + 'invoice_attribute_info' => 'invoiceAttributeInfo', 'live_mode' => 'liveMode' ]; @@ -122,6 +128,8 @@ public static function openAPIFormats() 'billing_address_only_schema' => 'setBillingAddressOnlySchema', 'individual_tax_identifiers_schemas' => 'setIndividualTaxIdentifiersSchemas', 'business_tax_identifiers_schemas' => 'setBusinessTaxIdentifiersSchemas', + 'tax_identifiers_info' => 'setTaxIdentifiersInfo', + 'invoice_attribute_info' => 'setInvoiceAttributeInfo', 'live_mode' => 'setLiveMode' ]; @@ -138,6 +146,8 @@ public static function openAPIFormats() 'billing_address_only_schema' => 'getBillingAddressOnlySchema', 'individual_tax_identifiers_schemas' => 'getIndividualTaxIdentifiersSchemas', 'business_tax_identifiers_schemas' => 'getBusinessTaxIdentifiersSchemas', + 'tax_identifiers_info' => 'getTaxIdentifiersInfo', + 'invoice_attribute_info' => 'getInvoiceAttributeInfo', 'live_mode' => 'getLiveMode' ]; @@ -208,6 +218,8 @@ public function __construct(array $data = null) $this->container['billing_address_only_schema'] = isset($data['billing_address_only_schema']) ? $data['billing_address_only_schema'] : null; $this->container['individual_tax_identifiers_schemas'] = isset($data['individual_tax_identifiers_schemas']) ? $data['individual_tax_identifiers_schemas'] : null; $this->container['business_tax_identifiers_schemas'] = isset($data['business_tax_identifiers_schemas']) ? $data['business_tax_identifiers_schemas'] : null; + $this->container['tax_identifiers_info'] = isset($data['tax_identifiers_info']) ? $data['tax_identifiers_info'] : null; + $this->container['invoice_attribute_info'] = isset($data['invoice_attribute_info']) ? $data['invoice_attribute_info'] : null; $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; } @@ -403,6 +415,54 @@ public function setBusinessTaxIdentifiersSchemas($business_tax_identifiers_schem return $this; } + /** + * Gets tax_identifiers_info + * + * @return \DigitalRiver\ApiSdk\Model\TaxIdentifiersInfo|null + */ + public function getTaxIdentifiersInfo() + { + return $this->container['tax_identifiers_info']; + } + + /** + * Sets tax_identifiers_info + * + * @param \DigitalRiver\ApiSdk\Model\TaxIdentifiersInfo|null $tax_identifiers_info tax_identifiers_info + * + * @return $this + */ + public function setTaxIdentifiersInfo($tax_identifiers_info) + { + $this->container['tax_identifiers_info'] = $tax_identifiers_info; + + return $this; + } + + /** + * Gets invoice_attribute_info + * + * @return \DigitalRiver\ApiSdk\Model\InvoiceAttributeInfo|null + */ + public function getInvoiceAttributeInfo() + { + return $this->container['invoice_attribute_info']; + } + + /** + * Sets invoice_attribute_info + * + * @param \DigitalRiver\ApiSdk\Model\InvoiceAttributeInfo|null $invoice_attribute_info invoice_attribute_info + * + * @return $this + */ + public function setInvoiceAttributeInfo($invoice_attribute_info) + { + $this->container['invoice_attribute_info'] = $invoice_attribute_info; + + return $this; + } + /** * Gets live_mode * diff --git a/lib/Model/CreateDropInCheckoutTokenResponse.php b/lib/Model/CreateDropInCheckoutTokenResponse.php new file mode 100644 index 0000000..e96bb62 --- /dev/null +++ b/lib/Model/CreateDropInCheckoutTokenResponse.php @@ -0,0 +1,356 @@ + 'string', + 'link' => 'string', + 'live_mode' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'link' => null, + 'live_mode' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'link' => 'link', + 'live_mode' => 'liveMode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'link' => 'setLink', + 'live_mode' => 'setLiveMode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'link' => 'getLink', + 'live_mode' => 'getLiveMode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['link'] = isset($data['link']) ? $data['link'] : null; + $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique checkout session identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link The domain of the hosted link. + * + * @return $this + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets live_mode + * + * @return bool|null + */ + public function getLiveMode() + { + return $this->container['live_mode']; + } + + /** + * Sets live_mode + * + * @param bool|null $live_mode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLiveMode($live_mode) + { + $this->container['live_mode'] = $live_mode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/CreateReturnsResponse.php b/lib/Model/CreateReturnsResponse.php new file mode 100644 index 0000000..7f1442d --- /dev/null +++ b/lib/Model/CreateReturnsResponse.php @@ -0,0 +1,632 @@ + 'string', + 'created_time' => '\DateTime', + 'order_id' => 'string', + 'currency' => 'string', + 'items' => '\DigitalRiver\ApiSdk\Model\ReturnsItem[]', + 'reason' => 'string', + 'state' => 'string', + 'location' => '\DigitalRiver\ApiSdk\Model\ReturnsLocation', + 'livemode' => 'bool', + 'metadata' => 'map[string,AnyType]', + 'refund_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'created_time' => 'date-time', + 'order_id' => null, + 'currency' => null, + 'items' => null, + 'reason' => null, + 'state' => null, + 'location' => null, + 'livemode' => null, + 'metadata' => null, + 'refund_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'created_time' => 'createdTime', + 'order_id' => 'orderId', + 'currency' => 'currency', + 'items' => 'items', + 'reason' => 'reason', + 'state' => 'state', + 'location' => 'location', + 'livemode' => 'livemode', + 'metadata' => 'metadata', + 'refund_ids' => 'refundIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'created_time' => 'setCreatedTime', + 'order_id' => 'setOrderId', + 'currency' => 'setCurrency', + 'items' => 'setItems', + 'reason' => 'setReason', + 'state' => 'setState', + 'location' => 'setLocation', + 'livemode' => 'setLivemode', + 'metadata' => 'setMetadata', + 'refund_ids' => 'setRefundIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'created_time' => 'getCreatedTime', + 'order_id' => 'getOrderId', + 'currency' => 'getCurrency', + 'items' => 'getItems', + 'reason' => 'getReason', + 'state' => 'getState', + 'location' => 'getLocation', + 'livemode' => 'getLivemode', + 'metadata' => 'getMetadata', + 'refund_ids' => 'getRefundIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_CREATED = 'created'; + const STATE_ACCEPTED = 'accepted'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_CREATED, + self::STATE_ACCEPTED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['livemode'] = isset($data['livemode']) ? $data['livemode'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + $this->container['refund_ids'] = isset($data['refund_ids']) ? $data['refund_ids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the return. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time Time at which the return was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id The unique identifier of the order. + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency Three-letter ISO currency code. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsItem[]|null $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for the return. + * + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state Enumeration indicating the state of the return. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets location + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsLocation|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsLocation|null $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets livemode + * + * @return bool|null + */ + public function getLivemode() + { + return $this->container['livemode']; + } + + /** + * Sets livemode + * + * @param bool|null $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLivemode($livemode) + { + $this->container['livemode'] = $livemode; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets refund_ids + * + * @return string[]|null + */ + public function getRefundIds() + { + return $this->container['refund_ids']; + } + + /** + * Sets refund_ids + * + * @param string[]|null $refund_ids refund_ids + * + * @return $this + */ + public function setRefundIds($refund_ids) + { + $this->container['refund_ids'] = $refund_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DropInCheckoutLink.php b/lib/Model/DropInCheckoutLink.php new file mode 100644 index 0000000..760c91f --- /dev/null +++ b/lib/Model/DropInCheckoutLink.php @@ -0,0 +1,296 @@ + 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'session_id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'session_id' => 'sessionId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'session_id' => 'setSessionId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'session_id' => 'getSessionId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['session_id'] = isset($data['session_id']) ? $data['session_id'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id The session identifier. + * + * @return $this + */ + public function setSessionId($session_id) + { + $this->container['session_id'] = $session_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DropInCheckoutLinkResponse.php b/lib/Model/DropInCheckoutLinkResponse.php new file mode 100644 index 0000000..06232ca --- /dev/null +++ b/lib/Model/DropInCheckoutLinkResponse.php @@ -0,0 +1,356 @@ + 'string', + 'session_id' => 'string', + 'link' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'session_id' => null, + 'link' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'session_id' => 'sessionId', + 'link' => 'link' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'session_id' => 'setSessionId', + 'link' => 'setLink' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'session_id' => 'getSessionId', + 'link' => 'getLink' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['session_id'] = isset($data['session_id']) ? $data['session_id'] : null; + $this->container['link'] = isset($data['link']) ? $data['link'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The link identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets session_id + * + * @return string|null + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string|null $session_id The session identifier. + * + * @return $this + */ + public function setSessionId($session_id) + { + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets link + * + * @return string|null + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param string|null $link The domain of the hosted link + * + * @return $this + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DropInCheckoutRequest.php b/lib/Model/DropInCheckoutRequest.php new file mode 100644 index 0000000..133659a --- /dev/null +++ b/lib/Model/DropInCheckoutRequest.php @@ -0,0 +1,1018 @@ + 'string', + 'currency' => 'string', + 'customer_id' => 'string', + 'language' => 'string', + 'email' => 'string', + 'tax_inclusive' => 'bool', + 'items' => '\DigitalRiver\ApiSdk\Model\SkuItemRequest[]', + 'ship_to' => '\DigitalRiver\ApiSdk\Model\IntegrationAddress', + 'bill_to' => '\DigitalRiver\ApiSdk\Model\IntegrationAddress', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', + 'discount' => '\DigitalRiver\ApiSdk\Model\Discount', + 'shipping_discount' => '\DigitalRiver\ApiSdk\Model\Discount', + 'browser_ip' => 'string', + 'application_id' => 'string', + 'locale' => 'string', + 'customer_type' => '\DigitalRiver\ApiSdk\Model\CustomerType', + 'charge_type' => '\DigitalRiver\ApiSdk\Model\ChargeType', + 'tax_identifiers' => '\DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]', + 'style' => 'object', + 'options' => '\DigitalRiver\ApiSdk\Model\DropInOptionsRequest', + 'redirects' => '\DigitalRiver\ApiSdk\Model\Redirects', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'upstream_id' => null, + 'currency' => null, + 'customer_id' => null, + 'language' => null, + 'email' => 'email', + 'tax_inclusive' => null, + 'items' => null, + 'ship_to' => null, + 'bill_to' => null, + 'ship_from' => null, + 'discount' => null, + 'shipping_discount' => null, + 'browser_ip' => null, + 'application_id' => null, + 'locale' => null, + 'customer_type' => null, + 'charge_type' => null, + 'tax_identifiers' => null, + 'style' => null, + 'options' => null, + 'redirects' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'upstream_id' => 'upstreamId', + 'currency' => 'currency', + 'customer_id' => 'customerId', + 'language' => 'language', + 'email' => 'email', + 'tax_inclusive' => 'taxInclusive', + 'items' => 'items', + 'ship_to' => 'shipTo', + 'bill_to' => 'billTo', + 'ship_from' => 'shipFrom', + 'discount' => 'discount', + 'shipping_discount' => 'shippingDiscount', + 'browser_ip' => 'browserIp', + 'application_id' => 'applicationId', + 'locale' => 'locale', + 'customer_type' => 'customerType', + 'charge_type' => 'chargeType', + 'tax_identifiers' => 'taxIdentifiers', + 'style' => 'style', + 'options' => 'options', + 'redirects' => 'redirects', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'upstream_id' => 'setUpstreamId', + 'currency' => 'setCurrency', + 'customer_id' => 'setCustomerId', + 'language' => 'setLanguage', + 'email' => 'setEmail', + 'tax_inclusive' => 'setTaxInclusive', + 'items' => 'setItems', + 'ship_to' => 'setShipTo', + 'bill_to' => 'setBillTo', + 'ship_from' => 'setShipFrom', + 'discount' => 'setDiscount', + 'shipping_discount' => 'setShippingDiscount', + 'browser_ip' => 'setBrowserIp', + 'application_id' => 'setApplicationId', + 'locale' => 'setLocale', + 'customer_type' => 'setCustomerType', + 'charge_type' => 'setChargeType', + 'tax_identifiers' => 'setTaxIdentifiers', + 'style' => 'setStyle', + 'options' => 'setOptions', + 'redirects' => 'setRedirects', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'upstream_id' => 'getUpstreamId', + 'currency' => 'getCurrency', + 'customer_id' => 'getCustomerId', + 'language' => 'getLanguage', + 'email' => 'getEmail', + 'tax_inclusive' => 'getTaxInclusive', + 'items' => 'getItems', + 'ship_to' => 'getShipTo', + 'bill_to' => 'getBillTo', + 'ship_from' => 'getShipFrom', + 'discount' => 'getDiscount', + 'shipping_discount' => 'getShippingDiscount', + 'browser_ip' => 'getBrowserIp', + 'application_id' => 'getApplicationId', + 'locale' => 'getLocale', + 'customer_type' => 'getCustomerType', + 'charge_type' => 'getChargeType', + 'tax_identifiers' => 'getTaxIdentifiers', + 'style' => 'getStyle', + 'options' => 'getOptions', + 'redirects' => 'getRedirects', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const LANGUAGE_AR = 'ar'; + const LANGUAGE_CS = 'cs'; + const LANGUAGE_DA = 'da'; + const LANGUAGE_DE = 'de'; + const LANGUAGE_EL = 'el'; + const LANGUAGE_EN_GB = 'en-gb'; + const LANGUAGE_EN = 'en'; + const LANGUAGE_EN_US = 'en-us'; + const LANGUAGE_ES = 'es'; + const LANGUAGE_ES_419 = 'es-419'; + const LANGUAGE_FI = 'fi'; + const LANGUAGE_FR_CA = 'fr-ca'; + const LANGUAGE_FR = 'fr'; + const LANGUAGE_HU = 'hu'; + const LANGUAGE_IT = 'it'; + const LANGUAGE_JA = 'ja'; + const LANGUAGE_KO = 'ko'; + const LANGUAGE_NL = 'nl'; + const LANGUAGE_NO = 'no'; + const LANGUAGE_PL = 'pl'; + const LANGUAGE_PT_BR = 'pt-br'; + const LANGUAGE_PT = 'pt'; + const LANGUAGE_RU = 'ru'; + const LANGUAGE_SK = 'sk'; + const LANGUAGE_SV = 'sv'; + const LANGUAGE_TH = 'th'; + const LANGUAGE_TR = 'tr'; + const LANGUAGE_ZH = 'zh'; + const LANGUAGE_ZH_HK = 'zh-hk'; + const LANGUAGE_ZH_TW = 'zh-tw'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLanguageAllowableValues() + { + $allowable = [ + self::LANGUAGE_AR, + self::LANGUAGE_CS, + self::LANGUAGE_DA, + self::LANGUAGE_DE, + self::LANGUAGE_EL, + self::LANGUAGE_EN_GB, + self::LANGUAGE_EN, + self::LANGUAGE_EN_US, + self::LANGUAGE_ES, + self::LANGUAGE_ES_419, + self::LANGUAGE_FI, + self::LANGUAGE_FR_CA, + self::LANGUAGE_FR, + self::LANGUAGE_HU, + self::LANGUAGE_IT, + self::LANGUAGE_JA, + self::LANGUAGE_KO, + self::LANGUAGE_NL, + self::LANGUAGE_NO, + self::LANGUAGE_PL, + self::LANGUAGE_PT_BR, + self::LANGUAGE_PT, + self::LANGUAGE_RU, + self::LANGUAGE_SK, + self::LANGUAGE_SV, + self::LANGUAGE_TH, + self::LANGUAGE_TR, + self::LANGUAGE_ZH, + self::LANGUAGE_ZH_HK, + self::LANGUAGE_ZH_TW, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['upstream_id'] = isset($data['upstream_id']) ? $data['upstream_id'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['tax_inclusive'] = isset($data['tax_inclusive']) ? $data['tax_inclusive'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['ship_to'] = isset($data['ship_to']) ? $data['ship_to'] : null; + $this->container['bill_to'] = isset($data['bill_to']) ? $data['bill_to'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; + $this->container['shipping_discount'] = isset($data['shipping_discount']) ? $data['shipping_discount'] : null; + $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; + $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; + $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['customer_type'] = isset($data['customer_type']) ? $data['customer_type'] : null; + $this->container['charge_type'] = isset($data['charge_type']) ? $data['charge_type'] : null; + $this->container['tax_identifiers'] = isset($data['tax_identifiers']) ? $data['tax_identifiers'] : null; + $this->container['style'] = isset($data['style']) ? $data['style'] : null; + $this->container['options'] = isset($data['options']) ? $data['options'] : null; + $this->container['redirects'] = isset($data['redirects']) ? $data['redirects'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getLanguageAllowableValues(); + + if (!is_null($this->container['language']) && !in_array(strtolower($this->container['language']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'language', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets upstream_id + * + * @return string|null + */ + public function getUpstreamId() + { + return $this->container['upstream_id']; + } + + /** + * Sets upstream_id + * + * @param string|null $upstream_id The upstream checkout identifier if it is different from the Digital River checkout identifier. + * + * @return $this + */ + public function setUpstreamId($upstream_id) + { + $this->container['upstream_id'] = $upstream_id; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency A three-letter ISO currency code. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id The identifier of a registered customer. + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language Language to be used by library. + * + * @return $this + */ + public function setLanguage($language) + { + $allowedValues = $this->getLanguageAllowableValues(); + if (!is_null($language) && !in_array(strtolower($language), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'language', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The customer's email address. + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets tax_inclusive + * + * @return bool|null + */ + public function getTaxInclusive() + { + return $this->container['tax_inclusive']; + } + + /** + * Sets tax_inclusive + * + * @param bool|null $tax_inclusive tax_inclusive + * + * @return $this + */ + public function setTaxInclusive($tax_inclusive) + { + $this->container['tax_inclusive'] = $tax_inclusive; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\SkuItemRequest[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\SkuItemRequest[]|null $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets ship_to + * + * @return \DigitalRiver\ApiSdk\Model\IntegrationAddress|null + */ + public function getShipTo() + { + return $this->container['ship_to']; + } + + /** + * Sets ship_to + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationAddress|null $ship_to ship_to + * + * @return $this + */ + public function setShipTo($ship_to) + { + $this->container['ship_to'] = $ship_to; + + return $this; + } + + /** + * Gets bill_to + * + * @return \DigitalRiver\ApiSdk\Model\IntegrationAddress|null + */ + public function getBillTo() + { + return $this->container['bill_to']; + } + + /** + * Sets bill_to + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationAddress|null $bill_to bill_to + * + * @return $this + */ + public function setBillTo($bill_to) + { + $this->container['bill_to'] = $bill_to; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\ShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\ShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + + /** + * Gets discount + * + * @return \DigitalRiver\ApiSdk\Model\Discount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \DigitalRiver\ApiSdk\Model\Discount|null $discount discount + * + * @return $this + */ + public function setDiscount($discount) + { + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets shipping_discount + * + * @return \DigitalRiver\ApiSdk\Model\Discount|null + */ + public function getShippingDiscount() + { + return $this->container['shipping_discount']; + } + + /** + * Sets shipping_discount + * + * @param \DigitalRiver\ApiSdk\Model\Discount|null $shipping_discount shipping_discount + * + * @return $this + */ + public function setShippingDiscount($shipping_discount) + { + $this->container['shipping_discount'] = $shipping_discount; + + return $this; + } + + /** + * Gets browser_ip + * + * @return string|null + */ + public function getBrowserIp() + { + return $this->container['browser_ip']; + } + + /** + * Sets browser_ip + * + * @param string|null $browser_ip The IP address of the browser used by the customer when checking out. + * + * @return $this + */ + public function setBrowserIp($browser_ip) + { + $this->container['browser_ip'] = $browser_ip; + + return $this; + } + + /** + * Gets application_id + * + * @return string|null + */ + public function getApplicationId() + { + return $this->container['application_id']; + } + + /** + * Sets application_id + * + * @param string|null $application_id An arbitrary identifier that can be used to track the application type. + * + * @return $this + */ + public function setApplicationId($application_id) + { + $this->container['application_id'] = $application_id; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. + * + * @return $this + */ + public function setLocale($locale) + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets customer_type + * + * @return \DigitalRiver\ApiSdk\Model\CustomerType|null + */ + public function getCustomerType() + { + return $this->container['customer_type']; + } + + /** + * Sets customer_type + * + * @param \DigitalRiver\ApiSdk\Model\CustomerType|null $customer_type customer_type + * + * @return $this + */ + public function setCustomerType($customer_type) + { + $this->container['customer_type'] = $customer_type; + + return $this; + } + + /** + * Gets charge_type + * + * @return \DigitalRiver\ApiSdk\Model\ChargeType|null + */ + public function getChargeType() + { + return $this->container['charge_type']; + } + + /** + * Sets charge_type + * + * @param \DigitalRiver\ApiSdk\Model\ChargeType|null $charge_type charge_type + * + * @return $this + */ + public function setChargeType($charge_type) + { + $this->container['charge_type'] = $charge_type; + + return $this; + } + + /** + * Gets tax_identifiers + * + * @return \DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]|null + */ + public function getTaxIdentifiers() + { + return $this->container['tax_identifiers']; + } + + /** + * Sets tax_identifiers + * + * @param \DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]|null $tax_identifiers tax_identifiers + * + * @return $this + */ + public function setTaxIdentifiers($tax_identifiers) + { + $this->container['tax_identifiers'] = $tax_identifiers; + + return $this; + } + + /** + * Gets style + * + * @return object|null + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param object|null $style Style for drop-in + * + * @return $this + */ + public function setStyle($style) + { + $this->container['style'] = $style; + + return $this; + } + + /** + * Gets options + * + * @return \DigitalRiver\ApiSdk\Model\DropInOptionsRequest|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param \DigitalRiver\ApiSdk\Model\DropInOptionsRequest|null $options options + * + * @return $this + */ + public function setOptions($options) + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets redirects + * + * @return \DigitalRiver\ApiSdk\Model\Redirects|null + */ + public function getRedirects() + { + return $this->container['redirects']; + } + + /** + * Sets redirects + * + * @param \DigitalRiver\ApiSdk\Model\Redirects|null $redirects redirects + * + * @return $this + */ + public function setRedirects($redirects) + { + $this->container['redirects'] = $redirects; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DropInCheckoutSession.php b/lib/Model/DropInCheckoutSession.php new file mode 100644 index 0000000..ad8de0d --- /dev/null +++ b/lib/Model/DropInCheckoutSession.php @@ -0,0 +1,746 @@ + 'string', + 'currency' => 'string', + 'tax_inclusive' => 'bool', + 'items' => '\DigitalRiver\ApiSdk\Model\SkuItemRequest[]', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', + 'discount' => '\DigitalRiver\ApiSdk\Model\Discount', + 'shipping_discount' => '\DigitalRiver\ApiSdk\Model\Discount', + 'browser_ip' => 'string', + 'application_id' => 'string', + 'locale' => 'string', + 'customer_type' => '\DigitalRiver\ApiSdk\Model\CustomerType', + 'charge_type' => '\DigitalRiver\ApiSdk\Model\ChargeType', + 'style' => 'object', + 'options' => '\DigitalRiver\ApiSdk\Model\DropInOptionsRequest', + 'redirects' => '\DigitalRiver\ApiSdk\Model\Redirects', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'upstream_id' => null, + 'currency' => null, + 'tax_inclusive' => null, + 'items' => null, + 'ship_from' => null, + 'discount' => null, + 'shipping_discount' => null, + 'browser_ip' => null, + 'application_id' => null, + 'locale' => null, + 'customer_type' => null, + 'charge_type' => null, + 'style' => null, + 'options' => null, + 'redirects' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'upstream_id' => 'upstreamId', + 'currency' => 'currency', + 'tax_inclusive' => 'taxInclusive', + 'items' => 'items', + 'ship_from' => 'shipFrom', + 'discount' => 'discount', + 'shipping_discount' => 'shippingDiscount', + 'browser_ip' => 'browserIp', + 'application_id' => 'applicationId', + 'locale' => 'locale', + 'customer_type' => 'customerType', + 'charge_type' => 'chargeType', + 'style' => 'style', + 'options' => 'options', + 'redirects' => 'redirects', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'upstream_id' => 'setUpstreamId', + 'currency' => 'setCurrency', + 'tax_inclusive' => 'setTaxInclusive', + 'items' => 'setItems', + 'ship_from' => 'setShipFrom', + 'discount' => 'setDiscount', + 'shipping_discount' => 'setShippingDiscount', + 'browser_ip' => 'setBrowserIp', + 'application_id' => 'setApplicationId', + 'locale' => 'setLocale', + 'customer_type' => 'setCustomerType', + 'charge_type' => 'setChargeType', + 'style' => 'setStyle', + 'options' => 'setOptions', + 'redirects' => 'setRedirects', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'upstream_id' => 'getUpstreamId', + 'currency' => 'getCurrency', + 'tax_inclusive' => 'getTaxInclusive', + 'items' => 'getItems', + 'ship_from' => 'getShipFrom', + 'discount' => 'getDiscount', + 'shipping_discount' => 'getShippingDiscount', + 'browser_ip' => 'getBrowserIp', + 'application_id' => 'getApplicationId', + 'locale' => 'getLocale', + 'customer_type' => 'getCustomerType', + 'charge_type' => 'getChargeType', + 'style' => 'getStyle', + 'options' => 'getOptions', + 'redirects' => 'getRedirects', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['upstream_id'] = isset($data['upstream_id']) ? $data['upstream_id'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['tax_inclusive'] = isset($data['tax_inclusive']) ? $data['tax_inclusive'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; + $this->container['shipping_discount'] = isset($data['shipping_discount']) ? $data['shipping_discount'] : null; + $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; + $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; + $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['customer_type'] = isset($data['customer_type']) ? $data['customer_type'] : null; + $this->container['charge_type'] = isset($data['charge_type']) ? $data['charge_type'] : null; + $this->container['style'] = isset($data['style']) ? $data['style'] : null; + $this->container['options'] = isset($data['options']) ? $data['options'] : null; + $this->container['redirects'] = isset($data['redirects']) ? $data['redirects'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets upstream_id + * + * @return string|null + */ + public function getUpstreamId() + { + return $this->container['upstream_id']; + } + + /** + * Sets upstream_id + * + * @param string|null $upstream_id The upstream checkout identifier if it is different from the Digital River checkout identifier. + * + * @return $this + */ + public function setUpstreamId($upstream_id) + { + $this->container['upstream_id'] = $upstream_id; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency A three-letter ISO currency code. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets tax_inclusive + * + * @return bool|null + */ + public function getTaxInclusive() + { + return $this->container['tax_inclusive']; + } + + /** + * Sets tax_inclusive + * + * @param bool|null $tax_inclusive tax_inclusive + * + * @return $this + */ + public function setTaxInclusive($tax_inclusive) + { + $this->container['tax_inclusive'] = $tax_inclusive; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\SkuItemRequest[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\SkuItemRequest[]|null $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\ShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\ShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + + /** + * Gets discount + * + * @return \DigitalRiver\ApiSdk\Model\Discount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \DigitalRiver\ApiSdk\Model\Discount|null $discount discount + * + * @return $this + */ + public function setDiscount($discount) + { + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets shipping_discount + * + * @return \DigitalRiver\ApiSdk\Model\Discount|null + */ + public function getShippingDiscount() + { + return $this->container['shipping_discount']; + } + + /** + * Sets shipping_discount + * + * @param \DigitalRiver\ApiSdk\Model\Discount|null $shipping_discount shipping_discount + * + * @return $this + */ + public function setShippingDiscount($shipping_discount) + { + $this->container['shipping_discount'] = $shipping_discount; + + return $this; + } + + /** + * Gets browser_ip + * + * @return string|null + */ + public function getBrowserIp() + { + return $this->container['browser_ip']; + } + + /** + * Sets browser_ip + * + * @param string|null $browser_ip The IP address of the browser used by the customer when checking out. + * + * @return $this + */ + public function setBrowserIp($browser_ip) + { + $this->container['browser_ip'] = $browser_ip; + + return $this; + } + + /** + * Gets application_id + * + * @return string|null + */ + public function getApplicationId() + { + return $this->container['application_id']; + } + + /** + * Sets application_id + * + * @param string|null $application_id An arbitrary identifier that can be used to track the application type. + * + * @return $this + */ + public function setApplicationId($application_id) + { + $this->container['application_id'] = $application_id; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. + * + * @return $this + */ + public function setLocale($locale) + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets customer_type + * + * @return \DigitalRiver\ApiSdk\Model\CustomerType|null + */ + public function getCustomerType() + { + return $this->container['customer_type']; + } + + /** + * Sets customer_type + * + * @param \DigitalRiver\ApiSdk\Model\CustomerType|null $customer_type customer_type + * + * @return $this + */ + public function setCustomerType($customer_type) + { + $this->container['customer_type'] = $customer_type; + + return $this; + } + + /** + * Gets charge_type + * + * @return \DigitalRiver\ApiSdk\Model\ChargeType|null + */ + public function getChargeType() + { + return $this->container['charge_type']; + } + + /** + * Sets charge_type + * + * @param \DigitalRiver\ApiSdk\Model\ChargeType|null $charge_type charge_type + * + * @return $this + */ + public function setChargeType($charge_type) + { + $this->container['charge_type'] = $charge_type; + + return $this; + } + + /** + * Gets style + * + * @return object|null + */ + public function getStyle() + { + return $this->container['style']; + } + + /** + * Sets style + * + * @param object|null $style Style for drop-in + * + * @return $this + */ + public function setStyle($style) + { + $this->container['style'] = $style; + + return $this; + } + + /** + * Gets options + * + * @return \DigitalRiver\ApiSdk\Model\DropInOptionsRequest|null + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param \DigitalRiver\ApiSdk\Model\DropInOptionsRequest|null $options options + * + * @return $this + */ + public function setOptions($options) + { + $this->container['options'] = $options; + + return $this; + } + + /** + * Gets redirects + * + * @return \DigitalRiver\ApiSdk\Model\Redirects|null + */ + public function getRedirects() + { + return $this->container['redirects']; + } + + /** + * Sets redirects + * + * @param \DigitalRiver\ApiSdk\Model\Redirects|null $redirects redirects + * + * @return $this + */ + public function setRedirects($redirects) + { + $this->container['redirects'] = $redirects; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DropInOptionsRequest.php b/lib/Model/DropInOptionsRequest.php new file mode 100644 index 0000000..8008882 --- /dev/null +++ b/lib/Model/DropInOptionsRequest.php @@ -0,0 +1,356 @@ + '\DigitalRiver\ApiSdk\Model\Shipping[]', + 'shipping_methods' => '\DigitalRiver\ApiSdk\Model\IntegrationShippingMethod[]', + 'store_credits' => '\DigitalRiver\ApiSdk\Model\IntegrationStoreCredit[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'addresses' => null, + 'shipping_methods' => null, + 'store_credits' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'addresses' => 'addresses', + 'shipping_methods' => 'shippingMethods', + 'store_credits' => 'storeCredits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'addresses' => 'setAddresses', + 'shipping_methods' => 'setShippingMethods', + 'store_credits' => 'setStoreCredits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'addresses' => 'getAddresses', + 'shipping_methods' => 'getShippingMethods', + 'store_credits' => 'getStoreCredits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['addresses'] = isset($data['addresses']) ? $data['addresses'] : null; + $this->container['shipping_methods'] = isset($data['shipping_methods']) ? $data['shipping_methods'] : null; + $this->container['store_credits'] = isset($data['store_credits']) ? $data['store_credits'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets addresses + * + * @return \DigitalRiver\ApiSdk\Model\Shipping[]|null + */ + public function getAddresses() + { + return $this->container['addresses']; + } + + /** + * Sets addresses + * + * @param \DigitalRiver\ApiSdk\Model\Shipping[]|null $addresses addresses + * + * @return $this + */ + public function setAddresses($addresses) + { + $this->container['addresses'] = $addresses; + + return $this; + } + + /** + * Gets shipping_methods + * + * @return \DigitalRiver\ApiSdk\Model\IntegrationShippingMethod[]|null + */ + public function getShippingMethods() + { + return $this->container['shipping_methods']; + } + + /** + * Sets shipping_methods + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationShippingMethod[]|null $shipping_methods shipping_methods + * + * @return $this + */ + public function setShippingMethods($shipping_methods) + { + $this->container['shipping_methods'] = $shipping_methods; + + return $this; + } + + /** + * Gets store_credits + * + * @return \DigitalRiver\ApiSdk\Model\IntegrationStoreCredit[]|null + */ + public function getStoreCredits() + { + return $this->container['store_credits']; + } + + /** + * Sets store_credits + * + * @param \DigitalRiver\ApiSdk\Model\IntegrationStoreCredit[]|null $store_credits store_credits + * + * @return $this + */ + public function setStoreCredits($store_credits) + { + $this->container['store_credits'] = $store_credits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/DropInSku.php b/lib/Model/DropInSku.php new file mode 100644 index 0000000..c49a80d --- /dev/null +++ b/lib/Model/DropInSku.php @@ -0,0 +1,506 @@ + 'string', + 'eccn' => 'string', + 'tax_code' => 'string', + 'name' => 'string', + 'image' => 'string', + 'url' => 'string', + 'physical' => 'bool', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'eccn' => null, + 'tax_code' => null, + 'name' => null, + 'image' => null, + 'url' => null, + 'physical' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'eccn' => 'eccn', + 'tax_code' => 'taxCode', + 'name' => 'name', + 'image' => 'image', + 'url' => 'url', + 'physical' => 'physical', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'eccn' => 'setEccn', + 'tax_code' => 'setTaxCode', + 'name' => 'setName', + 'image' => 'setImage', + 'url' => 'setUrl', + 'physical' => 'setPhysical', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'eccn' => 'getEccn', + 'tax_code' => 'getTaxCode', + 'name' => 'getName', + 'image' => 'getImage', + 'url' => 'getUrl', + 'physical' => 'getPhysical', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['eccn'] = isset($data['eccn']) ? $data['eccn'] : null; + $this->container['tax_code'] = isset($data['tax_code']) ? $data['tax_code'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['image'] = isset($data['image']) ? $data['image'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['physical'] = isset($data['physical']) ? $data['physical'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The SKU's unique identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets eccn + * + * @return string|null + */ + public function getEccn() + { + return $this->container['eccn']; + } + + /** + * Sets eccn + * + * @param string|null $eccn The export control classification number. + * + * @return $this + */ + public function setEccn($eccn) + { + $this->container['eccn'] = $eccn; + + return $this; + } + + /** + * Gets tax_code + * + * @return string|null + */ + public function getTaxCode() + { + return $this->container['tax_code']; + } + + /** + * Sets tax_code + * + * @param string|null $tax_code The designated tax code. + * + * @return $this + */ + public function setTaxCode($tax_code) + { + $this->container['tax_code'] = $tax_code; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The product’s name. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets image + * + * @return string|null + */ + public function getImage() + { + return $this->container['image']; + } + + /** + * Sets image + * + * @param string|null $image An image of the product. + * + * @return $this + */ + public function setImage($image) + { + $this->container['image'] = $image; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url A product url. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets physical + * + * @return bool|null + */ + public function getPhysical() + { + return $this->container['physical']; + } + + /** + * Sets physical + * + * @param bool|null $physical Identifies whether or not a product is physical, so that the appropriate data requirements are enforced. + * + * @return $this + */ + public function setPhysical($physical) + { + $this->container['physical'] = $physical; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FileContent.php b/lib/Model/FileContent.php new file mode 100644 index 0000000..bb0616f --- /dev/null +++ b/lib/Model/FileContent.php @@ -0,0 +1,326 @@ + 'string', + 'file_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'file_name' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'file_name' => 'fileName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'file_name' => 'setFileName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'file_name' => 'getFileName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['file_name'] = isset($data['file_name']) ? $data['file_name'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the file. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets file_name + * + * @return string|null + */ + public function getFileName() + { + return $this->container['file_name']; + } + + /** + * Sets file_name + * + * @param string|null $file_name The name of the file. + * + * @return $this + */ + public function setFileName($file_name) + { + $this->container['file_name'] = $file_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/FulfillmentOrder.php b/lib/Model/FulfillmentOrder.php new file mode 100644 index 0000000..45e68df --- /dev/null +++ b/lib/Model/FulfillmentOrder.php @@ -0,0 +1,596 @@ + 'string', + 'created_time' => '\DateTime', + 'order_id' => 'string', + 'order_details' => '\DigitalRiver\ApiSdk\Model\OrderDetails', + 'shipment_id' => 'string', + 'items' => '\DigitalRiver\ApiSdk\Model\FulfillmentResponseItem[]', + 'live_mode' => 'bool', + 'metadata' => 'map[string,AnyType]', + 'tracking_company' => 'string', + 'tracking_number' => 'string', + 'tracking_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'created_time' => 'date-time', + 'order_id' => null, + 'order_details' => null, + 'shipment_id' => null, + 'items' => null, + 'live_mode' => null, + 'metadata' => null, + 'tracking_company' => null, + 'tracking_number' => null, + 'tracking_url' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'created_time' => 'createdTime', + 'order_id' => 'orderId', + 'order_details' => 'orderDetails', + 'shipment_id' => 'shipmentId', + 'items' => 'items', + 'live_mode' => 'liveMode', + 'metadata' => 'metadata', + 'tracking_company' => 'trackingCompany', + 'tracking_number' => 'trackingNumber', + 'tracking_url' => 'trackingUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'created_time' => 'setCreatedTime', + 'order_id' => 'setOrderId', + 'order_details' => 'setOrderDetails', + 'shipment_id' => 'setShipmentId', + 'items' => 'setItems', + 'live_mode' => 'setLiveMode', + 'metadata' => 'setMetadata', + 'tracking_company' => 'setTrackingCompany', + 'tracking_number' => 'setTrackingNumber', + 'tracking_url' => 'setTrackingUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'created_time' => 'getCreatedTime', + 'order_id' => 'getOrderId', + 'order_details' => 'getOrderDetails', + 'shipment_id' => 'getShipmentId', + 'items' => 'getItems', + 'live_mode' => 'getLiveMode', + 'metadata' => 'getMetadata', + 'tracking_company' => 'getTrackingCompany', + 'tracking_number' => 'getTrackingNumber', + 'tracking_url' => 'getTrackingUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['order_details'] = isset($data['order_details']) ? $data['order_details'] : null; + $this->container['shipment_id'] = isset($data['shipment_id']) ? $data['shipment_id'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + $this->container['tracking_company'] = isset($data['tracking_company']) ? $data['tracking_company'] : null; + $this->container['tracking_number'] = isset($data['tracking_number']) ? $data['tracking_number'] : null; + $this->container['tracking_url'] = isset($data['tracking_url']) ? $data['tracking_url'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the Fulfillment. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time The time when the Fulfillment was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id The unique identifier of the Order associated with this Fulfillment. + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets order_details + * + * @return \DigitalRiver\ApiSdk\Model\OrderDetails|null + */ + public function getOrderDetails() + { + return $this->container['order_details']; + } + + /** + * Sets order_details + * + * @param \DigitalRiver\ApiSdk\Model\OrderDetails|null $order_details order_details + * + * @return $this + */ + public function setOrderDetails($order_details) + { + $this->container['order_details'] = $order_details; + + return $this; + } + + /** + * Gets shipment_id + * + * @return string|null + */ + public function getShipmentId() + { + return $this->container['shipment_id']; + } + + /** + * Sets shipment_id + * + * @param string|null $shipment_id The unique identifier associated to the shipment + * + * @return $this + */ + public function setShipmentId($shipment_id) + { + $this->container['shipment_id'] = $shipment_id; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\FulfillmentResponseItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\FulfillmentResponseItem[]|null $items An array of line items fulfilled and/or cancelled. + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets live_mode + * + * @return bool|null + */ + public function getLiveMode() + { + return $this->container['live_mode']; + } + + /** + * Sets live_mode + * + * @param bool|null $live_mode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLiveMode($live_mode) + { + $this->container['live_mode'] = $live_mode; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets tracking_company + * + * @return string|null + */ + public function getTrackingCompany() + { + return $this->container['tracking_company']; + } + + /** + * Sets tracking_company + * + * @param string|null $tracking_company The name of the tracking company. + * + * @return $this + */ + public function setTrackingCompany($tracking_company) + { + $this->container['tracking_company'] = $tracking_company; + + return $this; + } + + /** + * Gets tracking_number + * + * @return string|null + */ + public function getTrackingNumber() + { + return $this->container['tracking_number']; + } + + /** + * Sets tracking_number + * + * @param string|null $tracking_number A tracking number provided by the shipping company. + * + * @return $this + */ + public function setTrackingNumber($tracking_number) + { + $this->container['tracking_number'] = $tracking_number; + + return $this; + } + + /** + * Gets tracking_url + * + * @return string|null + */ + public function getTrackingUrl() + { + return $this->container['tracking_url']; + } + + /** + * Sets tracking_url + * + * @param string|null $tracking_url The URL of the tracking page for the Fulfillment. + * + * @return $this + */ + public function setTrackingUrl($tracking_url) + { + $this->container['tracking_url'] = $tracking_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GLAddress.php b/lib/Model/GLAddress.php new file mode 100644 index 0000000..be97c9b --- /dev/null +++ b/lib/Model/GLAddress.php @@ -0,0 +1,447 @@ + 'string', + 'line2' => 'string', + 'city' => 'string', + 'postal_code' => 'string', + 'state' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'line1' => null, + 'line2' => null, + 'city' => null, + 'postal_code' => null, + 'state' => null, + 'country' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'line1' => 'line1', + 'line2' => 'line2', + 'city' => 'city', + 'postal_code' => 'postalCode', + 'state' => 'state', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'city' => 'setCity', + 'postal_code' => 'setPostalCode', + 'state' => 'setState', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'city' => 'getCity', + 'postal_code' => 'getPostalCode', + 'state' => 'getState', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['line1'] = isset($data['line1']) ? $data['line1'] : null; + $this->container['line2'] = isset($data['line2']) ? $data['line2'] : null; + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The first line of the address. + * + * @return $this + */ + public function setLine1($line1) + { + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 The second line of the address. + * + * @return $this + */ + public function setLine2($line2) + { + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city The city of the address. + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code The postal code of the address. + * + * @return $this + */ + public function setPostalCode($postal_code) + { + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The state, county, province, or region. + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country A [two-letter Alpha-2 country code](https://www.iban.com/country-codes) as described in the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) international standard. + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/GLShipFrom.php b/lib/Model/GLShipFrom.php new file mode 100644 index 0000000..54aaefe --- /dev/null +++ b/lib/Model/GLShipFrom.php @@ -0,0 +1,327 @@ + '\DigitalRiver\ApiSdk\Model\GLAddress', + 'additional_address_info' => '\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'address' => null, + 'additional_address_info' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'additional_address_info' => 'additionalAddressInfo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'additional_address_info' => 'setAdditionalAddressInfo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'additional_address_info' => 'getAdditionalAddressInfo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['additional_address_info'] = isset($data['additional_address_info']) ? $data['additional_address_info'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \DigitalRiver\ApiSdk\Model\GLAddress|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \DigitalRiver\ApiSdk\Model\GLAddress|null $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets additional_address_info + * + * @return \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null + */ + public function getAdditionalAddressInfo() + { + return $this->container['additional_address_info']; + } + + /** + * Sets additional_address_info + * + * @param \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null $additional_address_info additional_address_info + * + * @return $this + */ + public function setAdditionalAddressInfo($additional_address_info) + { + $this->container['additional_address_info'] = $additional_address_info; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Individual.php b/lib/Model/Individual.php new file mode 100644 index 0000000..73abc8c --- /dev/null +++ b/lib/Model/Individual.php @@ -0,0 +1,368 @@ + 'string', + 'attributes' => '\DigitalRiver\ApiSdk\Model\Attributes' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'type' => null, + 'attributes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'attributes' => 'attributes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'attributes' => 'setAttributes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'attributes' => 'getAttributes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPE_CN_INDIVIDUAL_GENERAL = 'cn_individual_general'; + const TYPE_TW_INDIVIDUAL_MEMBER_CARRIER = 'tw_individual_member_carrier'; + const TYPE_TW_INDIVIDUAL_MOBILE_BARCODE = 'tw_individual_mobile_barcode'; + const TYPE_TW_INDIVIDUAL_CITIZEN_CERT = 'tw_individual_citizen_cert'; + const TYPE_TW_INDIVIDUAL_DONATE = 'tw_individual_donate'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + $allowable = [ + self::TYPE_CN_INDIVIDUAL_GENERAL, + self::TYPE_TW_INDIVIDUAL_MEMBER_CARRIER, + self::TYPE_TW_INDIVIDUAL_MOBILE_BARCODE, + self::TYPE_TW_INDIVIDUAL_CITIZEN_CERT, + self::TYPE_TW_INDIVIDUAL_DONATE, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['attributes'] = isset($data['attributes']) ? $data['attributes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + + if (!is_null($this->container['type']) && !in_array(strtolower($this->container['type']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of invoice. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array(strtolower($type), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets attributes + * + * @return \DigitalRiver\ApiSdk\Model\Attributes|null + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \DigitalRiver\ApiSdk\Model\Attributes|null $attributes attributes + * + * @return $this + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/IntegrationAddress.php b/lib/Model/IntegrationAddress.php new file mode 100644 index 0000000..36d9e27 --- /dev/null +++ b/lib/Model/IntegrationAddress.php @@ -0,0 +1,446 @@ + '\DigitalRiver\ApiSdk\Model\Address', + 'name' => 'string', + 'phone' => 'string', + 'email' => 'string', + 'organization' => 'string', + 'additional_address_info' => '\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'address' => null, + 'name' => null, + 'phone' => null, + 'email' => 'email', + 'organization' => null, + 'additional_address_info' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'name' => 'name', + 'phone' => 'phone', + 'email' => 'email', + 'organization' => 'organization', + 'additional_address_info' => 'additionalAddressInfo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'name' => 'setName', + 'phone' => 'setPhone', + 'email' => 'setEmail', + 'organization' => 'setOrganization', + 'additional_address_info' => 'setAdditionalAddressInfo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'name' => 'getName', + 'phone' => 'getPhone', + 'email' => 'getEmail', + 'organization' => 'getOrganization', + 'additional_address_info' => 'getAdditionalAddressInfo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['organization'] = isset($data['organization']) ? $data['organization'] : null; + $this->container['additional_address_info'] = isset($data['additional_address_info']) ? $data['additional_address_info'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \DigitalRiver\ApiSdk\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \DigitalRiver\ApiSdk\Model\Address|null $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The customer's name. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone The customer's phone number. + * + * @return $this + */ + public function setPhone($phone) + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The customer's email address. + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization The customer's organization. + * + * @return $this + */ + public function setOrganization($organization) + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets additional_address_info + * + * @return \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null + */ + public function getAdditionalAddressInfo() + { + return $this->container['additional_address_info']; + } + + /** + * Sets additional_address_info + * + * @param \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null $additional_address_info additional_address_info + * + * @return $this + */ + public function setAdditionalAddressInfo($additional_address_info) + { + $this->container['additional_address_info'] = $additional_address_info; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/IntegrationShippingMethod.php b/lib/Model/IntegrationShippingMethod.php new file mode 100644 index 0000000..4b0ca81 --- /dev/null +++ b/lib/Model/IntegrationShippingMethod.php @@ -0,0 +1,365 @@ + 'double', + 'description' => 'string', + 'service_level' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => 'double', + 'description' => null, + 'service_level' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'description' => 'description', + 'service_level' => 'serviceLevel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'description' => 'setDescription', + 'service_level' => 'setServiceLevel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'description' => 'getDescription', + 'service_level' => 'getServiceLevel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['service_level'] = isset($data['service_level']) ? $data['service_level'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['service_level'] === null) { + $invalidProperties[] = "'service_level' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return double + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double $amount The shipping method's cost. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description The shipping method's description. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets service_level + * + * @return string + */ + public function getServiceLevel() + { + return $this->container['service_level']; + } + + /** + * Sets service_level + * + * @param string $service_level service_level + * + * @return $this + */ + public function setServiceLevel($service_level) + { + $this->container['service_level'] = $service_level; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/IntegrationStoreCredit.php b/lib/Model/IntegrationStoreCredit.php new file mode 100644 index 0000000..d8f7024 --- /dev/null +++ b/lib/Model/IntegrationStoreCredit.php @@ -0,0 +1,416 @@ + 'double', + 'name' => 'string', + 'upstream_id' => 'string', + 'icon_url' => 'string', + 'last_four' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => 'double', + 'name' => null, + 'upstream_id' => null, + 'icon_url' => null, + 'last_four' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'name' => 'name', + 'upstream_id' => 'upstreamId', + 'icon_url' => 'iconUrl', + 'last_four' => 'lastFour' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'name' => 'setName', + 'upstream_id' => 'setUpstreamId', + 'icon_url' => 'setIconUrl', + 'last_four' => 'setLastFour' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'name' => 'getName', + 'upstream_id' => 'getUpstreamId', + 'icon_url' => 'getIconUrl', + 'last_four' => 'getLastFour' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['upstream_id'] = isset($data['upstream_id']) ? $data['upstream_id'] : null; + $this->container['icon_url'] = isset($data['icon_url']) ? $data['icon_url'] : null; + $this->container['last_four'] = isset($data['last_four']) ? $data['last_four'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The store credit amount. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The store credit name. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets upstream_id + * + * @return string|null + */ + public function getUpstreamId() + { + return $this->container['upstream_id']; + } + + /** + * Sets upstream_id + * + * @param string|null $upstream_id The upstream store credit identifier. + * + * @return $this + */ + public function setUpstreamId($upstream_id) + { + $this->container['upstream_id'] = $upstream_id; + + return $this; + } + + /** + * Gets icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url The store credit image url. + * + * @return $this + */ + public function setIconUrl($icon_url) + { + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets last_four + * + * @return string|null + */ + public function getLastFour() + { + return $this->container['last_four']; + } + + /** + * Sets last_four + * + * @param string|null $last_four The last four digits of the store credit. + * + * @return $this + */ + public function setLastFour($last_four) + { + $this->container['last_four'] = $last_four; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/IntegrationStoreCreditRequest.php b/lib/Model/IntegrationStoreCreditRequest.php new file mode 100644 index 0000000..747e38c --- /dev/null +++ b/lib/Model/IntegrationStoreCreditRequest.php @@ -0,0 +1,416 @@ + 'double', + 'name' => 'string', + 'upstream_id' => 'string', + 'icon_url' => 'string', + 'last_four' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => 'double', + 'name' => null, + 'upstream_id' => null, + 'icon_url' => null, + 'last_four' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'name' => 'name', + 'upstream_id' => 'upstreamId', + 'icon_url' => 'iconUrl', + 'last_four' => 'lastFour' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'name' => 'setName', + 'upstream_id' => 'setUpstreamId', + 'icon_url' => 'setIconUrl', + 'last_four' => 'setLastFour' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'name' => 'getName', + 'upstream_id' => 'getUpstreamId', + 'icon_url' => 'getIconUrl', + 'last_four' => 'getLastFour' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['upstream_id'] = isset($data['upstream_id']) ? $data['upstream_id'] : null; + $this->container['icon_url'] = isset($data['icon_url']) ? $data['icon_url'] : null; + $this->container['last_four'] = isset($data['last_four']) ? $data['last_four'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The store credit amount. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The store credit name. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets upstream_id + * + * @return string|null + */ + public function getUpstreamId() + { + return $this->container['upstream_id']; + } + + /** + * Sets upstream_id + * + * @param string|null $upstream_id The upstream store credit identifier. + * + * @return $this + */ + public function setUpstreamId($upstream_id) + { + $this->container['upstream_id'] = $upstream_id; + + return $this; + } + + /** + * Gets icon_url + * + * @return string|null + */ + public function getIconUrl() + { + return $this->container['icon_url']; + } + + /** + * Sets icon_url + * + * @param string|null $icon_url The store credit image url. + * + * @return $this + */ + public function setIconUrl($icon_url) + { + $this->container['icon_url'] = $icon_url; + + return $this; + } + + /** + * Gets last_four + * + * @return string|null + */ + public function getLastFour() + { + return $this->container['last_four']; + } + + /** + * Sets last_four + * + * @param string|null $last_four The last four digits of the store credit. + * + * @return $this + */ + public function setLastFour($last_four) + { + $this->container['last_four'] = $last_four; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvoiceAttributeInfo.php b/lib/Model/InvoiceAttributeInfo.php new file mode 100644 index 0000000..62501c8 --- /dev/null +++ b/lib/Model/InvoiceAttributeInfo.php @@ -0,0 +1,356 @@ + 'bool', + 'individual' => '\DigitalRiver\ApiSdk\Model\Individual', + 'business' => '\DigitalRiver\ApiSdk\Model\Business' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'is_required' => null, + 'individual' => null, + 'business' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'is_required' => 'isRequired', + 'individual' => 'individual', + 'business' => 'business' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'is_required' => 'setIsRequired', + 'individual' => 'setIndividual', + 'business' => 'setBusiness' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'is_required' => 'getIsRequired', + 'individual' => 'getIndividual', + 'business' => 'getBusiness' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['is_required'] = isset($data['is_required']) ? $data['is_required'] : null; + $this->container['individual'] = isset($data['individual']) ? $data['individual'] : null; + $this->container['business'] = isset($data['business']) ? $data['business'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets is_required + * + * @return bool|null + */ + public function getIsRequired() + { + return $this->container['is_required']; + } + + /** + * Sets is_required + * + * @param bool|null $is_required Designates if the invoice attributes are required. + * + * @return $this + */ + public function setIsRequired($is_required) + { + $this->container['is_required'] = $is_required; + + return $this; + } + + /** + * Gets individual + * + * @return \DigitalRiver\ApiSdk\Model\Individual|null + */ + public function getIndividual() + { + return $this->container['individual']; + } + + /** + * Sets individual + * + * @param \DigitalRiver\ApiSdk\Model\Individual|null $individual individual + * + * @return $this + */ + public function setIndividual($individual) + { + $this->container['individual'] = $individual; + + return $this; + } + + /** + * Gets business + * + * @return \DigitalRiver\ApiSdk\Model\Business|null + */ + public function getBusiness() + { + return $this->container['business']; + } + + /** + * Sets business + * + * @param \DigitalRiver\ApiSdk\Model\Business|null $business business + * + * @return $this + */ + public function setBusiness($business) + { + $this->container['business'] = $business; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvoiceAttributes.php b/lib/Model/InvoiceAttributes.php new file mode 100644 index 0000000..b17d6a4 --- /dev/null +++ b/lib/Model/InvoiceAttributes.php @@ -0,0 +1,522 @@ + 'string', + 'type' => 'string', + 'customer_id' => 'string', + 'atttributes' => '\DigitalRiver\ApiSdk\Model\Attributes[]', + 'created_time' => '\DateTime', + 'updated_time' => '\DateTime', + 'live_mode' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null, + 'customer_id' => null, + 'atttributes' => null, + 'created_time' => 'date-time', + 'updated_time' => 'date-time', + 'live_mode' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type', + 'customer_id' => 'customerId', + 'atttributes' => 'atttributes', + 'created_time' => 'createdTime', + 'updated_time' => 'updatedTime', + 'live_mode' => 'liveMode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType', + 'customer_id' => 'setCustomerId', + 'atttributes' => 'setAtttributes', + 'created_time' => 'setCreatedTime', + 'updated_time' => 'setUpdatedTime', + 'live_mode' => 'setLiveMode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType', + 'customer_id' => 'getCustomerId', + 'atttributes' => 'getAtttributes', + 'created_time' => 'getCreatedTime', + 'updated_time' => 'getUpdatedTime', + 'live_mode' => 'getLiveMode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPE_CN_INDIVIDUAL_GENERAL = 'cn_individual_general'; + const TYPE_CN_BUSINESS_GENERAL = 'cn_business_general'; + const TYPE_CN_BUSINESS_SPECIAL = 'cn_business_special'; + const TYPE_TW_INDIVIDUAL_MOBILE_BARCODE = 'tw_individual_mobile_barcode'; + const TYPE_TW_INDIVIDUAL_MEMBER_CARRIER = 'tw_individual_member_carrier'; + const TYPE_TW_INDIVIDUAL_CITIZEN_CERT = 'tw_individual_citizen_cert'; + const TYPE_TW_INDIVIDUAL_DONATE = 'tw_individual_donate'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + $allowable = [ + self::TYPE_CN_INDIVIDUAL_GENERAL, + self::TYPE_CN_BUSINESS_GENERAL, + self::TYPE_CN_BUSINESS_SPECIAL, + self::TYPE_TW_INDIVIDUAL_MOBILE_BARCODE, + self::TYPE_TW_INDIVIDUAL_MEMBER_CARRIER, + self::TYPE_TW_INDIVIDUAL_CITIZEN_CERT, + self::TYPE_TW_INDIVIDUAL_DONATE, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + $this->container['atttributes'] = isset($data['atttributes']) ? $data['atttributes'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['updated_time'] = isset($data['updated_time']) ? $data['updated_time'] : null; + $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + + if (!is_null($this->container['type']) && !in_array(strtolower($this->container['type']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The ID of the invoice + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of invoice. + * + * @return $this + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array(strtolower($type), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id The ID of the customer. + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets atttributes + * + * @return \DigitalRiver\ApiSdk\Model\Attributes[]|null + */ + public function getAtttributes() + { + return $this->container['atttributes']; + } + + /** + * Sets atttributes + * + * @param \DigitalRiver\ApiSdk\Model\Attributes[]|null $atttributes atttributes + * + * @return $this + */ + public function setAtttributes($atttributes) + { + $this->container['atttributes'] = $atttributes; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time The time when the invoice attribute was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets updated_time + * + * @return \DateTime|null + */ + public function getUpdatedTime() + { + return $this->container['updated_time']; + } + + /** + * Sets updated_time + * + * @param \DateTime|null $updated_time The time when the invoice attribute was updated. + * + * @return $this + */ + public function setUpdatedTime($updated_time) + { + $this->container['updated_time'] = $updated_time; + + return $this; + } + + /** + * Gets live_mode + * + * @return bool|null + */ + public function getLiveMode() + { + return $this->container['live_mode']; + } + + /** + * Sets live_mode + * + * @param bool|null $live_mode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLiveMode($live_mode) + { + $this->container['live_mode'] = $live_mode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/InvoiceItem.php b/lib/Model/InvoiceItem.php index 514cdce..6daccd2 100644 --- a/lib/Model/InvoiceItem.php +++ b/lib/Model/InvoiceItem.php @@ -48,6 +48,7 @@ class InvoiceItem implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'string', 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', 'fees' => '\DigitalRiver\ApiSdk\Model\Fees', 'quantity' => 'int', @@ -67,6 +68,7 @@ class InvoiceItem implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'sku_id' => null, + 'product_details' => null, 'subscription_info' => null, 'fees' => null, 'quantity' => null, @@ -107,6 +109,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'sku_id' => 'skuId', + 'product_details' => 'productDetails', 'subscription_info' => 'subscriptionInfo', 'fees' => 'fees', 'quantity' => 'quantity', @@ -126,6 +129,7 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', 'subscription_info' => 'setSubscriptionInfo', 'fees' => 'setFees', 'quantity' => 'setQuantity', @@ -145,6 +149,7 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', 'subscription_info' => 'getSubscriptionInfo', 'fees' => 'getFees', 'quantity' => 'getQuantity', @@ -218,6 +223,7 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; @@ -301,6 +307,30 @@ public function setSkuId($sku_id) return $this; } + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + /** * Gets subscription_info * diff --git a/lib/Model/InvoiceItemRequest.php b/lib/Model/InvoiceItemRequest.php index 82b6a4a..dee0ea4 100644 --- a/lib/Model/InvoiceItemRequest.php +++ b/lib/Model/InvoiceItemRequest.php @@ -47,6 +47,7 @@ class InvoiceItemRequest implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', 'price' => 'double', 'aggregate_price' => 'double', @@ -62,6 +63,7 @@ class InvoiceItemRequest implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'sku_id' => null, + 'product_details' => null, 'subscription_info' => null, 'price' => 'double', 'aggregate_price' => 'double', @@ -98,6 +100,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'sku_id' => 'skuId', + 'product_details' => 'productDetails', 'subscription_info' => 'subscriptionInfo', 'price' => 'price', 'aggregate_price' => 'aggregatePrice', @@ -113,6 +116,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', 'subscription_info' => 'setSubscriptionInfo', 'price' => 'setPrice', 'aggregate_price' => 'setAggregatePrice', @@ -128,6 +132,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', 'subscription_info' => 'getSubscriptionInfo', 'price' => 'getPrice', 'aggregate_price' => 'getAggregatePrice', @@ -197,6 +202,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['aggregate_price'] = isset($data['aggregate_price']) ? $data['aggregate_price'] : null; @@ -256,6 +262,30 @@ public function setSkuId($sku_id) return $this; } + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + /** * Gets subscription_info * diff --git a/lib/Model/ItemShipping.php b/lib/Model/ItemShipping.php new file mode 100644 index 0000000..b68e358 --- /dev/null +++ b/lib/Model/ItemShipping.php @@ -0,0 +1,326 @@ + 'double', + 'tax_amount' => 'double' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'amount' => 'double', + 'tax_amount' => 'double' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'amount' => 'amount', + 'tax_amount' => 'taxAmount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'amount' => 'setAmount', + 'tax_amount' => 'setTaxAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'amount' => 'getAmount', + 'tax_amount' => 'getTaxAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The shipping amount for the item. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets tax_amount + * + * @return double|null + */ + public function getTaxAmount() + { + return $this->container['tax_amount']; + } + + /** + * Sets tax_amount + * + * @param double|null $tax_amount The tax amount associated to the item level shipping cost. + * + * @return $this + */ + public function setTaxAmount($tax_amount) + { + $this->container['tax_amount'] = $tax_amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/LabelResponse.php b/lib/Model/LabelResponse.php new file mode 100644 index 0000000..457e26c --- /dev/null +++ b/lib/Model/LabelResponse.php @@ -0,0 +1,420 @@ + 'int', + 'width' => 'int', + 'format' => 'string', + 'file' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'height' => null, + 'width' => null, + 'format' => null, + 'file' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'height' => 'height', + 'width' => 'width', + 'format' => 'format', + 'file' => 'file' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'height' => 'setHeight', + 'width' => 'setWidth', + 'format' => 'setFormat', + 'file' => 'setFile' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'height' => 'getHeight', + 'width' => 'getWidth', + 'format' => 'getFormat', + 'file' => 'getFile' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const FORMAT_PDF = 'PDF'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFormatAllowableValues() + { + $allowable = [ + self::FORMAT_PDF, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['height'] = isset($data['height']) ? $data['height'] : null; + $this->container['width'] = isset($data['width']) ? $data['width'] : null; + $this->container['format'] = isset($data['format']) ? $data['format'] : null; + $this->container['file'] = isset($data['file']) ? $data['file'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getFormatAllowableValues(); + + if (!is_null($this->container['format']) && !in_array(strtolower($this->container['format']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'format', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets height + * + * @return int|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param int|null $height The label’s height in inches. + * + * @return $this + */ + public function setHeight($height) + { + $this->container['height'] = $height; + + return $this; + } + + /** + * Gets width + * + * @return int|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param int|null $width The label’s width in inches. + * + * @return $this + */ + public function setWidth($width) + { + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets format + * + * @return string|null + */ + public function getFormat() + { + return $this->container['format']; + } + + /** + * Sets format + * + * @param string|null $format The format of the label's data file. + * + * @return $this + */ + public function setFormat($format) + { + $allowedValues = $this->getFormatAllowableValues(); + if (!is_null($format) && !in_array(strtolower($format), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'format', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['format'] = $format; + + return $this; + } + + /** + * Gets file + * + * @return string|null + */ + public function getFile() + { + return $this->container['file']; + } + + /** + * Sets file + * + * @param string|null $file The shipping label data. + * + * @return $this + */ + public function setFile($file) + { + $this->container['file'] = $file; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ListCheckoutLinksResponse.php b/lib/Model/ListCheckoutLinksResponse.php new file mode 100644 index 0000000..ff62432 --- /dev/null +++ b/lib/Model/ListCheckoutLinksResponse.php @@ -0,0 +1,326 @@ + 'bool', + 'data' => '\DigitalRiver\ApiSdk\Model\CheckoutLinkDetails[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'has_more' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'has_more' => 'hasMore', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'has_more' => 'setHasMore', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'has_more' => 'getHasMore', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['has_more'] = isset($data['has_more']) ? $data['has_more'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets has_more + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['has_more']; + } + + /** + * Sets has_more + * + * @param bool|null $has_more Whether or not there are more elements available after this set. If false this set represents the end of the list. + * + * @return $this + */ + public function setHasMore($has_more) + { + $this->container['has_more'] = $has_more; + + return $this; + } + + /** + * Gets data + * + * @return \DigitalRiver\ApiSdk\Model\CheckoutLinkDetails[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \DigitalRiver\ApiSdk\Model\CheckoutLinkDetails[]|null $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ListReturnsResponse1.php b/lib/Model/ListReturnsResponse1.php new file mode 100644 index 0000000..ccdb68a --- /dev/null +++ b/lib/Model/ListReturnsResponse1.php @@ -0,0 +1,326 @@ + 'bool', + 'data' => '\DigitalRiver\ApiSdk\Model\ReturnsResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'has_more' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'has_more' => 'hasMore', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'has_more' => 'setHasMore', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'has_more' => 'getHasMore', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['has_more'] = isset($data['has_more']) ? $data['has_more'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets has_more + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['has_more']; + } + + /** + * Sets has_more + * + * @param bool|null $has_more Whether or not there are more elements available after this set. If false this set represents the end of the list. + * + * @return $this + */ + public function setHasMore($has_more) + { + $this->container['has_more'] = $has_more; + + return $this; + } + + /** + * Gets data + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsResponse[]|null $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ListShippingLabel.php b/lib/Model/ListShippingLabel.php new file mode 100644 index 0000000..3a1a7c2 --- /dev/null +++ b/lib/Model/ListShippingLabel.php @@ -0,0 +1,326 @@ + 'bool', + 'data' => '\DigitalRiver\ApiSdk\Model\ShippingLabelResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'has_more' => null, + 'data' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'has_more' => 'hasMore', + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'has_more' => 'setHasMore', + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'has_more' => 'getHasMore', + 'data' => 'getData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['has_more'] = isset($data['has_more']) ? $data['has_more'] : null; + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets has_more + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['has_more']; + } + + /** + * Sets has_more + * + * @param bool|null $has_more Whether or not there are more elements available after this set. If false this set represents the end of the list. + * + * @return $this + */ + public function setHasMore($has_more) + { + $this->container['has_more'] = $has_more; + + return $this; + } + + /** + * Gets data + * + * @return \DigitalRiver\ApiSdk\Model\ShippingLabelResponse[]|null + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \DigitalRiver\ApiSdk\Model\ShippingLabelResponse[]|null $data data + * + * @return $this + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Order.php b/lib/Model/Order.php index 069191b..e11097c 100644 --- a/lib/Model/Order.php +++ b/lib/Model/Order.php @@ -56,6 +56,7 @@ class Order implements ModelInterface, ArrayAccess 'browser_ip' => 'string', 'application_id' => 'string', 'tax_identifiers' => '\DigitalRiver\ApiSdk\Model\TaxIdentifier[]', + 'invoice_attributes' => '\DigitalRiver\ApiSdk\Model\InvoiceAttributes', 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', 'ship_to' => '\DigitalRiver\ApiSdk\Model\Shipping', 'bill_to' => '\DigitalRiver\ApiSdk\Model\Billing', @@ -110,6 +111,7 @@ class Order implements ModelInterface, ArrayAccess 'browser_ip' => null, 'application_id' => null, 'tax_identifiers' => null, + 'invoice_attributes' => null, 'ship_from' => null, 'ship_to' => null, 'bill_to' => null, @@ -185,6 +187,7 @@ public static function openAPIFormats() 'browser_ip' => 'browserIp', 'application_id' => 'applicationId', 'tax_identifiers' => 'taxIdentifiers', + 'invoice_attributes' => 'invoiceAttributes', 'ship_from' => 'shipFrom', 'ship_to' => 'shipTo', 'bill_to' => 'billTo', @@ -239,6 +242,7 @@ public static function openAPIFormats() 'browser_ip' => 'setBrowserIp', 'application_id' => 'setApplicationId', 'tax_identifiers' => 'setTaxIdentifiers', + 'invoice_attributes' => 'setInvoiceAttributes', 'ship_from' => 'setShipFrom', 'ship_to' => 'setShipTo', 'bill_to' => 'setBillTo', @@ -293,6 +297,7 @@ public static function openAPIFormats() 'browser_ip' => 'getBrowserIp', 'application_id' => 'getApplicationId', 'tax_identifiers' => 'getTaxIdentifiers', + 'invoice_attributes' => 'getInvoiceAttributes', 'ship_from' => 'getShipFrom', 'ship_to' => 'getShipTo', 'bill_to' => 'getBillTo', @@ -453,6 +458,7 @@ public function __construct(array $data = null) $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; $this->container['tax_identifiers'] = isset($data['tax_identifiers']) ? $data['tax_identifiers'] : null; + $this->container['invoice_attributes'] = isset($data['invoice_attributes']) ? $data['invoice_attributes'] : null; $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; $this->container['ship_to'] = isset($data['ship_to']) ? $data['ship_to'] : null; $this->container['bill_to'] = isset($data['bill_to']) ? $data['bill_to'] : null; @@ -777,6 +783,30 @@ public function setTaxIdentifiers($tax_identifiers) return $this; } + /** + * Gets invoice_attributes + * + * @return \DigitalRiver\ApiSdk\Model\InvoiceAttributes|null + */ + public function getInvoiceAttributes() + { + return $this->container['invoice_attributes']; + } + + /** + * Sets invoice_attributes + * + * @param \DigitalRiver\ApiSdk\Model\InvoiceAttributes|null $invoice_attributes invoice_attributes + * + * @return $this + */ + public function setInvoiceAttributes($invoice_attributes) + { + $this->container['invoice_attributes'] = $invoice_attributes; + + return $this; + } + /** * Gets ship_from * diff --git a/lib/Model/OrderDetails.php b/lib/Model/OrderDetails.php new file mode 100644 index 0000000..012c06a --- /dev/null +++ b/lib/Model/OrderDetails.php @@ -0,0 +1,1704 @@ + 'string', + 'checkout_id' => 'string', + 'created_time' => '\DateTime', + 'customer_id' => 'string', + 'currency' => 'string', + 'email' => 'string', + 'locale' => 'string', + 'browser_ip' => 'string', + 'application_id' => 'string', + 'tax_identifiers' => '\DigitalRiver\ApiSdk\Model\TaxIdentifier[]', + 'invoice_attributes' => '\DigitalRiver\ApiSdk\Model\InvoiceAttributes', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', + 'ship_to' => '\DigitalRiver\ApiSdk\Model\Shipping', + 'bill_to' => '\DigitalRiver\ApiSdk\Model\Billing', + 'organization' => '\DigitalRiver\ApiSdk\Model\Organization', + 'subtotal' => 'double', + 'total_tax' => 'double', + 'total_importer_tax' => 'double', + 'importer_of_record_tax' => 'bool', + 'total_fees' => 'double', + 'total_duty' => 'double', + 'total_discount' => 'double', + 'total_shipping' => 'double', + 'total_amount' => 'double', + 'discount' => '\DigitalRiver\ApiSdk\Model\Discount', + 'available_to_refund_amount' => 'double', + 'refunded_amount' => 'double', + 'cancelled_amount' => 'double', + 'captured_amount' => 'double', + 'items' => '\DigitalRiver\ApiSdk\Model\OrderItem[]', + 'invoice_pd_fs' => '\DigitalRiver\ApiSdk\Model\File[]', + 'credit_memo_pd_fs' => '\DigitalRiver\ApiSdk\Model\File[]', + 'request_to_be_forgotten' => 'bool', + 'shipping_choice' => '\DigitalRiver\ApiSdk\Model\ShippingChoice', + 'state' => 'string', + 'state_transitions' => '\DigitalRiver\ApiSdk\Model\OrderStateTransitions', + 'fraud_state' => 'string', + 'fraud_state_transitions' => '\DigitalRiver\ApiSdk\Model\FraudStateTransitions', + 'live_mode' => 'bool', + 'metadata' => 'map[string,AnyType]', + 'selling_entity' => '\DigitalRiver\ApiSdk\Model\SellingEntity', + 'purchase_location' => '\DigitalRiver\ApiSdk\Model\PurchaseLocation', + 'customer_type' => '\DigitalRiver\ApiSdk\Model\CustomerType', + 'upstream_id' => 'string', + 'updated_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'checkout_id' => null, + 'created_time' => 'date-time', + 'customer_id' => null, + 'currency' => null, + 'email' => 'email', + 'locale' => null, + 'browser_ip' => null, + 'application_id' => null, + 'tax_identifiers' => null, + 'invoice_attributes' => null, + 'ship_from' => null, + 'ship_to' => null, + 'bill_to' => null, + 'organization' => null, + 'subtotal' => 'double', + 'total_tax' => 'double', + 'total_importer_tax' => 'double', + 'importer_of_record_tax' => null, + 'total_fees' => 'double', + 'total_duty' => 'double', + 'total_discount' => 'double', + 'total_shipping' => 'double', + 'total_amount' => 'double', + 'discount' => null, + 'available_to_refund_amount' => 'double', + 'refunded_amount' => 'double', + 'cancelled_amount' => 'double', + 'captured_amount' => 'double', + 'items' => null, + 'invoice_pd_fs' => null, + 'credit_memo_pd_fs' => null, + 'request_to_be_forgotten' => null, + 'shipping_choice' => null, + 'state' => null, + 'state_transitions' => null, + 'fraud_state' => null, + 'fraud_state_transitions' => null, + 'live_mode' => null, + 'metadata' => null, + 'selling_entity' => null, + 'purchase_location' => null, + 'customer_type' => null, + 'upstream_id' => null, + 'updated_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'checkout_id' => 'checkoutId', + 'created_time' => 'createdTime', + 'customer_id' => 'customerId', + 'currency' => 'currency', + 'email' => 'email', + 'locale' => 'locale', + 'browser_ip' => 'browserIp', + 'application_id' => 'applicationId', + 'tax_identifiers' => 'taxIdentifiers', + 'invoice_attributes' => 'invoiceAttributes', + 'ship_from' => 'shipFrom', + 'ship_to' => 'shipTo', + 'bill_to' => 'billTo', + 'organization' => 'organization', + 'subtotal' => 'subtotal', + 'total_tax' => 'totalTax', + 'total_importer_tax' => 'totalImporterTax', + 'importer_of_record_tax' => 'importerOfRecordTax', + 'total_fees' => 'totalFees', + 'total_duty' => 'totalDuty', + 'total_discount' => 'totalDiscount', + 'total_shipping' => 'totalShipping', + 'total_amount' => 'totalAmount', + 'discount' => 'discount', + 'available_to_refund_amount' => 'availableToRefundAmount', + 'refunded_amount' => 'refundedAmount', + 'cancelled_amount' => 'cancelledAmount', + 'captured_amount' => 'capturedAmount', + 'items' => 'items', + 'invoice_pd_fs' => 'invoicePDFs', + 'credit_memo_pd_fs' => 'creditMemoPDFs', + 'request_to_be_forgotten' => 'requestToBeForgotten', + 'shipping_choice' => 'shippingChoice', + 'state' => 'state', + 'state_transitions' => 'stateTransitions', + 'fraud_state' => 'fraudState', + 'fraud_state_transitions' => 'fraudStateTransitions', + 'live_mode' => 'liveMode', + 'metadata' => 'metadata', + 'selling_entity' => 'sellingEntity', + 'purchase_location' => 'purchaseLocation', + 'customer_type' => 'customerType', + 'upstream_id' => 'upstreamId', + 'updated_time' => 'updatedTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'checkout_id' => 'setCheckoutId', + 'created_time' => 'setCreatedTime', + 'customer_id' => 'setCustomerId', + 'currency' => 'setCurrency', + 'email' => 'setEmail', + 'locale' => 'setLocale', + 'browser_ip' => 'setBrowserIp', + 'application_id' => 'setApplicationId', + 'tax_identifiers' => 'setTaxIdentifiers', + 'invoice_attributes' => 'setInvoiceAttributes', + 'ship_from' => 'setShipFrom', + 'ship_to' => 'setShipTo', + 'bill_to' => 'setBillTo', + 'organization' => 'setOrganization', + 'subtotal' => 'setSubtotal', + 'total_tax' => 'setTotalTax', + 'total_importer_tax' => 'setTotalImporterTax', + 'importer_of_record_tax' => 'setImporterOfRecordTax', + 'total_fees' => 'setTotalFees', + 'total_duty' => 'setTotalDuty', + 'total_discount' => 'setTotalDiscount', + 'total_shipping' => 'setTotalShipping', + 'total_amount' => 'setTotalAmount', + 'discount' => 'setDiscount', + 'available_to_refund_amount' => 'setAvailableToRefundAmount', + 'refunded_amount' => 'setRefundedAmount', + 'cancelled_amount' => 'setCancelledAmount', + 'captured_amount' => 'setCapturedAmount', + 'items' => 'setItems', + 'invoice_pd_fs' => 'setInvoicePdFs', + 'credit_memo_pd_fs' => 'setCreditMemoPdFs', + 'request_to_be_forgotten' => 'setRequestToBeForgotten', + 'shipping_choice' => 'setShippingChoice', + 'state' => 'setState', + 'state_transitions' => 'setStateTransitions', + 'fraud_state' => 'setFraudState', + 'fraud_state_transitions' => 'setFraudStateTransitions', + 'live_mode' => 'setLiveMode', + 'metadata' => 'setMetadata', + 'selling_entity' => 'setSellingEntity', + 'purchase_location' => 'setPurchaseLocation', + 'customer_type' => 'setCustomerType', + 'upstream_id' => 'setUpstreamId', + 'updated_time' => 'setUpdatedTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'checkout_id' => 'getCheckoutId', + 'created_time' => 'getCreatedTime', + 'customer_id' => 'getCustomerId', + 'currency' => 'getCurrency', + 'email' => 'getEmail', + 'locale' => 'getLocale', + 'browser_ip' => 'getBrowserIp', + 'application_id' => 'getApplicationId', + 'tax_identifiers' => 'getTaxIdentifiers', + 'invoice_attributes' => 'getInvoiceAttributes', + 'ship_from' => 'getShipFrom', + 'ship_to' => 'getShipTo', + 'bill_to' => 'getBillTo', + 'organization' => 'getOrganization', + 'subtotal' => 'getSubtotal', + 'total_tax' => 'getTotalTax', + 'total_importer_tax' => 'getTotalImporterTax', + 'importer_of_record_tax' => 'getImporterOfRecordTax', + 'total_fees' => 'getTotalFees', + 'total_duty' => 'getTotalDuty', + 'total_discount' => 'getTotalDiscount', + 'total_shipping' => 'getTotalShipping', + 'total_amount' => 'getTotalAmount', + 'discount' => 'getDiscount', + 'available_to_refund_amount' => 'getAvailableToRefundAmount', + 'refunded_amount' => 'getRefundedAmount', + 'cancelled_amount' => 'getCancelledAmount', + 'captured_amount' => 'getCapturedAmount', + 'items' => 'getItems', + 'invoice_pd_fs' => 'getInvoicePdFs', + 'credit_memo_pd_fs' => 'getCreditMemoPdFs', + 'request_to_be_forgotten' => 'getRequestToBeForgotten', + 'shipping_choice' => 'getShippingChoice', + 'state' => 'getState', + 'state_transitions' => 'getStateTransitions', + 'fraud_state' => 'getFraudState', + 'fraud_state_transitions' => 'getFraudStateTransitions', + 'live_mode' => 'getLiveMode', + 'metadata' => 'getMetadata', + 'selling_entity' => 'getSellingEntity', + 'purchase_location' => 'getPurchaseLocation', + 'customer_type' => 'getCustomerType', + 'upstream_id' => 'getUpstreamId', + 'updated_time' => 'getUpdatedTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_ACCEPTED = 'accepted'; + const STATE_BLOCKED = 'blocked'; + const STATE_PENDING_PAYMENT = 'pending_payment'; + const STATE_IN_REVIEW = 'in_review'; + const STATE_DISPUTE = 'dispute'; + const STATE_CANCELLED = 'cancelled'; + const STATE_FULFILLED = 'fulfilled'; + const STATE_COMPLETE = 'complete'; + const STATE_RETURNED = 'returned'; + const FRAUD_STATE_BLOCKED = 'blocked'; + const FRAUD_STATE_REVIEW_OPENED = 'review_opened'; + const FRAUD_STATE_PASSED = 'passed'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_ACCEPTED, + self::STATE_BLOCKED, + self::STATE_PENDING_PAYMENT, + self::STATE_IN_REVIEW, + self::STATE_DISPUTE, + self::STATE_CANCELLED, + self::STATE_FULFILLED, + self::STATE_COMPLETE, + self::STATE_RETURNED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFraudStateAllowableValues() + { + $allowable = [ + self::FRAUD_STATE_BLOCKED, + self::FRAUD_STATE_REVIEW_OPENED, + self::FRAUD_STATE_PASSED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['checkout_id'] = isset($data['checkout_id']) ? $data['checkout_id'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; + $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; + $this->container['tax_identifiers'] = isset($data['tax_identifiers']) ? $data['tax_identifiers'] : null; + $this->container['invoice_attributes'] = isset($data['invoice_attributes']) ? $data['invoice_attributes'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['ship_to'] = isset($data['ship_to']) ? $data['ship_to'] : null; + $this->container['bill_to'] = isset($data['bill_to']) ? $data['bill_to'] : null; + $this->container['organization'] = isset($data['organization']) ? $data['organization'] : null; + $this->container['subtotal'] = isset($data['subtotal']) ? $data['subtotal'] : null; + $this->container['total_tax'] = isset($data['total_tax']) ? $data['total_tax'] : null; + $this->container['total_importer_tax'] = isset($data['total_importer_tax']) ? $data['total_importer_tax'] : null; + $this->container['importer_of_record_tax'] = isset($data['importer_of_record_tax']) ? $data['importer_of_record_tax'] : null; + $this->container['total_fees'] = isset($data['total_fees']) ? $data['total_fees'] : null; + $this->container['total_duty'] = isset($data['total_duty']) ? $data['total_duty'] : null; + $this->container['total_discount'] = isset($data['total_discount']) ? $data['total_discount'] : null; + $this->container['total_shipping'] = isset($data['total_shipping']) ? $data['total_shipping'] : null; + $this->container['total_amount'] = isset($data['total_amount']) ? $data['total_amount'] : null; + $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; + $this->container['available_to_refund_amount'] = isset($data['available_to_refund_amount']) ? $data['available_to_refund_amount'] : null; + $this->container['refunded_amount'] = isset($data['refunded_amount']) ? $data['refunded_amount'] : null; + $this->container['cancelled_amount'] = isset($data['cancelled_amount']) ? $data['cancelled_amount'] : null; + $this->container['captured_amount'] = isset($data['captured_amount']) ? $data['captured_amount'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['invoice_pd_fs'] = isset($data['invoice_pd_fs']) ? $data['invoice_pd_fs'] : null; + $this->container['credit_memo_pd_fs'] = isset($data['credit_memo_pd_fs']) ? $data['credit_memo_pd_fs'] : null; + $this->container['request_to_be_forgotten'] = isset($data['request_to_be_forgotten']) ? $data['request_to_be_forgotten'] : false; + $this->container['shipping_choice'] = isset($data['shipping_choice']) ? $data['shipping_choice'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['state_transitions'] = isset($data['state_transitions']) ? $data['state_transitions'] : null; + $this->container['fraud_state'] = isset($data['fraud_state']) ? $data['fraud_state'] : null; + $this->container['fraud_state_transitions'] = isset($data['fraud_state_transitions']) ? $data['fraud_state_transitions'] : null; + $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + $this->container['selling_entity'] = isset($data['selling_entity']) ? $data['selling_entity'] : null; + $this->container['purchase_location'] = isset($data['purchase_location']) ? $data['purchase_location'] : null; + $this->container['customer_type'] = isset($data['customer_type']) ? $data['customer_type'] : null; + $this->container['upstream_id'] = isset($data['upstream_id']) ? $data['upstream_id'] : null; + $this->container['updated_time'] = isset($data['updated_time']) ? $data['updated_time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getFraudStateAllowableValues(); + + if (!is_null($this->container['fraud_state']) && !in_array(strtolower($this->container['fraud_state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'fraud_state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier for the order. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets checkout_id + * + * @return string|null + */ + public function getCheckoutId() + { + return $this->container['checkout_id']; + } + + /** + * Sets checkout_id + * + * @param string|null $checkout_id The unique identifier of the checkout submitted to create the order. + * + * @return $this + */ + public function setCheckoutId($checkout_id) + { + $this->container['checkout_id'] = $checkout_id; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time Time at which the order was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id The identifier of the customer associated with this order. + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency A three-letter ISO currency code. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The customer's email address. + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets locale + * + * @return string|null + */ + public function getLocale() + { + return $this->container['locale']; + } + + /** + * Sets locale + * + * @param string|null $locale A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. + * + * @return $this + */ + public function setLocale($locale) + { + $this->container['locale'] = $locale; + + return $this; + } + + /** + * Gets browser_ip + * + * @return string|null + */ + public function getBrowserIp() + { + return $this->container['browser_ip']; + } + + /** + * Sets browser_ip + * + * @param string|null $browser_ip The IP address of the browser used by the customer when placing the order. + * + * @return $this + */ + public function setBrowserIp($browser_ip) + { + $this->container['browser_ip'] = $browser_ip; + + return $this; + } + + /** + * Gets application_id + * + * @return string|null + */ + public function getApplicationId() + { + return $this->container['application_id']; + } + + /** + * Sets application_id + * + * @param string|null $application_id An arbitrary string identifier that can be used to track the application type. + * + * @return $this + */ + public function setApplicationId($application_id) + { + $this->container['application_id'] = $application_id; + + return $this; + } + + /** + * Gets tax_identifiers + * + * @return \DigitalRiver\ApiSdk\Model\TaxIdentifier[]|null + */ + public function getTaxIdentifiers() + { + return $this->container['tax_identifiers']; + } + + /** + * Sets tax_identifiers + * + * @param \DigitalRiver\ApiSdk\Model\TaxIdentifier[]|null $tax_identifiers A list of the tax identifiers applied to this order. + * + * @return $this + */ + public function setTaxIdentifiers($tax_identifiers) + { + $this->container['tax_identifiers'] = $tax_identifiers; + + return $this; + } + + /** + * Gets invoice_attributes + * + * @return \DigitalRiver\ApiSdk\Model\InvoiceAttributes|null + */ + public function getInvoiceAttributes() + { + return $this->container['invoice_attributes']; + } + + /** + * Sets invoice_attributes + * + * @param \DigitalRiver\ApiSdk\Model\InvoiceAttributes|null $invoice_attributes invoice_attributes + * + * @return $this + */ + public function setInvoiceAttributes($invoice_attributes) + { + $this->container['invoice_attributes'] = $invoice_attributes; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\ShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\ShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + + /** + * Gets ship_to + * + * @return \DigitalRiver\ApiSdk\Model\Shipping|null + */ + public function getShipTo() + { + return $this->container['ship_to']; + } + + /** + * Sets ship_to + * + * @param \DigitalRiver\ApiSdk\Model\Shipping|null $ship_to ship_to + * + * @return $this + */ + public function setShipTo($ship_to) + { + $this->container['ship_to'] = $ship_to; + + return $this; + } + + /** + * Gets bill_to + * + * @return \DigitalRiver\ApiSdk\Model\Billing|null + */ + public function getBillTo() + { + return $this->container['bill_to']; + } + + /** + * Sets bill_to + * + * @param \DigitalRiver\ApiSdk\Model\Billing|null $bill_to bill_to + * + * @return $this + */ + public function setBillTo($bill_to) + { + $this->container['bill_to'] = $bill_to; + + return $this; + } + + /** + * Gets organization + * + * @return \DigitalRiver\ApiSdk\Model\Organization|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param \DigitalRiver\ApiSdk\Model\Organization|null $organization organization + * + * @return $this + */ + public function setOrganization($organization) + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets subtotal + * + * @return double|null + */ + public function getSubtotal() + { + return $this->container['subtotal']; + } + + /** + * Sets subtotal + * + * @param double|null $subtotal Represents the total order amount exclusive of tax. + * + * @return $this + */ + public function setSubtotal($subtotal) + { + $this->container['subtotal'] = $subtotal; + + return $this; + } + + /** + * Gets total_tax + * + * @return double|null + */ + public function getTotalTax() + { + return $this->container['total_tax']; + } + + /** + * Sets total_tax + * + * @param double|null $total_tax Represents the total tax amount. + * + * @return $this + */ + public function setTotalTax($total_tax) + { + $this->container['total_tax'] = $total_tax; + + return $this; + } + + /** + * Gets total_importer_tax + * + * @return double|null + */ + public function getTotalImporterTax() + { + return $this->container['total_importer_tax']; + } + + /** + * Sets total_importer_tax + * + * @param double|null $total_importer_tax Represents the total tax amount from the importer of record. + * + * @return $this + */ + public function setTotalImporterTax($total_importer_tax) + { + $this->container['total_importer_tax'] = $total_importer_tax; + + return $this; + } + + /** + * Gets importer_of_record_tax + * + * @return bool|null + */ + public function getImporterOfRecordTax() + { + return $this->container['importer_of_record_tax']; + } + + /** + * Sets importer_of_record_tax + * + * @param bool|null $importer_of_record_tax If true, indicates that the tax amount is paid by the importer of record. + * + * @return $this + */ + public function setImporterOfRecordTax($importer_of_record_tax) + { + $this->container['importer_of_record_tax'] = $importer_of_record_tax; + + return $this; + } + + /** + * Gets total_fees + * + * @return double|null + */ + public function getTotalFees() + { + return $this->container['total_fees']; + } + + /** + * Sets total_fees + * + * @param double|null $total_fees Represents the total fee amount. + * + * @return $this + */ + public function setTotalFees($total_fees) + { + $this->container['total_fees'] = $total_fees; + + return $this; + } + + /** + * Gets total_duty + * + * @return double|null + */ + public function getTotalDuty() + { + return $this->container['total_duty']; + } + + /** + * Sets total_duty + * + * @param double|null $total_duty Represents the total duty amount. + * + * @return $this + */ + public function setTotalDuty($total_duty) + { + $this->container['total_duty'] = $total_duty; + + return $this; + } + + /** + * Gets total_discount + * + * @return double|null + */ + public function getTotalDiscount() + { + return $this->container['total_discount']; + } + + /** + * Sets total_discount + * + * @param double|null $total_discount Represents the total discount amount. + * + * @return $this + */ + public function setTotalDiscount($total_discount) + { + $this->container['total_discount'] = $total_discount; + + return $this; + } + + /** + * Gets total_shipping + * + * @return double|null + */ + public function getTotalShipping() + { + return $this->container['total_shipping']; + } + + /** + * Sets total_shipping + * + * @param double|null $total_shipping Represents the total shipping amount. + * + * @return $this + */ + public function setTotalShipping($total_shipping) + { + $this->container['total_shipping'] = $total_shipping; + + return $this; + } + + /** + * Gets total_amount + * + * @return double|null + */ + public function getTotalAmount() + { + return $this->container['total_amount']; + } + + /** + * Sets total_amount + * + * @param double|null $total_amount Represents the total charge amount. + * + * @return $this + */ + public function setTotalAmount($total_amount) + { + $this->container['total_amount'] = $total_amount; + + return $this; + } + + /** + * Gets discount + * + * @return \DigitalRiver\ApiSdk\Model\Discount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \DigitalRiver\ApiSdk\Model\Discount|null $discount discount + * + * @return $this + */ + public function setDiscount($discount) + { + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets available_to_refund_amount + * + * @return double|null + */ + public function getAvailableToRefundAmount() + { + return $this->container['available_to_refund_amount']; + } + + /** + * Sets available_to_refund_amount + * + * @param double|null $available_to_refund_amount The available to refund amount at the order-level. + * + * @return $this + */ + public function setAvailableToRefundAmount($available_to_refund_amount) + { + $this->container['available_to_refund_amount'] = $available_to_refund_amount; + + return $this; + } + + /** + * Gets refunded_amount + * + * @return double|null + */ + public function getRefundedAmount() + { + return $this->container['refunded_amount']; + } + + /** + * Sets refunded_amount + * + * @param double|null $refunded_amount Represents the total payment amount refunded. + * + * @return $this + */ + public function setRefundedAmount($refunded_amount) + { + $this->container['refunded_amount'] = $refunded_amount; + + return $this; + } + + /** + * Gets cancelled_amount + * + * @return double|null + */ + public function getCancelledAmount() + { + return $this->container['cancelled_amount']; + } + + /** + * Sets cancelled_amount + * + * @param double|null $cancelled_amount Represents the total payment amount cancelled. + * + * @return $this + */ + public function setCancelledAmount($cancelled_amount) + { + $this->container['cancelled_amount'] = $cancelled_amount; + + return $this; + } + + /** + * Gets captured_amount + * + * @return double|null + */ + public function getCapturedAmount() + { + return $this->container['captured_amount']; + } + + /** + * Sets captured_amount + * + * @param double|null $captured_amount Represents the total payment amount captured. + * + * @return $this + */ + public function setCapturedAmount($captured_amount) + { + $this->container['captured_amount'] = $captured_amount; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\OrderItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\OrderItem[]|null $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets invoice_pd_fs + * + * @return \DigitalRiver\ApiSdk\Model\File[]|null + */ + public function getInvoicePdFs() + { + return $this->container['invoice_pd_fs']; + } + + /** + * Sets invoice_pd_fs + * + * @param \DigitalRiver\ApiSdk\Model\File[]|null $invoice_pd_fs An array of links to downloadable PDF invoices. If no invoices exist yet, the array is null. + * + * @return $this + */ + public function setInvoicePdFs($invoice_pd_fs) + { + $this->container['invoice_pd_fs'] = $invoice_pd_fs; + + return $this; + } + + /** + * Gets credit_memo_pd_fs + * + * @return \DigitalRiver\ApiSdk\Model\File[]|null + */ + public function getCreditMemoPdFs() + { + return $this->container['credit_memo_pd_fs']; + } + + /** + * Sets credit_memo_pd_fs + * + * @param \DigitalRiver\ApiSdk\Model\File[]|null $credit_memo_pd_fs An array of links to downloadable PDF credit memos. If no credit memos exist yet, the array is null. + * + * @return $this + */ + public function setCreditMemoPdFs($credit_memo_pd_fs) + { + $this->container['credit_memo_pd_fs'] = $credit_memo_pd_fs; + + return $this; + } + + /** + * Gets request_to_be_forgotten + * + * @return bool|null + */ + public function getRequestToBeForgotten() + { + return $this->container['request_to_be_forgotten']; + } + + /** + * Sets request_to_be_forgotten + * + * @param bool|null $request_to_be_forgotten If true indicates a user placing an order has requested this order be forgotten. + * + * @return $this + */ + public function setRequestToBeForgotten($request_to_be_forgotten) + { + $this->container['request_to_be_forgotten'] = $request_to_be_forgotten; + + return $this; + } + + /** + * Gets shipping_choice + * + * @return \DigitalRiver\ApiSdk\Model\ShippingChoice|null + */ + public function getShippingChoice() + { + return $this->container['shipping_choice']; + } + + /** + * Sets shipping_choice + * + * @param \DigitalRiver\ApiSdk\Model\ShippingChoice|null $shipping_choice shipping_choice + * + * @return $this + */ + public function setShippingChoice($shipping_choice) + { + $this->container['shipping_choice'] = $shipping_choice; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The current order state. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets state_transitions + * + * @return \DigitalRiver\ApiSdk\Model\OrderStateTransitions|null + */ + public function getStateTransitions() + { + return $this->container['state_transitions']; + } + + /** + * Sets state_transitions + * + * @param \DigitalRiver\ApiSdk\Model\OrderStateTransitions|null $state_transitions state_transitions + * + * @return $this + */ + public function setStateTransitions($state_transitions) + { + $this->container['state_transitions'] = $state_transitions; + + return $this; + } + + /** + * Gets fraud_state + * + * @return string|null + */ + public function getFraudState() + { + return $this->container['fraud_state']; + } + + /** + * Sets fraud_state + * + * @param string|null $fraud_state The fraud review state. + * + * @return $this + */ + public function setFraudState($fraud_state) + { + $allowedValues = $this->getFraudStateAllowableValues(); + if (!is_null($fraud_state) && !in_array(strtolower($fraud_state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'fraud_state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['fraud_state'] = $fraud_state; + + return $this; + } + + /** + * Gets fraud_state_transitions + * + * @return \DigitalRiver\ApiSdk\Model\FraudStateTransitions|null + */ + public function getFraudStateTransitions() + { + return $this->container['fraud_state_transitions']; + } + + /** + * Sets fraud_state_transitions + * + * @param \DigitalRiver\ApiSdk\Model\FraudStateTransitions|null $fraud_state_transitions fraud_state_transitions + * + * @return $this + */ + public function setFraudStateTransitions($fraud_state_transitions) + { + $this->container['fraud_state_transitions'] = $fraud_state_transitions; + + return $this; + } + + /** + * Gets live_mode + * + * @return bool|null + */ + public function getLiveMode() + { + return $this->container['live_mode']; + } + + /** + * Sets live_mode + * + * @param bool|null $live_mode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLiveMode($live_mode) + { + $this->container['live_mode'] = $live_mode; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets selling_entity + * + * @return \DigitalRiver\ApiSdk\Model\SellingEntity|null + */ + public function getSellingEntity() + { + return $this->container['selling_entity']; + } + + /** + * Sets selling_entity + * + * @param \DigitalRiver\ApiSdk\Model\SellingEntity|null $selling_entity selling_entity + * + * @return $this + */ + public function setSellingEntity($selling_entity) + { + $this->container['selling_entity'] = $selling_entity; + + return $this; + } + + /** + * Gets purchase_location + * + * @return \DigitalRiver\ApiSdk\Model\PurchaseLocation|null + */ + public function getPurchaseLocation() + { + return $this->container['purchase_location']; + } + + /** + * Sets purchase_location + * + * @param \DigitalRiver\ApiSdk\Model\PurchaseLocation|null $purchase_location purchase_location + * + * @return $this + */ + public function setPurchaseLocation($purchase_location) + { + $this->container['purchase_location'] = $purchase_location; + + return $this; + } + + /** + * Gets customer_type + * + * @return \DigitalRiver\ApiSdk\Model\CustomerType|null + */ + public function getCustomerType() + { + return $this->container['customer_type']; + } + + /** + * Sets customer_type + * + * @param \DigitalRiver\ApiSdk\Model\CustomerType|null $customer_type customer_type + * + * @return $this + */ + public function setCustomerType($customer_type) + { + $this->container['customer_type'] = $customer_type; + + return $this; + } + + /** + * Gets upstream_id + * + * @return string|null + */ + public function getUpstreamId() + { + return $this->container['upstream_id']; + } + + /** + * Sets upstream_id + * + * @param string|null $upstream_id The upstream identifier. + * + * @return $this + */ + public function setUpstreamId($upstream_id) + { + $this->container['upstream_id'] = $upstream_id; + + return $this; + } + + /** + * Gets updated_time + * + * @return \DateTime|null + */ + public function getUpdatedTime() + { + return $this->container['updated_time']; + } + + /** + * Sets updated_time + * + * @param \DateTime|null $updated_time Time at which the order was created. + * + * @return $this + */ + public function setUpdatedTime($updated_time) + { + $this->container['updated_time'] = $updated_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/OrderItem.php b/lib/Model/OrderItem.php index 96e2277..2091bec 100644 --- a/lib/Model/OrderItem.php +++ b/lib/Model/OrderItem.php @@ -48,6 +48,7 @@ class OrderItem implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'string', 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', 'fees' => '\DigitalRiver\ApiSdk\Model\Fees', 'quantity' => 'int', @@ -55,12 +56,13 @@ class OrderItem implements ModelInterface, ArrayAccess 'state_transitions' => '\DigitalRiver\ApiSdk\Model\OrderItemStateTransitions', 'amount' => 'double', 'available_to_refund_amount' => 'double', - 'tariff_code' => 'string', + 'seller_tax_identifier' => 'string', 'tax' => '\DigitalRiver\ApiSdk\Model\Tax', 'importer_tax' => '\DigitalRiver\ApiSdk\Model\ImporterTax', 'duties' => '\DigitalRiver\ApiSdk\Model\Duties', 'discount' => '\DigitalRiver\ApiSdk\Model\SkuDiscount', 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', + 'shipping' => '\DigitalRiver\ApiSdk\Model\ItemShipping', 'metadata' => 'map[string,AnyType]' ]; @@ -72,6 +74,7 @@ class OrderItem implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'sku_id' => null, + 'product_details' => null, 'subscription_info' => null, 'fees' => null, 'quantity' => null, @@ -79,12 +82,13 @@ class OrderItem implements ModelInterface, ArrayAccess 'state_transitions' => null, 'amount' => 'double', 'available_to_refund_amount' => 'double', - 'tariff_code' => null, + 'seller_tax_identifier' => null, 'tax' => null, 'importer_tax' => null, 'duties' => null, 'discount' => null, 'ship_from' => null, + 'shipping' => null, 'metadata' => null ]; @@ -117,6 +121,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'sku_id' => 'skuId', + 'product_details' => 'productDetails', 'subscription_info' => 'subscriptionInfo', 'fees' => 'fees', 'quantity' => 'quantity', @@ -124,12 +129,13 @@ public static function openAPIFormats() 'state_transitions' => 'stateTransitions', 'amount' => 'amount', 'available_to_refund_amount' => 'availableToRefundAmount', - 'tariff_code' => 'tariffCode', + 'seller_tax_identifier' => 'sellerTaxIdentifier', 'tax' => 'tax', 'importer_tax' => 'importerTax', 'duties' => 'duties', 'discount' => 'discount', 'ship_from' => 'shipFrom', + 'shipping' => 'shipping', 'metadata' => 'metadata' ]; @@ -141,6 +147,7 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', 'subscription_info' => 'setSubscriptionInfo', 'fees' => 'setFees', 'quantity' => 'setQuantity', @@ -148,12 +155,13 @@ public static function openAPIFormats() 'state_transitions' => 'setStateTransitions', 'amount' => 'setAmount', 'available_to_refund_amount' => 'setAvailableToRefundAmount', - 'tariff_code' => 'setTariffCode', + 'seller_tax_identifier' => 'setSellerTaxIdentifier', 'tax' => 'setTax', 'importer_tax' => 'setImporterTax', 'duties' => 'setDuties', 'discount' => 'setDiscount', 'ship_from' => 'setShipFrom', + 'shipping' => 'setShipping', 'metadata' => 'setMetadata' ]; @@ -165,6 +173,7 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', 'subscription_info' => 'getSubscriptionInfo', 'fees' => 'getFees', 'quantity' => 'getQuantity', @@ -172,12 +181,13 @@ public static function openAPIFormats() 'state_transitions' => 'getStateTransitions', 'amount' => 'getAmount', 'available_to_refund_amount' => 'getAvailableToRefundAmount', - 'tariff_code' => 'getTariffCode', + 'seller_tax_identifier' => 'getSellerTaxIdentifier', 'tax' => 'getTax', 'importer_tax' => 'getImporterTax', 'duties' => 'getDuties', 'discount' => 'getDiscount', 'ship_from' => 'getShipFrom', + 'shipping' => 'getShipping', 'metadata' => 'getMetadata' ]; @@ -269,6 +279,7 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; @@ -276,12 +287,13 @@ public function __construct(array $data = null) $this->container['state_transitions'] = isset($data['state_transitions']) ? $data['state_transitions'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; $this->container['available_to_refund_amount'] = isset($data['available_to_refund_amount']) ? $data['available_to_refund_amount'] : null; - $this->container['tariff_code'] = isset($data['tariff_code']) ? $data['tariff_code'] : null; + $this->container['seller_tax_identifier'] = isset($data['seller_tax_identifier']) ? $data['seller_tax_identifier'] : null; $this->container['tax'] = isset($data['tax']) ? $data['tax'] : null; $this->container['importer_tax'] = isset($data['importer_tax']) ? $data['importer_tax'] : null; $this->container['duties'] = isset($data['duties']) ? $data['duties'] : null; $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['shipping'] = isset($data['shipping']) ? $data['shipping'] : null; $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; } @@ -366,6 +378,30 @@ public function setSkuId($sku_id) return $this; } + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + /** * Gets subscription_info * @@ -544,25 +580,25 @@ public function setAvailableToRefundAmount($available_to_refund_amount) } /** - * Gets tariff_code + * Gets seller_tax_identifier * * @return string|null */ - public function getTariffCode() + public function getSellerTaxIdentifier() { - return $this->container['tariff_code']; + return $this->container['seller_tax_identifier']; } /** - * Sets tariff_code + * Sets seller_tax_identifier * - * @param string|null $tariff_code “Harmonized Tariff Schedule” that adds 4 more country-specific digits to the end of the HS Code and is determined by individual countries of import. + * @param string|null $seller_tax_identifier The tax identifier of the seller. * * @return $this */ - public function setTariffCode($tariff_code) + public function setSellerTaxIdentifier($seller_tax_identifier) { - $this->container['tariff_code'] = $tariff_code; + $this->container['seller_tax_identifier'] = $seller_tax_identifier; return $this; } @@ -687,6 +723,30 @@ public function setShipFrom($ship_from) return $this; } + /** + * Gets shipping + * + * @return \DigitalRiver\ApiSdk\Model\ItemShipping|null + */ + public function getShipping() + { + return $this->container['shipping']; + } + + /** + * Sets shipping + * + * @param \DigitalRiver\ApiSdk\Model\ItemShipping|null $shipping shipping + * + * @return $this + */ + public function setShipping($shipping) + { + $this->container['shipping'] = $shipping; + + return $this; + } + /** * Gets metadata * diff --git a/lib/Model/OrderItem1.php b/lib/Model/OrderItem1.php new file mode 100644 index 0000000..11ca2cb --- /dev/null +++ b/lib/Model/OrderItem1.php @@ -0,0 +1,850 @@ + 'string', + 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', + 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', + 'fees' => '\DigitalRiver\ApiSdk\Model\Fees', + 'quantity' => 'int', + 'state' => 'string', + 'state_transitions' => '\DigitalRiver\ApiSdk\Model\OrderItemStateTransitions', + 'amount' => 'double', + 'available_to_refund_amount' => 'double', + 'seller_tax_identifier' => 'string', + 'tax' => '\DigitalRiver\ApiSdk\Model\Tax', + 'importer_tax' => '\DigitalRiver\ApiSdk\Model\ImporterTax', + 'duties' => '\DigitalRiver\ApiSdk\Model\Duties', + 'discount' => '\DigitalRiver\ApiSdk\Model\SkuDiscount', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom1', + 'shipping' => '\DigitalRiver\ApiSdk\Model\ItemShipping', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'sku_id' => null, + 'product_details' => null, + 'subscription_info' => null, + 'fees' => null, + 'quantity' => null, + 'state' => null, + 'state_transitions' => null, + 'amount' => 'double', + 'available_to_refund_amount' => 'double', + 'seller_tax_identifier' => null, + 'tax' => null, + 'importer_tax' => null, + 'duties' => null, + 'discount' => null, + 'ship_from' => null, + 'shipping' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'sku_id' => 'skuId', + 'product_details' => 'productDetails', + 'subscription_info' => 'subscriptionInfo', + 'fees' => 'fees', + 'quantity' => 'quantity', + 'state' => 'state', + 'state_transitions' => 'stateTransitions', + 'amount' => 'amount', + 'available_to_refund_amount' => 'availableToRefundAmount', + 'seller_tax_identifier' => 'sellerTaxIdentifier', + 'tax' => 'tax', + 'importer_tax' => 'importerTax', + 'duties' => 'duties', + 'discount' => 'discount', + 'ship_from' => 'shipFrom', + 'shipping' => 'shipping', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', + 'subscription_info' => 'setSubscriptionInfo', + 'fees' => 'setFees', + 'quantity' => 'setQuantity', + 'state' => 'setState', + 'state_transitions' => 'setStateTransitions', + 'amount' => 'setAmount', + 'available_to_refund_amount' => 'setAvailableToRefundAmount', + 'seller_tax_identifier' => 'setSellerTaxIdentifier', + 'tax' => 'setTax', + 'importer_tax' => 'setImporterTax', + 'duties' => 'setDuties', + 'discount' => 'setDiscount', + 'ship_from' => 'setShipFrom', + 'shipping' => 'setShipping', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', + 'subscription_info' => 'getSubscriptionInfo', + 'fees' => 'getFees', + 'quantity' => 'getQuantity', + 'state' => 'getState', + 'state_transitions' => 'getStateTransitions', + 'amount' => 'getAmount', + 'available_to_refund_amount' => 'getAvailableToRefundAmount', + 'seller_tax_identifier' => 'getSellerTaxIdentifier', + 'tax' => 'getTax', + 'importer_tax' => 'getImporterTax', + 'duties' => 'getDuties', + 'discount' => 'getDiscount', + 'ship_from' => 'getShipFrom', + 'shipping' => 'getShipping', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_CREATED = 'created'; + const STATE_FULFILLED = 'fulfilled'; + const STATE_PAID = 'paid'; + const STATE_CANCELLED = 'cancelled'; + const STATE_BLOCKED = 'blocked'; + const STATE_RETURNED = 'returned'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_CREATED, + self::STATE_FULFILLED, + self::STATE_PAID, + self::STATE_CANCELLED, + self::STATE_BLOCKED, + self::STATE_RETURNED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; + $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; + $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['state_transitions'] = isset($data['state_transitions']) ? $data['state_transitions'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['available_to_refund_amount'] = isset($data['available_to_refund_amount']) ? $data['available_to_refund_amount'] : null; + $this->container['seller_tax_identifier'] = isset($data['seller_tax_identifier']) ? $data['seller_tax_identifier'] : null; + $this->container['tax'] = isset($data['tax']) ? $data['tax'] : null; + $this->container['importer_tax'] = isset($data['importer_tax']) ? $data['importer_tax'] : null; + $this->container['duties'] = isset($data['duties']) ? $data['duties'] : null; + $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['shipping'] = isset($data['shipping']) ? $data['shipping'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The identifier of the item. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets sku_id + * + * @return string|null + */ + public function getSkuId() + { + return $this->container['sku_id']; + } + + /** + * Sets sku_id + * + * @param string|null $sku_id The identifier of the stock keeping unit (SKU). + * + * @return $this + */ + public function setSkuId($sku_id) + { + $this->container['sku_id'] = $sku_id; + + return $this; + } + + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + + /** + * Gets subscription_info + * + * @return \DigitalRiver\ApiSdk\Model\SubscriptionInfo|null + */ + public function getSubscriptionInfo() + { + return $this->container['subscription_info']; + } + + /** + * Sets subscription_info + * + * @param \DigitalRiver\ApiSdk\Model\SubscriptionInfo|null $subscription_info subscription_info + * + * @return $this + */ + public function setSubscriptionInfo($subscription_info) + { + $this->container['subscription_info'] = $subscription_info; + + return $this; + } + + /** + * Gets fees + * + * @return \DigitalRiver\ApiSdk\Model\Fees|null + */ + public function getFees() + { + return $this->container['fees']; + } + + /** + * Sets fees + * + * @param \DigitalRiver\ApiSdk\Model\Fees|null $fees fees + * + * @return $this + */ + public function setFees($fees) + { + $this->container['fees'] = $fees; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity The number of items. + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The current order state. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets state_transitions + * + * @return \DigitalRiver\ApiSdk\Model\OrderItemStateTransitions|null + */ + public function getStateTransitions() + { + return $this->container['state_transitions']; + } + + /** + * Sets state_transitions + * + * @param \DigitalRiver\ApiSdk\Model\OrderItemStateTransitions|null $state_transitions state_transitions + * + * @return $this + */ + public function setStateTransitions($state_transitions) + { + $this->container['state_transitions'] = $state_transitions; + + return $this; + } + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The cost of the items. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets available_to_refund_amount + * + * @return double|null + */ + public function getAvailableToRefundAmount() + { + return $this->container['available_to_refund_amount']; + } + + /** + * Sets available_to_refund_amount + * + * @param double|null $available_to_refund_amount The available to refund amount. + * + * @return $this + */ + public function setAvailableToRefundAmount($available_to_refund_amount) + { + $this->container['available_to_refund_amount'] = $available_to_refund_amount; + + return $this; + } + + /** + * Gets seller_tax_identifier + * + * @return string|null + */ + public function getSellerTaxIdentifier() + { + return $this->container['seller_tax_identifier']; + } + + /** + * Sets seller_tax_identifier + * + * @param string|null $seller_tax_identifier The tax identifier of the seller. + * + * @return $this + */ + public function setSellerTaxIdentifier($seller_tax_identifier) + { + $this->container['seller_tax_identifier'] = $seller_tax_identifier; + + return $this; + } + + /** + * Gets tax + * + * @return \DigitalRiver\ApiSdk\Model\Tax|null + */ + public function getTax() + { + return $this->container['tax']; + } + + /** + * Sets tax + * + * @param \DigitalRiver\ApiSdk\Model\Tax|null $tax tax + * + * @return $this + */ + public function setTax($tax) + { + $this->container['tax'] = $tax; + + return $this; + } + + /** + * Gets importer_tax + * + * @return \DigitalRiver\ApiSdk\Model\ImporterTax|null + */ + public function getImporterTax() + { + return $this->container['importer_tax']; + } + + /** + * Sets importer_tax + * + * @param \DigitalRiver\ApiSdk\Model\ImporterTax|null $importer_tax importer_tax + * + * @return $this + */ + public function setImporterTax($importer_tax) + { + $this->container['importer_tax'] = $importer_tax; + + return $this; + } + + /** + * Gets duties + * + * @return \DigitalRiver\ApiSdk\Model\Duties|null + */ + public function getDuties() + { + return $this->container['duties']; + } + + /** + * Sets duties + * + * @param \DigitalRiver\ApiSdk\Model\Duties|null $duties duties + * + * @return $this + */ + public function setDuties($duties) + { + $this->container['duties'] = $duties; + + return $this; + } + + /** + * Gets discount + * + * @return \DigitalRiver\ApiSdk\Model\SkuDiscount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \DigitalRiver\ApiSdk\Model\SkuDiscount|null $discount discount + * + * @return $this + */ + public function setDiscount($discount) + { + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\ShipFrom1|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\ShipFrom1|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + + /** + * Gets shipping + * + * @return \DigitalRiver\ApiSdk\Model\ItemShipping|null + */ + public function getShipping() + { + return $this->container['shipping']; + } + + /** + * Sets shipping + * + * @param \DigitalRiver\ApiSdk\Model\ItemShipping|null $shipping shipping + * + * @return $this + */ + public function setShipping($shipping) + { + $this->container['shipping'] = $shipping; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/OrderRequest.php b/lib/Model/OrderRequest.php index 7d19c17..0a7d2b8 100644 --- a/lib/Model/OrderRequest.php +++ b/lib/Model/OrderRequest.php @@ -52,6 +52,7 @@ class OrderRequest implements ModelInterface, ArrayAccess 'currency' => 'string', 'email' => 'string', 'locale' => 'string', + 'invoice_attribute_id' => 'string', 'application_id' => 'string', 'browser_ip' => 'string', 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', @@ -83,6 +84,7 @@ class OrderRequest implements ModelInterface, ArrayAccess 'currency' => null, 'email' => 'email', 'locale' => null, + 'invoice_attribute_id' => null, 'application_id' => null, 'browser_ip' => null, 'ship_from' => null, @@ -135,6 +137,7 @@ public static function openAPIFormats() 'currency' => 'currency', 'email' => 'email', 'locale' => 'locale', + 'invoice_attribute_id' => 'invoiceAttributeId', 'application_id' => 'applicationId', 'browser_ip' => 'browserIp', 'ship_from' => 'shipFrom', @@ -166,6 +169,7 @@ public static function openAPIFormats() 'currency' => 'setCurrency', 'email' => 'setEmail', 'locale' => 'setLocale', + 'invoice_attribute_id' => 'setInvoiceAttributeId', 'application_id' => 'setApplicationId', 'browser_ip' => 'setBrowserIp', 'ship_from' => 'setShipFrom', @@ -197,6 +201,7 @@ public static function openAPIFormats() 'currency' => 'getCurrency', 'email' => 'getEmail', 'locale' => 'getLocale', + 'invoice_attribute_id' => 'getInvoiceAttributeId', 'application_id' => 'getApplicationId', 'browser_ip' => 'getBrowserIp', 'ship_from' => 'getShipFrom', @@ -282,6 +287,7 @@ public function __construct(array $data = null) $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['invoice_attribute_id'] = isset($data['invoice_attribute_id']) ? $data['invoice_attribute_id'] : null; $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; @@ -469,6 +475,30 @@ public function setLocale($locale) return $this; } + /** + * Gets invoice_attribute_id + * + * @return string|null + */ + public function getInvoiceAttributeId() + { + return $this->container['invoice_attribute_id']; + } + + /** + * Sets invoice_attribute_id + * + * @param string|null $invoice_attribute_id The unique identfier of the invoice attribute. + * + * @return $this + */ + public function setInvoiceAttributeId($invoice_attribute_id) + { + $this->container['invoice_attribute_id'] = $invoice_attribute_id; + + return $this; + } + /** * Gets application_id * diff --git a/lib/Model/PackageRequest.php b/lib/Model/PackageRequest.php new file mode 100644 index 0000000..7cc391c --- /dev/null +++ b/lib/Model/PackageRequest.php @@ -0,0 +1,422 @@ + 'int', + 'weight_unit' => 'string', + 'height' => 'int', + 'width' => 'int', + 'length' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'weight' => null, + 'weight_unit' => null, + 'height' => null, + 'width' => null, + 'length' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'weight' => 'weight', + 'weight_unit' => 'weightUnit', + 'height' => 'height', + 'width' => 'width', + 'length' => 'length' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'weight' => 'setWeight', + 'weight_unit' => 'setWeightUnit', + 'height' => 'setHeight', + 'width' => 'setWidth', + 'length' => 'setLength' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'weight' => 'getWeight', + 'weight_unit' => 'getWeightUnit', + 'height' => 'getHeight', + 'width' => 'getWidth', + 'length' => 'getLength' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + $this->container['weight_unit'] = isset($data['weight_unit']) ? $data['weight_unit'] : null; + $this->container['height'] = isset($data['height']) ? $data['height'] : null; + $this->container['width'] = isset($data['width']) ? $data['width'] : null; + $this->container['length'] = isset($data['length']) ? $data['length'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['weight'] === null) { + $invalidProperties[] = "'weight' can't be null"; + } + if ($this->container['weight_unit'] === null) { + $invalidProperties[] = "'weight_unit' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets weight + * + * @return int + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param int $weight The box’s weight. + * + * @return $this + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + return $this; + } + + /** + * Gets weight_unit + * + * @return string + */ + public function getWeightUnit() + { + return $this->container['weight_unit']; + } + + /** + * Sets weight_unit + * + * @param string $weight_unit The box’s weight unit. + * + * @return $this + */ + public function setWeightUnit($weight_unit) + { + $this->container['weight_unit'] = $weight_unit; + + return $this; + } + + /** + * Gets height + * + * @return int|null + */ + public function getHeight() + { + return $this->container['height']; + } + + /** + * Sets height + * + * @param int|null $height The box’s height. + * + * @return $this + */ + public function setHeight($height) + { + $this->container['height'] = $height; + + return $this; + } + + /** + * Gets width + * + * @return int|null + */ + public function getWidth() + { + return $this->container['width']; + } + + /** + * Sets width + * + * @param int|null $width The box’s width. + * + * @return $this + */ + public function setWidth($width) + { + $this->container['width'] = $width; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length The box’s length. + * + * @return $this + */ + public function setLength($length) + { + $this->container['length'] = $length; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Plan.php b/lib/Model/Plan.php index 19295bd..0c3cdcf 100644 --- a/lib/Model/Plan.php +++ b/lib/Model/Plan.php @@ -57,6 +57,7 @@ class Plan implements ModelInterface, ArrayAccess 'created_time' => '\DateTime', 'name' => 'string', 'reminder_offset_days' => 'int', + 'billing_optimization' => 'bool', 'billing_offset_days' => 'int', 'collection_period_days' => 'int', 'state' => 'string', @@ -80,6 +81,7 @@ class Plan implements ModelInterface, ArrayAccess 'created_time' => 'date-time', 'name' => null, 'reminder_offset_days' => null, + 'billing_optimization' => null, 'billing_offset_days' => null, 'collection_period_days' => null, 'state' => null, @@ -124,6 +126,7 @@ public static function openAPIFormats() 'created_time' => 'createdTime', 'name' => 'name', 'reminder_offset_days' => 'reminderOffsetDays', + 'billing_optimization' => 'billingOptimization', 'billing_offset_days' => 'billingOffsetDays', 'collection_period_days' => 'collectionPeriodDays', 'state' => 'state', @@ -147,6 +150,7 @@ public static function openAPIFormats() 'created_time' => 'setCreatedTime', 'name' => 'setName', 'reminder_offset_days' => 'setReminderOffsetDays', + 'billing_optimization' => 'setBillingOptimization', 'billing_offset_days' => 'setBillingOffsetDays', 'collection_period_days' => 'setCollectionPeriodDays', 'state' => 'setState', @@ -170,6 +174,7 @@ public static function openAPIFormats() 'created_time' => 'getCreatedTime', 'name' => 'getName', 'reminder_offset_days' => 'getReminderOffsetDays', + 'billing_optimization' => 'getBillingOptimization', 'billing_offset_days' => 'getBillingOffsetDays', 'collection_period_days' => 'getCollectionPeriodDays', 'state' => 'getState', @@ -291,6 +296,7 @@ public function __construct(array $data = null) $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['reminder_offset_days'] = isset($data['reminder_offset_days']) ? $data['reminder_offset_days'] : null; + $this->container['billing_optimization'] = isset($data['billing_optimization']) ? $data['billing_optimization'] : null; $this->container['billing_offset_days'] = isset($data['billing_offset_days']) ? $data['billing_offset_days'] : null; $this->container['collection_period_days'] = isset($data['collection_period_days']) ? $data['collection_period_days'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; @@ -630,6 +636,30 @@ public function setReminderOffsetDays($reminder_offset_days) return $this; } + /** + * Gets billing_optimization + * + * @return bool|null + */ + public function getBillingOptimization() + { + return $this->container['billing_optimization']; + } + + /** + * Sets billing_optimization + * + * @param bool|null $billing_optimization Indicates whether billing optimization is activated. + * + * @return $this + */ + public function setBillingOptimization($billing_optimization) + { + $this->container['billing_optimization'] = $billing_optimization; + + return $this; + } + /** * Gets billing_offset_days * diff --git a/lib/Model/ProductDetails.php b/lib/Model/ProductDetails.php new file mode 100644 index 0000000..d45f32f --- /dev/null +++ b/lib/Model/ProductDetails.php @@ -0,0 +1,606 @@ + 'string', + 'sku_group_id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'url' => 'string', + 'country_of_origin' => 'string', + 'image' => 'string', + 'weight' => 'double', + 'weight_unit' => 'string', + 'part_number' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'sku_group_id' => null, + 'name' => null, + 'description' => null, + 'url' => null, + 'country_of_origin' => null, + 'image' => null, + 'weight' => 'double', + 'weight_unit' => null, + 'part_number' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'sku_group_id' => 'skuGroupId', + 'name' => 'name', + 'description' => 'description', + 'url' => 'url', + 'country_of_origin' => 'countryOfOrigin', + 'image' => 'image', + 'weight' => 'weight', + 'weight_unit' => 'weightUnit', + 'part_number' => 'partNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'sku_group_id' => 'setSkuGroupId', + 'name' => 'setName', + 'description' => 'setDescription', + 'url' => 'setUrl', + 'country_of_origin' => 'setCountryOfOrigin', + 'image' => 'setImage', + 'weight' => 'setWeight', + 'weight_unit' => 'setWeightUnit', + 'part_number' => 'setPartNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'sku_group_id' => 'getSkuGroupId', + 'name' => 'getName', + 'description' => 'getDescription', + 'url' => 'getUrl', + 'country_of_origin' => 'getCountryOfOrigin', + 'image' => 'getImage', + 'weight' => 'getWeight', + 'weight_unit' => 'getWeightUnit', + 'part_number' => 'getPartNumber' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const WEIGHT_UNIT_OZ = 'oz'; + const WEIGHT_UNIT_LB = 'lb'; + const WEIGHT_UNIT_G = 'g'; + const WEIGHT_UNIT_KG = 'kg'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWeightUnitAllowableValues() + { + $allowable = [ + self::WEIGHT_UNIT_OZ, + self::WEIGHT_UNIT_LB, + self::WEIGHT_UNIT_G, + self::WEIGHT_UNIT_KG, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['sku_group_id'] = isset($data['sku_group_id']) ? $data['sku_group_id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['url'] = isset($data['url']) ? $data['url'] : null; + $this->container['country_of_origin'] = isset($data['country_of_origin']) ? $data['country_of_origin'] : null; + $this->container['image'] = isset($data['image']) ? $data['image'] : null; + $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null; + $this->container['weight_unit'] = isset($data['weight_unit']) ? $data['weight_unit'] : null; + $this->container['part_number'] = isset($data['part_number']) ? $data['part_number'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getWeightUnitAllowableValues(); + + if (!is_null($this->container['weight_unit']) && !in_array(strtolower($this->container['weight_unit']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'weight_unit', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The identifier of the product in the upstream system. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets sku_group_id + * + * @return string|null + */ + public function getSkuGroupId() + { + return $this->container['sku_group_id']; + } + + /** + * Sets sku_group_id + * + * @param string|null $sku_group_id The identifier of the SKU group. + * + * @return $this + */ + public function setSkuGroupId($sku_group_id) + { + $this->container['sku_group_id'] = $sku_group_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the product. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the product. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets url + * + * @return string|null + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string|null $url The product url. + * + * @return $this + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets country_of_origin + * + * @return string|null + */ + public function getCountryOfOrigin() + { + return $this->container['country_of_origin']; + } + + /** + * Sets country_of_origin + * + * @param string|null $country_of_origin The country of origin of the product. + * + * @return $this + */ + public function setCountryOfOrigin($country_of_origin) + { + $this->container['country_of_origin'] = $country_of_origin; + + return $this; + } + + /** + * Gets image + * + * @return string|null + */ + public function getImage() + { + return $this->container['image']; + } + + /** + * Sets image + * + * @param string|null $image The image of the product. + * + * @return $this + */ + public function setImage($image) + { + $this->container['image'] = $image; + + return $this; + } + + /** + * Gets weight + * + * @return double|null + */ + public function getWeight() + { + return $this->container['weight']; + } + + /** + * Sets weight + * + * @param double|null $weight The weight of the product measured in the unit specified by weightUnit. + * + * @return $this + */ + public function setWeight($weight) + { + $this->container['weight'] = $weight; + + return $this; + } + + /** + * Gets weight_unit + * + * @return string|null + */ + public function getWeightUnit() + { + return $this->container['weight_unit']; + } + + /** + * Sets weight_unit + * + * @param string|null $weight_unit The unit of measurement applied to the weight. + * + * @return $this + */ + public function setWeightUnit($weight_unit) + { + $allowedValues = $this->getWeightUnitAllowableValues(); + if (!is_null($weight_unit) && !in_array(strtolower($weight_unit), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'weight_unit', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['weight_unit'] = $weight_unit; + + return $this; + } + + /** + * Gets part_number + * + * @return string|null + */ + public function getPartNumber() + { + return $this->container['part_number']; + } + + /** + * Sets part_number + * + * @param string|null $part_number The manufacturer's part number. + * + * @return $this + */ + public function setPartNumber($part_number) + { + $this->container['part_number'] = $part_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ProductItemRequest.php b/lib/Model/ProductItemRequest.php index dfd52d1..dffe7bb 100644 --- a/lib/Model/ProductItemRequest.php +++ b/lib/Model/ProductItemRequest.php @@ -46,8 +46,8 @@ class ProductItemRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'inventory_item_id' => 'string', - 'price' => 'double', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', + 'amount' => 'double', 'quantity' => 'int' ]; @@ -57,8 +57,8 @@ class ProductItemRequest implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'inventory_item_id' => null, - 'price' => 'double', + 'product_details' => null, + 'amount' => 'double', 'quantity' => null ]; @@ -89,8 +89,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'inventory_item_id' => 'inventoryItemId', - 'price' => 'price', + 'product_details' => 'productDetails', + 'amount' => 'amount', 'quantity' => 'quantity' ]; @@ -100,8 +100,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'inventory_item_id' => 'setInventoryItemId', - 'price' => 'setPrice', + 'product_details' => 'setProductDetails', + 'amount' => 'setAmount', 'quantity' => 'setQuantity' ]; @@ -111,8 +111,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'inventory_item_id' => 'getInventoryItemId', - 'price' => 'getPrice', + 'product_details' => 'getProductDetails', + 'amount' => 'getAmount', 'quantity' => 'getQuantity' ]; @@ -176,8 +176,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['inventory_item_id'] = isset($data['inventory_item_id']) ? $data['inventory_item_id'] : null; - $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; } @@ -190,11 +190,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['inventory_item_id'] === null) { - $invalidProperties[] = "'inventory_item_id' can't be null"; - } - if ($this->container['price'] === null) { - $invalidProperties[] = "'price' can't be null"; + if ($this->container['product_details'] === null) { + $invalidProperties[] = "'product_details' can't be null"; } if ($this->container['quantity'] === null) { $invalidProperties[] = "'quantity' can't be null"; @@ -215,49 +212,49 @@ public function valid() /** - * Gets inventory_item_id + * Gets product_details * - * @return string + * @return \DigitalRiver\ApiSdk\Model\ProductDetails */ - public function getInventoryItemId() + public function getProductDetails() { - return $this->container['inventory_item_id']; + return $this->container['product_details']; } /** - * Sets inventory_item_id + * Sets product_details * - * @param string $inventory_item_id The inventory item identifier. + * @param \DigitalRiver\ApiSdk\Model\ProductDetails $product_details product_details * * @return $this */ - public function setInventoryItemId($inventory_item_id) + public function setProductDetails($product_details) { - $this->container['inventory_item_id'] = $inventory_item_id; + $this->container['product_details'] = $product_details; return $this; } /** - * Gets price + * Gets amount * - * @return double + * @return double|null */ - public function getPrice() + public function getAmount() { - return $this->container['price']; + return $this->container['amount']; } /** - * Sets price + * Sets amount * - * @param double $price The unit price of the product. + * @param double|null $amount The amount of the product. * * @return $this */ - public function setPrice($price) + public function setAmount($amount) { - $this->container['price'] = $price; + $this->container['amount'] = $amount; return $this; } diff --git a/lib/Model/Redirects.php b/lib/Model/Redirects.php new file mode 100644 index 0000000..77ef60c --- /dev/null +++ b/lib/Model/Redirects.php @@ -0,0 +1,326 @@ + 'string', + 'cancel_url' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'success_url' => null, + 'cancel_url' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success_url' => 'successUrl', + 'cancel_url' => 'cancelUrl' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success_url' => 'setSuccessUrl', + 'cancel_url' => 'setCancelUrl' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success_url' => 'getSuccessUrl', + 'cancel_url' => 'getCancelUrl' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['success_url'] = isset($data['success_url']) ? $data['success_url'] : null; + $this->container['cancel_url'] = isset($data['cancel_url']) ? $data['cancel_url'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets success_url + * + * @return string|null + */ + public function getSuccessUrl() + { + return $this->container['success_url']; + } + + /** + * Sets success_url + * + * @param string|null $success_url success_url + * + * @return $this + */ + public function setSuccessUrl($success_url) + { + $this->container['success_url'] = $success_url; + + return $this; + } + + /** + * Gets cancel_url + * + * @return string|null + */ + public function getCancelUrl() + { + return $this->container['cancel_url']; + } + + /** + * Sets cancel_url + * + * @param string|null $cancel_url cancel_url + * + * @return $this + */ + public function setCancelUrl($cancel_url) + { + $this->container['cancel_url'] = $cancel_url; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/RequestReturnsItem.php b/lib/Model/RequestReturnsItem.php new file mode 100644 index 0000000..1e33b1c --- /dev/null +++ b/lib/Model/RequestReturnsItem.php @@ -0,0 +1,359 @@ + 'string', + 'sku_id' => 'string', + 'quantity' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'item_id' => null, + 'sku_id' => null, + 'quantity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item_id' => 'itemId', + 'sku_id' => 'skuId', + 'quantity' => 'quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item_id' => 'setItemId', + 'sku_id' => 'setSkuId', + 'quantity' => 'setQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item_id' => 'getItemId', + 'sku_id' => 'getSkuId', + 'quantity' => 'getQuantity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item_id'] = isset($data['item_id']) ? $data['item_id'] : null; + $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item_id + * + * @return string|null + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param string|null $item_id The identifier of the item. + * + * @return $this + */ + public function setItemId($item_id) + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets sku_id + * + * @return string|null + */ + public function getSkuId() + { + return $this->container['sku_id']; + } + + /** + * Sets sku_id + * + * @param string|null $sku_id The identifier of the SKU. + * + * @return $this + */ + public function setSkuId($sku_id) + { + $this->container['sku_id'] = $sku_id; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity The number of items. + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReturnItem.php b/lib/Model/ReturnItem.php index c4a1be1..91afead 100644 --- a/lib/Model/ReturnItem.php +++ b/lib/Model/ReturnItem.php @@ -47,11 +47,9 @@ class ReturnItem implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'item_id' => 'string', - 'sku_id' => 'string', - 'amount' => 'double', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'quantity' => 'int', - 'quantity_accepted' => 'int', - 'state' => 'string' + 'condition' => 'string' ]; /** @@ -61,11 +59,9 @@ class ReturnItem implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'item_id' => null, - 'sku_id' => null, - 'amount' => 'double', + 'product_details' => null, 'quantity' => null, - 'quantity_accepted' => null, - 'state' => null + 'condition' => null ]; /** @@ -96,11 +92,9 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'item_id' => 'itemId', - 'sku_id' => 'skuId', - 'amount' => 'amount', + 'product_details' => 'productDetails', 'quantity' => 'quantity', - 'quantity_accepted' => 'quantityAccepted', - 'state' => 'state' + 'condition' => 'condition' ]; /** @@ -110,11 +104,9 @@ public static function openAPIFormats() */ protected static $setters = [ 'item_id' => 'setItemId', - 'sku_id' => 'setSkuId', - 'amount' => 'setAmount', + 'product_details' => 'setProductDetails', 'quantity' => 'setQuantity', - 'quantity_accepted' => 'setQuantityAccepted', - 'state' => 'setState' + 'condition' => 'setCondition' ]; /** @@ -124,11 +116,9 @@ public static function openAPIFormats() */ protected static $getters = [ 'item_id' => 'getItemId', - 'sku_id' => 'getSkuId', - 'amount' => 'getAmount', + 'product_details' => 'getProductDetails', 'quantity' => 'getQuantity', - 'quantity_accepted' => 'getQuantityAccepted', - 'state' => 'getState' + 'condition' => 'getCondition' ]; /** @@ -172,27 +162,9 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_CREATED = 'created'; - const STATE_ACCEPTED = 'accepted'; - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStateAllowableValues() - { - $allowable = [ - self::STATE_CREATED, - self::STATE_ACCEPTED, - ]; - - $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); - return $allowableAllCase; - } - /** * Associative array for storing property values @@ -210,11 +182,9 @@ public function getStateAllowableValues() public function __construct(array $data = null) { $this->container['item_id'] = isset($data['item_id']) ? $data['item_id'] : null; - $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; - $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; - $this->container['quantity_accepted'] = isset($data['quantity_accepted']) ? $data['quantity_accepted'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['condition'] = isset($data['condition']) ? $data['condition'] : null; } /** @@ -226,15 +196,9 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getStateAllowableValues(); - - if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ); + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; } - return $invalidProperties; } @@ -275,49 +239,25 @@ public function setItemId($item_id) } /** - * Gets sku_id - * - * @return string|null - */ - public function getSkuId() - { - return $this->container['sku_id']; - } - - /** - * Sets sku_id - * - * @param string|null $sku_id The identifier of the SKU. - * - * @return $this - */ - public function setSkuId($sku_id) - { - $this->container['sku_id'] = $sku_id; - - return $this; - } - - /** - * Gets amount + * Gets product_details * - * @return double|null + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null */ - public function getAmount() + public function getProductDetails() { - return $this->container['amount']; + return $this->container['product_details']; } /** - * Sets amount + * Sets product_details * - * @param double|null $amount amount + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details * * @return $this */ - public function setAmount($amount) + public function setProductDetails($product_details) { - $this->container['amount'] = $amount; + $this->container['product_details'] = $product_details; return $this; } @@ -325,7 +265,7 @@ public function setAmount($amount) /** * Gets quantity * - * @return int|null + * @return int */ public function getQuantity() { @@ -335,7 +275,7 @@ public function getQuantity() /** * Sets quantity * - * @param int|null $quantity quantity + * @param int $quantity The number of items. * * @return $this */ @@ -347,58 +287,25 @@ public function setQuantity($quantity) } /** - * Gets quantity_accepted - * - * @return int|null - */ - public function getQuantityAccepted() - { - return $this->container['quantity_accepted']; - } - - /** - * Sets quantity_accepted - * - * @param int|null $quantity_accepted quantity_accepted - * - * @return $this - */ - public function setQuantityAccepted($quantity_accepted) - { - $this->container['quantity_accepted'] = $quantity_accepted; - - return $this; - } - - /** - * Gets state + * Gets condition * * @return string|null */ - public function getState() + public function getCondition() { - return $this->container['state']; + return $this->container['condition']; } /** - * Sets state + * Sets condition * - * @param string|null $state The current state of the return item. + * @param string|null $condition Condition of the returned goods. * * @return $this */ - public function setState($state) + public function setCondition($condition) { - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['state'] = $state; + $this->container['condition'] = $condition; return $this; } diff --git a/lib/Model/ReturnItemRequest.php b/lib/Model/ReturnItemRequest.php new file mode 100644 index 0000000..1d94a81 --- /dev/null +++ b/lib/Model/ReturnItemRequest.php @@ -0,0 +1,332 @@ + 'string', + 'quantity' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'item_id' => null, + 'quantity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item_id' => 'itemId', + 'quantity' => 'quantity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item_id' => 'setItemId', + 'quantity' => 'setQuantity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item_id' => 'getItemId', + 'quantity' => 'getQuantity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item_id'] = isset($data['item_id']) ? $data['item_id'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['item_id'] === null) { + $invalidProperties[] = "'item_id' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item_id + * + * @return string + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param string $item_id The identifier of the item. + * + * @return $this + */ + public function setItemId($item_id) + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity The number of items. + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReturnRequest.php b/lib/Model/ReturnRequest.php index 0d7c4a0..3391e9b 100644 --- a/lib/Model/ReturnRequest.php +++ b/lib/Model/ReturnRequest.php @@ -47,10 +47,9 @@ class ReturnRequest implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'order_id' => 'string', + 'rma_number' => 'string', 'reason' => 'string', - 'items' => '\DigitalRiver\ApiSdk\Model\RequestReturnItem[]', - 'location' => '\DigitalRiver\ApiSdk\Model\ReturnLocation', - 'metadata' => 'map[string,AnyType]' + 'items' => '\DigitalRiver\ApiSdk\Model\ReturnItemRequest[]' ]; /** @@ -60,10 +59,9 @@ class ReturnRequest implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'order_id' => null, + 'rma_number' => null, 'reason' => null, - 'items' => null, - 'location' => null, - 'metadata' => null + 'items' => null ]; /** @@ -94,10 +92,9 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'order_id' => 'orderId', + 'rma_number' => 'rmaNumber', 'reason' => 'reason', - 'items' => 'items', - 'location' => 'location', - 'metadata' => 'metadata' + 'items' => 'items' ]; /** @@ -107,10 +104,9 @@ public static function openAPIFormats() */ protected static $setters = [ 'order_id' => 'setOrderId', + 'rma_number' => 'setRmaNumber', 'reason' => 'setReason', - 'items' => 'setItems', - 'location' => 'setLocation', - 'metadata' => 'setMetadata' + 'items' => 'setItems' ]; /** @@ -120,10 +116,9 @@ public static function openAPIFormats() */ protected static $getters = [ 'order_id' => 'getOrderId', + 'rma_number' => 'getRmaNumber', 'reason' => 'getReason', - 'items' => 'getItems', - 'location' => 'getLocation', - 'metadata' => 'getMetadata' + 'items' => 'getItems' ]; /** @@ -187,10 +182,9 @@ public function getModelName() public function __construct(array $data = null) { $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['rma_number'] = isset($data['rma_number']) ? $data['rma_number'] : null; $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; - $this->container['location'] = isset($data['location']) ? $data['location'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; } /** @@ -205,6 +199,9 @@ public function listInvalidProperties() if ($this->container['order_id'] === null) { $invalidProperties[] = "'order_id' can't be null"; } + if ($this->container['rma_number'] === null) { + $invalidProperties[] = "'rma_number' can't be null"; + } if (!is_null($this->container['reason']) && (mb_strlen($this->container['reason']) > 64)) { $invalidProperties[] = "invalid value for 'reason', the character length must be smaller than or equal to 64."; } @@ -240,7 +237,7 @@ public function getOrderId() /** * Sets order_id * - * @param string $order_id The unique identifier of the Order associated with the Return. + * @param string $order_id The unique identifier of the order associated with the return. * * @return $this */ @@ -251,6 +248,30 @@ public function setOrderId($order_id) return $this; } + /** + * Gets rma_number + * + * @return string + */ + public function getRmaNumber() + { + return $this->container['rma_number']; + } + + /** + * Sets rma_number + * + * @param string $rma_number The return merchandise authorization number. + * + * @return $this + */ + public function setRmaNumber($rma_number) + { + $this->container['rma_number'] = $rma_number; + + return $this; + } + /** * Gets reason * @@ -282,7 +303,7 @@ public function setReason($reason) /** * Gets items * - * @return \DigitalRiver\ApiSdk\Model\RequestReturnItem[] + * @return \DigitalRiver\ApiSdk\Model\ReturnItemRequest[] */ public function getItems() { @@ -292,7 +313,7 @@ public function getItems() /** * Sets items * - * @param \DigitalRiver\ApiSdk\Model\RequestReturnItem[] $items items + * @param \DigitalRiver\ApiSdk\Model\ReturnItemRequest[] $items items * * @return $this */ @@ -302,54 +323,6 @@ public function setItems($items) return $this; } - - /** - * Gets location - * - * @return \DigitalRiver\ApiSdk\Model\ReturnLocation|null - */ - public function getLocation() - { - return $this->container['location']; - } - - /** - * Sets location - * - * @param \DigitalRiver\ApiSdk\Model\ReturnLocation|null $location location - * - * @return $this - */ - public function setLocation($location) - { - $this->container['location'] = $location; - - return $this; - } - - /** - * Gets metadata - * - * @return map[string,AnyType]|null - */ - public function getMetadata() - { - return $this->container['metadata']; - } - - /** - * Sets metadata - * - * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. - * - * @return $this - */ - public function setMetadata($metadata) - { - $this->container['metadata'] = $metadata; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ReturnResponse.php b/lib/Model/ReturnResponse.php index 97680d6..6a30eec 100644 --- a/lib/Model/ReturnResponse.php +++ b/lib/Model/ReturnResponse.php @@ -48,17 +48,13 @@ class ReturnResponse implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'string', 'created_time' => '\DateTime', - 'updated_time' => '\DateTime', 'order_id' => 'string', - 'currency' => 'string', - 'items' => '\DigitalRiver\ApiSdk\Model\ReturnItem[]', + 'rma_number' => 'string', 'reason' => 'string', - 'failure_reason' => 'string', - 'state' => 'string', - 'location' => '\DigitalRiver\ApiSdk\Model\ReturnLocation', - 'live_mode' => 'bool', - 'metadata' => 'map[string,AnyType]', - 'refund_ids' => 'string[]' + 'type' => 'string', + 'return_to' => '\DigitalRiver\ApiSdk\Model\Shipping', + 'items' => '\DigitalRiver\ApiSdk\Model\ReturnItem[]', + 'live_mode' => 'bool' ]; /** @@ -69,17 +65,13 @@ class ReturnResponse implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'created_time' => 'date-time', - 'updated_time' => 'date-time', 'order_id' => null, - 'currency' => null, - 'items' => null, + 'rma_number' => null, 'reason' => null, - 'failure_reason' => null, - 'state' => null, - 'location' => null, - 'live_mode' => null, - 'metadata' => null, - 'refund_ids' => null + 'type' => null, + 'return_to' => null, + 'items' => null, + 'live_mode' => null ]; /** @@ -111,17 +103,13 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'created_time' => 'createdTime', - 'updated_time' => 'updatedTime', 'order_id' => 'orderId', - 'currency' => 'currency', - 'items' => 'items', + 'rma_number' => 'rmaNumber', 'reason' => 'reason', - 'failure_reason' => 'failureReason', - 'state' => 'state', - 'location' => 'location', - 'live_mode' => 'liveMode', - 'metadata' => 'metadata', - 'refund_ids' => 'refundIds' + 'type' => 'type', + 'return_to' => 'returnTo', + 'items' => 'items', + 'live_mode' => 'liveMode' ]; /** @@ -132,17 +120,13 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'created_time' => 'setCreatedTime', - 'updated_time' => 'setUpdatedTime', 'order_id' => 'setOrderId', - 'currency' => 'setCurrency', - 'items' => 'setItems', + 'rma_number' => 'setRmaNumber', 'reason' => 'setReason', - 'failure_reason' => 'setFailureReason', - 'state' => 'setState', - 'location' => 'setLocation', - 'live_mode' => 'setLiveMode', - 'metadata' => 'setMetadata', - 'refund_ids' => 'setRefundIds' + 'type' => 'setType', + 'return_to' => 'setReturnTo', + 'items' => 'setItems', + 'live_mode' => 'setLiveMode' ]; /** @@ -153,17 +137,13 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'created_time' => 'getCreatedTime', - 'updated_time' => 'getUpdatedTime', 'order_id' => 'getOrderId', - 'currency' => 'getCurrency', - 'items' => 'getItems', + 'rma_number' => 'getRmaNumber', 'reason' => 'getReason', - 'failure_reason' => 'getFailureReason', - 'state' => 'getState', - 'location' => 'getLocation', - 'live_mode' => 'getLiveMode', - 'metadata' => 'getMetadata', - 'refund_ids' => 'getRefundIds' + 'type' => 'getType', + 'return_to' => 'getReturnTo', + 'items' => 'getItems', + 'live_mode' => 'getLiveMode' ]; /** @@ -207,8 +187,10 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_CREATED = 'created'; - const STATE_ACCEPTED = 'accepted'; + const TYPE_AUTHORIZATION = 'authorization'; + const TYPE_RECEIVED = 'received'; + const TYPE_REFUSED = 'refused'; + const TYPE_UNDELIVERABLE = 'undeliverable'; @@ -217,11 +199,13 @@ public function getModelName() * * @return string[] */ - public function getStateAllowableValues() + public function getTypeAllowableValues() { $allowable = [ - self::STATE_CREATED, - self::STATE_ACCEPTED, + self::TYPE_AUTHORIZATION, + self::TYPE_RECEIVED, + self::TYPE_REFUSED, + self::TYPE_UNDELIVERABLE, ]; $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); @@ -246,17 +230,13 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; - $this->container['updated_time'] = isset($data['updated_time']) ? $data['updated_time'] : null; $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['rma_number'] = isset($data['rma_number']) ? $data['rma_number'] : null; $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; - $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['return_to'] = isset($data['return_to']) ? $data['return_to'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; - $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; - $this->container['refund_ids'] = isset($data['refund_ids']) ? $data['refund_ids'] : null; } /** @@ -268,11 +248,15 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getStateAllowableValues(); + if (!is_null($this->container['reason']) && (mb_strlen($this->container['reason']) > 64)) { + $invalidProperties[] = "invalid value for 'reason', the character length must be smaller than or equal to 64."; + } + + $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + if (!is_null($this->container['type']) && !in_array(strtolower($this->container['type']), $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'state', must be one of '%s'", + "invalid value for 'type', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -340,30 +324,6 @@ public function setCreatedTime($created_time) return $this; } - /** - * Gets updated_time - * - * @return \DateTime|null - */ - public function getUpdatedTime() - { - return $this->container['updated_time']; - } - - /** - * Sets updated_time - * - * @param \DateTime|null $updated_time The time at which the return was updated. - * - * @return $this - */ - public function setUpdatedTime($updated_time) - { - $this->container['updated_time'] = $updated_time; - - return $this; - } - /** * Gets order_id * @@ -377,7 +337,7 @@ public function getOrderId() /** * Sets order_id * - * @param string|null $order_id The unique identifier of the order. + * @param string|null $order_id The unique identifier of the order associated with the return. * * @return $this */ @@ -389,49 +349,25 @@ public function setOrderId($order_id) } /** - * Gets currency + * Gets rma_number * * @return string|null */ - public function getCurrency() + public function getRmaNumber() { - return $this->container['currency']; + return $this->container['rma_number']; } /** - * Sets currency + * Sets rma_number * - * @param string|null $currency A three-letter ISO currency code. + * @param string|null $rma_number The return merchandise authorization number. * * @return $this */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - return $this; - } - - /** - * Gets items - * - * @return \DigitalRiver\ApiSdk\Model\ReturnItem[]|null - */ - public function getItems() + public function setRmaNumber($rma_number) { - return $this->container['items']; - } - - /** - * Sets items - * - * @param \DigitalRiver\ApiSdk\Model\ReturnItem[]|null $items items - * - * @return $this - */ - public function setItems($items) - { - $this->container['items'] = $items; + $this->container['rma_number'] = $rma_number; return $this; } @@ -455,88 +391,92 @@ public function getReason() */ public function setReason($reason) { + if (!is_null($reason) && (mb_strlen($reason) > 64)) { + throw new \InvalidArgumentException('invalid length for $reason when calling ReturnResponse., must be smaller than or equal to 64.'); + } + $this->container['reason'] = $reason; return $this; } /** - * Gets failure_reason + * Gets type * * @return string|null */ - public function getFailureReason() + public function getType() { - return $this->container['failure_reason']; + return $this->container['type']; } /** - * Sets failure_reason + * Sets type * - * @param string|null $failure_reason An enumeration indicating the reason for the return failure, if known. + * @param string|null $type type * * @return $this */ - public function setFailureReason($failure_reason) + public function setType($type) { - $this->container['failure_reason'] = $failure_reason; + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array(strtolower($type), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; return $this; } /** - * Gets state + * Gets return_to * - * @return string|null + * @return \DigitalRiver\ApiSdk\Model\Shipping|null */ - public function getState() + public function getReturnTo() { - return $this->container['state']; + return $this->container['return_to']; } /** - * Sets state + * Sets return_to * - * @param string|null $state An enumeration indicating the state of the return. + * @param \DigitalRiver\ApiSdk\Model\Shipping|null $return_to return_to * * @return $this */ - public function setState($state) + public function setReturnTo($return_to) { - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'state', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['state'] = $state; + $this->container['return_to'] = $return_to; return $this; } /** - * Gets location + * Gets items * - * @return \DigitalRiver\ApiSdk\Model\ReturnLocation|null + * @return \DigitalRiver\ApiSdk\Model\ReturnItem[]|null */ - public function getLocation() + public function getItems() { - return $this->container['location']; + return $this->container['items']; } /** - * Sets location + * Sets items * - * @param \DigitalRiver\ApiSdk\Model\ReturnLocation|null $location location + * @param \DigitalRiver\ApiSdk\Model\ReturnItem[]|null $items items * * @return $this */ - public function setLocation($location) + public function setItems($items) { - $this->container['location'] = $location; + $this->container['items'] = $items; return $this; } @@ -564,54 +504,6 @@ public function setLiveMode($live_mode) return $this; } - - /** - * Gets metadata - * - * @return map[string,AnyType]|null - */ - public function getMetadata() - { - return $this->container['metadata']; - } - - /** - * Sets metadata - * - * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. - * - * @return $this - */ - public function setMetadata($metadata) - { - $this->container['metadata'] = $metadata; - - return $this; - } - - /** - * Gets refund_ids - * - * @return string[]|null - */ - public function getRefundIds() - { - return $this->container['refund_ids']; - } - - /** - * Sets refund_ids - * - * @param string[]|null $refund_ids refund_ids - * - * @return $this - */ - public function setRefundIds($refund_ids) - { - $this->container['refund_ids'] = $refund_ids; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ReturnsAddress.php b/lib/Model/ReturnsAddress.php new file mode 100644 index 0000000..bfa4603 --- /dev/null +++ b/lib/Model/ReturnsAddress.php @@ -0,0 +1,461 @@ + 'string', + 'line2' => 'string', + 'city' => 'string', + 'postal_code' => 'string', + 'state' => 'string', + 'country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'line1' => null, + 'line2' => null, + 'city' => null, + 'postal_code' => null, + 'state' => null, + 'country' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'line1' => 'line1', + 'line2' => 'line2', + 'city' => 'city', + 'postal_code' => 'postalCode', + 'state' => 'state', + 'country' => 'country' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'city' => 'setCity', + 'postal_code' => 'setPostalCode', + 'state' => 'setState', + 'country' => 'setCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'city' => 'getCity', + 'postal_code' => 'getPostalCode', + 'state' => 'getState', + 'country' => 'getCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['line1'] = isset($data['line1']) ? $data['line1'] : null; + $this->container['line2'] = isset($data['line2']) ? $data['line2'] : null; + $this->container['city'] = isset($data['city']) ? $data['city'] : null; + $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['line1'] === null) { + $invalidProperties[] = "'line1' can't be null"; + } + if ($this->container['city'] === null) { + $invalidProperties[] = "'city' can't be null"; + } + if ($this->container['postal_code'] === null) { + $invalidProperties[] = "'postal_code' can't be null"; + } + if ($this->container['state'] === null) { + $invalidProperties[] = "'state' can't be null"; + } + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets line1 + * + * @return string + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string $line1 line1 + * + * @return $this + */ + public function setLine1($line1) + { + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 line2 + * + * @return $this + */ + public function setLine2($line2) + { + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets city + * + * @return string + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string $city city + * + * @return $this + */ + public function setCity($city) + { + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code postal_code + * + * @return $this + */ + public function setPostalCode($postal_code) + { + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets state + * + * @return string + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string $state state + * + * @return $this + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReturnsItem.php b/lib/Model/ReturnsItem.php new file mode 100644 index 0000000..c9b86c4 --- /dev/null +++ b/lib/Model/ReturnsItem.php @@ -0,0 +1,482 @@ + 'string', + 'sku_id' => 'string', + 'amount' => 'double', + 'quantity' => 'int', + 'quantity_accepted' => 'int', + 'state' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'item_id' => null, + 'sku_id' => null, + 'amount' => 'double', + 'quantity' => null, + 'quantity_accepted' => null, + 'state' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item_id' => 'itemId', + 'sku_id' => 'skuId', + 'amount' => 'amount', + 'quantity' => 'quantity', + 'quantity_accepted' => 'quantityAccepted', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item_id' => 'setItemId', + 'sku_id' => 'setSkuId', + 'amount' => 'setAmount', + 'quantity' => 'setQuantity', + 'quantity_accepted' => 'setQuantityAccepted', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item_id' => 'getItemId', + 'sku_id' => 'getSkuId', + 'amount' => 'getAmount', + 'quantity' => 'getQuantity', + 'quantity_accepted' => 'getQuantityAccepted', + 'state' => 'getState' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_CREATED = 'created'; + const STATE_ACCEPTED = 'accepted'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_CREATED, + self::STATE_ACCEPTED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item_id'] = isset($data['item_id']) ? $data['item_id'] : null; + $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + $this->container['quantity_accepted'] = isset($data['quantity_accepted']) ? $data['quantity_accepted'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item_id + * + * @return string|null + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param string|null $item_id The identifier of the item. + * + * @return $this + */ + public function setItemId($item_id) + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets sku_id + * + * @return string|null + */ + public function getSkuId() + { + return $this->container['sku_id']; + } + + /** + * Sets sku_id + * + * @param string|null $sku_id The identifier of the SKU. + * + * @return $this + */ + public function setSkuId($sku_id) + { + $this->container['sku_id'] = $sku_id; + + return $this; + } + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets quantity_accepted + * + * @return int|null + */ + public function getQuantityAccepted() + { + return $this->container['quantity_accepted']; + } + + /** + * Sets quantity_accepted + * + * @param int|null $quantity_accepted quantity_accepted + * + * @return $this + */ + public function setQuantityAccepted($quantity_accepted) + { + $this->container['quantity_accepted'] = $quantity_accepted; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The current state of the return item. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReturnsLocation.php b/lib/Model/ReturnsLocation.php new file mode 100644 index 0000000..fcaf0d0 --- /dev/null +++ b/lib/Model/ReturnsLocation.php @@ -0,0 +1,389 @@ + '\DigitalRiver\ApiSdk\Model\ReturnsAddress', + 'name' => 'string', + 'phone' => 'string', + 'email' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'address' => null, + 'name' => null, + 'phone' => null, + 'email' => 'email' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'name' => 'name', + 'phone' => 'phone', + 'email' => 'email' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'name' => 'setName', + 'phone' => 'setPhone', + 'email' => 'setEmail' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'name' => 'getName', + 'phone' => 'getPhone', + 'email' => 'getEmail' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['address'] === null) { + $invalidProperties[] = "'address' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsAddress + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsAddress $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone phone + * + * @return $this + */ + public function setPhone($phone) + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReturnsRequest.php b/lib/Model/ReturnsRequest.php new file mode 100644 index 0000000..2b32f93 --- /dev/null +++ b/lib/Model/ReturnsRequest.php @@ -0,0 +1,430 @@ + 'string', + 'reason' => 'string', + 'items' => '\DigitalRiver\ApiSdk\Model\RequestReturnsItem[]', + 'location' => '\DigitalRiver\ApiSdk\Model\ReturnsLocation', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'order_id' => null, + 'reason' => null, + 'items' => null, + 'location' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_id' => 'orderId', + 'reason' => 'reason', + 'items' => 'items', + 'location' => 'location', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_id' => 'setOrderId', + 'reason' => 'setReason', + 'items' => 'setItems', + 'location' => 'setLocation', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_id' => 'getOrderId', + 'reason' => 'getReason', + 'items' => 'getItems', + 'location' => 'getLocation', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['order_id'] === null) { + $invalidProperties[] = "'order_id' can't be null"; + } + if (!is_null($this->container['reason']) && (mb_strlen($this->container['reason']) > 64)) { + $invalidProperties[] = "invalid value for 'reason', the character length must be smaller than or equal to 64."; + } + + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_id + * + * @return string + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string $order_id The unique identifier of the Order associated with the Return. + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for the return. + * + * @return $this + */ + public function setReason($reason) + { + if (!is_null($reason) && (mb_strlen($reason) > 64)) { + throw new \InvalidArgumentException('invalid length for $reason when calling ReturnsRequest., must be smaller than or equal to 64.'); + } + + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\RequestReturnsItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\RequestReturnsItem[] $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets location + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsLocation|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsLocation|null $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ReturnsResponse.php b/lib/Model/ReturnsResponse.php new file mode 100644 index 0000000..f54fd46 --- /dev/null +++ b/lib/Model/ReturnsResponse.php @@ -0,0 +1,692 @@ + 'string', + 'created_time' => '\DateTime', + 'updated_time' => '\DateTime', + 'order_id' => 'string', + 'currency' => 'string', + 'items' => '\DigitalRiver\ApiSdk\Model\ReturnsItem[]', + 'reason' => 'string', + 'failure_reason' => 'string', + 'state' => 'string', + 'location' => '\DigitalRiver\ApiSdk\Model\ReturnsLocation', + 'live_mode' => 'bool', + 'metadata' => 'map[string,AnyType]', + 'refund_ids' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'created_time' => 'date-time', + 'updated_time' => 'date-time', + 'order_id' => null, + 'currency' => null, + 'items' => null, + 'reason' => null, + 'failure_reason' => null, + 'state' => null, + 'location' => null, + 'live_mode' => null, + 'metadata' => null, + 'refund_ids' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'created_time' => 'createdTime', + 'updated_time' => 'updatedTime', + 'order_id' => 'orderId', + 'currency' => 'currency', + 'items' => 'items', + 'reason' => 'reason', + 'failure_reason' => 'failureReason', + 'state' => 'state', + 'location' => 'location', + 'live_mode' => 'liveMode', + 'metadata' => 'metadata', + 'refund_ids' => 'refundIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'created_time' => 'setCreatedTime', + 'updated_time' => 'setUpdatedTime', + 'order_id' => 'setOrderId', + 'currency' => 'setCurrency', + 'items' => 'setItems', + 'reason' => 'setReason', + 'failure_reason' => 'setFailureReason', + 'state' => 'setState', + 'location' => 'setLocation', + 'live_mode' => 'setLiveMode', + 'metadata' => 'setMetadata', + 'refund_ids' => 'setRefundIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'created_time' => 'getCreatedTime', + 'updated_time' => 'getUpdatedTime', + 'order_id' => 'getOrderId', + 'currency' => 'getCurrency', + 'items' => 'getItems', + 'reason' => 'getReason', + 'failure_reason' => 'getFailureReason', + 'state' => 'getState', + 'location' => 'getLocation', + 'live_mode' => 'getLiveMode', + 'metadata' => 'getMetadata', + 'refund_ids' => 'getRefundIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_CREATED = 'created'; + const STATE_ACCEPTED = 'accepted'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_CREATED, + self::STATE_ACCEPTED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['updated_time'] = isset($data['updated_time']) ? $data['updated_time'] : null; + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; + $this->container['failure_reason'] = isset($data['failure_reason']) ? $data['failure_reason'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + $this->container['refund_ids'] = isset($data['refund_ids']) ? $data['refund_ids'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the return. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time The time at which the return was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets updated_time + * + * @return \DateTime|null + */ + public function getUpdatedTime() + { + return $this->container['updated_time']; + } + + /** + * Sets updated_time + * + * @param \DateTime|null $updated_time The time at which the return was updated. + * + * @return $this + */ + public function setUpdatedTime($updated_time) + { + $this->container['updated_time'] = $updated_time; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id The unique identifier of the order. + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency A three-letter ISO currency code. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsItem[]|null $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for the return. + * + * @return $this + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets failure_reason + * + * @return string|null + */ + public function getFailureReason() + { + return $this->container['failure_reason']; + } + + /** + * Sets failure_reason + * + * @param string|null $failure_reason An enumeration indicating the reason for the return failure, if known. + * + * @return $this + */ + public function setFailureReason($failure_reason) + { + $this->container['failure_reason'] = $failure_reason; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state An enumeration indicating the state of the return. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets location + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsLocation|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsLocation|null $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets live_mode + * + * @return bool|null + */ + public function getLiveMode() + { + return $this->container['live_mode']; + } + + /** + * Sets live_mode + * + * @param bool|null $live_mode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLiveMode($live_mode) + { + $this->container['live_mode'] = $live_mode; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets refund_ids + * + * @return string[]|null + */ + public function getRefundIds() + { + return $this->container['refund_ids']; + } + + /** + * Sets refund_ids + * + * @param string[]|null $refund_ids refund_ids + * + * @return $this + */ + public function setRefundIds($refund_ids) + { + $this->container['refund_ids'] = $refund_ids; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SalesTransaction.php b/lib/Model/SalesTransaction.php index efa46a2..9c6ea2d 100644 --- a/lib/Model/SalesTransaction.php +++ b/lib/Model/SalesTransaction.php @@ -67,7 +67,10 @@ class SalesTransaction implements ModelInterface, ArrayAccess 'ship_from_country' => 'string', 'ship_to_country' => 'string', 'bill_to_country' => 'string', - 'payment_type' => 'string' + 'payment_type' => 'string', + 'line_item_id' => 'string', + 'order_metadata' => 'map[string,AnyType]', + 'line_item_metadata' => 'map[string,AnyType]' ]; /** @@ -97,7 +100,10 @@ class SalesTransaction implements ModelInterface, ArrayAccess 'ship_from_country' => null, 'ship_to_country' => null, 'bill_to_country' => null, - 'payment_type' => null + 'payment_type' => null, + 'line_item_id' => null, + 'order_metadata' => null, + 'line_item_metadata' => null ]; /** @@ -148,7 +154,10 @@ public static function openAPIFormats() 'ship_from_country' => 'shipFromCountry', 'ship_to_country' => 'shipToCountry', 'bill_to_country' => 'billToCountry', - 'payment_type' => 'paymentType' + 'payment_type' => 'paymentType', + 'line_item_id' => 'lineItemId', + 'order_metadata' => 'orderMetadata', + 'line_item_metadata' => 'lineItemMetadata' ]; /** @@ -178,7 +187,10 @@ public static function openAPIFormats() 'ship_from_country' => 'setShipFromCountry', 'ship_to_country' => 'setShipToCountry', 'bill_to_country' => 'setBillToCountry', - 'payment_type' => 'setPaymentType' + 'payment_type' => 'setPaymentType', + 'line_item_id' => 'setLineItemId', + 'order_metadata' => 'setOrderMetadata', + 'line_item_metadata' => 'setLineItemMetadata' ]; /** @@ -208,7 +220,10 @@ public static function openAPIFormats() 'ship_from_country' => 'getShipFromCountry', 'ship_to_country' => 'getShipToCountry', 'bill_to_country' => 'getBillToCountry', - 'payment_type' => 'getPaymentType' + 'payment_type' => 'getPaymentType', + 'line_item_id' => 'getLineItemId', + 'order_metadata' => 'getOrderMetadata', + 'line_item_metadata' => 'getLineItemMetadata' ]; /** @@ -327,6 +342,9 @@ public function __construct(array $data = null) $this->container['ship_to_country'] = isset($data['ship_to_country']) ? $data['ship_to_country'] : null; $this->container['bill_to_country'] = isset($data['bill_to_country']) ? $data['bill_to_country'] : null; $this->container['payment_type'] = isset($data['payment_type']) ? $data['payment_type'] : null; + $this->container['line_item_id'] = isset($data['line_item_id']) ? $data['line_item_id'] : null; + $this->container['order_metadata'] = isset($data['order_metadata']) ? $data['order_metadata'] : null; + $this->container['line_item_metadata'] = isset($data['line_item_metadata']) ? $data['line_item_metadata'] : null; } /** @@ -898,6 +916,78 @@ public function setPaymentType($payment_type) return $this; } + + /** + * Gets line_item_id + * + * @return string|null + */ + public function getLineItemId() + { + return $this->container['line_item_id']; + } + + /** + * Sets line_item_id + * + * @param string|null $line_item_id The unique identiier of the line item. + * + * @return $this + */ + public function setLineItemId($line_item_id) + { + $this->container['line_item_id'] = $line_item_id; + + return $this; + } + + /** + * Gets order_metadata + * + * @return map[string,AnyType]|null + */ + public function getOrderMetadata() + { + return $this->container['order_metadata']; + } + + /** + * Sets order_metadata + * + * @param map[string,AnyType]|null $order_metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setOrderMetadata($order_metadata) + { + $this->container['order_metadata'] = $order_metadata; + + return $this; + } + + /** + * Gets line_item_metadata + * + * @return map[string,AnyType]|null + */ + public function getLineItemMetadata() + { + return $this->container['line_item_metadata']; + } + + /** + * Sets line_item_metadata + * + * @param map[string,AnyType]|null $line_item_metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setLineItemMetadata($line_item_metadata) + { + $this->container['line_item_metadata'] = $line_item_metadata; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ShipFrom1.php b/lib/Model/ShipFrom1.php new file mode 100644 index 0000000..b0e4adb --- /dev/null +++ b/lib/Model/ShipFrom1.php @@ -0,0 +1,327 @@ + '\DigitalRiver\ApiSdk\Model\Address', + 'additional_address_info' => '\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'address' => null, + 'additional_address_info' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'additional_address_info' => 'additionalAddressInfo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'additional_address_info' => 'setAdditionalAddressInfo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'additional_address_info' => 'getAdditionalAddressInfo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['additional_address_info'] = isset($data['additional_address_info']) ? $data['additional_address_info'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \DigitalRiver\ApiSdk\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \DigitalRiver\ApiSdk\Model\Address|null $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets additional_address_info + * + * @return \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null + */ + public function getAdditionalAddressInfo() + { + return $this->container['additional_address_info']; + } + + /** + * Sets additional_address_info + * + * @param \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null $additional_address_info additional_address_info + * + * @return $this + */ + public function setAdditionalAddressInfo($additional_address_info) + { + $this->container['additional_address_info'] = $additional_address_info; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/Shipping.php b/lib/Model/Shipping.php index 646e709..cd43c8c 100644 --- a/lib/Model/Shipping.php +++ b/lib/Model/Shipping.php @@ -25,7 +25,6 @@ * Shipping Class Doc Comment * * @category Class - * @description The ship to addresss of the customer. * @package DigitalRiver\ApiSdk * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -261,7 +260,7 @@ public function getName() /** * Sets name * - * @param string|null $name The customer's name. + * @param string|null $name The recipient’s name. * * @return $this */ @@ -285,7 +284,7 @@ public function getPhone() /** * Sets phone * - * @param string|null $phone The customer's phone number. + * @param string|null $phone The recipient’s phone number. * * @return $this */ @@ -309,7 +308,7 @@ public function getEmail() /** * Sets email * - * @param string|null $email The customer's email address. + * @param string|null $email The recipient’s email address. * * @return $this */ @@ -333,7 +332,7 @@ public function getOrganization() /** * Sets organization * - * @param string|null $organization The customer's organization. + * @param string|null $organization The recipient’s organization. * * @return $this */ diff --git a/lib/Model/Shipping1.php b/lib/Model/Shipping1.php new file mode 100644 index 0000000..d822e02 --- /dev/null +++ b/lib/Model/Shipping1.php @@ -0,0 +1,446 @@ + '\DigitalRiver\ApiSdk\Model\Address', + 'name' => 'string', + 'phone' => 'string', + 'email' => 'string', + 'organization' => 'string', + 'additional_address_info' => '\DigitalRiver\ApiSdk\Model\AdditionalAddressInfo' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'address' => null, + 'name' => null, + 'phone' => null, + 'email' => 'email', + 'organization' => null, + 'additional_address_info' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', + 'name' => 'name', + 'phone' => 'phone', + 'email' => 'email', + 'organization' => 'organization', + 'additional_address_info' => 'additionalAddressInfo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', + 'name' => 'setName', + 'phone' => 'setPhone', + 'email' => 'setEmail', + 'organization' => 'setOrganization', + 'additional_address_info' => 'setAdditionalAddressInfo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', + 'name' => 'getName', + 'phone' => 'getPhone', + 'email' => 'getEmail', + 'organization' => 'getOrganization', + 'additional_address_info' => 'getAdditionalAddressInfo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['organization'] = isset($data['organization']) ? $data['organization'] : null; + $this->container['additional_address_info'] = isset($data['additional_address_info']) ? $data['additional_address_info'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return \DigitalRiver\ApiSdk\Model\Address|null + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \DigitalRiver\ApiSdk\Model\Address|null $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The recipient’s name. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets phone + * + * @return string|null + */ + public function getPhone() + { + return $this->container['phone']; + } + + /** + * Sets phone + * + * @param string|null $phone The recipient’s phone number. + * + * @return $this + */ + public function setPhone($phone) + { + $this->container['phone'] = $phone; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email The recipient’s email address. + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets organization + * + * @return string|null + */ + public function getOrganization() + { + return $this->container['organization']; + } + + /** + * Sets organization + * + * @param string|null $organization The recipient’s organization. + * + * @return $this + */ + public function setOrganization($organization) + { + $this->container['organization'] = $organization; + + return $this; + } + + /** + * Gets additional_address_info + * + * @return \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null + */ + public function getAdditionalAddressInfo() + { + return $this->container['additional_address_info']; + } + + /** + * Sets additional_address_info + * + * @param \DigitalRiver\ApiSdk\Model\AdditionalAddressInfo|null $additional_address_info additional_address_info + * + * @return $this + */ + public function setAdditionalAddressInfo($additional_address_info) + { + $this->container['additional_address_info'] = $additional_address_info; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingChoice.php b/lib/Model/ShippingChoice.php index db3cd44..e30822e 100644 --- a/lib/Model/ShippingChoice.php +++ b/lib/Model/ShippingChoice.php @@ -25,7 +25,7 @@ * ShippingChoice Class Doc Comment * * @category Class - * @description Represents the shipping amount, description, taxes, and service level. + * @description Represents the shipping amount, description, taxes, and service level. * @package DigitalRiver\ApiSdk * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -50,7 +50,8 @@ class ShippingChoice implements ModelInterface, ArrayAccess 'amount' => 'double', 'tax_amount' => 'double', 'description' => 'string', - 'service_level' => 'string' + 'service_level' => 'string', + 'shipping_terms' => 'string' ]; /** @@ -62,7 +63,8 @@ class ShippingChoice implements ModelInterface, ArrayAccess 'amount' => 'double', 'tax_amount' => 'double', 'description' => null, - 'service_level' => null + 'service_level' => null, + 'shipping_terms' => null ]; /** @@ -95,7 +97,8 @@ public static function openAPIFormats() 'amount' => 'amount', 'tax_amount' => 'taxAmount', 'description' => 'description', - 'service_level' => 'serviceLevel' + 'service_level' => 'serviceLevel', + 'shipping_terms' => 'shippingTerms' ]; /** @@ -107,7 +110,8 @@ public static function openAPIFormats() 'amount' => 'setAmount', 'tax_amount' => 'setTaxAmount', 'description' => 'setDescription', - 'service_level' => 'setServiceLevel' + 'service_level' => 'setServiceLevel', + 'shipping_terms' => 'setShippingTerms' ]; /** @@ -119,7 +123,8 @@ public static function openAPIFormats() 'amount' => 'getAmount', 'tax_amount' => 'getTaxAmount', 'description' => 'getDescription', - 'service_level' => 'getServiceLevel' + 'service_level' => 'getServiceLevel', + 'shipping_terms' => 'getShippingTerms' ]; /** @@ -163,9 +168,27 @@ public function getModelName() return self::$openAPIModelName; } + const SHIPPING_TERMS_DDP = 'DDP'; + const SHIPPING_TERMS_DAP = 'DAP'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShippingTermsAllowableValues() + { + $allowable = [ + self::SHIPPING_TERMS_DDP, + self::SHIPPING_TERMS_DAP, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + /** * Associative array for storing property values @@ -186,6 +209,7 @@ public function __construct(array $data = null) $this->container['tax_amount'] = isset($data['tax_amount']) ? $data['tax_amount'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['service_level'] = isset($data['service_level']) ? $data['service_level'] : null; + $this->container['shipping_terms'] = isset($data['shipping_terms']) ? $data['shipping_terms'] : null; } /** @@ -197,6 +221,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getShippingTermsAllowableValues(); + + if (!is_null($this->container['shipping_terms']) && !in_array(strtolower($this->container['shipping_terms']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'shipping_terms', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -307,6 +340,39 @@ public function setServiceLevel($service_level) return $this; } + + /** + * Gets shipping_terms + * + * @return string|null + */ + public function getShippingTerms() + { + return $this->container['shipping_terms']; + } + + /** + * Sets shipping_terms + * + * @param string|null $shipping_terms The terms of shipping. + * + * @return $this + */ + public function setShippingTerms($shipping_terms) + { + $allowedValues = $this->getShippingTermsAllowableValues(); + if (!is_null($shipping_terms) && !in_array(strtolower($shipping_terms), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'shipping_terms', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['shipping_terms'] = $shipping_terms; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ShippingLabelRequest.php b/lib/Model/ShippingLabelRequest.php new file mode 100644 index 0000000..ea64945 --- /dev/null +++ b/lib/Model/ShippingLabelRequest.php @@ -0,0 +1,492 @@ + 'string', + 'label_format' => 'string', + 'shipping_choice' => '\DigitalRiver\ApiSdk\Model\ShippingRequest', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\GLShipFrom', + 'items' => '\DigitalRiver\ApiSdk\Model\ProductItemRequest[]', + 'packages' => '\DigitalRiver\ApiSdk\Model\PackageRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'order_id' => null, + 'label_format' => null, + 'shipping_choice' => null, + 'ship_from' => null, + 'items' => null, + 'packages' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'order_id' => 'orderId', + 'label_format' => 'labelFormat', + 'shipping_choice' => 'shippingChoice', + 'ship_from' => 'shipFrom', + 'items' => 'items', + 'packages' => 'packages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'order_id' => 'setOrderId', + 'label_format' => 'setLabelFormat', + 'shipping_choice' => 'setShippingChoice', + 'ship_from' => 'setShipFrom', + 'items' => 'setItems', + 'packages' => 'setPackages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'order_id' => 'getOrderId', + 'label_format' => 'getLabelFormat', + 'shipping_choice' => 'getShippingChoice', + 'ship_from' => 'getShipFrom', + 'items' => 'getItems', + 'packages' => 'getPackages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const LABEL_FORMAT_PDF = 'PDF'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLabelFormatAllowableValues() + { + $allowable = [ + self::LABEL_FORMAT_PDF, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['label_format'] = isset($data['label_format']) ? $data['label_format'] : null; + $this->container['shipping_choice'] = isset($data['shipping_choice']) ? $data['shipping_choice'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['packages'] = isset($data['packages']) ? $data['packages'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['order_id'] === null) { + $invalidProperties[] = "'order_id' can't be null"; + } + if ($this->container['label_format'] === null) { + $invalidProperties[] = "'label_format' can't be null"; + } + $allowedValues = $this->getLabelFormatAllowableValues(); + + if (!is_null($this->container['label_format']) && !in_array(strtolower($this->container['label_format']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'label_format', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + if ($this->container['packages'] === null) { + $invalidProperties[] = "'packages' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets order_id + * + * @return string + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string $order_id The identifier of the order in Digital River's system. + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets label_format + * + * @return string + */ + public function getLabelFormat() + { + return $this->container['label_format']; + } + + /** + * Sets label_format + * + * @param string $label_format The format of the label's data file. + * + * @return $this + */ + public function setLabelFormat($label_format) + { + $allowedValues = $this->getLabelFormatAllowableValues(); + if (!in_array(strtolower($label_format), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'label_format', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['label_format'] = $label_format; + + return $this; + } + + /** + * Gets shipping_choice + * + * @return \DigitalRiver\ApiSdk\Model\ShippingRequest|null + */ + public function getShippingChoice() + { + return $this->container['shipping_choice']; + } + + /** + * Sets shipping_choice + * + * @param \DigitalRiver\ApiSdk\Model\ShippingRequest|null $shipping_choice shipping_choice + * + * @return $this + */ + public function setShippingChoice($shipping_choice) + { + $this->container['shipping_choice'] = $shipping_choice; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\GLShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\GLShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\ProductItemRequest[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\ProductItemRequest[] $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets packages + * + * @return \DigitalRiver\ApiSdk\Model\PackageRequest[] + */ + public function getPackages() + { + return $this->container['packages']; + } + + /** + * Sets packages + * + * @param \DigitalRiver\ApiSdk\Model\PackageRequest[] $packages packages + * + * @return $this + */ + public function setPackages($packages) + { + $this->container['packages'] = $packages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingLabelResponse.php b/lib/Model/ShippingLabelResponse.php new file mode 100644 index 0000000..9f684d3 --- /dev/null +++ b/lib/Model/ShippingLabelResponse.php @@ -0,0 +1,386 @@ + 'string', + 'order_id' => 'string', + 'labels' => '\DigitalRiver\ApiSdk\Model\LabelResponse[]', + 'return_to' => '\DigitalRiver\ApiSdk\Model\Shipping' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'order_id' => null, + 'labels' => null, + 'return_to' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'order_id' => 'orderId', + 'labels' => 'labels', + 'return_to' => 'returnTo' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'order_id' => 'setOrderId', + 'labels' => 'setLabels', + 'return_to' => 'setReturnTo' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'order_id' => 'getOrderId', + 'labels' => 'getLabels', + 'return_to' => 'getReturnTo' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['order_id'] = isset($data['order_id']) ? $data['order_id'] : null; + $this->container['labels'] = isset($data['labels']) ? $data['labels'] : null; + $this->container['return_to'] = isset($data['return_to']) ? $data['return_to'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The shipping label identifier + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets order_id + * + * @return string|null + */ + public function getOrderId() + { + return $this->container['order_id']; + } + + /** + * Sets order_id + * + * @param string|null $order_id The identifier of the order in Digital River's system. + * + * @return $this + */ + public function setOrderId($order_id) + { + $this->container['order_id'] = $order_id; + + return $this; + } + + /** + * Gets labels + * + * @return \DigitalRiver\ApiSdk\Model\LabelResponse[]|null + */ + public function getLabels() + { + return $this->container['labels']; + } + + /** + * Sets labels + * + * @param \DigitalRiver\ApiSdk\Model\LabelResponse[]|null $labels labels + * + * @return $this + */ + public function setLabels($labels) + { + $this->container['labels'] = $labels; + + return $this; + } + + /** + * Gets return_to + * + * @return \DigitalRiver\ApiSdk\Model\Shipping|null + */ + public function getReturnTo() + { + return $this->container['return_to']; + } + + /** + * Sets return_to + * + * @param \DigitalRiver\ApiSdk\Model\Shipping|null $return_to return_to + * + * @return $this + */ + public function setReturnTo($return_to) + { + $this->container['return_to'] = $return_to; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingMethodQuote.php b/lib/Model/ShippingMethodQuote.php new file mode 100644 index 0000000..5795433 --- /dev/null +++ b/lib/Model/ShippingMethodQuote.php @@ -0,0 +1,356 @@ + 'string', + 'service_level' => 'string', + 'amount' => 'double' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'description' => null, + 'service_level' => null, + 'amount' => 'double' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'description' => 'description', + 'service_level' => 'serviceLevel', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'service_level' => 'setServiceLevel', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'service_level' => 'getServiceLevel', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['service_level'] = isset($data['service_level']) ? $data['service_level'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The shipping method's description. + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets service_level + * + * @return string|null + */ + public function getServiceLevel() + { + return $this->container['service_level']; + } + + /** + * Sets service_level + * + * @param string|null $service_level service_level + * + * @return $this + */ + public function setServiceLevel($service_level) + { + $this->container['service_level'] = $service_level; + + return $this; + } + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The shipping method's cost. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingMethodQuoteItemRequest.php b/lib/Model/ShippingMethodQuoteItemRequest.php new file mode 100644 index 0000000..aecbcc6 --- /dev/null +++ b/lib/Model/ShippingMethodQuoteItemRequest.php @@ -0,0 +1,395 @@ + 'string', + 'amount' => 'double', + 'quantity' => 'int', + 'sku' => '\DigitalRiver\ApiSdk\Model\DropInSku' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'amount' => 'double', + 'quantity' => null, + 'sku' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'amount' => 'amount', + 'quantity' => 'quantity', + 'sku' => 'sku' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'amount' => 'setAmount', + 'quantity' => 'setQuantity', + 'sku' => 'setSku' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'amount' => 'getAmount', + 'quantity' => 'getQuantity', + 'sku' => 'getSku' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The item identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets amount + * + * @return double + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double $amount The price of the product. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets sku + * + * @return \DigitalRiver\ApiSdk\Model\DropInSku|null + */ + public function getSku() + { + return $this->container['sku']; + } + + /** + * Sets sku + * + * @param \DigitalRiver\ApiSdk\Model\DropInSku|null $sku sku + * + * @return $this + */ + public function setSku($sku) + { + $this->container['sku'] = $sku; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingMethodQuoteItemResponse.php b/lib/Model/ShippingMethodQuoteItemResponse.php new file mode 100644 index 0000000..fdd41e7 --- /dev/null +++ b/lib/Model/ShippingMethodQuoteItemResponse.php @@ -0,0 +1,326 @@ + 'string[]', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'item_ids' => null, + 'ship_from' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item_ids' => 'itemIds', + 'ship_from' => 'shipFrom' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item_ids' => 'setItemIds', + 'ship_from' => 'setShipFrom' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item_ids' => 'getItemIds', + 'ship_from' => 'getShipFrom' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item_ids'] = isset($data['item_ids']) ? $data['item_ids'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item_ids + * + * @return string[]|null + */ + public function getItemIds() + { + return $this->container['item_ids']; + } + + /** + * Sets item_ids + * + * @param string[]|null $item_ids item_ids + * + * @return $this + */ + public function setItemIds($item_ids) + { + $this->container['item_ids'] = $item_ids; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\ShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\ShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingMethodQuoteRequest.php b/lib/Model/ShippingMethodQuoteRequest.php new file mode 100644 index 0000000..6f6ba2e --- /dev/null +++ b/lib/Model/ShippingMethodQuoteRequest.php @@ -0,0 +1,428 @@ + 'string', + 'session_upstream_id' => 'string', + 'currency' => 'string', + 'ship_to' => '\DigitalRiver\ApiSdk\Model\Shipping', + 'items' => '\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'session_id' => null, + 'session_upstream_id' => null, + 'currency' => null, + 'ship_to' => null, + 'items' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'session_id' => 'sessionId', + 'session_upstream_id' => 'sessionUpstreamId', + 'currency' => 'currency', + 'ship_to' => 'shipTo', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'session_id' => 'setSessionId', + 'session_upstream_id' => 'setSessionUpstreamId', + 'currency' => 'setCurrency', + 'ship_to' => 'setShipTo', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'session_id' => 'getSessionId', + 'session_upstream_id' => 'getSessionUpstreamId', + 'currency' => 'getCurrency', + 'ship_to' => 'getShipTo', + 'items' => 'getItems' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['session_id'] = isset($data['session_id']) ? $data['session_id'] : null; + $this->container['session_upstream_id'] = isset($data['session_upstream_id']) ? $data['session_upstream_id'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['ship_to'] = isset($data['ship_to']) ? $data['ship_to'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['session_id'] === null) { + $invalidProperties[] = "'session_id' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['ship_to'] === null) { + $invalidProperties[] = "'ship_to' can't be null"; + } + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets session_id + * + * @return string + */ + public function getSessionId() + { + return $this->container['session_id']; + } + + /** + * Sets session_id + * + * @param string $session_id The identifier of the checkout session associated with the shipping quotes request. + * + * @return $this + */ + public function setSessionId($session_id) + { + $this->container['session_id'] = $session_id; + + return $this; + } + + /** + * Gets session_upstream_id + * + * @return string|null + */ + public function getSessionUpstreamId() + { + return $this->container['session_upstream_id']; + } + + /** + * Sets session_upstream_id + * + * @param string|null $session_upstream_id The upstream identifier of the checkout session associated with the shipping quotes request. + * + * @return $this + */ + public function setSessionUpstreamId($session_upstream_id) + { + $this->container['session_upstream_id'] = $session_upstream_id; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency A three-letter ISO currency code. + * + * @return $this + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets ship_to + * + * @return \DigitalRiver\ApiSdk\Model\Shipping + */ + public function getShipTo() + { + return $this->container['ship_to']; + } + + /** + * Sets ship_to + * + * @param \DigitalRiver\ApiSdk\Model\Shipping $ship_to ship_to + * + * @return $this + */ + public function setShipTo($ship_to) + { + $this->container['ship_to'] = $ship_to; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemRequest[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemRequest[] $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingMethodQuoteResponse.php b/lib/Model/ShippingMethodQuoteResponse.php new file mode 100644 index 0000000..4d9b25a --- /dev/null +++ b/lib/Model/ShippingMethodQuoteResponse.php @@ -0,0 +1,356 @@ + '\DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemResponse[]', + 'shipping_methods' => '\DigitalRiver\ApiSdk\Model\ShippingMethodQuote[]', + 'live_mode' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'shipments' => null, + 'shipping_methods' => null, + 'live_mode' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'shipments' => 'shipments', + 'shipping_methods' => 'shippingMethods', + 'live_mode' => 'liveMode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'shipments' => 'setShipments', + 'shipping_methods' => 'setShippingMethods', + 'live_mode' => 'setLiveMode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'shipments' => 'getShipments', + 'shipping_methods' => 'getShippingMethods', + 'live_mode' => 'getLiveMode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['shipments'] = isset($data['shipments']) ? $data['shipments'] : null; + $this->container['shipping_methods'] = isset($data['shipping_methods']) ? $data['shipping_methods'] : null; + $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets shipments + * + * @return \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemResponse[]|null + */ + public function getShipments() + { + return $this->container['shipments']; + } + + /** + * Sets shipments + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuoteItemResponse[]|null $shipments shipments + * + * @return $this + */ + public function setShipments($shipments) + { + $this->container['shipments'] = $shipments; + + return $this; + } + + /** + * Gets shipping_methods + * + * @return \DigitalRiver\ApiSdk\Model\ShippingMethodQuote[]|null + */ + public function getShippingMethods() + { + return $this->container['shipping_methods']; + } + + /** + * Sets shipping_methods + * + * @param \DigitalRiver\ApiSdk\Model\ShippingMethodQuote[]|null $shipping_methods shipping_methods + * + * @return $this + */ + public function setShippingMethods($shipping_methods) + { + $this->container['shipping_methods'] = $shipping_methods; + + return $this; + } + + /** + * Gets live_mode + * + * @return bool|null + */ + public function getLiveMode() + { + return $this->container['live_mode']; + } + + /** + * Sets live_mode + * + * @param bool|null $live_mode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * + * @return $this + */ + public function setLiveMode($live_mode) + { + $this->container['live_mode'] = $live_mode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingQuote.php b/lib/Model/ShippingQuote.php index 0a0a73a..695503d 100644 --- a/lib/Model/ShippingQuote.php +++ b/lib/Model/ShippingQuote.php @@ -47,16 +47,13 @@ class ShippingQuote implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'id' => 'string', - 'currency' => 'string', + 'description' => 'string', 'service_level' => 'string', - 'shipping' => 'double', - 'handling' => 'double', - 'fees' => 'double', - 'total' => 'double', - 'signature_required_type' => 'string', - 'estimated_minimum_delivery_time' => 'float', - 'estimated_maximum_delivery_time' => 'float', - 'items' => '\DigitalRiver\ApiSdk\Model\ProductItem[]' + 'estimated_delivery' => 'string', + 'shipping_terms' => 'string', + 'total_amount' => 'double', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\GLShipFrom', + 'fees' => '\DigitalRiver\ApiSdk\Model\ShippingQuoteFees' ]; /** @@ -66,16 +63,13 @@ class ShippingQuote implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'id' => null, - 'currency' => null, + 'description' => null, 'service_level' => null, - 'shipping' => 'double', - 'handling' => 'double', - 'fees' => 'double', - 'total' => 'double', - 'signature_required_type' => null, - 'estimated_minimum_delivery_time' => 'integer', - 'estimated_maximum_delivery_time' => 'integer', - 'items' => null + 'estimated_delivery' => null, + 'shipping_terms' => null, + 'total_amount' => 'double', + 'ship_from' => null, + 'fees' => null ]; /** @@ -106,16 +100,13 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'currency' => 'currency', + 'description' => 'description', 'service_level' => 'serviceLevel', - 'shipping' => 'shipping', - 'handling' => 'handling', - 'fees' => 'fees', - 'total' => 'total', - 'signature_required_type' => 'signatureRequiredType', - 'estimated_minimum_delivery_time' => 'estimatedMinimumDeliveryTime', - 'estimated_maximum_delivery_time' => 'estimatedMaximumDeliveryTime', - 'items' => 'items' + 'estimated_delivery' => 'estimatedDelivery', + 'shipping_terms' => 'shippingTerms', + 'total_amount' => 'totalAmount', + 'ship_from' => 'shipFrom', + 'fees' => 'fees' ]; /** @@ -125,16 +116,13 @@ public static function openAPIFormats() */ protected static $setters = [ 'id' => 'setId', - 'currency' => 'setCurrency', + 'description' => 'setDescription', 'service_level' => 'setServiceLevel', - 'shipping' => 'setShipping', - 'handling' => 'setHandling', - 'fees' => 'setFees', - 'total' => 'setTotal', - 'signature_required_type' => 'setSignatureRequiredType', - 'estimated_minimum_delivery_time' => 'setEstimatedMinimumDeliveryTime', - 'estimated_maximum_delivery_time' => 'setEstimatedMaximumDeliveryTime', - 'items' => 'setItems' + 'estimated_delivery' => 'setEstimatedDelivery', + 'shipping_terms' => 'setShippingTerms', + 'total_amount' => 'setTotalAmount', + 'ship_from' => 'setShipFrom', + 'fees' => 'setFees' ]; /** @@ -144,16 +132,13 @@ public static function openAPIFormats() */ protected static $getters = [ 'id' => 'getId', - 'currency' => 'getCurrency', + 'description' => 'getDescription', 'service_level' => 'getServiceLevel', - 'shipping' => 'getShipping', - 'handling' => 'getHandling', - 'fees' => 'getFees', - 'total' => 'getTotal', - 'signature_required_type' => 'getSignatureRequiredType', - 'estimated_minimum_delivery_time' => 'getEstimatedMinimumDeliveryTime', - 'estimated_maximum_delivery_time' => 'getEstimatedMaximumDeliveryTime', - 'items' => 'getItems' + 'estimated_delivery' => 'getEstimatedDelivery', + 'shipping_terms' => 'getShippingTerms', + 'total_amount' => 'getTotalAmount', + 'ship_from' => 'getShipFrom', + 'fees' => 'getFees' ]; /** @@ -197,8 +182,8 @@ public function getModelName() return self::$openAPIModelName; } - const SIGNATURE_REQUIRED_TYPE_STANDARD = 'standard'; - const SIGNATURE_REQUIRED_TYPE_ADULT = 'adult'; + const SHIPPING_TERMS_DDP = 'DDP'; + const SHIPPING_TERMS_DAP = 'DAP'; @@ -207,11 +192,11 @@ public function getModelName() * * @return string[] */ - public function getSignatureRequiredTypeAllowableValues() + public function getShippingTermsAllowableValues() { $allowable = [ - self::SIGNATURE_REQUIRED_TYPE_STANDARD, - self::SIGNATURE_REQUIRED_TYPE_ADULT, + self::SHIPPING_TERMS_DDP, + self::SHIPPING_TERMS_DAP, ]; $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); @@ -235,16 +220,13 @@ public function getSignatureRequiredTypeAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['service_level'] = isset($data['service_level']) ? $data['service_level'] : null; - $this->container['shipping'] = isset($data['shipping']) ? $data['shipping'] : null; - $this->container['handling'] = isset($data['handling']) ? $data['handling'] : null; + $this->container['estimated_delivery'] = isset($data['estimated_delivery']) ? $data['estimated_delivery'] : null; + $this->container['shipping_terms'] = isset($data['shipping_terms']) ? $data['shipping_terms'] : null; + $this->container['total_amount'] = isset($data['total_amount']) ? $data['total_amount'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null; - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['signature_required_type'] = isset($data['signature_required_type']) ? $data['signature_required_type'] : null; - $this->container['estimated_minimum_delivery_time'] = isset($data['estimated_minimum_delivery_time']) ? $data['estimated_minimum_delivery_time'] : null; - $this->container['estimated_maximum_delivery_time'] = isset($data['estimated_maximum_delivery_time']) ? $data['estimated_maximum_delivery_time'] : null; - $this->container['items'] = isset($data['items']) ? $data['items'] : null; } /** @@ -256,11 +238,11 @@ public function listInvalidProperties() { $invalidProperties = []; - $allowedValues = $this->getSignatureRequiredTypeAllowableValues(); + $allowedValues = $this->getShippingTermsAllowableValues(); - if (!is_null($this->container['signature_required_type']) && !in_array(strtolower($this->container['signature_required_type']), $allowedValues, true)) { + if (!is_null($this->container['shipping_terms']) && !in_array(strtolower($this->container['shipping_terms']), $allowedValues, true)) { $invalidProperties[] = sprintf( - "invalid value for 'signature_required_type', must be one of '%s'", + "invalid value for 'shipping_terms', must be one of '%s'", implode("', '", $allowedValues) ); } @@ -293,7 +275,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id Shipping quote identifier * * @return $this */ @@ -305,25 +287,25 @@ public function setId($id) } /** - * Gets currency + * Gets description * * @return string|null */ - public function getCurrency() + public function getDescription() { - return $this->container['currency']; + return $this->container['description']; } /** - * Sets currency + * Sets description * - * @param string|null $currency A three-letter ISO currency code. + * @param string|null $description Shipping method description * * @return $this */ - public function setCurrency($currency) + public function setDescription($description) { - $this->container['currency'] = $currency; + $this->container['description'] = $description; return $this; } @@ -353,202 +335,130 @@ public function setServiceLevel($service_level) } /** - * Gets shipping + * Gets estimated_delivery * - * @return double|null - */ - public function getShipping() - { - return $this->container['shipping']; - } - - /** - * Sets shipping - * - * @param double|null $shipping The shipping amount. - * - * @return $this - */ - public function setShipping($shipping) - { - $this->container['shipping'] = $shipping; - - return $this; - } - - /** - * Gets handling - * - * @return double|null - */ - public function getHandling() - { - return $this->container['handling']; - } - - /** - * Sets handling - * - * @param double|null $handling The handling amount. - * - * @return $this - */ - public function setHandling($handling) - { - $this->container['handling'] = $handling; - - return $this; - } - - /** - * Gets fees - * - * @return double|null - */ - public function getFees() - { - return $this->container['fees']; - } - - /** - * Sets fees - * - * @param double|null $fees The fee amount. - * - * @return $this - */ - public function setFees($fees) - { - $this->container['fees'] = $fees; - - return $this; - } - - /** - * Gets total - * - * @return double|null + * @return string|null */ - public function getTotal() + public function getEstimatedDelivery() { - return $this->container['total']; + return $this->container['estimated_delivery']; } /** - * Sets total + * Sets estimated_delivery * - * @param double|null $total The total shipping and handling amount. + * @param string|null $estimated_delivery estimated_delivery * * @return $this */ - public function setTotal($total) + public function setEstimatedDelivery($estimated_delivery) { - $this->container['total'] = $total; + $this->container['estimated_delivery'] = $estimated_delivery; return $this; } /** - * Gets signature_required_type + * Gets shipping_terms * * @return string|null */ - public function getSignatureRequiredType() + public function getShippingTerms() { - return $this->container['signature_required_type']; + return $this->container['shipping_terms']; } /** - * Sets signature_required_type + * Sets shipping_terms * - * @param string|null $signature_required_type Indicates whether a signature is needed upon delivery, and, if it is, what type of signature is required. + * @param string|null $shipping_terms The terms of shipping. * * @return $this */ - public function setSignatureRequiredType($signature_required_type) + public function setShippingTerms($shipping_terms) { - $allowedValues = $this->getSignatureRequiredTypeAllowableValues(); - if (!is_null($signature_required_type) && !in_array(strtolower($signature_required_type), $allowedValues, true)) { + $allowedValues = $this->getShippingTermsAllowableValues(); + if (!is_null($shipping_terms) && !in_array(strtolower($shipping_terms), $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value for 'signature_required_type', must be one of '%s'", + "Invalid value for 'shipping_terms', must be one of '%s'", implode("', '", $allowedValues) ) ); } - $this->container['signature_required_type'] = $signature_required_type; + $this->container['shipping_terms'] = $shipping_terms; return $this; } /** - * Gets estimated_minimum_delivery_time + * Gets total_amount * - * @return float|null + * @return double|null */ - public function getEstimatedMinimumDeliveryTime() + public function getTotalAmount() { - return $this->container['estimated_minimum_delivery_time']; + return $this->container['total_amount']; } /** - * Sets estimated_minimum_delivery_time + * Sets total_amount * - * @param float|null $estimated_minimum_delivery_time The minimum estimated time until delivery (in minutes). + * @param double|null $total_amount The shipping amount. * * @return $this */ - public function setEstimatedMinimumDeliveryTime($estimated_minimum_delivery_time) + public function setTotalAmount($total_amount) { - $this->container['estimated_minimum_delivery_time'] = $estimated_minimum_delivery_time; + $this->container['total_amount'] = $total_amount; return $this; } /** - * Gets estimated_maximum_delivery_time + * Gets ship_from * - * @return float|null + * @return \DigitalRiver\ApiSdk\Model\GLShipFrom|null */ - public function getEstimatedMaximumDeliveryTime() + public function getShipFrom() { - return $this->container['estimated_maximum_delivery_time']; + return $this->container['ship_from']; } /** - * Sets estimated_maximum_delivery_time + * Sets ship_from * - * @param float|null $estimated_maximum_delivery_time The maximum estimated time until delivery (in minutes). + * @param \DigitalRiver\ApiSdk\Model\GLShipFrom|null $ship_from ship_from * * @return $this */ - public function setEstimatedMaximumDeliveryTime($estimated_maximum_delivery_time) + public function setShipFrom($ship_from) { - $this->container['estimated_maximum_delivery_time'] = $estimated_maximum_delivery_time; + $this->container['ship_from'] = $ship_from; return $this; } /** - * Gets items + * Gets fees * - * @return \DigitalRiver\ApiSdk\Model\ProductItem[]|null + * @return \DigitalRiver\ApiSdk\Model\ShippingQuoteFees|null */ - public function getItems() + public function getFees() { - return $this->container['items']; + return $this->container['fees']; } /** - * Sets items + * Sets fees * - * @param \DigitalRiver\ApiSdk\Model\ProductItem[]|null $items items + * @param \DigitalRiver\ApiSdk\Model\ShippingQuoteFees|null $fees fees * * @return $this */ - public function setItems($items) + public function setFees($fees) { - $this->container['items'] = $items; + $this->container['fees'] = $fees; return $this; } diff --git a/lib/Model/ShippingQuoteFees.php b/lib/Model/ShippingQuoteFees.php new file mode 100644 index 0000000..bfce009 --- /dev/null +++ b/lib/Model/ShippingQuoteFees.php @@ -0,0 +1,326 @@ + '\DigitalRiver\ApiSdk\Model\ShippingQuoteFeesDetails[]', + 'amount' => 'double' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'details' => null, + 'amount' => 'double' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'details' => 'details', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'details' => 'setDetails', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'details' => 'getDetails', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['details'] = isset($data['details']) ? $data['details'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets details + * + * @return \DigitalRiver\ApiSdk\Model\ShippingQuoteFeesDetails[]|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param \DigitalRiver\ApiSdk\Model\ShippingQuoteFeesDetails[]|null $details details + * + * @return $this + */ + public function setDetails($details) + { + $this->container['details'] = $details; + + return $this; + } + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The aggregated amount of assessed fees. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingQuoteFeesDetails.php b/lib/Model/ShippingQuoteFeesDetails.php new file mode 100644 index 0000000..7543a9f --- /dev/null +++ b/lib/Model/ShippingQuoteFeesDetails.php @@ -0,0 +1,326 @@ + 'string', + 'amount' => 'double' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'name' => null, + 'amount' => 'double' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'amount' => 'amount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'amount' => 'setAmount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'amount' => 'getAmount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the fee. + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets amount + * + * @return double|null + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double|null $amount The amount of the fee. + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/ShippingQuoteRequest.php b/lib/Model/ShippingQuoteRequest.php index 985ed0d..2455c4a 100644 --- a/lib/Model/ShippingQuoteRequest.php +++ b/lib/Model/ShippingQuoteRequest.php @@ -47,8 +47,10 @@ class ShippingQuoteRequest implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'currency' => 'string', - 'ship_to' => '\DigitalRiver\ApiSdk\Model\ShippingQuoteAddress', - 'items' => '\DigitalRiver\ApiSdk\Model\ProductItemRequest[]' + 'ship_to' => '\DigitalRiver\ApiSdk\Model\Shipping', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\GLShipFrom', + 'items' => '\DigitalRiver\ApiSdk\Model\ProductItemRequest[]', + 'packages' => '\DigitalRiver\ApiSdk\Model\PackageRequest[]' ]; /** @@ -59,7 +61,9 @@ class ShippingQuoteRequest implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'currency' => null, 'ship_to' => null, - 'items' => null + 'ship_from' => null, + 'items' => null, + 'packages' => null ]; /** @@ -91,7 +95,9 @@ public static function openAPIFormats() protected static $attributeMap = [ 'currency' => 'currency', 'ship_to' => 'shipTo', - 'items' => 'items' + 'ship_from' => 'shipFrom', + 'items' => 'items', + 'packages' => 'packages' ]; /** @@ -102,7 +108,9 @@ public static function openAPIFormats() protected static $setters = [ 'currency' => 'setCurrency', 'ship_to' => 'setShipTo', - 'items' => 'setItems' + 'ship_from' => 'setShipFrom', + 'items' => 'setItems', + 'packages' => 'setPackages' ]; /** @@ -113,7 +121,9 @@ public static function openAPIFormats() protected static $getters = [ 'currency' => 'getCurrency', 'ship_to' => 'getShipTo', - 'items' => 'getItems' + 'ship_from' => 'getShipFrom', + 'items' => 'getItems', + 'packages' => 'getPackages' ]; /** @@ -178,7 +188,9 @@ public function __construct(array $data = null) { $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['ship_to'] = isset($data['ship_to']) ? $data['ship_to'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['packages'] = isset($data['packages']) ? $data['packages'] : null; } /** @@ -241,7 +253,7 @@ public function setCurrency($currency) /** * Gets ship_to * - * @return \DigitalRiver\ApiSdk\Model\ShippingQuoteAddress + * @return \DigitalRiver\ApiSdk\Model\Shipping */ public function getShipTo() { @@ -251,7 +263,7 @@ public function getShipTo() /** * Sets ship_to * - * @param \DigitalRiver\ApiSdk\Model\ShippingQuoteAddress $ship_to ship_to + * @param \DigitalRiver\ApiSdk\Model\Shipping $ship_to ship_to * * @return $this */ @@ -262,6 +274,30 @@ public function setShipTo($ship_to) return $this; } + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\GLShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\GLShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + /** * Gets items * @@ -285,6 +321,30 @@ public function setItems($items) return $this; } + + /** + * Gets packages + * + * @return \DigitalRiver\ApiSdk\Model\PackageRequest[]|null + */ + public function getPackages() + { + return $this->container['packages']; + } + + /** + * Sets packages + * + * @param \DigitalRiver\ApiSdk\Model\PackageRequest[]|null $packages packages + * + * @return $this + */ + public function setPackages($packages) + { + $this->container['packages'] = $packages; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ShippingQuoteResponse.php b/lib/Model/ShippingQuoteResponse.php index f69079a..158a058 100644 --- a/lib/Model/ShippingQuoteResponse.php +++ b/lib/Model/ShippingQuoteResponse.php @@ -46,7 +46,7 @@ class ShippingQuoteResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'ship_to' => '\DigitalRiver\ApiSdk\Model\ShippingQuoteAddress', + 'currency' => 'string', 'quotes' => '\DigitalRiver\ApiSdk\Model\ShippingQuote[]', 'live_mode' => 'bool' ]; @@ -57,7 +57,7 @@ class ShippingQuoteResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ - 'ship_to' => null, + 'currency' => null, 'quotes' => null, 'live_mode' => null ]; @@ -89,7 +89,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'ship_to' => 'shipTo', + 'currency' => 'currency', 'quotes' => 'quotes', 'live_mode' => 'liveMode' ]; @@ -100,7 +100,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'ship_to' => 'setShipTo', + 'currency' => 'setCurrency', 'quotes' => 'setQuotes', 'live_mode' => 'setLiveMode' ]; @@ -111,7 +111,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'ship_to' => 'getShipTo', + 'currency' => 'getCurrency', 'quotes' => 'getQuotes', 'live_mode' => 'getLiveMode' ]; @@ -176,7 +176,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['ship_to'] = isset($data['ship_to']) ? $data['ship_to'] : null; + $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['quotes'] = isset($data['quotes']) ? $data['quotes'] : null; $this->container['live_mode'] = isset($data['live_mode']) ? $data['live_mode'] : null; } @@ -206,25 +206,25 @@ public function valid() /** - * Gets ship_to + * Gets currency * - * @return \DigitalRiver\ApiSdk\Model\ShippingQuoteAddress|null + * @return string|null */ - public function getShipTo() + public function getCurrency() { - return $this->container['ship_to']; + return $this->container['currency']; } /** - * Sets ship_to + * Sets currency * - * @param \DigitalRiver\ApiSdk\Model\ShippingQuoteAddress|null $ship_to ship_to + * @param string|null $currency A three-letter ISO currency code. * * @return $this */ - public function setShipTo($ship_to) + public function setCurrency($currency) { - $this->container['ship_to'] = $ship_to; + $this->container['currency'] = $currency; return $this; } diff --git a/lib/Model/ShippingRequest.php b/lib/Model/ShippingRequest.php index c467d4f..08337a2 100644 --- a/lib/Model/ShippingRequest.php +++ b/lib/Model/ShippingRequest.php @@ -49,7 +49,8 @@ class ShippingRequest implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'amount' => 'double', 'description' => 'string', - 'service_level' => 'string' + 'service_level' => 'string', + 'shipping_terms' => 'string' ]; /** @@ -60,7 +61,8 @@ class ShippingRequest implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'amount' => 'double', 'description' => null, - 'service_level' => null + 'service_level' => null, + 'shipping_terms' => null ]; /** @@ -92,7 +94,8 @@ public static function openAPIFormats() protected static $attributeMap = [ 'amount' => 'amount', 'description' => 'description', - 'service_level' => 'serviceLevel' + 'service_level' => 'serviceLevel', + 'shipping_terms' => 'shippingTerms' ]; /** @@ -103,7 +106,8 @@ public static function openAPIFormats() protected static $setters = [ 'amount' => 'setAmount', 'description' => 'setDescription', - 'service_level' => 'setServiceLevel' + 'service_level' => 'setServiceLevel', + 'shipping_terms' => 'setShippingTerms' ]; /** @@ -114,7 +118,8 @@ public static function openAPIFormats() protected static $getters = [ 'amount' => 'getAmount', 'description' => 'getDescription', - 'service_level' => 'getServiceLevel' + 'service_level' => 'getServiceLevel', + 'shipping_terms' => 'getShippingTerms' ]; /** @@ -158,9 +163,27 @@ public function getModelName() return self::$openAPIModelName; } + const SHIPPING_TERMS_DDP = 'DDP'; + const SHIPPING_TERMS_DAP = 'DAP'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getShippingTermsAllowableValues() + { + $allowable = [ + self::SHIPPING_TERMS_DDP, + self::SHIPPING_TERMS_DAP, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + /** * Associative array for storing property values @@ -180,6 +203,7 @@ public function __construct(array $data = null) $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; $this->container['service_level'] = isset($data['service_level']) ? $data['service_level'] : null; + $this->container['shipping_terms'] = isset($data['shipping_terms']) ? $data['shipping_terms'] : null; } /** @@ -191,6 +215,15 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getShippingTermsAllowableValues(); + + if (!is_null($this->container['shipping_terms']) && !in_array(strtolower($this->container['shipping_terms']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'shipping_terms', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -277,6 +310,39 @@ public function setServiceLevel($service_level) return $this; } + + /** + * Gets shipping_terms + * + * @return string|null + */ + public function getShippingTerms() + { + return $this->container['shipping_terms']; + } + + /** + * Sets shipping_terms + * + * @param string|null $shipping_terms The options for paying a transaction's full landed cost amount. DDP (Delivered Duty Paid) allows customers to pay the full amount during checkout. DAP (Deliverated At Place) allows customers to pay product and shipping costs at checkout, while paying duties, fees, and import fees upon delivery. + * + * @return $this + */ + public function setShippingTerms($shipping_terms) + { + $allowedValues = $this->getShippingTermsAllowableValues(); + if (!is_null($shipping_terms) && !in_array(strtolower($shipping_terms), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'shipping_terms', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['shipping_terms'] = $shipping_terms; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/Sku.php b/lib/Model/Sku.php index b435e07..be9467c 100644 --- a/lib/Model/Sku.php +++ b/lib/Model/Sku.php @@ -55,7 +55,6 @@ class Sku implements ModelInterface, ArrayAccess 'manufacturer_id' => 'string', 'managed_fulfillment' => 'string', 'physical' => 'bool', - 'allow_oversell' => 'bool', 'tax_code' => 'string', 'name' => 'string', 'description' => 'string', @@ -84,7 +83,6 @@ class Sku implements ModelInterface, ArrayAccess 'manufacturer_id' => null, 'managed_fulfillment' => null, 'physical' => null, - 'allow_oversell' => null, 'tax_code' => null, 'name' => null, 'description' => null, @@ -134,7 +132,6 @@ public static function openAPIFormats() 'manufacturer_id' => 'manufacturerId', 'managed_fulfillment' => 'managedFulfillment', 'physical' => 'physical', - 'allow_oversell' => 'allowOversell', 'tax_code' => 'taxCode', 'name' => 'name', 'description' => 'description', @@ -163,7 +160,6 @@ public static function openAPIFormats() 'manufacturer_id' => 'setManufacturerId', 'managed_fulfillment' => 'setManagedFulfillment', 'physical' => 'setPhysical', - 'allow_oversell' => 'setAllowOversell', 'tax_code' => 'setTaxCode', 'name' => 'setName', 'description' => 'setDescription', @@ -192,7 +188,6 @@ public static function openAPIFormats() 'manufacturer_id' => 'getManufacturerId', 'managed_fulfillment' => 'getManagedFulfillment', 'physical' => 'getPhysical', - 'allow_oversell' => 'getAllowOversell', 'tax_code' => 'getTaxCode', 'name' => 'getName', 'description' => 'getDescription', @@ -313,7 +308,6 @@ public function __construct(array $data = null) $this->container['manufacturer_id'] = isset($data['manufacturer_id']) ? $data['manufacturer_id'] : null; $this->container['managed_fulfillment'] = isset($data['managed_fulfillment']) ? $data['managed_fulfillment'] : null; $this->container['physical'] = isset($data['physical']) ? $data['physical'] : null; - $this->container['allow_oversell'] = isset($data['allow_oversell']) ? $data['allow_oversell'] : null; $this->container['tax_code'] = isset($data['tax_code']) ? $data['tax_code'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; @@ -594,30 +588,6 @@ public function setPhysical($physical) return $this; } - /** - * Gets allow_oversell - * - * @return bool|null - */ - public function getAllowOversell() - { - return $this->container['allow_oversell']; - } - - /** - * Sets allow_oversell - * - * @param bool|null $allow_oversell Determines whether customers are allowed to back order a product. - * - * @return $this - */ - public function setAllowOversell($allow_oversell) - { - $this->container['allow_oversell'] = $allow_oversell; - - return $this; - } - /** * Gets tax_code * diff --git a/lib/Model/SkuGroup.php b/lib/Model/SkuGroup.php index 7871052..3209784 100644 --- a/lib/Model/SkuGroup.php +++ b/lib/Model/SkuGroup.php @@ -212,7 +212,7 @@ public function getId() /** * Sets id * - * @param string|null $id The unique identifier of the Sku Group. + * @param string|null $id The system generated unique identifier of the Sku Group. * * @return $this */ @@ -236,7 +236,7 @@ public function getAlias() /** * Sets alias * - * @param string|null $alias A short usable value that represents the product code. + * @param string|null $alias A short usable value that represents the item. This value will be given to the brand. * * @return $this */ diff --git a/lib/Model/SkuItem.php b/lib/Model/SkuItem.php index edb7d53..9ad2ca5 100644 --- a/lib/Model/SkuItem.php +++ b/lib/Model/SkuItem.php @@ -48,16 +48,18 @@ class SkuItem implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'id' => 'string', 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', 'fees' => '\DigitalRiver\ApiSdk\Model\Fees', 'quantity' => 'int', 'amount' => 'double', - 'tariff_code' => 'string', + 'seller_tax_identifier' => 'string', 'tax' => '\DigitalRiver\ApiSdk\Model\Tax', 'importer_tax' => '\DigitalRiver\ApiSdk\Model\ImporterTax', 'duties' => '\DigitalRiver\ApiSdk\Model\Duties', 'discount' => '\DigitalRiver\ApiSdk\Model\SkuDiscount', 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', + 'shipping' => '\DigitalRiver\ApiSdk\Model\ItemShipping', 'metadata' => 'map[string,AnyType]' ]; @@ -69,16 +71,18 @@ class SkuItem implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'id' => null, 'sku_id' => null, + 'product_details' => null, 'subscription_info' => null, 'fees' => null, 'quantity' => null, 'amount' => 'double', - 'tariff_code' => null, + 'seller_tax_identifier' => null, 'tax' => null, 'importer_tax' => null, 'duties' => null, 'discount' => null, 'ship_from' => null, + 'shipping' => null, 'metadata' => null ]; @@ -111,16 +115,18 @@ public static function openAPIFormats() protected static $attributeMap = [ 'id' => 'id', 'sku_id' => 'skuId', + 'product_details' => 'productDetails', 'subscription_info' => 'subscriptionInfo', 'fees' => 'fees', 'quantity' => 'quantity', 'amount' => 'amount', - 'tariff_code' => 'tariffCode', + 'seller_tax_identifier' => 'sellerTaxIdentifier', 'tax' => 'tax', 'importer_tax' => 'importerTax', 'duties' => 'duties', 'discount' => 'discount', 'ship_from' => 'shipFrom', + 'shipping' => 'shipping', 'metadata' => 'metadata' ]; @@ -132,16 +138,18 @@ public static function openAPIFormats() protected static $setters = [ 'id' => 'setId', 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', 'subscription_info' => 'setSubscriptionInfo', 'fees' => 'setFees', 'quantity' => 'setQuantity', 'amount' => 'setAmount', - 'tariff_code' => 'setTariffCode', + 'seller_tax_identifier' => 'setSellerTaxIdentifier', 'tax' => 'setTax', 'importer_tax' => 'setImporterTax', 'duties' => 'setDuties', 'discount' => 'setDiscount', 'ship_from' => 'setShipFrom', + 'shipping' => 'setShipping', 'metadata' => 'setMetadata' ]; @@ -153,16 +161,18 @@ public static function openAPIFormats() protected static $getters = [ 'id' => 'getId', 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', 'subscription_info' => 'getSubscriptionInfo', 'fees' => 'getFees', 'quantity' => 'getQuantity', 'amount' => 'getAmount', - 'tariff_code' => 'getTariffCode', + 'seller_tax_identifier' => 'getSellerTaxIdentifier', 'tax' => 'getTax', 'importer_tax' => 'getImporterTax', 'duties' => 'getDuties', 'discount' => 'getDiscount', 'ship_from' => 'getShipFrom', + 'shipping' => 'getShipping', 'metadata' => 'getMetadata' ]; @@ -228,16 +238,18 @@ public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; - $this->container['tariff_code'] = isset($data['tariff_code']) ? $data['tariff_code'] : null; + $this->container['seller_tax_identifier'] = isset($data['seller_tax_identifier']) ? $data['seller_tax_identifier'] : null; $this->container['tax'] = isset($data['tax']) ? $data['tax'] : null; $this->container['importer_tax'] = isset($data['importer_tax']) ? $data['importer_tax'] : null; $this->container['duties'] = isset($data['duties']) ? $data['duties'] : null; $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['shipping'] = isset($data['shipping']) ? $data['shipping'] : null; $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; } @@ -302,7 +314,7 @@ public function getSkuId() /** * Sets sku_id * - * @param string|null $sku_id The identifier of the stock keeping unit (SKU). + * @param string|null $sku_id The identifier of the [stock keeping unit (SKU)](https://docs.digitalriver.com/digital-river-api/checkouts-and-orders/skus). * * @return $this */ @@ -313,6 +325,30 @@ public function setSkuId($sku_id) return $this; } + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + /** * Gets subscription_info * @@ -410,25 +446,25 @@ public function setAmount($amount) } /** - * Gets tariff_code + * Gets seller_tax_identifier * * @return string|null */ - public function getTariffCode() + public function getSellerTaxIdentifier() { - return $this->container['tariff_code']; + return $this->container['seller_tax_identifier']; } /** - * Sets tariff_code + * Sets seller_tax_identifier * - * @param string|null $tariff_code “Harmonized Tariff Schedule” that adds 4 more country-specific digits to the end of the HS Code and is determined by individual countries of import. + * @param string|null $seller_tax_identifier The tax identifier of the seller. * * @return $this */ - public function setTariffCode($tariff_code) + public function setSellerTaxIdentifier($seller_tax_identifier) { - $this->container['tariff_code'] = $tariff_code; + $this->container['seller_tax_identifier'] = $seller_tax_identifier; return $this; } @@ -553,6 +589,30 @@ public function setShipFrom($ship_from) return $this; } + /** + * Gets shipping + * + * @return \DigitalRiver\ApiSdk\Model\ItemShipping|null + */ + public function getShipping() + { + return $this->container['shipping']; + } + + /** + * Sets shipping + * + * @param \DigitalRiver\ApiSdk\Model\ItemShipping|null $shipping shipping + * + * @return $this + */ + public function setShipping($shipping) + { + $this->container['shipping'] = $shipping; + + return $this; + } + /** * Gets metadata * diff --git a/lib/Model/SkuItemRequest.php b/lib/Model/SkuItemRequest.php new file mode 100644 index 0000000..2a0eb16 --- /dev/null +++ b/lib/Model/SkuItemRequest.php @@ -0,0 +1,536 @@ + 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', + 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', + 'price' => 'double', + 'aggregate_price' => 'double', + 'quantity' => 'int', + 'discount' => '\DigitalRiver\ApiSdk\Model\SkuDiscount', + 'ship_from' => '\DigitalRiver\ApiSdk\Model\ShipFrom', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'sku_id' => null, + 'product_details' => null, + 'subscription_info' => null, + 'price' => 'double', + 'aggregate_price' => 'double', + 'quantity' => null, + 'discount' => null, + 'ship_from' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sku_id' => 'skuId', + 'product_details' => 'productDetails', + 'subscription_info' => 'subscriptionInfo', + 'price' => 'price', + 'aggregate_price' => 'aggregatePrice', + 'quantity' => 'quantity', + 'discount' => 'discount', + 'ship_from' => 'shipFrom', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', + 'subscription_info' => 'setSubscriptionInfo', + 'price' => 'setPrice', + 'aggregate_price' => 'setAggregatePrice', + 'quantity' => 'setQuantity', + 'discount' => 'setDiscount', + 'ship_from' => 'setShipFrom', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', + 'subscription_info' => 'getSubscriptionInfo', + 'price' => 'getPrice', + 'aggregate_price' => 'getAggregatePrice', + 'quantity' => 'getQuantity', + 'discount' => 'getDiscount', + 'ship_from' => 'getShipFrom', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; + $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; + $this->container['price'] = isset($data['price']) ? $data['price'] : null; + $this->container['aggregate_price'] = isset($data['aggregate_price']) ? $data['aggregate_price'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; + $this->container['ship_from'] = isset($data['ship_from']) ? $data['ship_from'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sku_id + * + * @return string|null + */ + public function getSkuId() + { + return $this->container['sku_id']; + } + + /** + * Sets sku_id + * + * @param string|null $sku_id The identifier of the stock keeping unit (SKU). + * + * @return $this + */ + public function setSkuId($sku_id) + { + $this->container['sku_id'] = $sku_id; + + return $this; + } + + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + + /** + * Gets subscription_info + * + * @return \DigitalRiver\ApiSdk\Model\SubscriptionInfo|null + */ + public function getSubscriptionInfo() + { + return $this->container['subscription_info']; + } + + /** + * Sets subscription_info + * + * @param \DigitalRiver\ApiSdk\Model\SubscriptionInfo|null $subscription_info subscription_info + * + * @return $this + */ + public function setSubscriptionInfo($subscription_info) + { + $this->container['subscription_info'] = $subscription_info; + + return $this; + } + + /** + * Gets price + * + * @return double|null + */ + public function getPrice() + { + return $this->container['price']; + } + + /** + * Sets price + * + * @param double|null $price The price of an item. + * + * @return $this + */ + public function setPrice($price) + { + $this->container['price'] = $price; + + return $this; + } + + /** + * Gets aggregate_price + * + * @return double|null + */ + public function getAggregatePrice() + { + return $this->container['aggregate_price']; + } + + /** + * Sets aggregate_price + * + * @param double|null $aggregate_price The aggregate price of an item. + * + * @return $this + */ + public function setAggregatePrice($aggregate_price) + { + $this->container['aggregate_price'] = $aggregate_price; + + return $this; + } + + /** + * Gets quantity + * + * @return int|null + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int|null $quantity The number of items. + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets discount + * + * @return \DigitalRiver\ApiSdk\Model\SkuDiscount|null + */ + public function getDiscount() + { + return $this->container['discount']; + } + + /** + * Sets discount + * + * @param \DigitalRiver\ApiSdk\Model\SkuDiscount|null $discount discount + * + * @return $this + */ + public function setDiscount($discount) + { + $this->container['discount'] = $discount; + + return $this; + } + + /** + * Gets ship_from + * + * @return \DigitalRiver\ApiSdk\Model\ShipFrom|null + */ + public function getShipFrom() + { + return $this->container['ship_from']; + } + + /** + * Sets ship_from + * + * @param \DigitalRiver\ApiSdk\Model\ShipFrom|null $ship_from ship_from + * + * @return $this + */ + public function setShipFrom($ship_from) + { + $this->container['ship_from'] = $ship_from; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/SkuRequest.php b/lib/Model/SkuRequest.php index d0d5e18..194d29c 100644 --- a/lib/Model/SkuRequest.php +++ b/lib/Model/SkuRequest.php @@ -53,7 +53,6 @@ class SkuRequest implements ModelInterface, ArrayAccess 'part_number' => 'string', 'manufacturer_id' => 'string', 'managed_fulfillment' => 'string', - 'allow_oversell' => 'bool', 'tax_code' => 'string', 'name' => 'string', 'description' => 'string', @@ -78,7 +77,6 @@ class SkuRequest implements ModelInterface, ArrayAccess 'part_number' => null, 'manufacturer_id' => null, 'managed_fulfillment' => null, - 'allow_oversell' => null, 'tax_code' => null, 'name' => null, 'description' => null, @@ -124,7 +122,6 @@ public static function openAPIFormats() 'part_number' => 'partNumber', 'manufacturer_id' => 'manufacturerId', 'managed_fulfillment' => 'managedFulfillment', - 'allow_oversell' => 'allowOversell', 'tax_code' => 'taxCode', 'name' => 'name', 'description' => 'description', @@ -149,7 +146,6 @@ public static function openAPIFormats() 'part_number' => 'setPartNumber', 'manufacturer_id' => 'setManufacturerId', 'managed_fulfillment' => 'setManagedFulfillment', - 'allow_oversell' => 'setAllowOversell', 'tax_code' => 'setTaxCode', 'name' => 'setName', 'description' => 'setDescription', @@ -174,7 +170,6 @@ public static function openAPIFormats() 'part_number' => 'getPartNumber', 'manufacturer_id' => 'getManufacturerId', 'managed_fulfillment' => 'getManagedFulfillment', - 'allow_oversell' => 'getAllowOversell', 'tax_code' => 'getTaxCode', 'name' => 'getName', 'description' => 'getDescription', @@ -291,7 +286,6 @@ public function __construct(array $data = null) $this->container['part_number'] = isset($data['part_number']) ? $data['part_number'] : null; $this->container['manufacturer_id'] = isset($data['manufacturer_id']) ? $data['manufacturer_id'] : null; $this->container['managed_fulfillment'] = isset($data['managed_fulfillment']) ? $data['managed_fulfillment'] : null; - $this->container['allow_oversell'] = isset($data['allow_oversell']) ? $data['allow_oversell'] : null; $this->container['tax_code'] = isset($data['tax_code']) ? $data['tax_code'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; @@ -534,30 +528,6 @@ public function setManagedFulfillment($managed_fulfillment) return $this; } - /** - * Gets allow_oversell - * - * @return bool|null - */ - public function getAllowOversell() - { - return $this->container['allow_oversell']; - } - - /** - * Sets allow_oversell - * - * @param bool|null $allow_oversell Determines whether customers are allowed to back order a product. - * - * @return $this - */ - public function setAllowOversell($allow_oversell) - { - $this->container['allow_oversell'] = $allow_oversell; - - return $this; - } - /** * Gets tax_code * diff --git a/lib/Model/SkuRequestItem.php b/lib/Model/SkuRequestItem.php index 29e81bb..0976685 100644 --- a/lib/Model/SkuRequestItem.php +++ b/lib/Model/SkuRequestItem.php @@ -47,6 +47,7 @@ class SkuRequestItem implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'subscription_info' => '\DigitalRiver\ApiSdk\Model\SubscriptionInfo', 'price' => 'double', 'aggregate_price' => 'double', @@ -63,6 +64,7 @@ class SkuRequestItem implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'sku_id' => null, + 'product_details' => null, 'subscription_info' => null, 'price' => 'double', 'aggregate_price' => 'double', @@ -100,6 +102,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'sku_id' => 'skuId', + 'product_details' => 'productDetails', 'subscription_info' => 'subscriptionInfo', 'price' => 'price', 'aggregate_price' => 'aggregatePrice', @@ -116,6 +119,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', 'subscription_info' => 'setSubscriptionInfo', 'price' => 'setPrice', 'aggregate_price' => 'setAggregatePrice', @@ -132,6 +136,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', 'subscription_info' => 'getSubscriptionInfo', 'price' => 'getPrice', 'aggregate_price' => 'getAggregatePrice', @@ -202,6 +207,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['subscription_info'] = isset($data['subscription_info']) ? $data['subscription_info'] : null; $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['aggregate_price'] = isset($data['aggregate_price']) ? $data['aggregate_price'] : null; @@ -220,9 +226,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['sku_id'] === null) { - $invalidProperties[] = "'sku_id' can't be null"; - } return $invalidProperties; } @@ -241,7 +244,7 @@ public function valid() /** * Gets sku_id * - * @return string + * @return string|null */ public function getSkuId() { @@ -251,7 +254,7 @@ public function getSkuId() /** * Sets sku_id * - * @param string $sku_id The identifier of the stock keeping unit (SKU). + * @param string|null $sku_id The identifier of the stock keeping unit (SKU). * * @return $this */ @@ -262,6 +265,30 @@ public function setSkuId($sku_id) return $this; } + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + /** * Gets subscription_info * diff --git a/lib/Model/SkuUpsertRequest.php b/lib/Model/SkuUpsertRequest.php index d3a1c2b..d747d7a 100644 --- a/lib/Model/SkuUpsertRequest.php +++ b/lib/Model/SkuUpsertRequest.php @@ -52,7 +52,6 @@ class SkuUpsertRequest implements ModelInterface, ArrayAccess 'part_number' => 'string', 'manufacturer_id' => 'string', 'managed_fulfillment' => 'string', - 'allow_oversell' => 'bool', 'tax_code' => 'string', 'name' => 'string', 'description' => 'string', @@ -76,7 +75,6 @@ class SkuUpsertRequest implements ModelInterface, ArrayAccess 'part_number' => null, 'manufacturer_id' => null, 'managed_fulfillment' => null, - 'allow_oversell' => null, 'tax_code' => null, 'name' => null, 'description' => null, @@ -121,7 +119,6 @@ public static function openAPIFormats() 'part_number' => 'partNumber', 'manufacturer_id' => 'manufacturerId', 'managed_fulfillment' => 'managedFulfillment', - 'allow_oversell' => 'allowOversell', 'tax_code' => 'taxCode', 'name' => 'name', 'description' => 'description', @@ -145,7 +142,6 @@ public static function openAPIFormats() 'part_number' => 'setPartNumber', 'manufacturer_id' => 'setManufacturerId', 'managed_fulfillment' => 'setManagedFulfillment', - 'allow_oversell' => 'setAllowOversell', 'tax_code' => 'setTaxCode', 'name' => 'setName', 'description' => 'setDescription', @@ -169,7 +165,6 @@ public static function openAPIFormats() 'part_number' => 'getPartNumber', 'manufacturer_id' => 'getManufacturerId', 'managed_fulfillment' => 'getManagedFulfillment', - 'allow_oversell' => 'getAllowOversell', 'tax_code' => 'getTaxCode', 'name' => 'getName', 'description' => 'getDescription', @@ -285,7 +280,6 @@ public function __construct(array $data = null) $this->container['part_number'] = isset($data['part_number']) ? $data['part_number'] : null; $this->container['manufacturer_id'] = isset($data['manufacturer_id']) ? $data['manufacturer_id'] : null; $this->container['managed_fulfillment'] = isset($data['managed_fulfillment']) ? $data['managed_fulfillment'] : null; - $this->container['allow_oversell'] = isset($data['allow_oversell']) ? $data['allow_oversell'] : null; $this->container['tax_code'] = isset($data['tax_code']) ? $data['tax_code'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; @@ -504,30 +498,6 @@ public function setManagedFulfillment($managed_fulfillment) return $this; } - /** - * Gets allow_oversell - * - * @return bool|null - */ - public function getAllowOversell() - { - return $this->container['allow_oversell']; - } - - /** - * Sets allow_oversell - * - * @param bool|null $allow_oversell Determines whether customers are allowed to back order a product. - * - * @return $this - */ - public function setAllowOversell($allow_oversell) - { - $this->container['allow_oversell'] = $allow_oversell; - - return $this; - } - /** * Gets tax_code * diff --git a/lib/Model/Source.php b/lib/Model/Source.php index 64d0756..1f57507 100644 --- a/lib/Model/Source.php +++ b/lib/Model/Source.php @@ -71,6 +71,8 @@ class Source implements ModelInterface, ArrayAccess 'klarna_credit_recurring' => '\DigitalRiver\ApiSdk\Model\KlarnaRecurring', 'konbini' => '\DigitalRiver\ApiSdk\Model\Konbini', 'bank_transfer' => 'object', + 'msts' => 'object', + 'bancontact' => 'object', 'flow' => 'string', 'state' => 'string', 'metadata' => 'map[string,AnyType]', @@ -110,6 +112,8 @@ class Source implements ModelInterface, ArrayAccess 'klarna_credit_recurring' => null, 'konbini' => null, 'bank_transfer' => null, + 'msts' => null, + 'bancontact' => null, 'flow' => null, 'state' => null, 'metadata' => null, @@ -170,6 +174,8 @@ public static function openAPIFormats() 'klarna_credit_recurring' => 'klarnaCreditRecurring', 'konbini' => 'konbini', 'bank_transfer' => 'bankTransfer', + 'msts' => 'msts', + 'bancontact' => 'bancontact', 'flow' => 'flow', 'state' => 'state', 'metadata' => 'metadata', @@ -209,6 +215,8 @@ public static function openAPIFormats() 'klarna_credit_recurring' => 'setKlarnaCreditRecurring', 'konbini' => 'setKonbini', 'bank_transfer' => 'setBankTransfer', + 'msts' => 'setMsts', + 'bancontact' => 'setBancontact', 'flow' => 'setFlow', 'state' => 'setState', 'metadata' => 'setMetadata', @@ -248,6 +256,8 @@ public static function openAPIFormats() 'klarna_credit_recurring' => 'getKlarnaCreditRecurring', 'konbini' => 'getKonbini', 'bank_transfer' => 'getBankTransfer', + 'msts' => 'getMsts', + 'bancontact' => 'getBancontact', 'flow' => 'getFlow', 'state' => 'getState', 'metadata' => 'getMetadata', @@ -314,6 +324,8 @@ public function getModelName() const TYPE_KLARNA_CREDIT_RECURRING = 'klarnaCreditRecurring'; const TYPE_KONBINI = 'konbini'; const TYPE_BANK_TRANSFER = 'bankTransfer'; + const TYPE_MSTS = 'msts'; + const TYPE_BANCONTACT = 'bancontact'; const FLOW_STANDARD = 'standard'; const FLOW_REDIRECT = 'redirect'; const FLOW_RECEIVER = 'receiver'; @@ -352,6 +364,8 @@ public function getTypeAllowableValues() self::TYPE_KLARNA_CREDIT_RECURRING, self::TYPE_KONBINI, self::TYPE_BANK_TRANSFER, + self::TYPE_MSTS, + self::TYPE_BANCONTACT, ]; $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); @@ -437,6 +451,8 @@ public function __construct(array $data = null) $this->container['klarna_credit_recurring'] = isset($data['klarna_credit_recurring']) ? $data['klarna_credit_recurring'] : null; $this->container['konbini'] = isset($data['konbini']) ? $data['konbini'] : null; $this->container['bank_transfer'] = isset($data['bank_transfer']) ? $data['bank_transfer'] : null; + $this->container['msts'] = isset($data['msts']) ? $data['msts'] : null; + $this->container['bancontact'] = isset($data['bancontact']) ? $data['bancontact'] : null; $this->container['flow'] = isset($data['flow']) ? $data['flow'] : null; $this->container['state'] = isset($data['state']) ? $data['state'] : null; $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; @@ -1105,6 +1121,54 @@ public function setBankTransfer($bank_transfer) return $this; } + /** + * Gets msts + * + * @return object|null + */ + public function getMsts() + { + return $this->container['msts']; + } + + /** + * Sets msts + * + * @param object|null $msts msts + * + * @return $this + */ + public function setMsts($msts) + { + $this->container['msts'] = $msts; + + return $this; + } + + /** + * Gets bancontact + * + * @return object|null + */ + public function getBancontact() + { + return $this->container['bancontact']; + } + + /** + * Sets bancontact + * + * @param object|null $bancontact bancontact + * + * @return $this + */ + public function setBancontact($bancontact) + { + $this->container['bancontact'] = $bancontact; + + return $this; + } + /** * Gets flow * diff --git a/lib/Model/StateTransitions.php b/lib/Model/StateTransitions.php index 0c43c41..7c827ae 100644 --- a/lib/Model/StateTransitions.php +++ b/lib/Model/StateTransitions.php @@ -47,9 +47,8 @@ class StateTransitions implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'activated' => '\DateTime', - 'failed' => '\DateTime', - 'cancelled' => '\DateTime', - 'ended' => '\DateTime' + 'discontinued' => '\DateTime', + 'deactivated' => '\DateTime' ]; /** @@ -59,9 +58,8 @@ class StateTransitions implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'activated' => 'date-time', - 'failed' => 'date-time', - 'cancelled' => 'date-time', - 'ended' => 'date-time' + 'discontinued' => 'date-time', + 'deactivated' => 'date-time' ]; /** @@ -92,9 +90,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'activated' => 'activated', - 'failed' => 'failed', - 'cancelled' => 'cancelled', - 'ended' => 'ended' + 'discontinued' => 'discontinued', + 'deactivated' => 'deactivated' ]; /** @@ -104,9 +101,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'activated' => 'setActivated', - 'failed' => 'setFailed', - 'cancelled' => 'setCancelled', - 'ended' => 'setEnded' + 'discontinued' => 'setDiscontinued', + 'deactivated' => 'setDeactivated' ]; /** @@ -116,9 +112,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'activated' => 'getActivated', - 'failed' => 'getFailed', - 'cancelled' => 'getCancelled', - 'ended' => 'getEnded' + 'discontinued' => 'getDiscontinued', + 'deactivated' => 'getDeactivated' ]; /** @@ -182,9 +177,8 @@ public function getModelName() public function __construct(array $data = null) { $this->container['activated'] = isset($data['activated']) ? $data['activated'] : null; - $this->container['failed'] = isset($data['failed']) ? $data['failed'] : null; - $this->container['cancelled'] = isset($data['cancelled']) ? $data['cancelled'] : null; - $this->container['ended'] = isset($data['ended']) ? $data['ended'] : null; + $this->container['discontinued'] = isset($data['discontinued']) ? $data['discontinued'] : null; + $this->container['deactivated'] = isset($data['deactivated']) ? $data['deactivated'] : null; } /** @@ -224,7 +218,7 @@ public function getActivated() /** * Sets activated * - * @param \DateTime|null $activated activated + * @param \DateTime|null $activated Can be subscribed to, updates are restricted to some fields * * @return $this */ @@ -236,73 +230,49 @@ public function setActivated($activated) } /** - * Gets failed + * Gets discontinued * * @return \DateTime|null */ - public function getFailed() + public function getDiscontinued() { - return $this->container['failed']; + return $this->container['discontinued']; } /** - * Sets failed + * Sets discontinued * - * @param \DateTime|null $failed failed + * @param \DateTime|null $discontinued Has active subscriptions, but not accepting new ones * * @return $this */ - public function setFailed($failed) + public function setDiscontinued($discontinued) { - $this->container['failed'] = $failed; + $this->container['discontinued'] = $discontinued; return $this; } /** - * Gets cancelled + * Gets deactivated * * @return \DateTime|null */ - public function getCancelled() + public function getDeactivated() { - return $this->container['cancelled']; + return $this->container['deactivated']; } /** - * Sets cancelled + * Sets deactivated * - * @param \DateTime|null $cancelled cancelled + * @param \DateTime|null $deactivated All subscriptions will be stopped * * @return $this */ - public function setCancelled($cancelled) + public function setDeactivated($deactivated) { - $this->container['cancelled'] = $cancelled; - - return $this; - } - - /** - * Gets ended - * - * @return \DateTime|null - */ - public function getEnded() - { - return $this->container['ended']; - } - - /** - * Sets ended - * - * @param \DateTime|null $ended ended - * - * @return $this - */ - public function setEnded($ended) - { - $this->container['ended'] = $ended; + $this->container['deactivated'] = $deactivated; return $this; } diff --git a/lib/Model/Subscription.php b/lib/Model/Subscription.php index 46de910..0711aea 100644 --- a/lib/Model/Subscription.php +++ b/lib/Model/Subscription.php @@ -49,7 +49,7 @@ class Subscription implements ModelInterface, ArrayAccess 'contract_binding_until' => '\DateTime', 'created_time' => '\DateTime', 'updated_time' => '\DateTime', - 'state_transitions' => '\DigitalRiver\ApiSdk\Model\StateTransitions', + 'state_transitions' => '\DigitalRiver\ApiSdk\Model\SubscriptionStateTransitions', 'live_mode' => 'bool', 'id' => 'string', 'billing_agreement_id' => 'string', @@ -64,6 +64,7 @@ class Subscription implements ModelInterface, ArrayAccess 'items' => '\DigitalRiver\ApiSdk\Model\SubscriptionItems[]', 'current_period_end_date' => '\DateTime', 'next_invoice_date' => '\DateTime', + 'next_reminder_date' => '\DateTime', 'metadata' => 'map[string,AnyType]' ]; @@ -91,6 +92,7 @@ class Subscription implements ModelInterface, ArrayAccess 'items' => null, 'current_period_end_date' => 'date-time', 'next_invoice_date' => 'date-time', + 'next_reminder_date' => 'date-time', 'metadata' => null ]; @@ -139,6 +141,7 @@ public static function openAPIFormats() 'items' => 'items', 'current_period_end_date' => 'currentPeriodEndDate', 'next_invoice_date' => 'nextInvoiceDate', + 'next_reminder_date' => 'nextReminderDate', 'metadata' => 'metadata' ]; @@ -166,6 +169,7 @@ public static function openAPIFormats() 'items' => 'setItems', 'current_period_end_date' => 'setCurrentPeriodEndDate', 'next_invoice_date' => 'setNextInvoiceDate', + 'next_reminder_date' => 'setNextReminderDate', 'metadata' => 'setMetadata' ]; @@ -193,6 +197,7 @@ public static function openAPIFormats() 'items' => 'getItems', 'current_period_end_date' => 'getCurrentPeriodEndDate', 'next_invoice_date' => 'getNextInvoiceDate', + 'next_reminder_date' => 'getNextReminderDate', 'metadata' => 'getMetadata' ]; @@ -240,6 +245,7 @@ public function getModelName() const STATE_DRAFT = 'draft'; const STATE_ACTIVE_PENDING_INVOICE = 'activePendingInvoice'; const STATE_ACTIVE = 'active'; + const STATE_ACTIVE_FREE = 'activeFree'; const STATE_FAILED = 'failed'; const STATE_CANCELLED = 'cancelled'; const STATE_ENDED = 'ended'; @@ -257,6 +263,7 @@ public function getStateAllowableValues() self::STATE_DRAFT, self::STATE_ACTIVE_PENDING_INVOICE, self::STATE_ACTIVE, + self::STATE_ACTIVE_FREE, self::STATE_FAILED, self::STATE_CANCELLED, self::STATE_ENDED, @@ -300,6 +307,7 @@ public function __construct(array $data = null) $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['current_period_end_date'] = isset($data['current_period_end_date']) ? $data['current_period_end_date'] : null; $this->container['next_invoice_date'] = isset($data['next_invoice_date']) ? $data['next_invoice_date'] : null; + $this->container['next_reminder_date'] = isset($data['next_reminder_date']) ? $data['next_reminder_date'] : null; $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; } @@ -417,7 +425,7 @@ public function setUpdatedTime($updated_time) /** * Gets state_transitions * - * @return \DigitalRiver\ApiSdk\Model\StateTransitions|null + * @return \DigitalRiver\ApiSdk\Model\SubscriptionStateTransitions|null */ public function getStateTransitions() { @@ -427,7 +435,7 @@ public function getStateTransitions() /** * Sets state_transitions * - * @param \DigitalRiver\ApiSdk\Model\StateTransitions|null $state_transitions state_transitions + * @param \DigitalRiver\ApiSdk\Model\SubscriptionStateTransitions|null $state_transitions state_transitions * * @return $this */ @@ -783,6 +791,30 @@ public function setNextInvoiceDate($next_invoice_date) return $this; } + /** + * Gets next_reminder_date + * + * @return \DateTime|null + */ + public function getNextReminderDate() + { + return $this->container['next_reminder_date']; + } + + /** + * Sets next_reminder_date + * + * @param \DateTime|null $next_reminder_date Date when the next reminder event will be sent. + * + * @return $this + */ + public function setNextReminderDate($next_reminder_date) + { + $this->container['next_reminder_date'] = $next_reminder_date; + + return $this; + } + /** * Gets metadata * diff --git a/lib/Model/SubscriptionItems.php b/lib/Model/SubscriptionItems.php index a54b93c..5f3447c 100644 --- a/lib/Model/SubscriptionItems.php +++ b/lib/Model/SubscriptionItems.php @@ -50,6 +50,7 @@ class SubscriptionItems implements ModelInterface, ArrayAccess 'price' => 'double', 'metadata' => 'map[string,AnyType]', 'sku_id' => 'string', + 'product_details' => '\DigitalRiver\ApiSdk\Model\ProductDetails', 'quantity' => 'int' ]; @@ -63,6 +64,7 @@ class SubscriptionItems implements ModelInterface, ArrayAccess 'price' => 'double', 'metadata' => null, 'sku_id' => null, + 'product_details' => null, 'quantity' => null ]; @@ -97,6 +99,7 @@ public static function openAPIFormats() 'price' => 'price', 'metadata' => 'metadata', 'sku_id' => 'skuId', + 'product_details' => 'productDetails', 'quantity' => 'quantity' ]; @@ -110,6 +113,7 @@ public static function openAPIFormats() 'price' => 'setPrice', 'metadata' => 'setMetadata', 'sku_id' => 'setSkuId', + 'product_details' => 'setProductDetails', 'quantity' => 'setQuantity' ]; @@ -123,6 +127,7 @@ public static function openAPIFormats() 'price' => 'getPrice', 'metadata' => 'getMetadata', 'sku_id' => 'getSkuId', + 'product_details' => 'getProductDetails', 'quantity' => 'getQuantity' ]; @@ -190,6 +195,7 @@ public function __construct(array $data = null) $this->container['price'] = isset($data['price']) ? $data['price'] : null; $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['product_details'] = isset($data['product_details']) ? $data['product_details'] : null; $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; } @@ -313,6 +319,30 @@ public function setSkuId($sku_id) return $this; } + /** + * Gets product_details + * + * @return \DigitalRiver\ApiSdk\Model\ProductDetails|null + */ + public function getProductDetails() + { + return $this->container['product_details']; + } + + /** + * Sets product_details + * + * @param \DigitalRiver\ApiSdk\Model\ProductDetails|null $product_details product_details + * + * @return $this + */ + public function setProductDetails($product_details) + { + $this->container['product_details'] = $product_details; + + return $this; + } + /** * Gets quantity * diff --git a/lib/Model/SubscriptionStateTransitions.php b/lib/Model/SubscriptionStateTransitions.php new file mode 100644 index 0000000..e635163 --- /dev/null +++ b/lib/Model/SubscriptionStateTransitions.php @@ -0,0 +1,416 @@ + '\DateTime', + 'activated_free' => '\DateTime', + 'failed' => '\DateTime', + 'cancelled' => '\DateTime', + 'ended' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'activated' => 'date-time', + 'activated_free' => 'date-time', + 'failed' => 'date-time', + 'cancelled' => 'date-time', + 'ended' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'activated' => 'activated', + 'activated_free' => 'activatedFree', + 'failed' => 'failed', + 'cancelled' => 'cancelled', + 'ended' => 'ended' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'activated' => 'setActivated', + 'activated_free' => 'setActivatedFree', + 'failed' => 'setFailed', + 'cancelled' => 'setCancelled', + 'ended' => 'setEnded' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'activated' => 'getActivated', + 'activated_free' => 'getActivatedFree', + 'failed' => 'getFailed', + 'cancelled' => 'getCancelled', + 'ended' => 'getEnded' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['activated'] = isset($data['activated']) ? $data['activated'] : null; + $this->container['activated_free'] = isset($data['activated_free']) ? $data['activated_free'] : null; + $this->container['failed'] = isset($data['failed']) ? $data['failed'] : null; + $this->container['cancelled'] = isset($data['cancelled']) ? $data['cancelled'] : null; + $this->container['ended'] = isset($data['ended']) ? $data['ended'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets activated + * + * @return \DateTime|null + */ + public function getActivated() + { + return $this->container['activated']; + } + + /** + * Sets activated + * + * @param \DateTime|null $activated activated + * + * @return $this + */ + public function setActivated($activated) + { + $this->container['activated'] = $activated; + + return $this; + } + + /** + * Gets activated_free + * + * @return \DateTime|null + */ + public function getActivatedFree() + { + return $this->container['activated_free']; + } + + /** + * Sets activated_free + * + * @param \DateTime|null $activated_free activated_free + * + * @return $this + */ + public function setActivatedFree($activated_free) + { + $this->container['activated_free'] = $activated_free; + + return $this; + } + + /** + * Gets failed + * + * @return \DateTime|null + */ + public function getFailed() + { + return $this->container['failed']; + } + + /** + * Sets failed + * + * @param \DateTime|null $failed failed + * + * @return $this + */ + public function setFailed($failed) + { + $this->container['failed'] = $failed; + + return $this; + } + + /** + * Gets cancelled + * + * @return \DateTime|null + */ + public function getCancelled() + { + return $this->container['cancelled']; + } + + /** + * Sets cancelled + * + * @param \DateTime|null $cancelled cancelled + * + * @return $this + */ + public function setCancelled($cancelled) + { + $this->container['cancelled'] = $cancelled; + + return $this; + } + + /** + * Gets ended + * + * @return \DateTime|null + */ + public function getEnded() + { + return $this->container['ended']; + } + + /** + * Sets ended + * + * @param \DateTime|null $ended ended + * + * @return $this + */ + public function setEnded($ended) + { + $this->container['ended'] = $ended; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TaxIdentifier1.php b/lib/Model/TaxIdentifier1.php new file mode 100644 index 0000000..84f5037 --- /dev/null +++ b/lib/Model/TaxIdentifier1.php @@ -0,0 +1,604 @@ + 'string', + 'created_time' => '\DateTime', + 'customer_id' => 'string', + 'type' => 'string', + 'value' => 'string', + 'state' => 'string', + 'state_transitions' => '\DigitalRiver\ApiSdk\Model\TaxIdentifierStateTransitions', + 'verified_name' => 'string', + 'verified_address' => 'string', + 'updated_time' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'created_time' => 'date-time', + 'customer_id' => null, + 'type' => null, + 'value' => null, + 'state' => null, + 'state_transitions' => null, + 'verified_name' => null, + 'verified_address' => null, + 'updated_time' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'created_time' => 'createdTime', + 'customer_id' => 'customerId', + 'type' => 'type', + 'value' => 'value', + 'state' => 'state', + 'state_transitions' => 'stateTransitions', + 'verified_name' => 'verifiedName', + 'verified_address' => 'verifiedAddress', + 'updated_time' => 'updatedTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'created_time' => 'setCreatedTime', + 'customer_id' => 'setCustomerId', + 'type' => 'setType', + 'value' => 'setValue', + 'state' => 'setState', + 'state_transitions' => 'setStateTransitions', + 'verified_name' => 'setVerifiedName', + 'verified_address' => 'setVerifiedAddress', + 'updated_time' => 'setUpdatedTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'created_time' => 'getCreatedTime', + 'customer_id' => 'getCustomerId', + 'type' => 'getType', + 'value' => 'getValue', + 'state' => 'getState', + 'state_transitions' => 'getStateTransitions', + 'verified_name' => 'getVerifiedName', + 'verified_address' => 'getVerifiedAddress', + 'updated_time' => 'getUpdatedTime' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_PENDING = 'pending'; + const STATE_NOT_VALID = 'not_valid'; + const STATE_VERIFIED = 'verified'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_PENDING, + self::STATE_NOT_VALID, + self::STATE_VERIFIED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['created_time'] = isset($data['created_time']) ? $data['created_time'] : null; + $this->container['customer_id'] = isset($data['customer_id']) ? $data['customer_id'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['value'] = isset($data['value']) ? $data['value'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['state_transitions'] = isset($data['state_transitions']) ? $data['state_transitions'] : null; + $this->container['verified_name'] = isset($data['verified_name']) ? $data['verified_name'] : null; + $this->container['verified_address'] = isset($data['verified_address']) ? $data['verified_address'] : null; + $this->container['updated_time'] = isset($data['updated_time']) ? $data['updated_time'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The identifier of the tax identifier. + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets created_time + * + * @return \DateTime|null + */ + public function getCreatedTime() + { + return $this->container['created_time']; + } + + /** + * Sets created_time + * + * @param \DateTime|null $created_time The time when the tax identifier was created. + * + * @return $this + */ + public function setCreatedTime($created_time) + { + $this->container['created_time'] = $created_time; + + return $this; + } + + /** + * Gets customer_id + * + * @return string|null + */ + public function getCustomerId() + { + return $this->container['customer_id']; + } + + /** + * Sets customer_id + * + * @param string|null $customer_id The identifier of an existing customer. + * + * @return $this + */ + public function setCustomerId($customer_id) + { + $this->container['customer_id'] = $customer_id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Type of tax identifier. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value The tax identifier. + * + * @return $this + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The verification state. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets state_transitions + * + * @return \DigitalRiver\ApiSdk\Model\TaxIdentifierStateTransitions|null + */ + public function getStateTransitions() + { + return $this->container['state_transitions']; + } + + /** + * Sets state_transitions + * + * @param \DigitalRiver\ApiSdk\Model\TaxIdentifierStateTransitions|null $state_transitions state_transitions + * + * @return $this + */ + public function setStateTransitions($state_transitions) + { + $this->container['state_transitions'] = $state_transitions; + + return $this; + } + + /** + * Gets verified_name + * + * @return string|null + */ + public function getVerifiedName() + { + return $this->container['verified_name']; + } + + /** + * Sets verified_name + * + * @param string|null $verified_name The registered name of the customer with this tax identifier. + * + * @return $this + */ + public function setVerifiedName($verified_name) + { + $this->container['verified_name'] = $verified_name; + + return $this; + } + + /** + * Gets verified_address + * + * @return string|null + */ + public function getVerifiedAddress() + { + return $this->container['verified_address']; + } + + /** + * Sets verified_address + * + * @param string|null $verified_address The registered address of the customer with this tax identifier. + * + * @return $this + */ + public function setVerifiedAddress($verified_address) + { + $this->container['verified_address'] = $verified_address; + + return $this; + } + + /** + * Gets updated_time + * + * @return \DateTime|null + */ + public function getUpdatedTime() + { + return $this->container['updated_time']; + } + + /** + * Sets updated_time + * + * @param \DateTime|null $updated_time The time when the tax identifier was updated. + * + * @return $this + */ + public function setUpdatedTime($updated_time) + { + $this->container['updated_time'] = $updated_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/TaxIdentifiersInfo.php b/lib/Model/TaxIdentifiersInfo.php new file mode 100644 index 0000000..7f35197 --- /dev/null +++ b/lib/Model/TaxIdentifiersInfo.php @@ -0,0 +1,452 @@ + 'string', + 'customer_type' => 'string', + 'is_required' => 'bool', + 'format_pattern' => 'string', + 'locales' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'type' => null, + 'customer_type' => null, + 'is_required' => null, + 'format_pattern' => null, + 'locales' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'customer_type' => 'customerType', + 'is_required' => 'isRequired', + 'format_pattern' => 'formatPattern', + 'locales' => 'locales' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'customer_type' => 'setCustomerType', + 'is_required' => 'setIsRequired', + 'format_pattern' => 'setFormatPattern', + 'locales' => 'setLocales' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'customer_type' => 'getCustomerType', + 'is_required' => 'getIsRequired', + 'format_pattern' => 'getFormatPattern', + 'locales' => 'getLocales' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const CUSTOMER_TYPE_BUSINESS = 'business'; + const CUSTOMER_TYPE_CUSTOMER = 'customer'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCustomerTypeAllowableValues() + { + $allowable = [ + self::CUSTOMER_TYPE_BUSINESS, + self::CUSTOMER_TYPE_CUSTOMER, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['customer_type'] = isset($data['customer_type']) ? $data['customer_type'] : null; + $this->container['is_required'] = isset($data['is_required']) ? $data['is_required'] : null; + $this->container['format_pattern'] = isset($data['format_pattern']) ? $data['format_pattern'] : null; + $this->container['locales'] = isset($data['locales']) ? $data['locales'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getCustomerTypeAllowableValues(); + + if (!is_null($this->container['customer_type']) && !in_array(strtolower($this->container['customer_type']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'customer_type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of tax identifier. + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets customer_type + * + * @return string|null + */ + public function getCustomerType() + { + return $this->container['customer_type']; + } + + /** + * Sets customer_type + * + * @param string|null $customer_type The type of customer. + * + * @return $this + */ + public function setCustomerType($customer_type) + { + $allowedValues = $this->getCustomerTypeAllowableValues(); + if (!is_null($customer_type) && !in_array(strtolower($customer_type), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'customer_type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['customer_type'] = $customer_type; + + return $this; + } + + /** + * Gets is_required + * + * @return bool|null + */ + public function getIsRequired() + { + return $this->container['is_required']; + } + + /** + * Sets is_required + * + * @param bool|null $is_required Indicates whether or not tax id is required. + * + * @return $this + */ + public function setIsRequired($is_required) + { + $this->container['is_required'] = $is_required; + + return $this; + } + + /** + * Gets format_pattern + * + * @return string|null + */ + public function getFormatPattern() + { + return $this->container['format_pattern']; + } + + /** + * Sets format_pattern + * + * @param string|null $format_pattern The format pattern of the tax id. + * + * @return $this + */ + public function setFormatPattern($format_pattern) + { + $this->container['format_pattern'] = $format_pattern; + + return $this; + } + + /** + * Gets locales + * + * @return string|null + */ + public function getLocales() + { + return $this->container['locales']; + } + + /** + * Sets locales + * + * @param string|null $locales A designator that combines the two-letter ISO 639-1 language code with the ISO 3166-1 alpha-2 country code. + * + * @return $this + */ + public function setLocales($locales) + { + $this->container['locales'] = $locales; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateCheckoutRequest.php b/lib/Model/UpdateCheckoutRequest.php index 04699bf..b26d93c 100644 --- a/lib/Model/UpdateCheckoutRequest.php +++ b/lib/Model/UpdateCheckoutRequest.php @@ -51,6 +51,7 @@ class UpdateCheckoutRequest implements ModelInterface, ArrayAccess 'currency' => 'string', 'email' => 'string', 'locale' => 'string', + 'invoice_attribute_id' => 'string', 'browser_ip' => 'string', 'application_id' => 'string', 'tax_identifiers' => '\DigitalRiver\ApiSdk\Model\CheckoutTaxIdentifierRequest[]', @@ -61,8 +62,8 @@ class UpdateCheckoutRequest implements ModelInterface, ArrayAccess 'shipping_discount' => '\DigitalRiver\ApiSdk\Model\Discount', 'charge_type' => '\DigitalRiver\ApiSdk\Model\ChargeType', 'customer_type' => '\DigitalRiver\ApiSdk\Model\CustomerType', - 'shipping_choice' => '\DigitalRiver\ApiSdk\Model\ShippingRequest', 'purchase_location' => '\DigitalRiver\ApiSdk\Model\PurchaseLocation', + 'shipping_choice' => '\DigitalRiver\ApiSdk\Model\ShippingRequest', 'items' => '\DigitalRiver\ApiSdk\Model\SkuUpdateRequestItem', 'upstream_id' => 'string', 'metadata' => 'map[string,AnyType]' @@ -79,6 +80,7 @@ class UpdateCheckoutRequest implements ModelInterface, ArrayAccess 'currency' => null, 'email' => 'email', 'locale' => null, + 'invoice_attribute_id' => null, 'browser_ip' => null, 'application_id' => null, 'tax_identifiers' => null, @@ -89,8 +91,8 @@ class UpdateCheckoutRequest implements ModelInterface, ArrayAccess 'shipping_discount' => null, 'charge_type' => null, 'customer_type' => null, - 'shipping_choice' => null, 'purchase_location' => null, + 'shipping_choice' => null, 'items' => null, 'upstream_id' => null, 'metadata' => null @@ -128,6 +130,7 @@ public static function openAPIFormats() 'currency' => 'currency', 'email' => 'email', 'locale' => 'locale', + 'invoice_attribute_id' => 'invoiceAttributeId', 'browser_ip' => 'browserIp', 'application_id' => 'applicationId', 'tax_identifiers' => 'taxIdentifiers', @@ -138,8 +141,8 @@ public static function openAPIFormats() 'shipping_discount' => 'shippingDiscount', 'charge_type' => 'chargeType', 'customer_type' => 'customerType', - 'shipping_choice' => 'shippingChoice', 'purchase_location' => 'purchaseLocation', + 'shipping_choice' => 'shippingChoice', 'items' => 'items', 'upstream_id' => 'upstreamId', 'metadata' => 'metadata' @@ -156,6 +159,7 @@ public static function openAPIFormats() 'currency' => 'setCurrency', 'email' => 'setEmail', 'locale' => 'setLocale', + 'invoice_attribute_id' => 'setInvoiceAttributeId', 'browser_ip' => 'setBrowserIp', 'application_id' => 'setApplicationId', 'tax_identifiers' => 'setTaxIdentifiers', @@ -166,8 +170,8 @@ public static function openAPIFormats() 'shipping_discount' => 'setShippingDiscount', 'charge_type' => 'setChargeType', 'customer_type' => 'setCustomerType', - 'shipping_choice' => 'setShippingChoice', 'purchase_location' => 'setPurchaseLocation', + 'shipping_choice' => 'setShippingChoice', 'items' => 'setItems', 'upstream_id' => 'setUpstreamId', 'metadata' => 'setMetadata' @@ -184,6 +188,7 @@ public static function openAPIFormats() 'currency' => 'getCurrency', 'email' => 'getEmail', 'locale' => 'getLocale', + 'invoice_attribute_id' => 'getInvoiceAttributeId', 'browser_ip' => 'getBrowserIp', 'application_id' => 'getApplicationId', 'tax_identifiers' => 'getTaxIdentifiers', @@ -194,8 +199,8 @@ public static function openAPIFormats() 'shipping_discount' => 'getShippingDiscount', 'charge_type' => 'getChargeType', 'customer_type' => 'getCustomerType', - 'shipping_choice' => 'getShippingChoice', 'purchase_location' => 'getPurchaseLocation', + 'shipping_choice' => 'getShippingChoice', 'items' => 'getItems', 'upstream_id' => 'getUpstreamId', 'metadata' => 'getMetadata' @@ -266,6 +271,7 @@ public function __construct(array $data = null) $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; $this->container['email'] = isset($data['email']) ? $data['email'] : null; $this->container['locale'] = isset($data['locale']) ? $data['locale'] : null; + $this->container['invoice_attribute_id'] = isset($data['invoice_attribute_id']) ? $data['invoice_attribute_id'] : null; $this->container['browser_ip'] = isset($data['browser_ip']) ? $data['browser_ip'] : null; $this->container['application_id'] = isset($data['application_id']) ? $data['application_id'] : null; $this->container['tax_identifiers'] = isset($data['tax_identifiers']) ? $data['tax_identifiers'] : null; @@ -276,8 +282,8 @@ public function __construct(array $data = null) $this->container['shipping_discount'] = isset($data['shipping_discount']) ? $data['shipping_discount'] : null; $this->container['charge_type'] = isset($data['charge_type']) ? $data['charge_type'] : null; $this->container['customer_type'] = isset($data['customer_type']) ? $data['customer_type'] : null; - $this->container['shipping_choice'] = isset($data['shipping_choice']) ? $data['shipping_choice'] : null; $this->container['purchase_location'] = isset($data['purchase_location']) ? $data['purchase_location'] : null; + $this->container['shipping_choice'] = isset($data['shipping_choice']) ? $data['shipping_choice'] : null; $this->container['items'] = isset($data['items']) ? $data['items'] : null; $this->container['upstream_id'] = isset($data['upstream_id']) ? $data['upstream_id'] : null; $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; @@ -427,6 +433,30 @@ public function setLocale($locale) return $this; } + /** + * Gets invoice_attribute_id + * + * @return string|null + */ + public function getInvoiceAttributeId() + { + return $this->container['invoice_attribute_id']; + } + + /** + * Sets invoice_attribute_id + * + * @param string|null $invoice_attribute_id The unique identfier of the invoice attribute. + * + * @return $this + */ + public function setInvoiceAttributeId($invoice_attribute_id) + { + $this->container['invoice_attribute_id'] = $invoice_attribute_id; + + return $this; + } + /** * Gets browser_ip * @@ -668,49 +698,49 @@ public function setCustomerType($customer_type) } /** - * Gets shipping_choice + * Gets purchase_location * - * @return \DigitalRiver\ApiSdk\Model\ShippingRequest|null + * @return \DigitalRiver\ApiSdk\Model\PurchaseLocation|null */ - public function getShippingChoice() + public function getPurchaseLocation() { - return $this->container['shipping_choice']; + return $this->container['purchase_location']; } /** - * Sets shipping_choice + * Sets purchase_location * - * @param \DigitalRiver\ApiSdk\Model\ShippingRequest|null $shipping_choice shipping_choice + * @param \DigitalRiver\ApiSdk\Model\PurchaseLocation|null $purchase_location purchase_location * * @return $this */ - public function setShippingChoice($shipping_choice) + public function setPurchaseLocation($purchase_location) { - $this->container['shipping_choice'] = $shipping_choice; + $this->container['purchase_location'] = $purchase_location; return $this; } /** - * Gets purchase_location + * Gets shipping_choice * - * @return \DigitalRiver\ApiSdk\Model\PurchaseLocation|null + * @return \DigitalRiver\ApiSdk\Model\ShippingRequest|null */ - public function getPurchaseLocation() + public function getShippingChoice() { - return $this->container['purchase_location']; + return $this->container['shipping_choice']; } /** - * Sets purchase_location + * Sets shipping_choice * - * @param \DigitalRiver\ApiSdk\Model\PurchaseLocation|null $purchase_location purchase_location + * @param \DigitalRiver\ApiSdk\Model\ShippingRequest|null $shipping_choice shipping_choice * * @return $this */ - public function setPurchaseLocation($purchase_location) + public function setShippingChoice($shipping_choice) { - $this->container['purchase_location'] = $purchase_location; + $this->container['shipping_choice'] = $shipping_choice; return $this; } diff --git a/lib/Model/UpdateReturnsItem.php b/lib/Model/UpdateReturnsItem.php new file mode 100644 index 0000000..92329df --- /dev/null +++ b/lib/Model/UpdateReturnsItem.php @@ -0,0 +1,426 @@ + 'string', + 'sku_id' => 'string', + 'quantity' => 'int', + 'state' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'item_id' => null, + 'sku_id' => null, + 'quantity' => null, + 'state' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'item_id' => 'itemId', + 'sku_id' => 'skuId', + 'quantity' => 'quantity', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'item_id' => 'setItemId', + 'sku_id' => 'setSkuId', + 'quantity' => 'setQuantity', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'item_id' => 'getItemId', + 'sku_id' => 'getSkuId', + 'quantity' => 'getQuantity', + 'state' => 'getState' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_ACCEPTED = 'accepted'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_ACCEPTED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['item_id'] = isset($data['item_id']) ? $data['item_id'] : null; + $this->container['sku_id'] = isset($data['sku_id']) ? $data['sku_id'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['quantity'] === null) { + $invalidProperties[] = "'quantity' can't be null"; + } + if ($this->container['state'] === null) { + $invalidProperties[] = "'state' can't be null"; + } + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets item_id + * + * @return string|null + */ + public function getItemId() + { + return $this->container['item_id']; + } + + /** + * Sets item_id + * + * @param string|null $item_id The identifier of the item. + * + * @return $this + */ + public function setItemId($item_id) + { + $this->container['item_id'] = $item_id; + + return $this; + } + + /** + * Gets sku_id + * + * @return string|null + */ + public function getSkuId() + { + return $this->container['sku_id']; + } + + /** + * Sets sku_id + * + * @param string|null $sku_id The identifier of the SKU. + * + * @return $this + */ + public function setSkuId($sku_id) + { + $this->container['sku_id'] = $sku_id; + + return $this; + } + + /** + * Gets quantity + * + * @return int + */ + public function getQuantity() + { + return $this->container['quantity']; + } + + /** + * Sets quantity + * + * @param int $quantity quantity + * + * @return $this + */ + public function setQuantity($quantity) + { + $this->container['quantity'] = $quantity; + + return $this; + } + + /** + * Gets state + * + * @return string + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string $state An enumeration indicating the state of the return item. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateReturnsRequest.php b/lib/Model/UpdateReturnsRequest.php new file mode 100644 index 0000000..de2eff8 --- /dev/null +++ b/lib/Model/UpdateReturnsRequest.php @@ -0,0 +1,420 @@ + '\DigitalRiver\ApiSdk\Model\ReturnsLocation', + 'state' => 'string', + 'items' => '\DigitalRiver\ApiSdk\Model\UpdateReturnsItem[]', + 'metadata' => 'map[string,AnyType]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'location' => null, + 'state' => null, + 'items' => null, + 'metadata' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'location' => 'location', + 'state' => 'state', + 'items' => 'items', + 'metadata' => 'metadata' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'location' => 'setLocation', + 'state' => 'setState', + 'items' => 'setItems', + 'metadata' => 'setMetadata' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'location' => 'getLocation', + 'state' => 'getState', + 'items' => 'getItems', + 'metadata' => 'getMetadata' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_ACCEPTED = 'accepted'; + + + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + $allowable = [ + self::STATE_ACCEPTED, + ]; + + $allowableAllCase = array_unique(array_merge(array_map('strtolower', $allowable), $allowable)); + return $allowableAllCase; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['location'] = isset($data['location']) ? $data['location'] : null; + $this->container['state'] = isset($data['state']) ? $data['state'] : null; + $this->container['items'] = isset($data['items']) ? $data['items'] : null; + $this->container['metadata'] = isset($data['metadata']) ? $data['metadata'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStateAllowableValues(); + + if (!is_null($this->container['state']) && !in_array(strtolower($this->container['state']), $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets location + * + * @return \DigitalRiver\ApiSdk\Model\ReturnsLocation|null + */ + public function getLocation() + { + return $this->container['location']; + } + + /** + * Sets location + * + * @param \DigitalRiver\ApiSdk\Model\ReturnsLocation|null $location location + * + * @return $this + */ + public function setLocation($location) + { + $this->container['location'] = $location; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state Enumeration indicating the state of the return. + * + * @return $this + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array(strtolower($state), $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'state', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + + /** + * Gets items + * + * @return \DigitalRiver\ApiSdk\Model\UpdateReturnsItem[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \DigitalRiver\ApiSdk\Model\UpdateReturnsItem[]|null $items items + * + * @return $this + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets metadata + * + * @return map[string,AnyType]|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param map[string,AnyType]|null $metadata Key-value pairs used to store additional data. Value can be string, boolean or integer types. + * + * @return $this + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/Model/UpdateSkuRequest.php b/lib/Model/UpdateSkuRequest.php index 2d5c1e5..22dd46b 100644 --- a/lib/Model/UpdateSkuRequest.php +++ b/lib/Model/UpdateSkuRequest.php @@ -52,7 +52,6 @@ class UpdateSkuRequest implements ModelInterface, ArrayAccess 'part_number' => 'string', 'manufacturer_id' => 'string', 'managed_fulfillment' => 'string', - 'allow_oversell' => 'bool', 'tax_code' => 'string', 'name' => 'string', 'description' => 'string', @@ -76,7 +75,6 @@ class UpdateSkuRequest implements ModelInterface, ArrayAccess 'part_number' => null, 'manufacturer_id' => null, 'managed_fulfillment' => null, - 'allow_oversell' => null, 'tax_code' => null, 'name' => null, 'description' => null, @@ -121,7 +119,6 @@ public static function openAPIFormats() 'part_number' => 'partNumber', 'manufacturer_id' => 'manufacturerId', 'managed_fulfillment' => 'managedFulfillment', - 'allow_oversell' => 'allowOversell', 'tax_code' => 'taxCode', 'name' => 'name', 'description' => 'description', @@ -145,7 +142,6 @@ public static function openAPIFormats() 'part_number' => 'setPartNumber', 'manufacturer_id' => 'setManufacturerId', 'managed_fulfillment' => 'setManagedFulfillment', - 'allow_oversell' => 'setAllowOversell', 'tax_code' => 'setTaxCode', 'name' => 'setName', 'description' => 'setDescription', @@ -169,7 +165,6 @@ public static function openAPIFormats() 'part_number' => 'getPartNumber', 'manufacturer_id' => 'getManufacturerId', 'managed_fulfillment' => 'getManagedFulfillment', - 'allow_oversell' => 'getAllowOversell', 'tax_code' => 'getTaxCode', 'name' => 'getName', 'description' => 'getDescription', @@ -285,7 +280,6 @@ public function __construct(array $data = null) $this->container['part_number'] = isset($data['part_number']) ? $data['part_number'] : null; $this->container['manufacturer_id'] = isset($data['manufacturer_id']) ? $data['manufacturer_id'] : null; $this->container['managed_fulfillment'] = isset($data['managed_fulfillment']) ? $data['managed_fulfillment'] : null; - $this->container['allow_oversell'] = isset($data['allow_oversell']) ? $data['allow_oversell'] : null; $this->container['tax_code'] = isset($data['tax_code']) ? $data['tax_code'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; @@ -492,30 +486,6 @@ public function setManagedFulfillment($managed_fulfillment) return $this; } - /** - * Gets allow_oversell - * - * @return bool|null - */ - public function getAllowOversell() - { - return $this->container['allow_oversell']; - } - - /** - * Sets allow_oversell - * - * @param bool|null $allow_oversell Determines whether customers are allowed to back order a product. - * - * @return $this - */ - public function setAllowOversell($allow_oversell) - { - $this->container['allow_oversell'] = $allow_oversell; - - return $this; - } - /** * Gets tax_code * diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index bfe0e44..46eb9e4 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -13,9 +13,9 @@ /** * Digital River API Reference * - * If you have a commerce technology in place, the Digital River API allows you to integrate our back-end payments, tax, fraud, and compliance services. The Digital River API is a RESTful API. That means Digital River designed this API to allow you to retrieve, create, update, and delete objects with the HTTP verbs GET, POST, and DELETE. You can use the Digital River API in a test environment when you do not want to interact with financial institutions. The API key you use to authenticate a request determines whether the request is in the production environment or test environment. The Digital River API speaks exclusively in JSON. You should always set the content-type header to `application/json` to ensure the API accepts and processes your requests. All Digital River API requests are sent to https://api.digitalriver.com. # Explore Digital River Products
Product Description
Digital River API Explore Digital River's API suite for Global Seller Services.
Payment Integrations Explore our payment integration options that allow you to enable payment methods and checkout flows.
# Obtaining Digital River API credentials Before you can start making Digital River API requests, you'll need to [create a test account](https://docs.digitalriver.com/digital-river-api/getting-started-1#quick-start-guide) in the [Dashboard](https://dashboard.digitalriver.com/login). Check out our [Quick Start Guide](https://docs.digitalriver.com/digital-river-api/getting-started-1#quick-start-guide) for additional information. # Authentication The Digital River API authenticates requests using API keys. Digital River provides secret keys (tokens) for production and test environment in the Digital River API. Each secret key uses a prefix. Use the `sk_test_ prefix` for test environment secret keys and the `sk_ prefix` for production environment secret keys. If you want to apply additional restrictions to access and permissions, you can use restricted API keys. **Important**: Limit access to your API keys to those who need them. Do not store them in a version control system. The Java library automatically sends your API key in each request when you assign the API key to `DigitalRiver.apiKey`. You must send all API requests over HTTPS. Calls sent over plain HTTP will fail. Sending an API request without authentication automatically fails. # API keys Digital River uses your account's API keys to authenticate your API requests. If you do not include your key when you send an API request or use an incorrect or outdated key, Digital River returns an error. See [API keys](https://docs.digitalriver.com/digital-river-api/dashboard/developers/api-keys) in the [Dashboard documentation](https://docs.digitalriver.com/digital-river-api/dashboard) for more information. ## Get your API keys To [get your keys](https://docs.digitalriver.com/digital-river-api/getting-started-1#step-1-create-a-test-account), sign in to [Digital River Dashboard](https://dashboard.digitalriver.com/). The API keys page displays your public key and secret key. # Webhooks Webhooks allow developers to be notified, in near real-time, when specific events occur. When you register your webhook URLs with Digital River, Digital River creates an Event object and sends webhook events that notify your application any time an event occurs. The Event object includes the [event type](https://docs.digitalriver.com/digital-river-api/events-and-webhooks-1/events-1/event-types) and the data associated with that event. Digital River sends the Event object to the endpoint URLs you define in [Dashboard](https://dashboard.digitalriver.com/)'s Webhook settings for your account through an HTTP POST request. You can set up multiple webhook endpoints to receive a single event. See [Creating a webhook](https://docs.digitalriver.com/digital-river-api/dashboard/developers/webhooks/creating-a-webhook) to learn how to create a webhook. ## Event logs To view the webhook events, sign in to [Dashboard](https://dashboard.digitalriver.com/) and click Event logs. The Event logs display the event type, event ID, and timestamp for the event. # Metadata The metadata parameter stores additional, structured information on an object. You can use the metadata parameter to attach key-value data to the following Digital River resources: SKUs, Checkouts, Orders, Customers, Returns, Refunds, and Fulfillments. For example, you can store your user's full name and ID on a Digital River Customer object. Digital River does not use the metadata. Your users will only see this data if you choose to show it to them. **Note**: Do not store any data that identifies a person, their card information, and so on as metadata. The metadata parameter supports up to 20 keys. Each key name can be up to 40 characters long, and the values can be up to 500 characters long. # Pagination All API resources that return lists support bulk fetches. For example, you can use the `limit`, `startingAfter`, and `endingBefore` parameters to list orders, customers, and SKUs. The `startingBefore` and `endingAfter` parameters both use an object ID value to determine the starting point, and the objects appear in the response in reverse chronological order. To return objects listed before the named object, use the `endingBefore` parameter. To return objects listed after the named object, use the `startingAfter` parameter. If you provide both parameters, the request uses only the `endingBefore` parameter. ## Parameters
Parameter Description
limit The maximum number of objects returned. You can specify a value between 1 and 100.
startingAfter This cursor identifies the pagination starting point in the list based on the object ID. For example, if you send a list request and receive 100 customers ending with `xyz`, your subsequent calls can include `startingAfter=xyz` to fetch the next page of the list.
endingBefore This cursor identifies the pagination starting point in the list based on the object ID. For example, if you send a list request and receive 100 objects starting with `xyz`, your subsequent call can include `endingBefore=xyz` to fetch the previous page of the list.
## List response attributes
Attribute Description
data This array contains response elements. Any request parameter can paginate the response elements.
hasMore When true, there are more elements available after this set. When false, this set marks the end of the list.
# Request identifiers A request identifier is associated with each API request. It appears in the response headers under `x-dr-requestid`. Request identifiers also appear in the URLs of each request log in your [Dashboard](https://dashboard.digitalriver.com/). **Note**: Contact us if you have a question about a specific request. To ensure a quick solution, include the request identifier. # Versioning Your account's API version determines the structure of events generated by API requests. All versions with breaking changes are dated. All requests will use the version pinned to your account API settings. It only changes when you upgrade to the latest API version. Select a version of the library to change the API version used and create a webhook endpoint with the same API version as `DigitalRiver.API_VERSION` property in the library. Use the [Changelog](https://docs.digitalriver.com/digital-river-api/updates/changelog) to find the API version you need and view all breaking changes. You can test a single API request without upgrading your API key. To set an API version with a specific request, send a `DigitalRiver-Version` header, for example: `digitalriver-version=2020-09-30` # Response status codes Digital River uses HTTP response status codes. These codes indicate whether an API request succeeded or failed. HTTP status codes group responses into the following classes: * The `2xx` range indicates success. * The `4xx` range indicates an error that failed based on the provided information provided (for example, you omitted a parameter or a charge failed). * The `5xx` range indicates an error with Digital River's servers. * You can handle some `4xx` errors programmatically to include an error code that briefly explains the error reported (for example, include an error code when you decline a card). ## Error types
Type Description
bad_request The server could not process the request due to a client error (for example, malformed request syntax). Correct the problem and try again.
not_found The server can’t find the requested resource. No indication is given of whether the condition is temporary or permanent.
request_timeout The client did not produce the request within the time that the server was prepared to wait. Resend the request without modifications at any later time.
internal_server_error The server encountered an unexpected problem that prevented it from fulfilling the request.
unauthorized The request requires user authentication. Resend the request with valid user authentication.
too_many_requests The user sent too many requests in a given amount of time (“rate limiting”). The response should include details explaining the condition and may include a Retry-After header indicating how long to wait before sending a new request.
conflict There is a request conflict with the current state of the server. Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file that is older than the one already on the server resulting in a version control conflict.
validation_error Errors triggered by our client-side libraries when failing to validate fields (for example, when a card number or expiration date is invalid or incomplete). Used by: DigitalRiver.js
no_network There is no network coverage or cellular data connection.
## Error codes The following table contains a list of API error codes. **Note**: Do not share the error's code with customers. Doing so may aid fradulent and malicious actors.
Code Description
account_closed Stop all billing as this account is closed.
already_exists The item you tried to create already exists.
amount_too_large The given amount is too large. Provide a smaller amount and try again.
api_key_expired The API key has expired.
card_expired The card has expired. Provide valid card information and try again.
card_limit_exceeded The transaction exceeds the card limit amount.
card_type_block The merchant has blocked this card type.
card_velocity_exceeded The transaction exceeds the card velocity amount.
charge_expired The charge has expired. Provide valid charge information and try again.
charge_not_capturable The charge could not be captured.
country_restricted A user provided a restricted country. Make sure that users can only sign up from supported countries.
create-order-failed The order is missing required details and could not be completed.
currency_unsupported The currency provided is not supported. Provide a supported currency and try again.
declined The card has been declined for an unknown reason.
do_not_honor The card issuing bank has declined this payment.
email_invalid The email address is invalid. Provide a valid email address and try again.
failed-request Failed to charge source.
fraud The transaction has been identified by the issuing bank as fraudulent.
fraud_block The transaction has been identified by Digital River as fraudulent.
invalid_address The address does not match the card network's records.
invalid_amount The amount is not accepted by the card network.
invalid_boolean The boolean value is invalid. Provide a valid boolean value and try again.
invalid_card_bin The card bin is invalid.
invalid_card_number The card number entered is invalid.
invalid_currency This currency is not supported.
invalid_empty The empty value is invalid. Provide a valid value and try again.
invalid_expiration_date The card is expired, or the expiration date is invalid. This validation message indicates the expiration date did not meet basic validation requirements (for example, the date is in the past, incorrect month, missing year, and so on).
invalid_format The format of your request is invalid.
invalid_integer The integer value is valid. Provide a value integer value and try again.
invalid_metadata_key The metadata key is invalid. Provide a value metadata key and try again.
invalid_metadata_value The value provided for the metadata was invalid.
invalid_parameter The parameter is invalid. Check our API Reference to see which values are valid and try again.
invalid_pin The PIN provided is invalid or incorrect.invalid_quantity_amount
invalid_quantity_amount The quantity provided in the request was invalid. Check our API Reference to see what is a valid quantity and try again.
invalid_security_code The security code provided is invalid or incorrect.
invalid_shipping_choice The shipping choice is invalid. Provide a valid shipping choice and try again.
invalid_string_blank The string value is blank. Provide a valid string value and try again.
invalid_string_empty The string value is empty. Provide a valid string value and try again.
invalid_transaction_type The transaction type is invalid.
issuer_invalid_card The card does not exist with the issuer.
issuer_not_found The card issuer does not exist.
issuer_unavailable The card issuing bank could not be reached.
insufficient_funds The card has insufficient funds to complete the purchase.
limit_exceeded The transaction amount exceeds your assigned limit.
lost_stolen_card The issuing bank has marked this card lost or stolen.
method_not_allowed The method is not allowed. Provide a valid method value and try again.
mid_limit_exceeded The transaction amount exceeds the limit assigned for this MID.
missing_parameter A parameter is missing. Check our API Reference to see which values are required and try again.
no_response The payment processor did not respond.
not_found The item requested was not found.
order_already_complete The specified orderId is already complete.
order_submit_failed The payment session status is invalid.
out_of_inventory The item is not in inventory.
pin_try_exceeded The bank's allowable number of PIN tries has been exceeded.
plan_not_active The plan is not in an active state.
postal_code_invalid The postal code is invalid. Enter a valid postal code and try again.
restricted_card Restricted by the card network.
restricted_update Additional data cannot be included in the update request
sku_inactive The given SKU is inactive. Provide an active SKU and try again.
source_expired The source provided has expired. Check Sources to see which sources have not expired and try again.
source_not_chargeable The source provided is not chargeable. Check Sources to see which sources are chargeable and try again.
source_not_found The source you have requested was not found.
source_status_invalid_for_session The source status is invalid for this session.
stop_recurring The cardholder has requested all recurring and / or installment charges to be stopped.
tax_id_invalid The tax identifier is not valid. Correct the tax identifier and try again.
too_many_metadata_pairs The request contained too many metadata pairs.
unknown_error An unknown error has occurred.
unknown_parameter The request contains an unknown parameter. Check our API Reference to see which values are required and try again.
voice_authorization_required The request request requires voice authorization before it can be authorized.


Updated at 2021-11-17T14:32:19.679663Z. + * If you have a commerce technology in place, the Digital River API allows you to integrate our back-end payments, tax, fraud, and compliance services. The Digital River API is a RESTful API. That means Digital River designed this API to allow you to retrieve, create, update, and delete objects with the HTTP verbs GET, POST, and DELETE. You can use the Digital River API in a test environment when you do not want to interact with financial institutions. The API key you use to authenticate a request determines whether the request is in the production environment or test environment. The Digital River API speaks exclusively in JSON. You should always set the content-type header to `application/json` to ensure the API accepts and processes your requests. All Digital River API requests are sent to https://api.digitalriver.com. # Explore Digital River Products
Product Description
Digital River API Explore Digital River's API suite for Global Seller Services.
Payment Integrations Explore our payment integration options that allow you to enable payment methods and checkout flows.
# Obtaining Digital River API credentials Before you can start making Digital River API requests, you'll need to create a test account in the [Dashboard](https://dashboard.digitalriver.com/login). Check out our [Quick Start Guide](https://docs.digitalriver.com/digital-river-api/quick-start-guide) for additional information. # Authentication The Digital River API authenticates requests using API keys. Digital River provides secret keys (tokens) for production and test environment in the Digital River API. Each secret key uses a prefix. Use the `sk_test_ prefix` for test environment secret keys and the `sk_ prefix` for production environment secret keys. If you want to apply additional restrictions to access and permissions, you can use restricted API keys. **Important**: Limit access to your API keys to those who need them. Do not store them in a version control system. The Java library automatically sends your API key in each request when you assign the API key to `DigitalRiver.apiKey`. You must send all API requests over HTTPS. Calls sent over plain HTTP will fail. Sending an API request without authentication automatically fails. # API keys Digital River uses your account's API keys to authenticate your API requests. If you do not include your key when you send an API request or use an incorrect or outdated key, Digital River returns an error. See [API keys](https://docs.digitalriver.com/digital-river-api/administration/dashboard/developers/api-keys) in the [Dashboard documentation](https://docs.digitalriver.com/digital-river-api/administration/dashboard) for more information. ## Get your API keys To [get your keys](https://docs.digitalriver.com/digital-river-api/getting-started-1#step-1-create-a-test-account), sign in to [Digital River Dashboard](https://dashboard.digitalriver.com/). The API keys page displays your public key and secret key. # Webhooks Webhooks allow developers to be notified, in near real-time, when specific events occur. When you register your webhook URLs with Digital River, Digital River creates an Event object and sends webhook events that notify your application any time an event occurs. The Event object includes the event type and the data associated with that event. Digital River sends the Event object to the endpoint URLs you define in [Dashboard](https://dashboard.digitalriver.com/)'s Webhook settings for your account through an HTTP POST request. You can set up multiple webhook endpoints to receive a single event. See [Creating a webhook](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/webhooks/creating-a-webhook) to learn how to create a webhook. ## Event logs To view the webhook events, sign in to [Dashboard](https://dashboard.digitalriver.com/) and click Event logs. The Event logs display the event type, event ID, and timestamp for the event. # Metadata The metadata parameter stores additional, structured information on an object. You can use the metadata parameter to attach key-value data to the following Digital River resources: SKUs, Checkouts, Orders, Customers, Returns, Refunds, and Fulfillments. For example, you can store your user's full name and ID on a Digital River Customer object. Digital River does not use the metadata. Your users will only see this data if you choose to show it to them. **Note**: Do not store any data that identifies a person, their card information, and so on as metadata. The metadata parameter supports up to 20 keys. Each key name can be up to 40 characters long, and the values can be up to 500 characters long. # Pagination All API resources that return lists support bulk fetches. For example, you can use the `limit`, `startingAfter`, and `endingBefore` parameters to list orders, customers, and SKUs. The `startingBefore` and `endingAfter` parameters both use an object ID value to determine the starting point, and the objects appear in the response in reverse chronological order. To return objects listed before the named object, use the `endingBefore` parameter. To return objects listed after the named object, use the `startingAfter` parameter. If you provide both parameters, the request uses only the `endingBefore` parameter. ## Parameters
Parameter Description
limit The maximum number of objects returned. You can specify a value between 1 and 100.
startingAfter This cursor identifies the pagination starting point in the list based on the object ID. For example, if you send a list request and receive 100 customers ending with `xyz`, your subsequent calls can include `startingAfter=xyz` to fetch the next page of the list.
endingBefore This cursor identifies the pagination starting point in the list based on the object ID. For example, if you send a list request and receive 100 objects starting with `xyz`, your subsequent call can include `endingBefore=xyz` to fetch the previous page of the list.
## List response attributes
Attribute Description
data This array contains response elements. Any request parameter can paginate the response elements.
hasMore When true, there are more elements available after this set. When false, this set marks the end of the list.
# Request identifiers A request identifier is associated with each API request. It appears in the response headers under `x-dr-requestid`. Request identifiers also appear in the URLs of each request log in your [Dashboard](https://dashboard.digitalriver.com/). **Note**: Contact us if you have a question about a specific request. To ensure a quick solution, include the request identifier. # Versioning Your account's API version determines the structure of events generated by API requests. All versions with breaking changes are dated. All requests will use the version pinned to your account API settings. It only changes when you upgrade to the latest API version. Select a version of the library to change the API version used and create a webhook endpoint with the same API version as `DigitalRiver.API_VERSION` property in the library. Use the [Changelog](https://docs.digitalriver.com/digital-river-api/general-resources/release-notes) to find the API version you need and view all breaking changes. You can test a single API request without upgrading your API key. To set an API version with a specific request, send a `DigitalRiver-Version` header, for example: `digitalriver-version=2020-09-30` # Response status codes Digital River uses HTTP response status codes. These codes indicate whether an API request succeeded or failed. HTTP status codes group responses into the following classes: * The `2xx` range indicates success. * The `4xx` range indicates an error that failed based on the provided information provided (for example, you omitted a parameter or a charge failed). * The `5xx` range indicates an error with Digital River's servers. * You can handle some `4xx` errors programmatically to include an error code that briefly explains the error reported (for example, include an error code when you decline a card). ## Error types
Type Description
bad_request The server could not process the request due to a client error (for example, malformed request syntax). Correct the problem and try again.
not_found The server can’t find the requested resource. No indication is given of whether the condition is temporary or permanent.
request_timeout The client did not produce the request within the time that the server was prepared to wait. Resend the request without modifications at any later time.
internal_server_error The server encountered an unexpected problem that prevented it from fulfilling the request.
unauthorized The request requires user authentication. Resend the request with valid user authentication.
too_many_requests The user sent too many requests in a given amount of time (“rate limiting”). The response should include details explaining the condition and may include a Retry-After header indicating how long to wait before sending a new request.
conflict There is a request conflict with the current state of the server. Conflicts are most likely to occur in response to a PUT request. For example, you may get a 409 response when uploading a file that is older than the one already on the server resulting in a version control conflict.
validation_error Errors triggered by our client-side libraries when failing to validate fields (for example, when a card number or expiration date is invalid or incomplete). Used by: DigitalRiver.js
no_network There is no network coverage or cellular data connection.
## Error codes The following table contains a list of API error codes. **Note**: Do not share the error's code with customers. Doing so may aid fradulent and malicious actors.
Code Description
account_closed Stop all billing as this account is closed.
already_exists The item you tried to create already exists.
amount_too_large The given amount is too large. Provide a smaller amount and try again.
api_key_expired The API key has expired.
card_expired The card has expired. Provide valid card information and try again.
card_limit_exceeded The transaction exceeds the card limit amount.
card_type_block The merchant has blocked this card type.
card_velocity_exceeded The transaction exceeds the card velocity amount.
charge_expired The charge has expired. Provide valid charge information and try again.
charge_not_capturable The charge could not be captured.
country_restricted A user provided a restricted country. Make sure that users can only sign up from supported countries.
create-order-failed The order is missing required details and could not be completed.
currency_unsupported The currency provided is not supported. Provide a supported currency and try again.
declined The card has been declined for an unknown reason.
do_not_honor The card issuing bank has declined this payment.
email_invalid The email address is invalid. Provide a valid email address and try again.
failed-request Failed to charge source.
fraud The transaction has been identified by the issuing bank as fraudulent.
fraud_block The transaction has been identified by Digital River as fraudulent.
invalid_address The address does not match the card network's records.
invalid_amount The amount is not accepted by the card network.
invalid_boolean The boolean value is invalid. Provide a valid boolean value and try again.
invalid_card_bin The card bin is invalid.
invalid_card_number The card number entered is invalid.
invalid_currency This currency is not supported.
invalid_empty The empty value is invalid. Provide a valid value and try again.
invalid_expiration_date The card is expired, or the expiration date is invalid. This validation message indicates the expiration date did not meet basic validation requirements (for example, the date is in the past, incorrect month, missing year, and so on).
invalid_format The format of your request is invalid.
invalid_integer The integer value is valid. Provide a value integer value and try again.
invalid_metadata_key The metadata key is invalid. Provide a value metadata key and try again.
invalid_metadata_value The value provided for the metadata was invalid.
invalid_parameter The parameter is invalid. Check our API Reference to see which values are valid and try again.
invalid_pin The PIN provided is invalid or incorrect.invalid_quantity_amount
invalid_quantity_amount The quantity provided in the request was invalid. Check our API Reference to see what is a valid quantity and try again.
invalid_security_code The security code provided is invalid or incorrect.
invalid_shipping_choice The shipping choice is invalid. Provide a valid shipping choice and try again.
invalid_string_blank The string value is blank. Provide a valid string value and try again.
invalid_string_empty The string value is empty. Provide a valid string value and try again.
invalid_transaction_type The transaction type is invalid.
issuer_invalid_card The card does not exist with the issuer.
issuer_not_found The card issuer does not exist.
issuer_unavailable The card issuing bank could not be reached.
insufficient_funds The card has insufficient funds to complete the purchase.
limit_exceeded The transaction amount exceeds your assigned limit.
lost_stolen_card The issuing bank has marked this card lost or stolen.
method_not_allowed The method is not allowed. Provide a valid method value and try again.
mid_limit_exceeded The transaction amount exceeds the limit assigned for this MID.
missing_parameter A parameter is missing. Check our API Reference to see which values are required and try again.
no_response The payment processor did not respond.
not_found The item requested was not found.
order_already_complete The specified orderId is already complete.
order_submit_failed The payment session status is invalid.
out_of_inventory The item is not in inventory.
pin_try_exceeded The bank's allowable number of PIN tries has been exceeded.
plan_not_active The plan is not in an active state.
postal_code_invalid The postal code is invalid. Enter a valid postal code and try again.
restricted_card Restricted by the card network.
restricted_update Additional data cannot be included in the update request
sku_inactive The given SKU is inactive. Provide an active SKU and try again.
source_expired The source provided has expired. Check Sources to see which sources have not expired and try again.
source_not_chargeable The source provided is not chargeable. Check Sources to see which sources are chargeable and try again.
source_not_found The source you have requested was not found.
source_status_invalid_for_session The source status is invalid for this session.
stop_recurring The cardholder has requested all recurring and / or installment charges to be stopped.
tax_id_invalid The tax identifier is not valid. Correct the tax identifier and try again.
too_many_metadata_pairs The request contained too many metadata pairs.
unknown_error An unknown error has occurred.
unknown_parameter The request contains an unknown parameter. Check our API Reference to see which values are required and try again.
voice_authorization_required The request request requires voice authorization before it can be authorized.


Updated at 2022-09-29T13:59:12.934153Z. * - * The version of the OpenAPI document: 2021 + * The version of the OpenAPI document: 2022 * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 4.3.1