From 47d312c135e19c4b39c451957396a9f785d355f4 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 30 May 2017 15:14:53 +0100 Subject: [PATCH 01/31] fix: add missing properties for various fulfillment classes close #93 --- CHANGELOG.md | 11 +++ .../Enums/FinalDestinationTypeEnum.php | 17 +++++ .../Enums/OrderPaymentStatusEnum.php | 1 + .../Enums/PaymentMethodTypeEnum.php | 6 ++ src/Fulfillment/Enums/PaymentModeTypeEnum.php | 17 +++++ src/Fulfillment/Enums/PaymentStatusEnum.php | 1 + src/Fulfillment/Types/DeliveryCost.php | 2 +- src/Fulfillment/Types/LineItem.php | 14 ++++ .../Types/LineItemFulfillmentInstructions.php | 67 +++++++++++++++++++ src/Fulfillment/Types/LineItemRefund.php | 60 +++++++++++++++++ src/Fulfillment/Types/Payment.php | 7 ++ src/Fulfillment/Types/ShippingFulfillment.php | 7 ++ .../Enums/FinalDestinationTypeEnumTest.php | 28 ++++++++ .../Enums/PaymentModeTypeEnumTest.php | 28 ++++++++ .../LineItemFulfillmentInstructionsTest.php | 33 +++++++++ test/Fulfillment/Types/LineItemRefundTest.php | 33 +++++++++ test/property_fixes/PropertyFixesTest.php | 12 ++++ 17 files changed, 343 insertions(+), 1 deletion(-) create mode 100644 src/Fulfillment/Enums/FinalDestinationTypeEnum.php create mode 100644 src/Fulfillment/Enums/PaymentModeTypeEnum.php create mode 100644 src/Fulfillment/Types/LineItemFulfillmentInstructions.php create mode 100644 src/Fulfillment/Types/LineItemRefund.php create mode 100644 test/Fulfillment/Enums/FinalDestinationTypeEnumTest.php create mode 100644 test/Fulfillment/Enums/PaymentModeTypeEnumTest.php create mode 100644 test/Fulfillment/Types/LineItemFulfillmentInstructionsTest.php create mode 100644 test/Fulfillment/Types/LineItemRefundTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 88872a2c4..e8b65087d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # CHANGELOG +## Unreleased + +### Fixes + +* Added missing shippingServiceCode property to Fulfillment\Types\ShippingFulfillment. +* Added missing paymentMode property to Fulfillment\Types\Payment. +* Added missing lineItemFulfillmentInstructions property to Fulfillment\Types\LineItem. +* Added missing refunds property to Fulfillment\Types\LineItem. +* Added missing enums to Fulfillment\Enums\OrderPaymentStatusEnum. +* Added missing enums to Fulfillment\Enums\PaymentMethodTypeEnum. + ## 12.0.0 - 2017-05-23 ### Fixes diff --git a/src/Fulfillment/Enums/FinalDestinationTypeEnum.php b/src/Fulfillment/Enums/FinalDestinationTypeEnum.php new file mode 100644 index 000000000..7f16237cc --- /dev/null +++ b/src/Fulfillment/Enums/FinalDestinationTypeEnum.php @@ -0,0 +1,17 @@ + false, 'attribute' => false, 'elementName' => 'discountAmount' - ], + ] ]; /** diff --git a/src/Fulfillment/Types/LineItem.php b/src/Fulfillment/Types/LineItem.php index 40abc0a16..81fa1d666 100644 --- a/src/Fulfillment/Types/LineItem.php +++ b/src/Fulfillment/Types/LineItem.php @@ -19,12 +19,14 @@ * @property string $legacyItemId * @property string $legacyVariationId * @property \DTS\eBaySDK\Fulfillment\Types\Amount $lineItemCost + * @property \DTS\eBaySDK\Fulfillment\Types\LineItemFulfillmentInstructions $lineItemFulfillmentInstructions * @property \DTS\eBaySDK\Fulfillment\Enums\LineItemFulfillmentStatusEnum $lineItemFulfillmentStatus * @property string $lineItemId * @property \DTS\eBaySDK\Fulfillment\Enums\MarketplaceIdEnum $listingMarketplaceId * @property \DTS\eBaySDK\Fulfillment\Types\LineItemProperties $properties * @property \DTS\eBaySDK\Fulfillment\Enums\MarketplaceIdEnum $purchaseMarketplaceId * @property integer $quantity + * @property \DTS\eBaySDK\Fulfillment\Types\LineItemRefund[] $refunds * @property string $sku * @property \DTS\eBaySDK\Fulfillment\Enums\SoldFormatEnum $soldFormat * @property \DTS\eBaySDK\Fulfillment\Types\Tax[] $taxes @@ -79,6 +81,12 @@ class LineItem extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'lineItemCost' ], + 'lineItemFulfillmentInstructions' => [ + 'type' => 'DTS\eBaySDK\Fulfillment\Types\LineItemFulfillmentInstructions', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'lineItemFulfillmentInstructions' + ], 'lineItemFulfillmentStatus' => [ 'type' => 'string', 'repeatable' => false, @@ -115,6 +123,12 @@ class LineItem extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'quantity' ], + 'refunds' => [ + 'type' => 'DTS\eBaySDK\Fulfillment\Types\LineItemRefund', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'refunds' + ], 'sku' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/Fulfillment/Types/LineItemFulfillmentInstructions.php b/src/Fulfillment/Types/LineItemFulfillmentInstructions.php new file mode 100644 index 000000000..df48521c7 --- /dev/null +++ b/src/Fulfillment/Types/LineItemFulfillmentInstructions.php @@ -0,0 +1,67 @@ + [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'guaranteedDelivery' + ], + 'maxEstimatedDeliveryDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'maxEstimatedDeliveryDate' + ], + 'minEstimatedDeliveryDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'minEstimatedDeliveryDate' + ], + 'shipByDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shipByDate' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Fulfillment/Types/LineItemRefund.php b/src/Fulfillment/Types/LineItemRefund.php new file mode 100644 index 000000000..1958e856f --- /dev/null +++ b/src/Fulfillment/Types/LineItemRefund.php @@ -0,0 +1,60 @@ + [ + 'type' => 'DTS\eBaySDK\Fulfillment\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'amount' + ], + 'refundDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'refundDate' + ], + 'refundReferenceId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'refundReferenceId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Fulfillment/Types/Payment.php b/src/Fulfillment/Types/Payment.php index d671196da..345a72d6e 100644 --- a/src/Fulfillment/Types/Payment.php +++ b/src/Fulfillment/Types/Payment.php @@ -16,6 +16,7 @@ * @property string $paymentDate * @property \DTS\eBaySDK\Fulfillment\Types\PaymentHold[] $paymentHolds * @property \DTS\eBaySDK\Fulfillment\Enums\PaymentMethodTypeEnum $paymentMethod + * @property \DTS\eBaySDK\Fulfillment\Enums\PaymentModeTypeEnum $paymentMode * @property string $paymentReferenceId * @property \DTS\eBaySDK\Fulfillment\Enums\PaymentStatusEnum $paymentStatus */ @@ -49,6 +50,12 @@ class Payment extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'paymentMethod' ], + 'paymentMode' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'paymentMode' + ], 'paymentReferenceId' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/Fulfillment/Types/ShippingFulfillment.php b/src/Fulfillment/Types/ShippingFulfillment.php index 24570c128..6e236e47e 100644 --- a/src/Fulfillment/Types/ShippingFulfillment.php +++ b/src/Fulfillment/Types/ShippingFulfillment.php @@ -17,6 +17,7 @@ * @property string $shipmentTrackingNumber * @property string $shippedDate * @property string $shippingCarrierCode + * @property string $shippingServiceCode */ class ShippingFulfillment extends \DTS\eBaySDK\Types\BaseType { @@ -53,6 +54,12 @@ class ShippingFulfillment extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'shippingCarrierCode' + ], + 'shippingServiceCode' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shippingServiceCode' ] ]; diff --git a/test/Fulfillment/Enums/FinalDestinationTypeEnumTest.php b/test/Fulfillment/Enums/FinalDestinationTypeEnumTest.php new file mode 100644 index 000000000..721bb0c3f --- /dev/null +++ b/test/Fulfillment/Enums/FinalDestinationTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new FinalDestinationTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Enums\FinalDestinationTypeEnum', $this->obj); + } +} diff --git a/test/Fulfillment/Enums/PaymentModeTypeEnumTest.php b/test/Fulfillment/Enums/PaymentModeTypeEnumTest.php new file mode 100644 index 000000000..b45755ae9 --- /dev/null +++ b/test/Fulfillment/Enums/PaymentModeTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new PaymentModeTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Enums\PaymentModeTypeEnum', $this->obj); + } +} diff --git a/test/Fulfillment/Types/LineItemFulfillmentInstructionsTest.php b/test/Fulfillment/Types/LineItemFulfillmentInstructionsTest.php new file mode 100644 index 000000000..479bb7c48 --- /dev/null +++ b/test/Fulfillment/Types/LineItemFulfillmentInstructionsTest.php @@ -0,0 +1,33 @@ +obj = new LineItemFulfillmentInstructions(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Types\LineItemFulfillmentInstructions', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Fulfillment/Types/LineItemRefundTest.php b/test/Fulfillment/Types/LineItemRefundTest.php new file mode 100644 index 000000000..2bdd7aac1 --- /dev/null +++ b/test/Fulfillment/Types/LineItemRefundTest.php @@ -0,0 +1,33 @@ +obj = new LineItemRefund(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Types\LineItemRefund', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index b53a4709b..60de5bc14 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -52,4 +52,16 @@ public function testDeliveryCost() $obj->discountAmount = new Sdk\Fulfillment\Types\Amount(); $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Types\Amount', $obj->discountAmount); } + + /** + * Incorrect documentation https://developer.ebay.com/devzone/rest/api-ref/fulfillment/types/ShippingFulfillment.html + * Example of correct property names returned in the API https://developer.ebay.com/devzone/rest/api-ref/fulfillment/order-orderid_shipping_fulfillment__get.html#Samples + */ + public function testShippingServiceCode() + { + $obj = new Sdk\Fulfillment\Types\ShippingFulfillment(); + + $obj->shippingServiceCode = 'foo'; + $this->assertInternalType('string', $obj->shippingServiceCode); + } } From 610eaa0742dd8967d48fc08b7ac17b1c78e27e03 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 30 May 2017 15:32:33 +0100 Subject: [PATCH 02/31] fix: add missing property priceDiscount close #90 --- CHANGELOG.md | 1 + src/Fulfillment/Types/PricingSummary.php | 6 +++--- test/property_fixes/PropertyFixesTest.php | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8b65087d..d4966c1fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ * Added missing refunds property to Fulfillment\Types\LineItem. * Added missing enums to Fulfillment\Enums\OrderPaymentStatusEnum. * Added missing enums to Fulfillment\Enums\PaymentMethodTypeEnum. +* Added missing priceDiscount property to Fulfillment\Types\Pricingsummary. ## 12.0.0 - 2017-05-23 diff --git a/src/Fulfillment/Types/PricingSummary.php b/src/Fulfillment/Types/PricingSummary.php index 370a51683..f99b5a878 100644 --- a/src/Fulfillment/Types/PricingSummary.php +++ b/src/Fulfillment/Types/PricingSummary.php @@ -16,7 +16,7 @@ * @property \DTS\eBaySDK\Fulfillment\Types\Amount $deliveryCost * @property \DTS\eBaySDK\Fulfillment\Types\Amount $deliveryDiscount * @property \DTS\eBaySDK\Fulfillment\Types\Amount $fee - * @property \DTS\eBaySDK\Fulfillment\Types\Amount $priceDiscountSubtotal + * @property \DTS\eBaySDK\Fulfillment\Types\Amount $priceDiscount * @property \DTS\eBaySDK\Fulfillment\Types\Amount $priceSubtotal * @property \DTS\eBaySDK\Fulfillment\Types\Amount $tax * @property \DTS\eBaySDK\Fulfillment\Types\Amount $total @@ -51,11 +51,11 @@ class PricingSummary extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'fee' ], - 'priceDiscountSubtotal' => [ + 'priceDiscount' => [ 'type' => 'DTS\eBaySDK\Fulfillment\Types\Amount', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'priceDiscountSubtotal' + 'elementName' => 'priceDiscount' ], 'priceSubtotal' => [ 'type' => 'DTS\eBaySDK\Fulfillment\Types\Amount', diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index 60de5bc14..db628174b 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -64,4 +64,26 @@ public function testShippingServiceCode() $obj->shippingServiceCode = 'foo'; $this->assertInternalType('string', $obj->shippingServiceCode); } + + /** + * Incorrect documentation https://developer.ebay.com/devzone/rest/api-ref/fulfillment/types/PricingSummary.html + * Issue discussed at https://groups.google.com/forum/?hl=en-GB#!topic/ebay-sdk-php/Pz1s0K5V9ZE + * Replace priceDiscountSubtotal with priceDiscount. + */ + public function testPriceDiscount() + { + $obj = new Sdk\Fulfillment\Types\PricingSummary(); + + $obj->priceDiscount = new Sdk\Fulfillment\Types\Amount(); + $this->assertInstanceOf('\DTS\eBaySDK\Fulfillment\Types\Amount', $obj->priceDiscount); + } + + public function testPriceDiscountSubtotalDoesNotExist() + { + $this->setExpectedException('\DTS\eBaySDK\Exceptions\UnknownPropertyException', 'Unknown property'); + + $obj = new Sdk\Fulfillment\Types\PricingSummary(); + + $obj->priceDiscountSubtotal = new Sdk\Fulfillment\Types\Amount(); + } } From 0e9b5226b813402191cce7e8fc14be12c86cb45b Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 30 May 2017 17:25:29 +0100 Subject: [PATCH 03/31] update: support marketing api version 1.2.0 --- CHANGELOG.md | 4 + src/Marketing/Enums/DataTypeEnum.php | 20 ++ src/Marketing/Enums/ReportFormatEnum.php | 16 ++ src/Marketing/Enums/ReportTypeEnum.php | 20 ++ src/Marketing/Enums/TaskStatusEnum.php | 18 ++ src/Marketing/Services/MarketingService.php | 200 ++++++++++++++++++ ...kCreateAdsByInventoryReferenceResponse.php | 46 ++++ ...ateAdsByInventoryReferenceRestResponse.php | 2 +- ...kDeleteAdsByInventoryReferenceResponse.php | 46 ++++ ...eteAdsByInventoryReferenceRestResponse.php | 2 +- .../CreateAdsByInventoryReferenceResponse.php | 74 +++++++ src/Marketing/Types/CreateReportTask.php | 109 ++++++++++ .../Types/CreateReportTaskRestRequest.php | 39 ++++ .../Types/CreateReportTaskRestResponse.php | 65 ++++++ .../DeleteAdsByInventoryReferenceResponse.php | 74 +++++++ .../DeleteSpecificReportTaskRestRequest.php | 46 ++++ .../DeleteSpecificReportTaskRestResponse.php | 65 ++++++ src/Marketing/Types/Dimension.php | 53 +++++ .../Types/DimensionKeyAnnotation.php | 53 +++++ src/Marketing/Types/DimensionMetadata.php | 60 ++++++ .../GetMetadataForAReportTypeRestRequest.php | 46 ++++ .../GetMetadataForAReportTypeRestResponse.php | 65 ++++++ .../GetMetadataForAllReportsRestRequest.php | 39 ++++ .../GetMetadataForAllReportsRestResponse.php | 65 ++++++ .../Types/GetReportTasksRestRequest.php | 60 ++++++ .../Types/GetReportTasksRestResponse.php | 65 ++++++ .../Types/GetSpecificReportRestRequest.php | 46 ++++ .../Types/GetSpecificReportRestResponse.php | 65 ++++++ .../GetSpecificReportTaskRestRequest.php | 46 ++++ .../GetSpecificReportTaskRestResponse.php | 65 ++++++ src/Marketing/Types/InventoryReference.php | 53 +++++ src/Marketing/Types/MetricMetadata.php | 53 +++++ src/Marketing/Types/ReportMetadata.php | 74 +++++++ src/Marketing/Types/ReportMetadatas.php | 46 ++++ src/Marketing/Types/ReportTask.php | 179 ++++++++++++++++ .../Types/ReportTaskPagedCollection.php | 88 ++++++++ test/Marketing/Enums/DataTypeEnumTest.php | 28 +++ test/Marketing/Enums/ReportFormatEnumTest.php | 28 +++ test/Marketing/Enums/ReportTypeEnumTest.php | 28 +++ test/Marketing/Enums/TaskStatusEnumTest.php | 28 +++ ...ateAdsByInventoryReferenceResponseTest.php | 33 +++ ...dsByInventoryReferenceRestResponseTest.php | 4 +- ...eteAdsByInventoryReferenceResponseTest.php | 33 +++ ...dsByInventoryReferenceRestResponseTest.php | 4 +- ...ateAdsByInventoryReferenceResponseTest.php | 33 +++ .../Types/CreateReportTaskRestRequestTest.php | 33 +++ .../CreateReportTaskRestResponseTest.php | 33 +++ test/Marketing/Types/CreateReportTaskTest.php | 33 +++ ...eteAdsByInventoryReferenceResponseTest.php | 33 +++ ...eleteSpecificReportTaskRestRequestTest.php | 33 +++ ...leteSpecificReportTaskRestResponseTest.php | 33 +++ .../Types/DimensionKeyAnnotationTest.php | 33 +++ .../Marketing/Types/DimensionMetadataTest.php | 33 +++ test/Marketing/Types/DimensionTest.php | 33 +++ ...tMetadataForAReportTypeRestRequestTest.php | 33 +++ ...MetadataForAReportTypeRestResponseTest.php | 33 +++ ...etMetadataForAllReportsRestRequestTest.php | 33 +++ ...tMetadataForAllReportsRestResponseTest.php | 33 +++ .../Types/GetReportTasksRestRequestTest.php | 33 +++ .../Types/GetReportTasksRestResponseTest.php | 33 +++ .../GetSpecificReportRestRequestTest.php | 33 +++ .../GetSpecificReportRestResponseTest.php | 33 +++ .../GetSpecificReportTaskRestRequestTest.php | 33 +++ .../GetSpecificReportTaskRestResponseTest.php | 33 +++ .../Types/InventoryReferenceTest.php | 33 +++ test/Marketing/Types/MetricMetadataTest.php | 33 +++ test/Marketing/Types/ReportMetadataTest.php | 33 +++ test/Marketing/Types/ReportMetadatasTest.php | 33 +++ .../Types/ReportTaskPagedCollectionTest.php | 33 +++ test/Marketing/Types/ReportTaskTest.php | 33 +++ 70 files changed, 3105 insertions(+), 6 deletions(-) create mode 100644 src/Marketing/Enums/DataTypeEnum.php create mode 100644 src/Marketing/Enums/ReportFormatEnum.php create mode 100644 src/Marketing/Enums/ReportTypeEnum.php create mode 100644 src/Marketing/Enums/TaskStatusEnum.php create mode 100644 src/Marketing/Types/BulkCreateAdsByInventoryReferenceResponse.php create mode 100644 src/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponse.php create mode 100644 src/Marketing/Types/CreateAdsByInventoryReferenceResponse.php create mode 100644 src/Marketing/Types/CreateReportTask.php create mode 100644 src/Marketing/Types/CreateReportTaskRestRequest.php create mode 100644 src/Marketing/Types/CreateReportTaskRestResponse.php create mode 100644 src/Marketing/Types/DeleteAdsByInventoryReferenceResponse.php create mode 100644 src/Marketing/Types/DeleteSpecificReportTaskRestRequest.php create mode 100644 src/Marketing/Types/DeleteSpecificReportTaskRestResponse.php create mode 100644 src/Marketing/Types/Dimension.php create mode 100644 src/Marketing/Types/DimensionKeyAnnotation.php create mode 100644 src/Marketing/Types/DimensionMetadata.php create mode 100644 src/Marketing/Types/GetMetadataForAReportTypeRestRequest.php create mode 100644 src/Marketing/Types/GetMetadataForAReportTypeRestResponse.php create mode 100644 src/Marketing/Types/GetMetadataForAllReportsRestRequest.php create mode 100644 src/Marketing/Types/GetMetadataForAllReportsRestResponse.php create mode 100644 src/Marketing/Types/GetReportTasksRestRequest.php create mode 100644 src/Marketing/Types/GetReportTasksRestResponse.php create mode 100644 src/Marketing/Types/GetSpecificReportRestRequest.php create mode 100644 src/Marketing/Types/GetSpecificReportRestResponse.php create mode 100644 src/Marketing/Types/GetSpecificReportTaskRestRequest.php create mode 100644 src/Marketing/Types/GetSpecificReportTaskRestResponse.php create mode 100644 src/Marketing/Types/InventoryReference.php create mode 100644 src/Marketing/Types/MetricMetadata.php create mode 100644 src/Marketing/Types/ReportMetadata.php create mode 100644 src/Marketing/Types/ReportMetadatas.php create mode 100644 src/Marketing/Types/ReportTask.php create mode 100644 src/Marketing/Types/ReportTaskPagedCollection.php create mode 100644 test/Marketing/Enums/DataTypeEnumTest.php create mode 100644 test/Marketing/Enums/ReportFormatEnumTest.php create mode 100644 test/Marketing/Enums/ReportTypeEnumTest.php create mode 100644 test/Marketing/Enums/TaskStatusEnumTest.php create mode 100644 test/Marketing/Types/BulkCreateAdsByInventoryReferenceResponseTest.php create mode 100644 test/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponseTest.php create mode 100644 test/Marketing/Types/CreateAdsByInventoryReferenceResponseTest.php create mode 100644 test/Marketing/Types/CreateReportTaskRestRequestTest.php create mode 100644 test/Marketing/Types/CreateReportTaskRestResponseTest.php create mode 100644 test/Marketing/Types/CreateReportTaskTest.php create mode 100644 test/Marketing/Types/DeleteAdsByInventoryReferenceResponseTest.php create mode 100644 test/Marketing/Types/DeleteSpecificReportTaskRestRequestTest.php create mode 100644 test/Marketing/Types/DeleteSpecificReportTaskRestResponseTest.php create mode 100644 test/Marketing/Types/DimensionKeyAnnotationTest.php create mode 100644 test/Marketing/Types/DimensionMetadataTest.php create mode 100644 test/Marketing/Types/DimensionTest.php create mode 100644 test/Marketing/Types/GetMetadataForAReportTypeRestRequestTest.php create mode 100644 test/Marketing/Types/GetMetadataForAReportTypeRestResponseTest.php create mode 100644 test/Marketing/Types/GetMetadataForAllReportsRestRequestTest.php create mode 100644 test/Marketing/Types/GetMetadataForAllReportsRestResponseTest.php create mode 100644 test/Marketing/Types/GetReportTasksRestRequestTest.php create mode 100644 test/Marketing/Types/GetReportTasksRestResponseTest.php create mode 100644 test/Marketing/Types/GetSpecificReportRestRequestTest.php create mode 100644 test/Marketing/Types/GetSpecificReportRestResponseTest.php create mode 100644 test/Marketing/Types/GetSpecificReportTaskRestRequestTest.php create mode 100644 test/Marketing/Types/GetSpecificReportTaskRestResponseTest.php create mode 100644 test/Marketing/Types/InventoryReferenceTest.php create mode 100644 test/Marketing/Types/MetricMetadataTest.php create mode 100644 test/Marketing/Types/ReportMetadataTest.php create mode 100644 test/Marketing/Types/ReportMetadatasTest.php create mode 100644 test/Marketing/Types/ReportTaskPagedCollectionTest.php create mode 100644 test/Marketing/Types/ReportTaskTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d4966c1fc..9b8c1f2be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking changes + +* Support Marketing API version 1.2.0. + ### Fixes * Added missing shippingServiceCode property to Fulfillment\Types\ShippingFulfillment. diff --git a/src/Marketing/Enums/DataTypeEnum.php b/src/Marketing/Enums/DataTypeEnum.php new file mode 100644 index 000000000..ef97a171f --- /dev/null +++ b/src/Marketing/Enums/DataTypeEnum.php @@ -0,0 +1,20 @@ + true ] ] + ], + 'GetSpecificReport' => [ + 'method' => 'GET', + 'resource' => 'ad_report/{report_id}', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\GetSpecificReportRestResponse', + 'params' => [ + 'report_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetMetadataForAllReports' => [ + 'method' => 'GET', + 'resource' => 'ad_report_metadata', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestResponse', + 'params' => [ + ] + ], + 'GetMetadataForAReportType' => [ + 'method' => 'GET', + 'resource' => 'ad_report_metadata/{report_type}', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestResponse', + 'params' => [ + 'report_type' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'CreateReportTask' => [ + 'method' => 'GET', + 'resource' => 'ad_report_task', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\CreateReportTasktRestResponse', + 'params' => [ + ] + ], + 'DeleteSpecificReportTask' => [ + 'method' => 'GET', + 'resource' => 'ad_report_task/{report_task_id}', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestResponse', + 'params' => [ + 'report_task_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetReportTasks' => [ + 'method' => 'GET', + 'resource' => 'ad_report_task', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\GetReportTasksRestResponse', + 'params' => [ + 'limit' => [ + 'valid' => ['string'] + ], + 'offset' => [ + 'valid' => ['string'] + ], + 'report_task_statuses' => [ + 'valid' => ['string'] + ] + ] + ], + 'GetSpecificReportTask' => [ + 'method' => 'GET', + 'resource' => 'ad_report_task/{report_task_id}', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestResponse', + 'params' => [ + 'report_task_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] ] ]; @@ -1079,4 +1153,130 @@ public function getPromotionSummaryReportAsync(\DTS\eBaySDK\Marketing\Types\GetP { return $this->callOperationAsync('GetPromotionSummaryReport', $request); } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetSpecificReportRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\GetSpecificReportRestResponse + */ + public function getSpecificReport(\DTS\eBaySDK\Marketing\Types\GetSpecificReportRestRequest $request) + { + return $this->getSpecificReportAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetSpecificReportRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSpecificReportAsync(\DTS\eBaySDK\Marketing\Types\GetSpecificReportRestRequest $request) + { + return $this->callOperationAsync('GetSpecificReport', $request); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestResponse + */ + public function getMetadataForAllReports(\DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestRequest $request) + { + return $this->getMetadataForAllReportsAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetadataForAllReportsAsync(\DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestRequest $request) + { + return $this->callOperationAsync('GetMetadataForAllReports', $request); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestResponse + */ + public function getMetadataForAReportType(\DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestRequest $request) + { + return $this->getMetadataForAReportTypeAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getMetadataForAReportTypeAsync(\DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestRequest $request) + { + return $this->callOperationAsync('GetMetadataForAReportType', $request); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\CreateReportTaskRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\CreateReportTasktRestResponse + */ + public function createReportTask(\DTS\eBaySDK\Marketing\Types\CreateReportTaskRestRequest $request) + { + return $this->createReportTaskAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\CreateReportTaskRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function createReportTaskAsync(\DTS\eBaySDK\Marketing\Types\CreateReportTaskRestRequest $request) + { + return $this->callOperationAsync('CreateReportTask', $request); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestResponse + */ + public function deleteSpecificReportTask(\DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestRequest $request) + { + return $this->deleteSpecificReportTaskAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function deleteSpecificReportTaskAsync(\DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestRequest $request) + { + return $this->callOperationAsync('DeleteSpecificReportTask', $request); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetReportTasksRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\GetReportTasksRestResponse + */ + public function getReportTasks(\DTS\eBaySDK\Marketing\Types\GetReportTasksRestRequest $request) + { + return $this->getReportTasksAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetReportTasksRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getReportTasksAsync(\DTS\eBaySDK\Marketing\Types\GetReportTasksRestRequest $request) + { + return $this->callOperationAsync('GetReportTasks', $request); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestResponse + */ + public function getSpecificReportTask(\DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestRequest $request) + { + return $this->getSpecificReportTaskAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSpecificReportTaskAsync(\DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestRequest $request) + { + return $this->callOperationAsync('GetSpecificReportTask', $request); + } } diff --git a/src/Marketing/Types/BulkCreateAdsByInventoryReferenceResponse.php b/src/Marketing/Types/BulkCreateAdsByInventoryReferenceResponse.php new file mode 100644 index 000000000..2eed44366 --- /dev/null +++ b/src/Marketing/Types/BulkCreateAdsByInventoryReferenceResponse.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\CreateAdsByInventoryReferenceResponse', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'responses' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponse.php b/src/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponse.php index 74d571fda..b48f37ee9 100644 --- a/src/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponse.php +++ b/src/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponse.php @@ -18,7 +18,7 @@ * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $errors * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $warnings */ -class BulkCreateAdsByInventoryReferenceRestResponse extends \DTS\eBaySDK\Types\BaseType +class BulkCreateAdsByInventoryReferenceRestResponse extends \DTS\eBaySDK\Marketing\Types\BulkCreateAdsByInventoryReferenceResponse { use StatusCodeTrait; use HttpHeadersTrait; diff --git a/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponse.php b/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponse.php new file mode 100644 index 000000000..5ef5a69a1 --- /dev/null +++ b/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponse.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\DeleteAdsByInventoryReferenceResponse', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'responses' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponse.php b/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponse.php index 65f405306..8c0acf3bd 100644 --- a/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponse.php +++ b/src/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponse.php @@ -18,7 +18,7 @@ * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $errors * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $warnings */ -class BulkDeleteAdsByInventoryReferenceRestResponse extends \DTS\eBaySDK\Types\BaseType +class BulkDeleteAdsByInventoryReferenceRestResponse extends \DTS\eBaySDK\Marketing\Types\BulkDeleteAdsByInventoryReferenceResponse { use StatusCodeTrait; use HttpHeadersTrait; diff --git a/src/Marketing/Types/CreateAdsByInventoryReferenceResponse.php b/src/Marketing/Types/CreateAdsByInventoryReferenceResponse.php new file mode 100644 index 000000000..b1657fdf3 --- /dev/null +++ b/src/Marketing/Types/CreateAdsByInventoryReferenceResponse.php @@ -0,0 +1,74 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\AdReference', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'ads' + ], + 'errors' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'inventoryReferenceId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryReferenceId' + ], + 'inventoryReferenceType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryReferenceType' + ], + 'statusCode' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'statusCode' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/CreateReportTask.php b/src/Marketing/Types/CreateReportTask.php new file mode 100644 index 000000000..214e3bc60 --- /dev/null +++ b/src/Marketing/Types/CreateReportTask.php @@ -0,0 +1,109 @@ + [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'campaignIds' + ], + 'dateFrom' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dateFrom' + ], + 'dateTo' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dateTo' + ], + 'dimensions' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Dimension', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'dimensions' + ], + 'inventoryReferences' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\InventoryReference', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'inventoryReferences' + ], + 'listingIds' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'listingIds' + ], + 'marketplaceId' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Bas:MarketplaceIdEnum', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplaceId' + ], + 'metricKeys' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'metricKeys' + ], + 'reportFormat' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportFormat' + ], + 'reportType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/CreateReportTaskRestRequest.php b/src/Marketing/Types/CreateReportTaskRestRequest.php new file mode 100644 index 000000000..4b0cfe070 --- /dev/null +++ b/src/Marketing/Types/CreateReportTaskRestRequest.php @@ -0,0 +1,39 @@ +setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/CreateReportTaskRestResponse.php b/src/Marketing/Types/CreateReportTaskRestResponse.php new file mode 100644 index 000000000..e5724298e --- /dev/null +++ b/src/Marketing/Types/CreateReportTaskRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/DeleteAdsByInventoryReferenceResponse.php b/src/Marketing/Types/DeleteAdsByInventoryReferenceResponse.php new file mode 100644 index 000000000..7511f9641 --- /dev/null +++ b/src/Marketing/Types/DeleteAdsByInventoryReferenceResponse.php @@ -0,0 +1,74 @@ + [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'adIds' + ], + 'errors' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'inventoryReferenceId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryReferenceId' + ], + 'inventoryReferenceType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryReferenceType' + ], + 'statusCode' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'statusCode' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/DeleteSpecificReportTaskRestRequest.php b/src/Marketing/Types/DeleteSpecificReportTaskRestRequest.php new file mode 100644 index 000000000..2ec53a2d3 --- /dev/null +++ b/src/Marketing/Types/DeleteSpecificReportTaskRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'report_task_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/DeleteSpecificReportTaskRestResponse.php b/src/Marketing/Types/DeleteSpecificReportTaskRestResponse.php new file mode 100644 index 000000000..cd89c94f1 --- /dev/null +++ b/src/Marketing/Types/DeleteSpecificReportTaskRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/Dimension.php b/src/Marketing/Types/Dimension.php new file mode 100644 index 000000000..d52cc0120 --- /dev/null +++ b/src/Marketing/Types/Dimension.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'annotationKeys' + ], + 'dimensionKey' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dimensionKey' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/DimensionKeyAnnotation.php b/src/Marketing/Types/DimensionKeyAnnotation.php new file mode 100644 index 000000000..808334886 --- /dev/null +++ b/src/Marketing/Types/DimensionKeyAnnotation.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'annotationKey' + ], + 'dataType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dataType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/DimensionMetadata.php b/src/Marketing/Types/DimensionMetadata.php new file mode 100644 index 000000000..19e5ddd19 --- /dev/null +++ b/src/Marketing/Types/DimensionMetadata.php @@ -0,0 +1,60 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dataType' + ], + 'dimensionKey' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dimensionKey' + ], + 'dimensionKeyAnnotations' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\DimensionKeyAnnotation', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'dimensionKeyAnnotations' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetMetadataForAReportTypeRestRequest.php b/src/Marketing/Types/GetMetadataForAReportTypeRestRequest.php new file mode 100644 index 000000000..fcb2a76f2 --- /dev/null +++ b/src/Marketing/Types/GetMetadataForAReportTypeRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'report_type' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetMetadataForAReportTypeRestResponse.php b/src/Marketing/Types/GetMetadataForAReportTypeRestResponse.php new file mode 100644 index 000000000..5e4784ace --- /dev/null +++ b/src/Marketing/Types/GetMetadataForAReportTypeRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/GetMetadataForAllReportsRestRequest.php b/src/Marketing/Types/GetMetadataForAllReportsRestRequest.php new file mode 100644 index 000000000..8592e48aa --- /dev/null +++ b/src/Marketing/Types/GetMetadataForAllReportsRestRequest.php @@ -0,0 +1,39 @@ +setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetMetadataForAllReportsRestResponse.php b/src/Marketing/Types/GetMetadataForAllReportsRestResponse.php new file mode 100644 index 000000000..2ae367c49 --- /dev/null +++ b/src/Marketing/Types/GetMetadataForAllReportsRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/GetReportTasksRestRequest.php b/src/Marketing/Types/GetReportTasksRestRequest.php new file mode 100644 index 000000000..ff0bb1db2 --- /dev/null +++ b/src/Marketing/Types/GetReportTasksRestRequest.php @@ -0,0 +1,60 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'limit' + ], + 'offset' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'offset' + ], + 'report_task_statuses' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'report_task_statuses' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetReportTasksRestResponse.php b/src/Marketing/Types/GetReportTasksRestResponse.php new file mode 100644 index 000000000..f1c09f39a --- /dev/null +++ b/src/Marketing/Types/GetReportTasksRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/GetSpecificReportRestRequest.php b/src/Marketing/Types/GetSpecificReportRestRequest.php new file mode 100644 index 000000000..9d2b77056 --- /dev/null +++ b/src/Marketing/Types/GetSpecificReportRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'report_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetSpecificReportRestResponse.php b/src/Marketing/Types/GetSpecificReportRestResponse.php new file mode 100644 index 000000000..74ab4e66c --- /dev/null +++ b/src/Marketing/Types/GetSpecificReportRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/GetSpecificReportTaskRestRequest.php b/src/Marketing/Types/GetSpecificReportTaskRestRequest.php new file mode 100644 index 000000000..4f1a34e9d --- /dev/null +++ b/src/Marketing/Types/GetSpecificReportTaskRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'report_task_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetSpecificReportTaskRestResponse.php b/src/Marketing/Types/GetSpecificReportTaskRestResponse.php new file mode 100644 index 000000000..4f5cd6052 --- /dev/null +++ b/src/Marketing/Types/GetSpecificReportTaskRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/InventoryReference.php b/src/Marketing/Types/InventoryReference.php new file mode 100644 index 000000000..7a657a316 --- /dev/null +++ b/src/Marketing/Types/InventoryReference.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryReferenceId' + ], + 'inventoryReferenceType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryReferenceType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/MetricMetadata.php b/src/Marketing/Types/MetricMetadata.php new file mode 100644 index 000000000..21b130790 --- /dev/null +++ b/src/Marketing/Types/MetricMetadata.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dataType' + ], + 'metricKey' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'metricKey' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/ReportMetadata.php b/src/Marketing/Types/ReportMetadata.php new file mode 100644 index 000000000..b4684d2d7 --- /dev/null +++ b/src/Marketing/Types/ReportMetadata.php @@ -0,0 +1,74 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\DimensionMetadata', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'dimensionMetadata' + ], + 'maxNumberOfDimensionsToRequest' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'maxNumberOfDimensionsToRequest' + ], + 'maxNumberOfMetricsToRequest' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'maxNumberOfMetricsToRequest' + ], + 'metricMetadata' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\MetricMetadata', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'metricMetadata' + ], + 'reportType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/ReportMetadatas.php b/src/Marketing/Types/ReportMetadatas.php new file mode 100644 index 000000000..5eb596fa3 --- /dev/null +++ b/src/Marketing/Types/ReportMetadatas.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ReportMetadata', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'reportMetadata' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/ReportTask.php b/src/Marketing/Types/ReportTask.php new file mode 100644 index 000000000..d60a8ae6c --- /dev/null +++ b/src/Marketing/Types/ReportTask.php @@ -0,0 +1,179 @@ + [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'campaignIds' + ], + 'dateFrom' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dateFrom' + ], + 'dateTo' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dateTo' + ], + 'dimensions' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Dimension', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'dimensions' + ], + 'inventoryReferences' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\InventoryReference', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'inventoryReferences' + ], + 'listingIds' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'listingIds' + ], + 'marketplaceId' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Bas:MarketplaceIdEnum', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplaceId' + ], + 'metricKeys' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'metricKeys' + ], + 'reportExpirationDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportExpirationDate' + ], + 'reportFormat' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportFormat' + ], + 'reportHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportHref' + ], + 'reportId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportId' + ], + 'reportName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportName' + ], + 'reportTaskCompletionDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportTaskCompletionDate' + ], + 'reportTaskCreationDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportTaskCreationDate' + ], + 'reportTaskExpectedCompletionDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportTaskExpectedCompletionDate' + ], + 'reportTaskId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportTaskId' + ], + 'reportTaskStatus' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportTaskStatus' + ], + 'reportTaskStatusMessage' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportTaskStatusMessage' + ], + 'reportType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'reportType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/ReportTaskPagedCollection.php b/src/Marketing/Types/ReportTaskPagedCollection.php new file mode 100644 index 000000000..084d84bb4 --- /dev/null +++ b/src/Marketing/Types/ReportTaskPagedCollection.php @@ -0,0 +1,88 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'href' + ], + 'limit' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'limit' + ], + 'next' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'next' + ], + 'offset' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'offset' + ], + 'prev' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'prev' + ], + 'reportTasks' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ReportTask', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'reportTasks' + ], + 'total' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'total' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/test/Marketing/Enums/DataTypeEnumTest.php b/test/Marketing/Enums/DataTypeEnumTest.php new file mode 100644 index 000000000..9ae052dcd --- /dev/null +++ b/test/Marketing/Enums/DataTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new DataTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Enums\DataTypeEnum', $this->obj); + } +} diff --git a/test/Marketing/Enums/ReportFormatEnumTest.php b/test/Marketing/Enums/ReportFormatEnumTest.php new file mode 100644 index 000000000..e74b69c86 --- /dev/null +++ b/test/Marketing/Enums/ReportFormatEnumTest.php @@ -0,0 +1,28 @@ +obj = new ReportFormatEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Enums\ReportFormatEnum', $this->obj); + } +} diff --git a/test/Marketing/Enums/ReportTypeEnumTest.php b/test/Marketing/Enums/ReportTypeEnumTest.php new file mode 100644 index 000000000..215484eff --- /dev/null +++ b/test/Marketing/Enums/ReportTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new ReportTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Enums\ReportTypeEnum', $this->obj); + } +} diff --git a/test/Marketing/Enums/TaskStatusEnumTest.php b/test/Marketing/Enums/TaskStatusEnumTest.php new file mode 100644 index 000000000..51e291dae --- /dev/null +++ b/test/Marketing/Enums/TaskStatusEnumTest.php @@ -0,0 +1,28 @@ +obj = new TaskStatusEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Enums\TaskStatusEnum', $this->obj); + } +} diff --git a/test/Marketing/Types/BulkCreateAdsByInventoryReferenceResponseTest.php b/test/Marketing/Types/BulkCreateAdsByInventoryReferenceResponseTest.php new file mode 100644 index 000000000..5041593b8 --- /dev/null +++ b/test/Marketing/Types/BulkCreateAdsByInventoryReferenceResponseTest.php @@ -0,0 +1,33 @@ +obj = new BulkCreateAdsByInventoryReferenceResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BulkCreateAdsByInventoryReferenceResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponseTest.php b/test/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponseTest.php index bf118292c..bb04cbc2f 100644 --- a/test/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponseTest.php +++ b/test/Marketing/Types/BulkCreateAdsByInventoryReferenceRestResponseTest.php @@ -26,8 +26,8 @@ public function testCanBeCreated() $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BulkCreateAdsByInventoryReferenceRestResponse', $this->obj); } - public function testExtendsBaseType() + public function testExtendsBulkCreateAdsByInventoryReferenceResponse() { - $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BulkCreateAdsByInventoryReferenceResponse', $this->obj); } } diff --git a/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponseTest.php b/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponseTest.php new file mode 100644 index 000000000..c043f7f52 --- /dev/null +++ b/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceResponseTest.php @@ -0,0 +1,33 @@ +obj = new BulkDeleteAdsByInventoryReferenceResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BulkDeleteAdsByInventoryReferenceResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponseTest.php b/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponseTest.php index 4a1a5c27c..1081f2d8f 100644 --- a/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponseTest.php +++ b/test/Marketing/Types/BulkDeleteAdsByInventoryReferenceRestResponseTest.php @@ -26,8 +26,8 @@ public function testCanBeCreated() $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BulkDeleteAdsByInventoryReferenceRestResponse', $this->obj); } - public function testExtendsBaseType() + public function testExtendsBulkDeleteAdsByInventoryReferenceResponse() { - $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BulkDeleteAdsByInventoryReferenceResponse', $this->obj); } } diff --git a/test/Marketing/Types/CreateAdsByInventoryReferenceResponseTest.php b/test/Marketing/Types/CreateAdsByInventoryReferenceResponseTest.php new file mode 100644 index 000000000..128ad2f40 --- /dev/null +++ b/test/Marketing/Types/CreateAdsByInventoryReferenceResponseTest.php @@ -0,0 +1,33 @@ +obj = new CreateAdsByInventoryReferenceResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\CreateAdsByInventoryReferenceResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/CreateReportTaskRestRequestTest.php b/test/Marketing/Types/CreateReportTaskRestRequestTest.php new file mode 100644 index 000000000..0e451b684 --- /dev/null +++ b/test/Marketing/Types/CreateReportTaskRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new CreateReportTaskRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\CreateReportTaskRestRequest', $this->obj); + } + + public function testExtendsCreateReportTask() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\CreateReportTask', $this->obj); + } +} diff --git a/test/Marketing/Types/CreateReportTaskRestResponseTest.php b/test/Marketing/Types/CreateReportTaskRestResponseTest.php new file mode 100644 index 000000000..8fa5371b3 --- /dev/null +++ b/test/Marketing/Types/CreateReportTaskRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new CreateReportTaskRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\CreateReportTaskRestResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/CreateReportTaskTest.php b/test/Marketing/Types/CreateReportTaskTest.php new file mode 100644 index 000000000..5f571e06c --- /dev/null +++ b/test/Marketing/Types/CreateReportTaskTest.php @@ -0,0 +1,33 @@ +obj = new CreateReportTask(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\CreateReportTask', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/DeleteAdsByInventoryReferenceResponseTest.php b/test/Marketing/Types/DeleteAdsByInventoryReferenceResponseTest.php new file mode 100644 index 000000000..433ccc194 --- /dev/null +++ b/test/Marketing/Types/DeleteAdsByInventoryReferenceResponseTest.php @@ -0,0 +1,33 @@ +obj = new DeleteAdsByInventoryReferenceResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\DeleteAdsByInventoryReferenceResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/DeleteSpecificReportTaskRestRequestTest.php b/test/Marketing/Types/DeleteSpecificReportTaskRestRequestTest.php new file mode 100644 index 000000000..c01c5d90c --- /dev/null +++ b/test/Marketing/Types/DeleteSpecificReportTaskRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new DeleteSpecificReportTaskRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/DeleteSpecificReportTaskRestResponseTest.php b/test/Marketing/Types/DeleteSpecificReportTaskRestResponseTest.php new file mode 100644 index 000000000..d01e461b6 --- /dev/null +++ b/test/Marketing/Types/DeleteSpecificReportTaskRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new DeleteSpecificReportTaskRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/DimensionKeyAnnotationTest.php b/test/Marketing/Types/DimensionKeyAnnotationTest.php new file mode 100644 index 000000000..6aef79d14 --- /dev/null +++ b/test/Marketing/Types/DimensionKeyAnnotationTest.php @@ -0,0 +1,33 @@ +obj = new DimensionKeyAnnotation(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\DimensionKeyAnnotation', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/DimensionMetadataTest.php b/test/Marketing/Types/DimensionMetadataTest.php new file mode 100644 index 000000000..c61c7a923 --- /dev/null +++ b/test/Marketing/Types/DimensionMetadataTest.php @@ -0,0 +1,33 @@ +obj = new DimensionMetadata(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\DimensionMetadata', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/DimensionTest.php b/test/Marketing/Types/DimensionTest.php new file mode 100644 index 000000000..7493f4699 --- /dev/null +++ b/test/Marketing/Types/DimensionTest.php @@ -0,0 +1,33 @@ +obj = new Dimension(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\Dimension', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetMetadataForAReportTypeRestRequestTest.php b/test/Marketing/Types/GetMetadataForAReportTypeRestRequestTest.php new file mode 100644 index 000000000..3a8543d49 --- /dev/null +++ b/test/Marketing/Types/GetMetadataForAReportTypeRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetMetadataForAReportTypeRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetMetadataForAReportTypeRestResponseTest.php b/test/Marketing/Types/GetMetadataForAReportTypeRestResponseTest.php new file mode 100644 index 000000000..402975f3a --- /dev/null +++ b/test/Marketing/Types/GetMetadataForAReportTypeRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetMetadataForAReportTypeRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetMetadataForAReportTypeRestResponse', $this->obj); + } + + public function testExtendsReportMetadata() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportMetadata', $this->obj); + } +} diff --git a/test/Marketing/Types/GetMetadataForAllReportsRestRequestTest.php b/test/Marketing/Types/GetMetadataForAllReportsRestRequestTest.php new file mode 100644 index 000000000..f0b4e4c1a --- /dev/null +++ b/test/Marketing/Types/GetMetadataForAllReportsRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetMetadataForAllReportsRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetMetadataForAllReportsRestResponseTest.php b/test/Marketing/Types/GetMetadataForAllReportsRestResponseTest.php new file mode 100644 index 000000000..72c566c5d --- /dev/null +++ b/test/Marketing/Types/GetMetadataForAllReportsRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetMetadataForAllReportsRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetMetadataForAllReportsRestResponse', $this->obj); + } + + public function testExtendsReportMetadatas() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportMetadatas', $this->obj); + } +} diff --git a/test/Marketing/Types/GetReportTasksRestRequestTest.php b/test/Marketing/Types/GetReportTasksRestRequestTest.php new file mode 100644 index 000000000..9f9dd4116 --- /dev/null +++ b/test/Marketing/Types/GetReportTasksRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetReportTasksRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetReportTasksRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetReportTasksRestResponseTest.php b/test/Marketing/Types/GetReportTasksRestResponseTest.php new file mode 100644 index 000000000..cae4b9dcf --- /dev/null +++ b/test/Marketing/Types/GetReportTasksRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetReportTasksRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetReportTasksRestResponse', $this->obj); + } + + public function testExtendsReportTaskPagedCollection() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportTaskPagedCollection', $this->obj); + } +} diff --git a/test/Marketing/Types/GetSpecificReportRestRequestTest.php b/test/Marketing/Types/GetSpecificReportRestRequestTest.php new file mode 100644 index 000000000..47a8dbbad --- /dev/null +++ b/test/Marketing/Types/GetSpecificReportRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetSpecificReportRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetSpecificReportRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetSpecificReportRestResponseTest.php b/test/Marketing/Types/GetSpecificReportRestResponseTest.php new file mode 100644 index 000000000..2c6ccfdb2 --- /dev/null +++ b/test/Marketing/Types/GetSpecificReportRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetSpecificReportRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetSpecificReportRestResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetSpecificReportTaskRestRequestTest.php b/test/Marketing/Types/GetSpecificReportTaskRestRequestTest.php new file mode 100644 index 000000000..5fb6810c6 --- /dev/null +++ b/test/Marketing/Types/GetSpecificReportTaskRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetSpecificReportTaskRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetSpecificReportTaskRestResponseTest.php b/test/Marketing/Types/GetSpecificReportTaskRestResponseTest.php new file mode 100644 index 000000000..78ea1a018 --- /dev/null +++ b/test/Marketing/Types/GetSpecificReportTaskRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetSpecificReportTaskRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetSpecificReportTaskRestResponse', $this->obj); + } + + public function testExtendsReportTask() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportTask', $this->obj); + } +} diff --git a/test/Marketing/Types/InventoryReferenceTest.php b/test/Marketing/Types/InventoryReferenceTest.php new file mode 100644 index 000000000..7f6eff628 --- /dev/null +++ b/test/Marketing/Types/InventoryReferenceTest.php @@ -0,0 +1,33 @@ +obj = new InventoryReference(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\InventoryReference', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/MetricMetadataTest.php b/test/Marketing/Types/MetricMetadataTest.php new file mode 100644 index 000000000..08ab33b1b --- /dev/null +++ b/test/Marketing/Types/MetricMetadataTest.php @@ -0,0 +1,33 @@ +obj = new MetricMetadata(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\MetricMetadata', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/ReportMetadataTest.php b/test/Marketing/Types/ReportMetadataTest.php new file mode 100644 index 000000000..c212db5bb --- /dev/null +++ b/test/Marketing/Types/ReportMetadataTest.php @@ -0,0 +1,33 @@ +obj = new ReportMetadata(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportMetadata', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/ReportMetadatasTest.php b/test/Marketing/Types/ReportMetadatasTest.php new file mode 100644 index 000000000..802202881 --- /dev/null +++ b/test/Marketing/Types/ReportMetadatasTest.php @@ -0,0 +1,33 @@ +obj = new ReportMetadatas(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportMetadatas', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/ReportTaskPagedCollectionTest.php b/test/Marketing/Types/ReportTaskPagedCollectionTest.php new file mode 100644 index 000000000..ad8b7fafe --- /dev/null +++ b/test/Marketing/Types/ReportTaskPagedCollectionTest.php @@ -0,0 +1,33 @@ +obj = new ReportTaskPagedCollection(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportTaskPagedCollection', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/ReportTaskTest.php b/test/Marketing/Types/ReportTaskTest.php new file mode 100644 index 000000000..848b7cccc --- /dev/null +++ b/test/Marketing/Types/ReportTaskTest.php @@ -0,0 +1,33 @@ +obj = new ReportTask(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\ReportTask', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} From 69743c121fd1f60fe5f2e0faa0d666d4a0a07aa9 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 11:25:13 +0100 Subject: [PATCH 04/31] update: support order api version v1_beta.6.0 --- CHANGELOG.md | 1 + src/Order/Types/ShippingDetail.php | 12 ++++++------ src/Order/Types/ShippingFulfillment.php | 12 ++++++------ src/Order/Types/ShippingOption.php | 12 ++++++------ 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b8c1f2be..0857603f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Breaking changes * Support Marketing API version 1.2.0. +* Support Order API version v1_beta.6.0 ### Fixes diff --git a/src/Order/Types/ShippingDetail.php b/src/Order/Types/ShippingDetail.php index 0d9c7c480..c445d6c7d 100644 --- a/src/Order/Types/ShippingDetail.php +++ b/src/Order/Types/ShippingDetail.php @@ -14,8 +14,8 @@ * * @property string $maxEstimatedDeliveryDate * @property string $minEstimatedDeliveryDate - * @property string $shippingCarrierName - * @property string $shippingServiceName + * @property string $shippingCarrierCode + * @property string $shippingServiceCode */ class ShippingDetail extends \DTS\eBaySDK\Types\BaseType { @@ -35,17 +35,17 @@ class ShippingDetail extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'minEstimatedDeliveryDate' ], - 'shippingCarrierName' => [ + 'shippingCarrierCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingCarrierName' + 'elementName' => 'shippingCarrierCode' ], - 'shippingServiceName' => [ + 'shippingServiceCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingServiceName' + 'elementName' => 'shippingServiceCode' ] ]; diff --git a/src/Order/Types/ShippingFulfillment.php b/src/Order/Types/ShippingFulfillment.php index 60d627f1d..39b8ea1ef 100644 --- a/src/Order/Types/ShippingFulfillment.php +++ b/src/Order/Types/ShippingFulfillment.php @@ -19,8 +19,8 @@ * @property string $shipmentTrackingNumber * @property string $shipmentTrackingUrl * @property string $shippedDate - * @property string $shippingCarrierName - * @property string $shippingServiceName + * @property string $shippingCarrierCode + * @property string $shippingServiceCode */ class ShippingFulfillment extends \DTS\eBaySDK\Types\BaseType { @@ -70,17 +70,17 @@ class ShippingFulfillment extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'shippedDate' ], - 'shippingCarrierName' => [ + 'shippingCarrierCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingCarrierName' + 'elementName' => 'shippingCarrierCode' ], - 'shippingServiceName' => [ + 'shippingServiceCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingServiceName' + 'elementName' => 'shippingServiceCode' ] ]; diff --git a/src/Order/Types/ShippingOption.php b/src/Order/Types/ShippingOption.php index e56de71b7..6ef57014f 100644 --- a/src/Order/Types/ShippingOption.php +++ b/src/Order/Types/ShippingOption.php @@ -17,9 +17,9 @@ * @property string $maxEstimatedDeliveryDate * @property string $minEstimatedDeliveryDate * @property boolean $selected - * @property string $shippingCarrierName + * @property string $shippingCarrierCode * @property string $shippingOptionId - * @property string $shippingServiceName + * @property string $shippingServiceCode */ class ShippingOption extends \DTS\eBaySDK\Types\BaseType { @@ -57,11 +57,11 @@ class ShippingOption extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'selected' ], - 'shippingCarrierName' => [ + 'shippingCarrierCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingCarrierName' + 'elementName' => 'shippingCarrierCode' ], 'shippingOptionId' => [ 'type' => 'string', @@ -69,11 +69,11 @@ class ShippingOption extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'shippingOptionId' ], - 'shippingServiceName' => [ + 'shippingServiceCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingServiceName' + 'elementName' => 'shippingServiceCode' ] ]; From dbfa3e1a6b4cdec495adeed4b04588c720368ae1 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 12:41:41 +0100 Subject: [PATCH 05/31] api: support trading api version 1007 --- CHANGELOG.md | 1 + src/Trading/Services/TradingService.php | 2 +- src/Trading/Types/ReviseCheckoutStatusRequestType.php | 7 ------- src/Trading/Types/TransactionType.php | 7 +++++++ 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0857603f9..1d2b784a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Support Marketing API version 1.2.0. * Support Order API version v1_beta.6.0 +* Support Trading API version 1007. ### Fixes diff --git a/src/Trading/Services/TradingService.php b/src/Trading/Services/TradingService.php index 7416eb1b6..f059424a9 100644 --- a/src/Trading/Services/TradingService.php +++ b/src/Trading/Services/TradingService.php @@ -12,7 +12,7 @@ class TradingService extends \DTS\eBaySDK\Trading\Services\TradingBaseService { - const API_VERSION = '997'; + const API_VERSION = '1007'; /** * @param array $config Configuration option values. diff --git a/src/Trading/Types/ReviseCheckoutStatusRequestType.php b/src/Trading/Types/ReviseCheckoutStatusRequestType.php index d1de73104..5ff287855 100644 --- a/src/Trading/Types/ReviseCheckoutStatusRequestType.php +++ b/src/Trading/Types/ReviseCheckoutStatusRequestType.php @@ -23,7 +23,6 @@ * @property \DTS\eBaySDK\Trading\Enums\InsuranceSelectedCodeType $InsuranceType * @property \DTS\eBaySDK\Trading\Enums\RCSPaymentStatusCodeType $PaymentStatus * @property \DTS\eBaySDK\Trading\Types\AmountType $AdjustmentAmount - * @property \DTS\eBaySDK\Trading\Types\AddressType $ShippingAddress * @property string $BuyerID * @property \DTS\eBaySDK\Trading\Types\AmountType $ShippingInsuranceCost * @property \DTS\eBaySDK\Trading\Types\AmountType $SalesTax @@ -106,12 +105,6 @@ class ReviseCheckoutStatusRequestType extends \DTS\eBaySDK\Trading\Types\Abstrac 'attribute' => false, 'elementName' => 'AdjustmentAmount' ], - 'ShippingAddress' => [ - 'type' => 'DTS\eBaySDK\Trading\Types\AddressType', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'ShippingAddress' - ], 'BuyerID' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/Trading/Types/TransactionType.php b/src/Trading/Types/TransactionType.php index 3dc44d540..467765157 100644 --- a/src/Trading/Types/TransactionType.php +++ b/src/Trading/Types/TransactionType.php @@ -51,6 +51,7 @@ * @property \DTS\eBaySDK\Trading\Types\AmountType $BuyerGuaranteePrice * @property \DTS\eBaySDK\Trading\Types\VariationType $Variation * @property string $BuyerCheckoutMessage + * @property \DTS\eBaySDK\Trading\Types\AmountType $TotalTransactionPrice * @property \DTS\eBaySDK\Trading\Types\TaxesType $Taxes * @property boolean $BundlePurchase * @property \DTS\eBaySDK\Trading\Types\AmountType $ActualShippingCost @@ -319,6 +320,12 @@ class TransactionType extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'BuyerCheckoutMessage' ], + 'TotalTransactionPrice' => [ + 'type' => 'DTS\eBaySDK\Trading\Types\AmountType', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'TotalTransactionPrice' + ], 'Taxes' => [ 'type' => 'DTS\eBaySDK\Trading\Types\TaxesType', 'repeatable' => false, From 11a817825cd3c10e3d2e9abd7b45681b58aa5b29 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 12:46:26 +0100 Subject: [PATCH 06/31] api: support shopping api version 1007 --- CHANGELOG.md | 1 + src/Shopping/Services/ShoppingService.php | 2 +- src/Shopping/Types/FindProductsResponseType.php | 7 ------- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d2b784a7..2449e7f0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Support Marketing API version 1.2.0. * Support Order API version v1_beta.6.0 * Support Trading API version 1007. +* Support Shopping API version 1007. ### Fixes diff --git a/src/Shopping/Services/ShoppingService.php b/src/Shopping/Services/ShoppingService.php index a8cd33a40..e12ab8f62 100644 --- a/src/Shopping/Services/ShoppingService.php +++ b/src/Shopping/Services/ShoppingService.php @@ -12,7 +12,7 @@ class ShoppingService extends \DTS\eBaySDK\Shopping\Services\ShoppingBaseService { - const API_VERSION = '983'; + const API_VERSION = '1007'; /** * @param array $config Configuration option values. diff --git a/src/Shopping/Types/FindProductsResponseType.php b/src/Shopping/Types/FindProductsResponseType.php index 3c69eabbb..c67ae68d6 100644 --- a/src/Shopping/Types/FindProductsResponseType.php +++ b/src/Shopping/Types/FindProductsResponseType.php @@ -15,7 +15,6 @@ * @property integer $ApproximatePages * @property boolean $MoreResults * @property \DTS\eBaySDK\Shopping\Types\DomainHistogramType $DomainHistogram - * @property \DTS\eBaySDK\Shopping\Types\SimpleItemArrayType $ItemArray * @property integer $PageNumber * @property \DTS\eBaySDK\Shopping\Types\CatalogProductType[] $Product * @property integer $TotalProducts @@ -45,12 +44,6 @@ class FindProductsResponseType extends \DTS\eBaySDK\Shopping\Types\AbstractRespo 'attribute' => false, 'elementName' => 'DomainHistogram' ], - 'ItemArray' => [ - 'type' => 'DTS\eBaySDK\Shopping\Types\SimpleItemArrayType', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'ItemArray' - ], 'PageNumber' => [ 'type' => 'integer', 'repeatable' => false, From e0010113eb0de8d4db9478af45dcc0fb7d1df0d4 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 13:00:34 +0100 Subject: [PATCH 07/31] api: support browse api version v1_beta.6.0 --- CHANGELOG.md | 1 + .../Enums/AvailabilityThresholdEnum.php | 16 ++ src/Browse/Enums/DeliveryOptionsEnum.php | 20 ++ src/Browse/Enums/ItemGroupTypeEnum.php | 16 ++ src/Browse/Enums/RegionTypeEnum.php | 20 ++ src/Browse/Services/BrowseService.php | 72 +++--- src/Browse/Types/AspectDistribution.php | 53 +++++ src/Browse/Types/AspectFilter.php | 53 +++++ ...rice_0.php => AspectValueDistribution.php} | 26 +-- ...quest.php => BuyingOptionDistribution.php} | 22 +- src/Browse/Types/CategoryDistribution.php | 67 ++++++ src/Browse/Types/CommonDescriptions.php | 53 +++++ src/Browse/Types/ConditionDistribution.php | 67 ++++++ src/Browse/Types/ConvertedAmount.php | 67 ++++++ src/Browse/Types/EstimatedAvailability.php | 81 +++++++ .../Types/GetItemByLegacyIdRestRequest.php | 60 +++++ ....php => GetItemByLegacyIdRestResponse.php} | 2 +- ...php => GetItemsByItemGroupRestRequest.php} | 2 +- ...hp => GetItemsByItemGroupRestResponse.php} | 2 +- src/Browse/Types/Item.php | 77 +++--- src/Browse/Types/ItemDigest.php | 165 ------------- src/Browse/Types/ItemFeed.php | 221 ------------------ src/Browse/Types/ItemGroupSummary.php | 81 +++++++ src/Browse/Types/ItemSummary.php | 47 ++-- src/Browse/Types/Items.php | 53 +++++ src/Browse/Types/LegalAddress.php | 95 ++++++++ src/Browse/Types/MarketingPrice.php | 8 +- src/Browse/Types/Refinement.php | 74 ++++++ src/Browse/Types/{Amount.php => Region.php} | 14 +- .../Types/SearchForItemsRestRequest.php | 28 +++ src/Browse/Types/SearchPagedCollection.php | 7 + src/Browse/Types/Seller.php | 7 + .../{ItemGroup.php => SellerLegalInfo.php} | 88 +++---- .../{Amount_0.php => ShipToLocation.php} | 14 +- src/Browse/Types/ShipToLocations.php | 53 +++++ src/Browse/Types/ShippingOption.php | 65 +++++- src/Browse/Types/ShippingOptionSummary.php | 18 +- src/Browse/Types/TaxJurisdiction.php | 53 +++++ .../{ItemFeedResponse.php => TaxType.php} | 9 +- src/Browse/Types/Taxes.php | 74 ++++++ src/Browse/Types/TypedNameValue.php | 4 +- src/Browse/Types/VatDetail.php | 53 +++++ .../Enums/AvailabilityThresholdEnumTest.php | 28 +++ test/Browse/Enums/DeliveryOptionsEnumTest.php | 28 +++ test/Browse/Enums/ItemGroupTypeEnumTest.php | 28 +++ test/Browse/Enums/RegionTypeEnumTest.php | 28 +++ ...nseTest.php => AspectDistributionTest.php} | 8 +- test/Browse/Types/AspectFilterTest.php | 33 +++ .../Types/AspectValueDistributionTest.php | 33 +++ .../Types/BuyingOptionDistributionTest.php | 33 +++ .../Browse/Types/CategoryDistributionTest.php | 33 +++ test/Browse/Types/CommonDescriptionsTest.php | 33 +++ .../Types/ConditionDistributionTest.php | 33 +++ test/Browse/Types/ConvertedAmountTest.php | 33 +++ .../Types/EstimatedAvailabilityTest.php | 33 +++ ...p => GetItemByLegacyIdRestRequestTest.php} | 8 +- ... => GetItemByLegacyIdRestResponseTest.php} | 12 +- ...=> GetItemsByItemGroupRestRequestTest.php} | 8 +- ...> GetItemsByItemGroupRestResponseTest.php} | 12 +- ...GroupTest.php => ItemGroupSummaryTest.php} | 8 +- .../Types/{AmountTest.php => ItemsTest.php} | 8 +- test/Browse/Types/LegalAddressTest.php | 33 +++ test/Browse/Types/MarketingPrice_0Test.php | 33 --- ...{ItemDigestTest.php => RefinementTest.php} | 8 +- .../{ItemFeedTest.php => RegionTest.php} | 8 +- test/Browse/Types/SellerLegalInfoTest.php | 33 +++ test/Browse/Types/ShipToLocationTest.php | 33 +++ test/Browse/Types/ShipToLocationsTest.php | 33 +++ test/Browse/Types/TaxJurisdictionTest.php | 33 +++ .../{Amount_0Test.php => TaxTypeTest.php} | 8 +- test/Browse/Types/TaxesTest.php | 33 +++ test/Browse/Types/VatDetailTest.php | 33 +++ 72 files changed, 2092 insertions(+), 644 deletions(-) create mode 100644 src/Browse/Enums/AvailabilityThresholdEnum.php create mode 100644 src/Browse/Enums/DeliveryOptionsEnum.php create mode 100644 src/Browse/Enums/ItemGroupTypeEnum.php create mode 100644 src/Browse/Enums/RegionTypeEnum.php create mode 100644 src/Browse/Types/AspectDistribution.php create mode 100644 src/Browse/Types/AspectFilter.php rename src/Browse/Types/{MarketingPrice_0.php => AspectValueDistribution.php} (67%) rename src/Browse/Types/{GetItemFeedRestRequest.php => BuyingOptionDistribution.php} (74%) create mode 100644 src/Browse/Types/CategoryDistribution.php create mode 100644 src/Browse/Types/CommonDescriptions.php create mode 100644 src/Browse/Types/ConditionDistribution.php create mode 100644 src/Browse/Types/ConvertedAmount.php create mode 100644 src/Browse/Types/EstimatedAvailability.php create mode 100644 src/Browse/Types/GetItemByLegacyIdRestRequest.php rename src/Browse/Types/{GetItemGroupRestResponse.php => GetItemByLegacyIdRestResponse.php} (96%) rename src/Browse/Types/{GetItemGroupRestRequest.php => GetItemsByItemGroupRestRequest.php} (94%) rename src/Browse/Types/{GetItemFeedRestResponse.php => GetItemsByItemGroupRestResponse.php} (95%) delete mode 100644 src/Browse/Types/ItemDigest.php delete mode 100644 src/Browse/Types/ItemFeed.php create mode 100644 src/Browse/Types/ItemGroupSummary.php create mode 100644 src/Browse/Types/Items.php create mode 100644 src/Browse/Types/LegalAddress.php create mode 100644 src/Browse/Types/Refinement.php rename src/Browse/Types/{Amount.php => Region.php} (80%) rename src/Browse/Types/{ItemGroup.php => SellerLegalInfo.php} (50%) rename src/Browse/Types/{Amount_0.php => ShipToLocation.php} (80%) create mode 100644 src/Browse/Types/ShipToLocations.php create mode 100644 src/Browse/Types/TaxJurisdiction.php rename src/Browse/Types/{ItemFeedResponse.php => TaxType.php} (74%) create mode 100644 src/Browse/Types/Taxes.php create mode 100644 src/Browse/Types/VatDetail.php create mode 100644 test/Browse/Enums/AvailabilityThresholdEnumTest.php create mode 100644 test/Browse/Enums/DeliveryOptionsEnumTest.php create mode 100644 test/Browse/Enums/ItemGroupTypeEnumTest.php create mode 100644 test/Browse/Enums/RegionTypeEnumTest.php rename test/Browse/Types/{ItemFeedResponseTest.php => AspectDistributionTest.php} (66%) create mode 100644 test/Browse/Types/AspectFilterTest.php create mode 100644 test/Browse/Types/AspectValueDistributionTest.php create mode 100644 test/Browse/Types/BuyingOptionDistributionTest.php create mode 100644 test/Browse/Types/CategoryDistributionTest.php create mode 100644 test/Browse/Types/CommonDescriptionsTest.php create mode 100644 test/Browse/Types/ConditionDistributionTest.php create mode 100644 test/Browse/Types/ConvertedAmountTest.php create mode 100644 test/Browse/Types/EstimatedAvailabilityTest.php rename test/Browse/Types/{GetItemGroupRestRequestTest.php => GetItemByLegacyIdRestRequestTest.php} (70%) rename test/Browse/Types/{GetItemGroupRestResponseTest.php => GetItemByLegacyIdRestResponseTest.php} (55%) rename test/Browse/Types/{GetItemFeedRestRequestTest.php => GetItemsByItemGroupRestRequestTest.php} (70%) rename test/Browse/Types/{GetItemFeedRestResponseTest.php => GetItemsByItemGroupRestResponseTest.php} (55%) rename test/Browse/Types/{ItemGroupTest.php => ItemGroupSummaryTest.php} (75%) rename test/Browse/Types/{AmountTest.php => ItemsTest.php} (70%) create mode 100644 test/Browse/Types/LegalAddressTest.php delete mode 100644 test/Browse/Types/MarketingPrice_0Test.php rename test/Browse/Types/{ItemDigestTest.php => RefinementTest.php} (69%) rename test/Browse/Types/{ItemFeedTest.php => RegionTest.php} (69%) create mode 100644 test/Browse/Types/SellerLegalInfoTest.php create mode 100644 test/Browse/Types/ShipToLocationTest.php create mode 100644 test/Browse/Types/ShipToLocationsTest.php create mode 100644 test/Browse/Types/TaxJurisdictionTest.php rename test/Browse/Types/{Amount_0Test.php => TaxTypeTest.php} (69%) create mode 100644 test/Browse/Types/TaxesTest.php create mode 100644 test/Browse/Types/VatDetailTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 2449e7f0d..cd8f6c7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Support Order API version v1_beta.6.0 * Support Trading API version 1007. * Support Shopping API version 1007. +* Support Browse API version v1_beta.6.0 ### Fixes diff --git a/src/Browse/Enums/AvailabilityThresholdEnum.php b/src/Browse/Enums/AvailabilityThresholdEnum.php new file mode 100644 index 000000000..d486cd17e --- /dev/null +++ b/src/Browse/Enums/AvailabilityThresholdEnum.php @@ -0,0 +1,16 @@ + [ + 'GetItem' => [ 'method' => 'GET', 'resource' => 'item/{item_id}', 'responseClass' => '\DTS\eBaySDK\Browse\Types\GetItemRestResponse', @@ -29,29 +29,27 @@ class BrowseService extends \DTS\eBaySDK\Browse\Services\BrowseBaseService ] ] ], - 'getItemFeed' => [ + 'GetItemByLegacyId' => [ 'method' => 'GET', - 'resource' => 'item_feed', - 'responseClass' => '\DTS\eBaySDK\Browse\Types\GetItemFeedRestResponse', + 'resource' => 'item/get_item_by_legacy_id', + 'responseClass' => '\DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestResponse', 'params' => [ - 'category_id' => [ + 'legacy_item_id' => [ 'valid' => ['string'], 'required' => true ], - 'date' => [ - 'valid' => ['string'], - 'required' => true + 'legacy_variation_id' => [ + 'valid' => ['string'] ], - 'feed_type' => [ - 'valid' => ['string'], - 'required' => true + 'legacy_variation_sku' => [ + 'valid' => ['string'] ] ] ], - 'getItemGroup' => [ + 'GetItemsByItemGroup' => [ 'method' => 'GET', - 'resource' => 'item_group/{item_group_id}', - 'responseClass' => '\DTS\eBaySDK\Browse\Types\GetItemGroupRestResponse', + 'resource' => 'item/get_items_by_item_group', + 'responseClass' => '\DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestResponse', 'params' => [ 'item_group_id' => [ 'valid' => ['string'], @@ -59,11 +57,23 @@ class BrowseService extends \DTS\eBaySDK\Browse\Services\BrowseBaseService ] ] ], - 'searchForItems' => [ + 'SearchForItems' => [ 'method' => 'GET', 'resource' => 'item_summary/search', 'responseClass' => '\DTS\eBaySDK\Browse\Types\SearchForItemsRestResponse', 'params' => [ + 'aspect_filter' => [ + 'valid' => ['string'] + ], + 'category_ids' => [ + 'valid' => ['string'] + ], + 'epid' => [ + 'valid' => ['string'] + ], + 'fieldgroups' => [ + 'valid' => ['string'] + ], 'filter' => [ 'valid' => ['string'] ], @@ -106,43 +116,43 @@ public function getItem(\DTS\eBaySDK\Browse\Types\GetItemRestRequest $request) */ public function getItemAsync(\DTS\eBaySDK\Browse\Types\GetItemRestRequest $request) { - return $this->callOperationAsync('getItem', $request); + return $this->callOperationAsync('GetItem', $request); } /** - * @param \DTS\eBaySDK\Browse\Types\GetItemFeedRestRequest $request - * @return \DTS\eBaySDK\Browse\Types\GetItemFeedRestResponse + * @param \DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestRequest $request + * @return \DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestResponse */ - public function getItemFeed(\DTS\eBaySDK\Browse\Types\GetItemFeedRestRequest $request) + public function getItemByLegacyId(\DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestRequest $request) { - return $this->getItemFeedAsync($request)->wait(); + return $this->getItemByLegacyIdAsync($request)->wait(); } /** - * @param \DTS\eBaySDK\Browse\Types\GetItemFeedRestRequest $request + * @param \DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestRequest $request * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getItemFeedAsync(\DTS\eBaySDK\Browse\Types\GetItemFeedRestRequest $request) + public function getItemByLegacyIdAsync(\DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestRequest $request) { - return $this->callOperationAsync('getItemFeed', $request); + return $this->callOperationAsync('GetItemByLegacyId', $request); } /** - * @param \DTS\eBaySDK\Browse\Types\GetItemGroupRestRequest $request - * @return \DTS\eBaySDK\Browse\Types\GetItemGroupRestResponse + * @param \DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestRequest $request + * @return \DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestResponse */ - public function getItemGroup(\DTS\eBaySDK\Browse\Types\GetItemGroupRestRequest $request) + public function getItemsByItemGroup(\DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestRequest $request) { - return $this->getItemGroupAsync($request)->wait(); + return $this->getItemsByItemGroupAsync($request)->wait(); } /** - * @param \DTS\eBaySDK\Browse\Types\GetItemGroupRestRequest $request + * @param \DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestRequest $request * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getItemGroupAsync(\DTS\eBaySDK\Browse\Types\GetItemGroupRestRequest $request) + public function getItemsByItemGroupAsync(\DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestRequest $request) { - return $this->callOperationAsync('getItemGroup', $request); + return $this->callOperationAsync('GetItemsByItemGroup', $request); } /** @@ -160,6 +170,6 @@ public function searchForItems(\DTS\eBaySDK\Browse\Types\SearchForItemsRestReque */ public function searchForItemsAsync(\DTS\eBaySDK\Browse\Types\SearchForItemsRestRequest $request) { - return $this->callOperationAsync('searchForItems', $request); + return $this->callOperationAsync('SearchForItems', $request); } } diff --git a/src/Browse/Types/AspectDistribution.php b/src/Browse/Types/AspectDistribution.php new file mode 100644 index 000000000..ae9ec033f --- /dev/null +++ b/src/Browse/Types/AspectDistribution.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Browse\Types\AspectValueDistribution', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'aspectValueDistributions' + ], + 'localizedAspectName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'localizedAspectName' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/AspectFilter.php b/src/Browse/Types/AspectFilter.php new file mode 100644 index 000000000..b7edfb953 --- /dev/null +++ b/src/Browse/Types/AspectFilter.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'filters' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\FilterField', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'filters' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/MarketingPrice_0.php b/src/Browse/Types/AspectValueDistribution.php similarity index 67% rename from src/Browse/Types/MarketingPrice_0.php rename to src/Browse/Types/AspectValueDistribution.php index 374c8cfea..5960bf820 100644 --- a/src/Browse/Types/MarketingPrice_0.php +++ b/src/Browse/Types/AspectValueDistribution.php @@ -12,33 +12,33 @@ /** * - * @property \DTS\eBaySDK\Browse\Types\Amount_0 $discountAmount - * @property string $discountPercentage - * @property \DTS\eBaySDK\Browse\Types\Amount_0 $originalPrice + * @property string $localizedAspectValue + * @property integer $matchCount + * @property string $refinementHref */ -class MarketingPrice_0 extends \DTS\eBaySDK\Types\BaseType +class AspectValueDistribution extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'discountAmount' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount_0', + 'localizedAspectValue' => [ + 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'discountAmount' + 'elementName' => 'localizedAspectValue' ], - 'discountPercentage' => [ - 'type' => 'string', + 'matchCount' => [ + 'type' => 'integer', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'discountPercentage' + 'elementName' => 'matchCount' ], - 'originalPrice' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount_0', + 'refinementHref' => [ + 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'originalPrice' + 'elementName' => 'refinementHref' ] ]; diff --git a/src/Browse/Types/GetItemFeedRestRequest.php b/src/Browse/Types/BuyingOptionDistribution.php similarity index 74% rename from src/Browse/Types/GetItemFeedRestRequest.php rename to src/Browse/Types/BuyingOptionDistribution.php index df068dcee..1195ea83f 100644 --- a/src/Browse/Types/GetItemFeedRestRequest.php +++ b/src/Browse/Types/BuyingOptionDistribution.php @@ -12,33 +12,33 @@ /** * - * @property string $category_id - * @property string $date - * @property string $feed_type + * @property string $buyingOption + * @property integer $matchCount + * @property string $refinementHref */ -class GetItemFeedRestRequest extends \DTS\eBaySDK\Types\BaseType +class BuyingOptionDistribution extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'category_id' => [ + 'buyingOption' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'category_id' + 'elementName' => 'buyingOption' ], - 'date' => [ - 'type' => 'string', + 'matchCount' => [ + 'type' => 'integer', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'date' + 'elementName' => 'matchCount' ], - 'feed_type' => [ + 'refinementHref' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'feed_type' + 'elementName' => 'refinementHref' ] ]; diff --git a/src/Browse/Types/CategoryDistribution.php b/src/Browse/Types/CategoryDistribution.php new file mode 100644 index 000000000..5bb465831 --- /dev/null +++ b/src/Browse/Types/CategoryDistribution.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryName' + ], + 'matchCount' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'matchCount' + ], + 'refinementHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'refinementHref' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/CommonDescriptions.php b/src/Browse/Types/CommonDescriptions.php new file mode 100644 index 000000000..6b26d7ad0 --- /dev/null +++ b/src/Browse/Types/CommonDescriptions.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'description' + ], + 'itemIds' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'itemIds' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/ConditionDistribution.php b/src/Browse/Types/ConditionDistribution.php new file mode 100644 index 000000000..03b8bc976 --- /dev/null +++ b/src/Browse/Types/ConditionDistribution.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'condition' + ], + 'conditionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'conditionId' + ], + 'matchCount' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'matchCount' + ], + 'refinementHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'refinementHref' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/ConvertedAmount.php b/src/Browse/Types/ConvertedAmount.php new file mode 100644 index 000000000..8a8bd46cf --- /dev/null +++ b/src/Browse/Types/ConvertedAmount.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'convertedFromCurrency' + ], + 'convertedFromValue' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'convertedFromValue' + ], + 'currency' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'currency' + ], + 'value' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'value' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/EstimatedAvailability.php b/src/Browse/Types/EstimatedAvailability.php new file mode 100644 index 000000000..315766f82 --- /dev/null +++ b/src/Browse/Types/EstimatedAvailability.php @@ -0,0 +1,81 @@ + [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'availabilityThreshold' + ], + 'availabilityThresholdType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'availabilityThresholdType' + ], + 'deliveryOptions' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'deliveryOptions' + ], + 'estimatedAvailabilityStatus' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'estimatedAvailabilityStatus' + ], + 'estimatedAvailableQuantity' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'estimatedAvailableQuantity' + ], + 'estimatedSoldQuantity' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'estimatedSoldQuantity' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/GetItemByLegacyIdRestRequest.php b/src/Browse/Types/GetItemByLegacyIdRestRequest.php new file mode 100644 index 000000000..e049d9727 --- /dev/null +++ b/src/Browse/Types/GetItemByLegacyIdRestRequest.php @@ -0,0 +1,60 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'legacy_item_id' + ], + 'legacy_variation_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'legacy_variation_id' + ], + 'legacy_variation_sku' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'legacy_variation_sku' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/GetItemGroupRestResponse.php b/src/Browse/Types/GetItemByLegacyIdRestResponse.php similarity index 96% rename from src/Browse/Types/GetItemGroupRestResponse.php rename to src/Browse/Types/GetItemByLegacyIdRestResponse.php index 525b33094..98622ce88 100644 --- a/src/Browse/Types/GetItemGroupRestResponse.php +++ b/src/Browse/Types/GetItemByLegacyIdRestResponse.php @@ -18,7 +18,7 @@ * @property \DTS\eBaySDK\Browse\Types\ErrorDetailV3[] $errors * @property \DTS\eBaySDK\Browse\Types\ErrorDetailV3[] $warnings */ -class GetItemGroupRestResponse extends \DTS\eBaySDK\Browse\Types\ItemGroup +class GetItemByLegacyIdRestResponse extends \DTS\eBaySDK\Browse\Types\Item { use StatusCodeTrait; use HttpHeadersTrait; diff --git a/src/Browse/Types/GetItemGroupRestRequest.php b/src/Browse/Types/GetItemsByItemGroupRestRequest.php similarity index 94% rename from src/Browse/Types/GetItemGroupRestRequest.php rename to src/Browse/Types/GetItemsByItemGroupRestRequest.php index e9e57c771..5471c90d1 100644 --- a/src/Browse/Types/GetItemGroupRestRequest.php +++ b/src/Browse/Types/GetItemsByItemGroupRestRequest.php @@ -14,7 +14,7 @@ * * @property string $item_group_id */ -class GetItemGroupRestRequest extends \DTS\eBaySDK\Types\BaseType +class GetItemsByItemGroupRestRequest extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. diff --git a/src/Browse/Types/GetItemFeedRestResponse.php b/src/Browse/Types/GetItemsByItemGroupRestResponse.php similarity index 95% rename from src/Browse/Types/GetItemFeedRestResponse.php rename to src/Browse/Types/GetItemsByItemGroupRestResponse.php index 329fc101a..25641ddb0 100644 --- a/src/Browse/Types/GetItemFeedRestResponse.php +++ b/src/Browse/Types/GetItemsByItemGroupRestResponse.php @@ -18,7 +18,7 @@ * @property \DTS\eBaySDK\Browse\Types\ErrorDetailV3[] $errors * @property \DTS\eBaySDK\Browse\Types\ErrorDetailV3[] $warnings */ -class GetItemFeedRestResponse extends \DTS\eBaySDK\Browse\Types\ItemFeedResponse +class GetItemsByItemGroupRestResponse extends \DTS\eBaySDK\Browse\Types\Items { use StatusCodeTrait; use HttpHeadersTrait; diff --git a/src/Browse/Types/Item.php b/src/Browse/Types/Item.php index 184569a86..ef454929b 100644 --- a/src/Browse/Types/Item.php +++ b/src/Browse/Types/Item.php @@ -14,16 +14,18 @@ * * @property \DTS\eBaySDK\Browse\Types\Image[] $additionalImages * @property string $ageGroup - * @property \DTS\eBaySDK\Browse\Enums\AvailabilityStatusEnum $availabilityStatusForShipToHome * @property integer $bidCount * @property string $brand * @property string[] $buyingOptions * @property string $categoryPath * @property string $color * @property string $condition - * @property \DTS\eBaySDK\Browse\Types\Amount $currentBidPrice + * @property string $conditionId + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $currentBidPrice * @property string $description * @property string $energyEfficiencyClass + * @property string $epid + * @property \DTS\eBaySDK\Browse\Types\EstimatedAvailability[] $estimatedAvailabilities * @property string $gender * @property string $gtin * @property \DTS\eBaySDK\Browse\Types\Image $image @@ -37,21 +39,22 @@ * @property string $material * @property string $mpn * @property string $pattern - * @property \DTS\eBaySDK\Browse\Types\Amount $price + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $price * @property \DTS\eBaySDK\Browse\Enums\PriceDisplayConditionEnum $priceDisplayCondition - * @property string $primaryItemGroupHref - * @property string $primaryItemGroupId + * @property \DTS\eBaySDK\Browse\Types\ItemGroupSummary $primaryItemGroup * @property \DTS\eBaySDK\Browse\Types\ReviewRating $primaryProductReviewRating + * @property string $productFicheWebUrl * @property integer $quantityLimitPerBuyer - * @property integer $quantitySold * @property \DTS\eBaySDK\Browse\Types\ItemReturnTerms $returnTerms * @property \DTS\eBaySDK\Browse\Types\Seller $seller * @property \DTS\eBaySDK\Browse\Types\ShippingOption[] $shippingOptions + * @property \DTS\eBaySDK\Browse\Types\ShipToLocations $shipToLocations * @property string $shortDescription * @property string $size * @property string $sizeSystem * @property string $sizeType * @property string $subtitle + * @property \DTS\eBaySDK\Browse\Types\Taxes[] $taxes * @property string $title * @property boolean $topRatedBuyingExperience * @property integer $uniqueBidderCount @@ -75,12 +78,6 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'ageGroup' ], - 'availabilityStatusForShipToHome' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'availabilityStatusForShipToHome' - ], 'bidCount' => [ 'type' => 'integer', 'repeatable' => false, @@ -117,8 +114,14 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'condition' ], + 'conditionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'conditionId' + ], 'currentBidPrice' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'currentBidPrice' @@ -135,6 +138,18 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'energyEfficiencyClass' ], + 'epid' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'epid' + ], + 'estimatedAvailabilities' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\EstimatedAvailability', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'estimatedAvailabilities' + ], 'gender' => [ 'type' => 'string', 'repeatable' => false, @@ -214,7 +229,7 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'pattern' ], 'price' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'price' @@ -225,17 +240,11 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'priceDisplayCondition' ], - 'primaryItemGroupHref' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'primaryItemGroupHref' - ], - 'primaryItemGroupId' => [ - 'type' => 'string', + 'primaryItemGroup' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\ItemGroupSummary', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'primaryItemGroupId' + 'elementName' => 'primaryItemGroup' ], 'primaryProductReviewRating' => [ 'type' => 'DTS\eBaySDK\Browse\Types\ReviewRating', @@ -243,17 +252,17 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'primaryProductReviewRating' ], - 'quantityLimitPerBuyer' => [ - 'type' => 'integer', + 'productFicheWebUrl' => [ + 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'quantityLimitPerBuyer' + 'elementName' => 'productFicheWebUrl' ], - 'quantitySold' => [ + 'quantityLimitPerBuyer' => [ 'type' => 'integer', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'quantitySold' + 'elementName' => 'quantityLimitPerBuyer' ], 'returnTerms' => [ 'type' => 'DTS\eBaySDK\Browse\Types\ItemReturnTerms', @@ -273,6 +282,12 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'shippingOptions' ], + 'shipToLocations' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\ShipToLocations', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shipToLocations' + ], 'shortDescription' => [ 'type' => 'string', 'repeatable' => false, @@ -303,6 +318,12 @@ class Item extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'subtitle' ], + 'taxes' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\Taxes', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'taxes' + ], 'title' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/Browse/Types/ItemDigest.php b/src/Browse/Types/ItemDigest.php deleted file mode 100644 index 6691fb79e..000000000 --- a/src/Browse/Types/ItemDigest.php +++ /dev/null @@ -1,165 +0,0 @@ - [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'ageGroup' - ], - 'availabilityStatusForShipToHome' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'availabilityStatusForShipToHome' - ], - 'brand' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'brand' - ], - 'color' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'color' - ], - 'gender' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'gender' - ], - 'image' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Image', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'image' - ], - 'itemHref' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'itemHref' - ], - 'itemId' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'itemId' - ], - 'localizedAspects' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\TypedNameValue', - 'repeatable' => true, - 'attribute' => false, - 'elementName' => 'localizedAspects' - ], - 'material' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'material' - ], - 'pattern' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'pattern' - ], - 'price' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'price' - ], - 'priceDisplayCondition' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'priceDisplayCondition' - ], - 'quantitySold' => [ - 'type' => 'integer', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'quantitySold' - ], - 'size' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'size' - ], - 'sizeSystem' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'sizeSystem' - ], - 'sizeType' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'sizeType' - ], - 'title' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'title' - ] - ]; - - /** - * @param array $values Optional properties and values to assign to the object. - */ - public function __construct(array $values = []) - { - list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); - - parent::__construct($parentValues); - - if (!array_key_exists(__CLASS__, self::$properties)) { - self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); - } - - $this->setValues(__CLASS__, $childValues); - } -} diff --git a/src/Browse/Types/ItemFeed.php b/src/Browse/Types/ItemFeed.php deleted file mode 100644 index 4230e420a..000000000 --- a/src/Browse/Types/ItemFeed.php +++ /dev/null @@ -1,221 +0,0 @@ - [ - 'type' => 'string', - 'repeatable' => true, - 'attribute' => false, - 'elementName' => 'additionalImageUrls' - ], - 'ageGroup' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'ageGroup' - ], - 'brand' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'brand' - ], - 'category' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'category' - ], - 'categoryId' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'categoryId' - ], - 'color' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'color' - ], - 'condition' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'condition' - ], - 'conditionId' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'conditionId' - ], - 'description' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'description' - ], - 'gender' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'gender' - ], - 'gtin' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'gtin' - ], - 'imageUrl' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'imageUrl' - ], - 'itemEndDate' => [ - 'type' => 'DateTime', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'itemEndDate' - ], - 'itemId' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'itemId' - ], - 'material' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'material' - ], - 'mpn' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'mpn' - ], - 'priceCurrency' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'priceCurrency' - ], - 'priceValue' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'priceValue' - ], - 'quantity' => [ - 'type' => 'integer', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'quantity' - ], - 'sellerFeedbackPercentage' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'sellerFeedbackPercentage' - ], - 'sellerFeedbackScore' => [ - 'type' => 'integer', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'sellerFeedbackScore' - ], - 'sellerUsername' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'sellerUsername' - ], - 'shipsTo' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'shipsTo' - ], - 'size' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'size' - ], - 'sizeType' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'sizeType' - ], - 'title' => [ - 'type' => 'string', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'title' - ] - ]; - - /** - * @param array $values Optional properties and values to assign to the object. - */ - public function __construct(array $values = []) - { - list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); - - parent::__construct($parentValues); - - if (!array_key_exists(__CLASS__, self::$properties)) { - self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); - } - - $this->setValues(__CLASS__, $childValues); - } -} diff --git a/src/Browse/Types/ItemGroupSummary.php b/src/Browse/Types/ItemGroupSummary.php new file mode 100644 index 000000000..3ecab9701 --- /dev/null +++ b/src/Browse/Types/ItemGroupSummary.php @@ -0,0 +1,81 @@ + [ + 'type' => 'DTS\eBaySDK\Browse\Types\Image', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'itemGroupAdditionalImages' + ], + 'itemGroupHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemGroupHref' + ], + 'itemGroupId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemGroupId' + ], + 'itemGroupImage' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\Image', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemGroupImage' + ], + 'itemGroupTitle' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemGroupTitle' + ], + 'itemGroupType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemGroupType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/ItemSummary.php b/src/Browse/Types/ItemSummary.php index d1d094c62..657c81037 100644 --- a/src/Browse/Types/ItemSummary.php +++ b/src/Browse/Types/ItemSummary.php @@ -17,23 +17,26 @@ * @property string[] $buyingOptions * @property \DTS\eBaySDK\Browse\Types\Category[] $categories * @property string $condition - * @property \DTS\eBaySDK\Browse\Types\Amount_0 $currentBidPrice + * @property string $conditionId + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $currentBidPrice * @property \DTS\eBaySDK\Browse\Types\TargetLocation $distanceFromPickupLocation * @property string $energyEfficiencyClass + * @property string $epid * @property \DTS\eBaySDK\Browse\Types\Image $image * @property string $itemAffiliateWebUrl * @property string $itemGroupHref + * @property string $itemGroupType + * @property string $itemHref * @property string $itemId * @property \DTS\eBaySDK\Browse\Types\ItemLocationImpl $itemLocation * @property string $itemWebUrl - * @property \DTS\eBaySDK\Browse\Types\MarketingPrice_0 $marketingPrice + * @property \DTS\eBaySDK\Browse\Types\MarketingPrice $marketingPrice * @property \DTS\eBaySDK\Browse\Types\PickupOptionSummary[] $pickupOptions - * @property \DTS\eBaySDK\Browse\Types\Amount_0 $price + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $price * @property \DTS\eBaySDK\Browse\Types\Seller $seller * @property \DTS\eBaySDK\Browse\Types\ShippingOptionSummary[] $shippingOptions * @property \DTS\eBaySDK\Browse\Types\Image[] $thumbnailImages * @property string $title - * @property boolean $topRatedBuyingExperience */ class ItemSummary extends \DTS\eBaySDK\Types\BaseType { @@ -71,8 +74,14 @@ class ItemSummary extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'condition' ], + 'conditionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'conditionId' + ], 'currentBidPrice' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount_0', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'currentBidPrice' @@ -89,6 +98,12 @@ class ItemSummary extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'energyEfficiencyClass' ], + 'epid' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'epid' + ], 'image' => [ 'type' => 'DTS\eBaySDK\Browse\Types\Image', 'repeatable' => false, @@ -107,6 +122,18 @@ class ItemSummary extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'itemGroupHref' ], + 'itemGroupType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemGroupType' + ], + 'itemHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemHref' + ], 'itemId' => [ 'type' => 'string', 'repeatable' => false, @@ -126,7 +153,7 @@ class ItemSummary extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'itemWebUrl' ], 'marketingPrice' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\MarketingPrice_0', + 'type' => 'DTS\eBaySDK\Browse\Types\MarketingPrice', 'repeatable' => false, 'attribute' => false, 'elementName' => 'marketingPrice' @@ -138,7 +165,7 @@ class ItemSummary extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'pickupOptions' ], 'price' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount_0', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'price' @@ -166,12 +193,6 @@ class ItemSummary extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'title' - ], - 'topRatedBuyingExperience' => [ - 'type' => 'boolean', - 'repeatable' => false, - 'attribute' => false, - 'elementName' => 'topRatedBuyingExperience' ] ]; diff --git a/src/Browse/Types/Items.php b/src/Browse/Types/Items.php new file mode 100644 index 000000000..0005c52ac --- /dev/null +++ b/src/Browse/Types/Items.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Browse\Types\CommonDescriptions', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'commonDescriptions' + ], + 'items' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\Item', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'items' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/LegalAddress.php b/src/Browse/Types/LegalAddress.php new file mode 100644 index 000000000..bf419c68e --- /dev/null +++ b/src/Browse/Types/LegalAddress.php @@ -0,0 +1,95 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'addressLine1' + ], + 'addressLine2' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'addressLine2' + ], + 'city' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'city' + ], + 'country' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'country' + ], + 'countryName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'countryName' + ], + 'county' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'county' + ], + 'postalCode' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'postalCode' + ], + 'stateOrProvince' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'stateOrProvince' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/MarketingPrice.php b/src/Browse/Types/MarketingPrice.php index 8fb13ba78..63b2a74b0 100644 --- a/src/Browse/Types/MarketingPrice.php +++ b/src/Browse/Types/MarketingPrice.php @@ -12,9 +12,9 @@ /** * - * @property \DTS\eBaySDK\Browse\Types\Amount $discountAmount + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $discountAmount * @property string $discountPercentage - * @property \DTS\eBaySDK\Browse\Types\Amount $originalPrice + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $originalPrice */ class MarketingPrice extends \DTS\eBaySDK\Types\BaseType { @@ -23,7 +23,7 @@ class MarketingPrice extends \DTS\eBaySDK\Types\BaseType */ private static $propertyTypes = [ 'discountAmount' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'discountAmount' @@ -35,7 +35,7 @@ class MarketingPrice extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'discountPercentage' ], 'originalPrice' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'originalPrice' diff --git a/src/Browse/Types/Refinement.php b/src/Browse/Types/Refinement.php new file mode 100644 index 000000000..346e7262f --- /dev/null +++ b/src/Browse/Types/Refinement.php @@ -0,0 +1,74 @@ + [ + 'type' => 'DTS\eBaySDK\Browse\Types\AspectDistribution', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'aspectDistributions' + ], + 'buyingOptionDistributions' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\BuyingOptionDistribution', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'buyingOptionDistributions' + ], + 'categoryDistributions' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\CategoryDistribution', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'categoryDistributions' + ], + 'conditionDistributions' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\ConditionDistribution', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'conditionDistributions' + ], + 'dominantCategoryId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'dominantCategoryId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/Amount.php b/src/Browse/Types/Region.php similarity index 80% rename from src/Browse/Types/Amount.php rename to src/Browse/Types/Region.php index 02b07034e..d97a21f91 100644 --- a/src/Browse/Types/Amount.php +++ b/src/Browse/Types/Region.php @@ -12,26 +12,26 @@ /** * - * @property \DTS\eBaySDK\Browse\Enums\CurrencyCodeEnum $currency - * @property string $value + * @property string $regionName + * @property \DTS\eBaySDK\Browse\Enums\RegionTypeEnum $regionType */ -class Amount extends \DTS\eBaySDK\Types\BaseType +class Region extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'currency' => [ + 'regionName' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'currency' + 'elementName' => 'regionName' ], - 'value' => [ + 'regionType' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'value' + 'elementName' => 'regionType' ] ]; diff --git a/src/Browse/Types/SearchForItemsRestRequest.php b/src/Browse/Types/SearchForItemsRestRequest.php index f8a69afa1..7bbaf7ec4 100644 --- a/src/Browse/Types/SearchForItemsRestRequest.php +++ b/src/Browse/Types/SearchForItemsRestRequest.php @@ -12,6 +12,10 @@ /** * + * @property string $aspect_filter + * @property string $category_ids + * @property string $epid + * @property string $fieldgroups * @property string $filter * @property string $limit * @property string $offset @@ -24,6 +28,30 @@ class SearchForItemsRestRequest extends \DTS\eBaySDK\Types\BaseType * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ + 'aspect_filter' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'aspect_filter' + ], + 'category_ids' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category_ids' + ], + 'epid' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'epid' + ], + 'fieldgroups' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'fieldgroups' + ], 'filter' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/Browse/Types/SearchPagedCollection.php b/src/Browse/Types/SearchPagedCollection.php index 7f45ec732..3fdfcf904 100644 --- a/src/Browse/Types/SearchPagedCollection.php +++ b/src/Browse/Types/SearchPagedCollection.php @@ -18,6 +18,7 @@ * @property string $next * @property integer $offset * @property string $prev + * @property \DTS\eBaySDK\Browse\Types\Refinement $refinement * @property integer $total * @property \DTS\eBaySDK\Browse\Types\ErrorDetailV3[] $warnings */ @@ -63,6 +64,12 @@ class SearchPagedCollection extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'prev' ], + 'refinement' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\Refinement', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'refinement' + ], 'total' => [ 'type' => 'integer', 'repeatable' => false, diff --git a/src/Browse/Types/Seller.php b/src/Browse/Types/Seller.php index 7b06fd0a5..e50bcbfe2 100644 --- a/src/Browse/Types/Seller.php +++ b/src/Browse/Types/Seller.php @@ -15,6 +15,7 @@ * @property string $feedbackPercentage * @property integer $feedbackScore * @property string $sellerAccountType + * @property \DTS\eBaySDK\Browse\Types\SellerLegalInfo $sellerLegalInfo * @property string $username */ class Seller extends \DTS\eBaySDK\Types\BaseType @@ -41,6 +42,12 @@ class Seller extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'sellerAccountType' ], + 'sellerLegalInfo' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\SellerLegalInfo', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'sellerLegalInfo' + ], 'username' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/Browse/Types/ItemGroup.php b/src/Browse/Types/SellerLegalInfo.php similarity index 50% rename from src/Browse/Types/ItemGroup.php rename to src/Browse/Types/SellerLegalInfo.php index a82c4743e..df7e217b0 100644 --- a/src/Browse/Types/ItemGroup.php +++ b/src/Browse/Types/SellerLegalInfo.php @@ -12,89 +12,89 @@ /** * - * @property \DTS\eBaySDK\Browse\Types\Image[] $additionalImages - * @property string $categoryPath - * @property string $description - * @property \DTS\eBaySDK\Browse\Types\Image $image - * @property string $itemGroupId - * @property \DTS\eBaySDK\Browse\Types\ItemDigest[] $items - * @property \DTS\eBaySDK\Browse\Types\ReviewRating $reviewRating - * @property string $shortDescription - * @property string $title - * @property \DTS\eBaySDK\Browse\Types\TypedNameValue[] $variesByLocalizedAspects - * @property \DTS\eBaySDK\Browse\Types\ErrorDetailV3[] $warnings + * @property string $email + * @property string $fax + * @property string $imprint + * @property string $legalContactFirstName + * @property string $legalContactLastName + * @property string $name + * @property string $phone + * @property string $registrationNumber + * @property \DTS\eBaySDK\Browse\Types\LegalAddress $sellerProvidedLegalAddress + * @property string $termsOfService + * @property \DTS\eBaySDK\Browse\Types\VatDetail[] $vatDetails */ -class ItemGroup extends \DTS\eBaySDK\Types\BaseType +class SellerLegalInfo extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'additionalImages' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Image', - 'repeatable' => true, + 'email' => [ + 'type' => 'string', + 'repeatable' => false, 'attribute' => false, - 'elementName' => 'additionalImages' + 'elementName' => 'email' ], - 'categoryPath' => [ + 'fax' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'categoryPath' + 'elementName' => 'fax' ], - 'description' => [ + 'imprint' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'description' + 'elementName' => 'imprint' ], - 'image' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Image', + 'legalContactFirstName' => [ + 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'image' + 'elementName' => 'legalContactFirstName' ], - 'itemGroupId' => [ + 'legalContactLastName' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'itemGroupId' + 'elementName' => 'legalContactLastName' ], - 'items' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\ItemDigest', - 'repeatable' => true, + 'name' => [ + 'type' => 'string', + 'repeatable' => false, 'attribute' => false, - 'elementName' => 'items' + 'elementName' => 'name' ], - 'reviewRating' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\ReviewRating', + 'phone' => [ + 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'reviewRating' + 'elementName' => 'phone' ], - 'shortDescription' => [ + 'registrationNumber' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shortDescription' + 'elementName' => 'registrationNumber' ], - 'title' => [ - 'type' => 'string', + 'sellerProvidedLegalAddress' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\LegalAddress', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'title' + 'elementName' => 'sellerProvidedLegalAddress' ], - 'variesByLocalizedAspects' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\TypedNameValue', - 'repeatable' => true, + 'termsOfService' => [ + 'type' => 'string', + 'repeatable' => false, 'attribute' => false, - 'elementName' => 'variesByLocalizedAspects' + 'elementName' => 'termsOfService' ], - 'warnings' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\ErrorDetailV3', + 'vatDetails' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\VatDetail', 'repeatable' => true, 'attribute' => false, - 'elementName' => 'warnings' + 'elementName' => 'vatDetails' ] ]; diff --git a/src/Browse/Types/Amount_0.php b/src/Browse/Types/ShipToLocation.php similarity index 80% rename from src/Browse/Types/Amount_0.php rename to src/Browse/Types/ShipToLocation.php index 21e0927ec..5347ad4e9 100644 --- a/src/Browse/Types/Amount_0.php +++ b/src/Browse/Types/ShipToLocation.php @@ -12,26 +12,26 @@ /** * - * @property \DTS\eBaySDK\Browse\Enums\CurrencyCodeEnum $currency - * @property string $value + * @property \DTS\eBaySDK\Browse\Enums\CountryCodeEnum $country + * @property string $postalCode */ -class Amount_0 extends \DTS\eBaySDK\Types\BaseType +class ShipToLocation extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'currency' => [ + 'country' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'currency' + 'elementName' => 'country' ], - 'value' => [ + 'postalCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'value' + 'elementName' => 'postalCode' ] ]; diff --git a/src/Browse/Types/ShipToLocations.php b/src/Browse/Types/ShipToLocations.php new file mode 100644 index 000000000..051b67d30 --- /dev/null +++ b/src/Browse/Types/ShipToLocations.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Browse\Types\Region', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'regionExcluded' + ], + 'regionIncluded' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\Region', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'regionIncluded' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/ShippingOption.php b/src/Browse/Types/ShippingOption.php index bbe0cfb13..71c7016d7 100644 --- a/src/Browse/Types/ShippingOption.php +++ b/src/Browse/Types/ShippingOption.php @@ -12,9 +12,16 @@ /** * - * @property string $shippingCarrierName - * @property \DTS\eBaySDK\Browse\Types\Amount $shippingCost - * @property string $shippingServiceName + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $additionalShippingCostPerUnit + * @property string $cutOffDateUsedForEstimate + * @property string $maxEstimatedDeliveryDate + * @property string $minEstimatedDeliveryDate + * @property integer $quantityUsedForEstimate + * @property string $shippingCarrierCode + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $shippingCost + * @property string $shippingCostType + * @property string $shippingServiceCode + * @property \DTS\eBaySDK\Browse\Types\ShipToLocation $shipToLocationUsedForEstimate * @property string $trademarkSymbol * @property string $type */ @@ -24,23 +31,65 @@ class ShippingOption extends \DTS\eBaySDK\Types\BaseType * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'shippingCarrierName' => [ + 'additionalShippingCostPerUnit' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'additionalShippingCostPerUnit' + ], + 'cutOffDateUsedForEstimate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'cutOffDateUsedForEstimate' + ], + 'maxEstimatedDeliveryDate' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingCarrierName' + 'elementName' => 'maxEstimatedDeliveryDate' + ], + 'minEstimatedDeliveryDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'minEstimatedDeliveryDate' + ], + 'quantityUsedForEstimate' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'quantityUsedForEstimate' + ], + 'shippingCarrierCode' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shippingCarrierCode' ], 'shippingCost' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'shippingCost' ], - 'shippingServiceName' => [ + 'shippingCostType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shippingCostType' + ], + 'shippingServiceCode' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'shippingServiceName' + 'elementName' => 'shippingServiceCode' + ], + 'shipToLocationUsedForEstimate' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\ShipToLocation', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shipToLocationUsedForEstimate' ], 'trademarkSymbol' => [ 'type' => 'string', diff --git a/src/Browse/Types/ShippingOptionSummary.php b/src/Browse/Types/ShippingOptionSummary.php index 0b2688bab..11b674a8c 100644 --- a/src/Browse/Types/ShippingOptionSummary.php +++ b/src/Browse/Types/ShippingOptionSummary.php @@ -12,7 +12,9 @@ /** * - * @property \DTS\eBaySDK\Browse\Types\Amount_0 $shippingCost + * @property string $maxEstimatedDeliveryDate + * @property string $minEstimatedDeliveryDate + * @property \DTS\eBaySDK\Browse\Types\ConvertedAmount $shippingCost * @property string $shippingCostType */ class ShippingOptionSummary extends \DTS\eBaySDK\Types\BaseType @@ -21,8 +23,20 @@ class ShippingOptionSummary extends \DTS\eBaySDK\Types\BaseType * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ + 'maxEstimatedDeliveryDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'maxEstimatedDeliveryDate' + ], + 'minEstimatedDeliveryDate' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'minEstimatedDeliveryDate' + ], 'shippingCost' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\Amount_0', + 'type' => 'DTS\eBaySDK\Browse\Types\ConvertedAmount', 'repeatable' => false, 'attribute' => false, 'elementName' => 'shippingCost' diff --git a/src/Browse/Types/TaxJurisdiction.php b/src/Browse/Types/TaxJurisdiction.php new file mode 100644 index 000000000..9356d4c90 --- /dev/null +++ b/src/Browse/Types/TaxJurisdiction.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Browse\Types\Region', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'region' + ], + 'taxJurisdictionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'taxJurisdictionId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/ItemFeedResponse.php b/src/Browse/Types/TaxType.php similarity index 74% rename from src/Browse/Types/ItemFeedResponse.php rename to src/Browse/Types/TaxType.php index 655818a87..1af6ae56f 100644 --- a/src/Browse/Types/ItemFeedResponse.php +++ b/src/Browse/Types/TaxType.php @@ -12,20 +12,13 @@ /** * - * @property \DTS\eBaySDK\Browse\Types\ItemFeed[] $itemFeed */ -class ItemFeedResponse extends \DTS\eBaySDK\Types\BaseType +class TaxType extends \DTS\eBaySDK\Types\BaseType { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ - 'itemFeed' => [ - 'type' => 'DTS\eBaySDK\Browse\Types\ItemFeed', - 'repeatable' => true, - 'attribute' => false, - 'elementName' => 'itemFeed' - ] ]; /** diff --git a/src/Browse/Types/Taxes.php b/src/Browse/Types/Taxes.php new file mode 100644 index 000000000..e0e1ded99 --- /dev/null +++ b/src/Browse/Types/Taxes.php @@ -0,0 +1,74 @@ + [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'includedInPrice' + ], + 'shippingAndHandlingTaxed' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'shippingAndHandlingTaxed' + ], + 'taxJurisdiction' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\TaxJurisdiction', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'taxJurisdiction' + ], + 'taxPercentage' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'taxPercentage' + ], + 'taxType' => [ + 'type' => 'DTS\eBaySDK\Browse\Types\TaxType', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'taxType' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Browse/Types/TypedNameValue.php b/src/Browse/Types/TypedNameValue.php index a5342ef89..30c54eee8 100644 --- a/src/Browse/Types/TypedNameValue.php +++ b/src/Browse/Types/TypedNameValue.php @@ -14,7 +14,7 @@ * * @property string $name * @property \DTS\eBaySDK\Browse\Enums\ValueTypeEnum $type - * @property mixed $value + * @property string $value */ class TypedNameValue extends \DTS\eBaySDK\Types\BaseType { @@ -35,7 +35,7 @@ class TypedNameValue extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'type' ], 'value' => [ - 'type' => 'any', + 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'value' diff --git a/src/Browse/Types/VatDetail.php b/src/Browse/Types/VatDetail.php new file mode 100644 index 000000000..c0337829c --- /dev/null +++ b/src/Browse/Types/VatDetail.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'issuingCountry' + ], + 'vatId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'vatId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/test/Browse/Enums/AvailabilityThresholdEnumTest.php b/test/Browse/Enums/AvailabilityThresholdEnumTest.php new file mode 100644 index 000000000..694e7c665 --- /dev/null +++ b/test/Browse/Enums/AvailabilityThresholdEnumTest.php @@ -0,0 +1,28 @@ +obj = new AvailabilityThresholdEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Enums\AvailabilityThresholdEnum', $this->obj); + } +} diff --git a/test/Browse/Enums/DeliveryOptionsEnumTest.php b/test/Browse/Enums/DeliveryOptionsEnumTest.php new file mode 100644 index 000000000..f7870a843 --- /dev/null +++ b/test/Browse/Enums/DeliveryOptionsEnumTest.php @@ -0,0 +1,28 @@ +obj = new DeliveryOptionsEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Enums\DeliveryOptionsEnum', $this->obj); + } +} diff --git a/test/Browse/Enums/ItemGroupTypeEnumTest.php b/test/Browse/Enums/ItemGroupTypeEnumTest.php new file mode 100644 index 000000000..963f805b7 --- /dev/null +++ b/test/Browse/Enums/ItemGroupTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new ItemGroupTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Enums\ItemGroupTypeEnum', $this->obj); + } +} diff --git a/test/Browse/Enums/RegionTypeEnumTest.php b/test/Browse/Enums/RegionTypeEnumTest.php new file mode 100644 index 000000000..64b30c1d1 --- /dev/null +++ b/test/Browse/Enums/RegionTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new RegionTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Enums\RegionTypeEnum', $this->obj); + } +} diff --git a/test/Browse/Types/ItemFeedResponseTest.php b/test/Browse/Types/AspectDistributionTest.php similarity index 66% rename from test/Browse/Types/ItemFeedResponseTest.php rename to test/Browse/Types/AspectDistributionTest.php index dc5363280..dd4d4d5d8 100644 --- a/test/Browse/Types/ItemFeedResponseTest.php +++ b/test/Browse/Types/AspectDistributionTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\ItemFeedResponse; +use DTS\eBaySDK\Browse\Types\AspectDistribution; -class ItemFeedResponseTest extends \PHPUnit_Framework_TestCase +class AspectDistributionTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new ItemFeedResponse(); + $this->obj = new AspectDistribution(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemFeedResponse', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\AspectDistribution', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/AspectFilterTest.php b/test/Browse/Types/AspectFilterTest.php new file mode 100644 index 000000000..06070cbad --- /dev/null +++ b/test/Browse/Types/AspectFilterTest.php @@ -0,0 +1,33 @@ +obj = new AspectFilter(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\AspectFilter', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/AspectValueDistributionTest.php b/test/Browse/Types/AspectValueDistributionTest.php new file mode 100644 index 000000000..547e1e7df --- /dev/null +++ b/test/Browse/Types/AspectValueDistributionTest.php @@ -0,0 +1,33 @@ +obj = new AspectValueDistribution(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\AspectValueDistribution', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/BuyingOptionDistributionTest.php b/test/Browse/Types/BuyingOptionDistributionTest.php new file mode 100644 index 000000000..30d4c67b5 --- /dev/null +++ b/test/Browse/Types/BuyingOptionDistributionTest.php @@ -0,0 +1,33 @@ +obj = new BuyingOptionDistribution(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\BuyingOptionDistribution', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/CategoryDistributionTest.php b/test/Browse/Types/CategoryDistributionTest.php new file mode 100644 index 000000000..1e8c8921e --- /dev/null +++ b/test/Browse/Types/CategoryDistributionTest.php @@ -0,0 +1,33 @@ +obj = new CategoryDistribution(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\CategoryDistribution', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/CommonDescriptionsTest.php b/test/Browse/Types/CommonDescriptionsTest.php new file mode 100644 index 000000000..6019578f8 --- /dev/null +++ b/test/Browse/Types/CommonDescriptionsTest.php @@ -0,0 +1,33 @@ +obj = new CommonDescriptions(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\CommonDescriptions', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/ConditionDistributionTest.php b/test/Browse/Types/ConditionDistributionTest.php new file mode 100644 index 000000000..c7a5ed2cb --- /dev/null +++ b/test/Browse/Types/ConditionDistributionTest.php @@ -0,0 +1,33 @@ +obj = new ConditionDistribution(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ConditionDistribution', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/ConvertedAmountTest.php b/test/Browse/Types/ConvertedAmountTest.php new file mode 100644 index 000000000..b377436e0 --- /dev/null +++ b/test/Browse/Types/ConvertedAmountTest.php @@ -0,0 +1,33 @@ +obj = new ConvertedAmount(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ConvertedAmount', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/EstimatedAvailabilityTest.php b/test/Browse/Types/EstimatedAvailabilityTest.php new file mode 100644 index 000000000..d4f7a66aa --- /dev/null +++ b/test/Browse/Types/EstimatedAvailabilityTest.php @@ -0,0 +1,33 @@ +obj = new EstimatedAvailability(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\EstimatedAvailability', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/GetItemGroupRestRequestTest.php b/test/Browse/Types/GetItemByLegacyIdRestRequestTest.php similarity index 70% rename from test/Browse/Types/GetItemGroupRestRequestTest.php rename to test/Browse/Types/GetItemByLegacyIdRestRequestTest.php index 609bc140a..68b0b7270 100644 --- a/test/Browse/Types/GetItemGroupRestRequestTest.php +++ b/test/Browse/Types/GetItemByLegacyIdRestRequestTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\GetItemGroupRestRequest; +use DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestRequest; -class GetItemGroupRestRequestTest extends \PHPUnit_Framework_TestCase +class GetItemByLegacyIdRestRequestTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new GetItemGroupRestRequest(); + $this->obj = new GetItemByLegacyIdRestRequest(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemGroupRestRequest', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestRequest', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/GetItemGroupRestResponseTest.php b/test/Browse/Types/GetItemByLegacyIdRestResponseTest.php similarity index 55% rename from test/Browse/Types/GetItemGroupRestResponseTest.php rename to test/Browse/Types/GetItemByLegacyIdRestResponseTest.php index 24a2ad491..ee193e12f 100644 --- a/test/Browse/Types/GetItemGroupRestResponseTest.php +++ b/test/Browse/Types/GetItemByLegacyIdRestResponseTest.php @@ -10,24 +10,24 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\GetItemGroupRestResponse; +use DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestResponse; -class GetItemGroupRestResponseTest extends \PHPUnit_Framework_TestCase +class GetItemByLegacyIdRestResponseTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new GetItemGroupRestResponse(); + $this->obj = new GetItemByLegacyIdRestResponse(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemGroupRestResponse', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemByLegacyIdRestResponse', $this->obj); } - public function testExtendsItemGroup() + public function testExtendsItem() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemGroup', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Item', $this->obj); } } diff --git a/test/Browse/Types/GetItemFeedRestRequestTest.php b/test/Browse/Types/GetItemsByItemGroupRestRequestTest.php similarity index 70% rename from test/Browse/Types/GetItemFeedRestRequestTest.php rename to test/Browse/Types/GetItemsByItemGroupRestRequestTest.php index 6d7ff2bd8..207286f03 100644 --- a/test/Browse/Types/GetItemFeedRestRequestTest.php +++ b/test/Browse/Types/GetItemsByItemGroupRestRequestTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\GetItemFeedRestRequest; +use DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestRequest; -class GetItemFeedRestRequestTest extends \PHPUnit_Framework_TestCase +class GetItemsByItemGroupRestRequestTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new GetItemFeedRestRequest(); + $this->obj = new GetItemsByItemGroupRestRequest(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemFeedRestRequest', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestRequest', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/GetItemFeedRestResponseTest.php b/test/Browse/Types/GetItemsByItemGroupRestResponseTest.php similarity index 55% rename from test/Browse/Types/GetItemFeedRestResponseTest.php rename to test/Browse/Types/GetItemsByItemGroupRestResponseTest.php index ff0c26625..973eddd82 100644 --- a/test/Browse/Types/GetItemFeedRestResponseTest.php +++ b/test/Browse/Types/GetItemsByItemGroupRestResponseTest.php @@ -10,24 +10,24 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\GetItemFeedRestResponse; +use DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestResponse; -class GetItemFeedRestResponseTest extends \PHPUnit_Framework_TestCase +class GetItemsByItemGroupRestResponseTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new GetItemFeedRestResponse(); + $this->obj = new GetItemsByItemGroupRestResponse(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemFeedRestResponse', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\GetItemsByItemGroupRestResponse', $this->obj); } - public function testExtendsItemFeedResponse() + public function testExtendsItems() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemFeedResponse', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Items', $this->obj); } } diff --git a/test/Browse/Types/ItemGroupTest.php b/test/Browse/Types/ItemGroupSummaryTest.php similarity index 75% rename from test/Browse/Types/ItemGroupTest.php rename to test/Browse/Types/ItemGroupSummaryTest.php index e92435391..821c037fa 100644 --- a/test/Browse/Types/ItemGroupTest.php +++ b/test/Browse/Types/ItemGroupSummaryTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\ItemGroup; +use DTS\eBaySDK\Browse\Types\ItemGroupSummary; -class ItemGroupTest extends \PHPUnit_Framework_TestCase +class ItemGroupSummaryTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new ItemGroup(); + $this->obj = new ItemGroupSummary(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemGroup', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemGroupSummary', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/AmountTest.php b/test/Browse/Types/ItemsTest.php similarity index 70% rename from test/Browse/Types/AmountTest.php rename to test/Browse/Types/ItemsTest.php index e55d5c8a1..163a35b98 100644 --- a/test/Browse/Types/AmountTest.php +++ b/test/Browse/Types/ItemsTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\Amount; +use DTS\eBaySDK\Browse\Types\Items; -class AmountTest extends \PHPUnit_Framework_TestCase +class ItemsTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new Amount(); + $this->obj = new Items(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Amount', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Items', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/LegalAddressTest.php b/test/Browse/Types/LegalAddressTest.php new file mode 100644 index 000000000..1124bdaf3 --- /dev/null +++ b/test/Browse/Types/LegalAddressTest.php @@ -0,0 +1,33 @@ +obj = new LegalAddress(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\LegalAddress', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/MarketingPrice_0Test.php b/test/Browse/Types/MarketingPrice_0Test.php deleted file mode 100644 index f7983da39..000000000 --- a/test/Browse/Types/MarketingPrice_0Test.php +++ /dev/null @@ -1,33 +0,0 @@ -obj = new MarketingPrice_0(); - } - - public function testCanBeCreated() - { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\MarketingPrice_0', $this->obj); - } - - public function testExtendsBaseType() - { - $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); - } -} diff --git a/test/Browse/Types/ItemDigestTest.php b/test/Browse/Types/RefinementTest.php similarity index 69% rename from test/Browse/Types/ItemDigestTest.php rename to test/Browse/Types/RefinementTest.php index c8a5d7791..ab22b9bc8 100644 --- a/test/Browse/Types/ItemDigestTest.php +++ b/test/Browse/Types/RefinementTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\ItemDigest; +use DTS\eBaySDK\Browse\Types\Refinement; -class ItemDigestTest extends \PHPUnit_Framework_TestCase +class RefinementTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new ItemDigest(); + $this->obj = new Refinement(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemDigest', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Refinement', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/ItemFeedTest.php b/test/Browse/Types/RegionTest.php similarity index 69% rename from test/Browse/Types/ItemFeedTest.php rename to test/Browse/Types/RegionTest.php index a5998d1ba..172396b00 100644 --- a/test/Browse/Types/ItemFeedTest.php +++ b/test/Browse/Types/RegionTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\ItemFeed; +use DTS\eBaySDK\Browse\Types\Region; -class ItemFeedTest extends \PHPUnit_Framework_TestCase +class RegionTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new ItemFeed(); + $this->obj = new Region(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ItemFeed', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Region', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/SellerLegalInfoTest.php b/test/Browse/Types/SellerLegalInfoTest.php new file mode 100644 index 000000000..6b26758cc --- /dev/null +++ b/test/Browse/Types/SellerLegalInfoTest.php @@ -0,0 +1,33 @@ +obj = new SellerLegalInfo(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\SellerLegalInfo', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/ShipToLocationTest.php b/test/Browse/Types/ShipToLocationTest.php new file mode 100644 index 000000000..8e01e0fc8 --- /dev/null +++ b/test/Browse/Types/ShipToLocationTest.php @@ -0,0 +1,33 @@ +obj = new ShipToLocation(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ShipToLocation', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/ShipToLocationsTest.php b/test/Browse/Types/ShipToLocationsTest.php new file mode 100644 index 000000000..a4365e36f --- /dev/null +++ b/test/Browse/Types/ShipToLocationsTest.php @@ -0,0 +1,33 @@ +obj = new ShipToLocations(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\ShipToLocations', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/TaxJurisdictionTest.php b/test/Browse/Types/TaxJurisdictionTest.php new file mode 100644 index 000000000..35dda58ef --- /dev/null +++ b/test/Browse/Types/TaxJurisdictionTest.php @@ -0,0 +1,33 @@ +obj = new TaxJurisdiction(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\TaxJurisdiction', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/Amount_0Test.php b/test/Browse/Types/TaxTypeTest.php similarity index 69% rename from test/Browse/Types/Amount_0Test.php rename to test/Browse/Types/TaxTypeTest.php index 6b3dd9005..93362afb1 100644 --- a/test/Browse/Types/Amount_0Test.php +++ b/test/Browse/Types/TaxTypeTest.php @@ -10,20 +10,20 @@ namespace DTS\eBaySDK\Test\Browse\Types; -use DTS\eBaySDK\Browse\Types\Amount_0; +use DTS\eBaySDK\Browse\Types\TaxType; -class Amount_0Test extends \PHPUnit_Framework_TestCase +class TaxTypeTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { - $this->obj = new Amount_0(); + $this->obj = new TaxType(); } public function testCanBeCreated() { - $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Amount_0', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\TaxType', $this->obj); } public function testExtendsBaseType() diff --git a/test/Browse/Types/TaxesTest.php b/test/Browse/Types/TaxesTest.php new file mode 100644 index 000000000..9a7441898 --- /dev/null +++ b/test/Browse/Types/TaxesTest.php @@ -0,0 +1,33 @@ +obj = new Taxes(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\Taxes', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Browse/Types/VatDetailTest.php b/test/Browse/Types/VatDetailTest.php new file mode 100644 index 000000000..5bd495a00 --- /dev/null +++ b/test/Browse/Types/VatDetailTest.php @@ -0,0 +1,33 @@ +obj = new VatDetail(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Browse\Types\VatDetail', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} From aa52d1ad456c059f9a2e0dc7979ce45f0cea95d7 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 13:50:10 +0100 Subject: [PATCH 08/31] update: improve travis settings --- .travis.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52cbf790a..c5dc22ba6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,15 +4,23 @@ php: - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm -install: - - if test "$TRAVIS_PHP_VERSION" == "7.0"; then echo "xdebug.overload_var_dump = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi +sudo: false + +env: + - COMPOSER_OPTS="" + - COMPOSER_OPTS="--prefer-lowest" -before_script: - - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-source +matrix: + allow_failures: + - php: hhvm + fast_finish: true + +install: + - 'if [ $(phpenv version-name) != "hhvm" ]; then echo "xdebug.overload_var_dump = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi' + - travis_retry composer update $COMPOSER_OPTS --no-interaction --prefer-source script: - make test - From 0b59ac7d007aeb014174fc3cd5eb59f4a85ecd2a Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 14:46:11 +0100 Subject: [PATCH 09/31] fix: added missing enums to postorder\enums\cancelreasonenum --- CHANGELOG.md | 1 + src/PostOrder/Enums/CancelReasonEnum.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd8f6c7a5..ab467fd42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ * Added missing enums to Fulfillment\Enums\OrderPaymentStatusEnum. * Added missing enums to Fulfillment\Enums\PaymentMethodTypeEnum. * Added missing priceDiscount property to Fulfillment\Types\Pricingsummary. +* Added missing enums to PostOrder\Enums\CancelReasonEnum. ## 12.0.0 - 2017-05-23 diff --git a/src/PostOrder/Enums/CancelReasonEnum.php b/src/PostOrder/Enums/CancelReasonEnum.php index 9f3c0f880..a1d18fffa 100644 --- a/src/PostOrder/Enums/CancelReasonEnum.php +++ b/src/PostOrder/Enums/CancelReasonEnum.php @@ -12,9 +12,12 @@ class CancelReasonEnum { + const C_ADDRESS_ISSUE = 'ADDRESS_ISSUE'; + const C_BUYER_ASKED_CANCEL = 'BUYER_ASKED_CANCEL'; const C_BUYER_CANCEL_OR_ADDRESS_ISSUE = 'BUYER_CANCEL_OR_ADDRESS_ISSUE'; const C_FOUND_CHEAPER_PRICE = 'FOUND_CHEAPER_PRICE'; const C_ORDER_MISTAKE = 'ORDER_MISTAKE'; + const C_ORDER_UNPAID = 'ORDER_UNPAID'; const C_OTHER = 'OTHER'; const C_OUT_OF_STOCK_OR_CANNOT_FULFILL = 'OUT_OF_STOCK_OR_CANNOT_FULFILL'; const C_PRICE_TOO_HIGH = 'PRICE_TOO_HIGH'; From 073b3ac1df7d21b5d842f090ecec5303b772b8a8 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 15:28:29 +0100 Subject: [PATCH 10/31] fix: use correct http method for new marketing operations --- src/Marketing/Services/MarketingService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Marketing/Services/MarketingService.php b/src/Marketing/Services/MarketingService.php index 6dfa57a5c..725abc8f0 100644 --- a/src/Marketing/Services/MarketingService.php +++ b/src/Marketing/Services/MarketingService.php @@ -488,14 +488,14 @@ class MarketingService extends \DTS\eBaySDK\Marketing\Services\MarketingBaseServ ] ], 'CreateReportTask' => [ - 'method' => 'GET', + 'method' => 'POST', 'resource' => 'ad_report_task', 'responseClass' => '\DTS\eBaySDK\Marketing\Types\CreateReportTasktRestResponse', 'params' => [ ] ], 'DeleteSpecificReportTask' => [ - 'method' => 'GET', + 'method' => 'DELETE', 'resource' => 'ad_report_task/{report_task_id}', 'responseClass' => '\DTS\eBaySDK\Marketing\Types\DeleteSpecificReportTaskRestResponse', 'params' => [ From 3c2b9957daa7914d2500c431e5cf2b65dda72244 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 31 May 2017 17:16:50 +0100 Subject: [PATCH 11/31] api: support taxonomy api version v1_beta.0.0 --- CHANGELOG.md | 4 + Makefile | 4 + docs/guide/configuration.rst | 8 +- src/Taxonomy/Enums/MarketplaceIdEnum.php | 36 ++++ src/Taxonomy/Services/TaxonomyBaseService.php | 79 +++++++++ src/Taxonomy/Services/TaxonomyService.php | 154 ++++++++++++++++++ src/Taxonomy/Types/AncestorReference.php | 67 ++++++++ src/Taxonomy/Types/BaseCategoryTree.php | 53 ++++++ src/Taxonomy/Types/Category.php | 53 ++++++ src/Taxonomy/Types/CategorySubtree.php | 60 +++++++ src/Taxonomy/Types/CategorySuggestion.php | 67 ++++++++ .../Types/CategorySuggestionResponse.php | 60 +++++++ src/Taxonomy/Types/CategoryTree.php | 67 ++++++++ src/Taxonomy/Types/CategoryTreeNode.php | 74 +++++++++ src/Taxonomy/Types/ErrorDetailV3.php | 102 ++++++++++++ src/Taxonomy/Types/ErrorParameterV3.php | 53 ++++++ .../Types/GetACategorySubtreeRestRequest.php | 53 ++++++ .../Types/GetACategorySubtreeRestResponse.php | 65 ++++++++ .../Types/GetACategoryTreeRestRequest.php | 46 ++++++ .../Types/GetACategoryTreeRestResponse.php | 65 ++++++++ .../GetADefaultCategoryTreeIdRestRequest.php | 46 ++++++ .../GetADefaultCategoryTreeIdRestResponse.php | 65 ++++++++ .../GetSuggestedCategoriesRestRequest.php | 53 ++++++ .../GetSuggestedCategoriesRestResponse.php | 65 ++++++++ test/Taxonomy/Enums/MarketplaceIdEnumTest.php | 28 ++++ test/Taxonomy/Mocks/Service.php | 27 +++ test/Taxonomy/Services/ServiceTest.php | 68 ++++++++ test/Taxonomy/Types/AncestorReferenceTest.php | 33 ++++ test/Taxonomy/Types/BaseCategoryTreeTest.php | 33 ++++ test/Taxonomy/Types/CategorySubtreeTest.php | 33 ++++ .../Types/CategorySuggestionResponseTest.php | 33 ++++ .../Taxonomy/Types/CategorySuggestionTest.php | 33 ++++ test/Taxonomy/Types/CategoryTest.php | 33 ++++ test/Taxonomy/Types/CategoryTreeNodeTest.php | 33 ++++ test/Taxonomy/Types/CategoryTreeTest.php | 33 ++++ test/Taxonomy/Types/ErrorDetailV3Test.php | 33 ++++ test/Taxonomy/Types/ErrorParameterV3Test.php | 33 ++++ .../GetACategorySubtreeRestRequestTest.php | 33 ++++ .../GetACategorySubtreeRestResponseTest.php | 33 ++++ .../Types/GetACategoryTreeRestRequestTest.php | 33 ++++ .../GetACategoryTreeRestResponseTest.php | 33 ++++ ...tADefaultCategoryTreeIdRestRequestTest.php | 33 ++++ ...ADefaultCategoryTreeIdRestResponseTest.php | 33 ++++ .../GetSuggestedCategoriesRestRequestTest.php | 33 ++++ ...GetSuggestedCategoriesRestResponseTest.php | 33 ++++ 45 files changed, 2112 insertions(+), 4 deletions(-) create mode 100644 src/Taxonomy/Enums/MarketplaceIdEnum.php create mode 100644 src/Taxonomy/Services/TaxonomyBaseService.php create mode 100644 src/Taxonomy/Services/TaxonomyService.php create mode 100644 src/Taxonomy/Types/AncestorReference.php create mode 100644 src/Taxonomy/Types/BaseCategoryTree.php create mode 100644 src/Taxonomy/Types/Category.php create mode 100644 src/Taxonomy/Types/CategorySubtree.php create mode 100644 src/Taxonomy/Types/CategorySuggestion.php create mode 100644 src/Taxonomy/Types/CategorySuggestionResponse.php create mode 100644 src/Taxonomy/Types/CategoryTree.php create mode 100644 src/Taxonomy/Types/CategoryTreeNode.php create mode 100644 src/Taxonomy/Types/ErrorDetailV3.php create mode 100644 src/Taxonomy/Types/ErrorParameterV3.php create mode 100644 src/Taxonomy/Types/GetACategorySubtreeRestRequest.php create mode 100644 src/Taxonomy/Types/GetACategorySubtreeRestResponse.php create mode 100644 src/Taxonomy/Types/GetACategoryTreeRestRequest.php create mode 100644 src/Taxonomy/Types/GetACategoryTreeRestResponse.php create mode 100644 src/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequest.php create mode 100644 src/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponse.php create mode 100644 src/Taxonomy/Types/GetSuggestedCategoriesRestRequest.php create mode 100644 src/Taxonomy/Types/GetSuggestedCategoriesRestResponse.php create mode 100644 test/Taxonomy/Enums/MarketplaceIdEnumTest.php create mode 100644 test/Taxonomy/Mocks/Service.php create mode 100644 test/Taxonomy/Services/ServiceTest.php create mode 100644 test/Taxonomy/Types/AncestorReferenceTest.php create mode 100644 test/Taxonomy/Types/BaseCategoryTreeTest.php create mode 100644 test/Taxonomy/Types/CategorySubtreeTest.php create mode 100644 test/Taxonomy/Types/CategorySuggestionResponseTest.php create mode 100644 test/Taxonomy/Types/CategorySuggestionTest.php create mode 100644 test/Taxonomy/Types/CategoryTest.php create mode 100644 test/Taxonomy/Types/CategoryTreeNodeTest.php create mode 100644 test/Taxonomy/Types/CategoryTreeTest.php create mode 100644 test/Taxonomy/Types/ErrorDetailV3Test.php create mode 100644 test/Taxonomy/Types/ErrorParameterV3Test.php create mode 100644 test/Taxonomy/Types/GetACategorySubtreeRestRequestTest.php create mode 100644 test/Taxonomy/Types/GetACategorySubtreeRestResponseTest.php create mode 100644 test/Taxonomy/Types/GetACategoryTreeRestRequestTest.php create mode 100644 test/Taxonomy/Types/GetACategoryTreeRestResponseTest.php create mode 100644 test/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequestTest.php create mode 100644 test/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponseTest.php create mode 100644 test/Taxonomy/Types/GetSuggestedCategoriesRestRequestTest.php create mode 100644 test/Taxonomy/Types/GetSuggestedCategoriesRestResponseTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index ab467fd42..3c533e4bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## Features + +* Support Taxonomy API version v1_beta.0.0 + ### Breaking changes * Support Marketing API version 1.2.0. diff --git a/Makefile b/Makefile index 009829748..1636394b2 100644 --- a/Makefile +++ b/Makefile @@ -145,6 +145,10 @@ sync_order: rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Order/src/Order/ src/Order/ rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Order/test/Order/ test/Order/ +sync_taxonomy: + rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Taxonomy/src/Taxonomy/ src/Taxonomy/ + rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Taxonomy/test/Taxonomy/ test/Taxonomy/ + sync_post: rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/PostOrder/src/PostOrder/ src/PostOrder/ rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/PostOrder/test/PostOrder/ test/PostOrder/ diff --git a/docs/guide/configuration.rst b/docs/guide/configuration.rst index 4cead353d..281d5de98 100644 --- a/docs/guide/configuration.rst +++ b/docs/guide/configuration.rst @@ -77,7 +77,7 @@ authorization ~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Trading`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Trading``, ``Taxonomy`` :Required: true, except for the Trading service. All eBay RESTful services use OAuth 2.0 access tokens for application authentication and user authorization. The token passed via ``authorization`` can be either an User or Application token. You must ensure that the token has the require scope for the operation that you are calling. @@ -402,7 +402,7 @@ marketplaceId ~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` The string identifier for the eBay site your API requests are to be sent to. For example, you would pass the value ``EBAY-UK`` to specify the eBay UK site. @@ -428,7 +428,7 @@ requestLanguage ~~~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` This configuration option will set the ``Content-Language`` HTTP header for the request. @@ -436,7 +436,7 @@ responseLanguage ~~~~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` This configuration option will set the ``Accept-Language`` HTTP header for the request. diff --git a/src/Taxonomy/Enums/MarketplaceIdEnum.php b/src/Taxonomy/Enums/MarketplaceIdEnum.php new file mode 100644 index 000000000..bc5a09581 --- /dev/null +++ b/src/Taxonomy/Enums/MarketplaceIdEnum.php @@ -0,0 +1,36 @@ + 'https://api.sandbox.ebay.com/commerce/taxonomy', + 'production' => 'https://api.ebay.com/commerce/taxonomy' + ]; + + /** + * HTTP header constant. The Authentication Token that is used to validate the caller has permission to access the eBay servers. + */ + const HDR_AUTHORIZATION = 'Authorization'; + + /** + * HTTP header constant. The global ID of the eBay site on which the transaction took place. + */ + const HDR_MARKETPLACE_ID = 'X-EBAY-C-MARKETPLACE-ID'; + + /** + * @param array $config Configuration option values. + */ + public function __construct(array $config) + { + parent::__construct($config); + } + + /** + * Returns definitions for each configuration option that is supported. + * + * @return array An associative array of configuration definitions. + */ + public static function getConfigDefinitions() + { + $definitions = parent::getConfigDefinitions(); + + return $definitions + [ + 'apiVersion' => [ + 'valid' => ['string'], + 'default' => \DTS\eBaySDK\Taxonomy\Services\TaxonomyService::API_VERSION, + 'required' => true + ], + 'authorization' => [ + 'valid' => ['string'], + 'required' => true + ], + 'marketplaceId' => [ + 'valid' => ['string'] + ] + ]; + } + + /** + * Builds the needed eBay HTTP headers. + * + * @return array An associative array of eBay HTTP headers. + */ + protected function getEbayHeaders() + { + $headers = []; + + // Add required headers first. + $headers[self::HDR_AUTHORIZATION] = 'Bearer '.$this->getConfig('authorization'); + + // Add optional headers. + if ($this->getConfig('marketplaceId')) { + $headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId'); + } + + return $headers; + } +} diff --git a/src/Taxonomy/Services/TaxonomyService.php b/src/Taxonomy/Services/TaxonomyService.php new file mode 100644 index 000000000..4794b9142 --- /dev/null +++ b/src/Taxonomy/Services/TaxonomyService.php @@ -0,0 +1,154 @@ + [ + 'method' => 'GET', + 'resource' => 'get_default_category_tree_id', + 'responseClass' => '\DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestResponse', + 'params' => [ + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetACategoryTree' => [ + 'method' => 'GET', + 'resource' => 'category_tree/{category_tree_id}', + 'responseClass' => '\DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestResponse', + 'params' => [ + 'category_tree_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetACategorySubtree' => [ + 'method' => 'GET', + 'resource' => 'category_tree/{category_tree_id}/get_category_subtree', + 'responseClass' => '\DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestResponse', + 'params' => [ + 'category_id' => [ + 'valid' => ['string'], + 'required' => true + ], + 'category_tree_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetSuggestedCategories' => [ + 'method' => 'GET', + 'resource' => 'category_tree/{category_tree_id}/get_category_suggestions', + 'responseClass' => '\DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestResponse', + 'params' => [ + 'category_tree_id' => [ + 'valid' => ['string'], + 'required' => true + ], + 'q' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ] + ]; + + /** + * @param array $config Configuration option values. + */ + public function __construct(array $config = []) + { + parent::__construct($config); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestRequest $request + * @return \DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestResponse + */ + public function getADefaultCategoryTreeId(\DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestRequest $request) + { + return $this->getADefaultCategoryTreeIdAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getADefaultCategoryTreeIdAsync(\DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestRequest $request) + { + return $this->callOperationAsync('GetADefaultCategoryTreeId', $request); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestRequest $request + * @return \DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestResponse + */ + public function getACategoryTree(\DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestRequest $request) + { + return $this->getACategoryTreeAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getACategoryTreeAsync(\DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestRequest $request) + { + return $this->callOperationAsync('GetACategoryTree', $request); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestRequest $request + * @return \DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestResponse + */ + public function getACategorySubtree(\DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestRequest $request) + { + return $this->getACategorySubtreeAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getACategorySubtreeAsync(\DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestRequest $request) + { + return $this->callOperationAsync('GetACategorySubtree', $request); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestRequest $request + * @return \DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestResponse + */ + public function getSuggestedCategories(\DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestRequest $request) + { + return $this->getSuggestedCategoriesAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getSuggestedCategoriesAsync(\DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestRequest $request) + { + return $this->callOperationAsync('GetSuggestedCategories', $request); + } +} diff --git a/src/Taxonomy/Types/AncestorReference.php b/src/Taxonomy/Types/AncestorReference.php new file mode 100644 index 000000000..03d32c372 --- /dev/null +++ b/src/Taxonomy/Types/AncestorReference.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryName' + ], + 'categorySubtreeNodeHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categorySubtreeNodeHref' + ], + 'categoryTreeNodeLevel' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeNodeLevel' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/BaseCategoryTree.php b/src/Taxonomy/Types/BaseCategoryTree.php new file mode 100644 index 000000000..770cc5289 --- /dev/null +++ b/src/Taxonomy/Types/BaseCategoryTree.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'categoryTreeVersion' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeVersion' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/Category.php b/src/Taxonomy/Types/Category.php new file mode 100644 index 000000000..c57c1190e --- /dev/null +++ b/src/Taxonomy/Types/Category.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryName' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/CategorySubtree.php b/src/Taxonomy/Types/CategorySubtree.php new file mode 100644 index 000000000..518aa13cc --- /dev/null +++ b/src/Taxonomy/Types/CategorySubtree.php @@ -0,0 +1,60 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\CategoryTreeNode', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categorySubtreeNode' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'categoryTreeVersion' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeVersion' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/CategorySuggestion.php b/src/Taxonomy/Types/CategorySuggestion.php new file mode 100644 index 000000000..5b37af2ce --- /dev/null +++ b/src/Taxonomy/Types/CategorySuggestion.php @@ -0,0 +1,67 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\Category', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category' + ], + 'categoryTreeNodeAncestors' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\AncestorReference', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'categoryTreeNodeAncestors' + ], + 'categoryTreeNodeLevel' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeNodeLevel' + ], + 'relevancy' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'relevancy' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/CategorySuggestionResponse.php b/src/Taxonomy/Types/CategorySuggestionResponse.php new file mode 100644 index 000000000..a4664d645 --- /dev/null +++ b/src/Taxonomy/Types/CategorySuggestionResponse.php @@ -0,0 +1,60 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\CategorySuggestion', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'categorySuggestions' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'categoryTreeVersion' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeVersion' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/CategoryTree.php b/src/Taxonomy/Types/CategoryTree.php new file mode 100644 index 000000000..5471915e9 --- /dev/null +++ b/src/Taxonomy/Types/CategoryTree.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'applicableMarketplaceIds' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'categoryTreeVersion' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeVersion' + ], + 'rootCategoryNode' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\CategoryTreeNode', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'rootCategoryNode' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/CategoryTreeNode.php b/src/Taxonomy/Types/CategoryTreeNode.php new file mode 100644 index 000000000..769e7d247 --- /dev/null +++ b/src/Taxonomy/Types/CategoryTreeNode.php @@ -0,0 +1,74 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\Category', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category' + ], + 'categoryTreeNodeLevel' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeNodeLevel' + ], + 'childCategoryTreeNodes' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\CategoryTreeNode', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'childCategoryTreeNodes' + ], + 'leafCategoryTreeNode' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'leafCategoryTreeNode' + ], + 'parentCategoryTreeNodeHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'parentCategoryTreeNodeHref' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/ErrorDetailV3.php b/src/Taxonomy/Types/ErrorDetailV3.php new file mode 100644 index 000000000..2efdafd7a --- /dev/null +++ b/src/Taxonomy/Types/ErrorDetailV3.php @@ -0,0 +1,102 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category' + ], + 'domain' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'domain' + ], + 'errorId' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'errorId' + ], + 'inputRefIds' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'inputRefIds' + ], + 'longMessage' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'longMessage' + ], + 'message' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'message' + ], + 'outputRefIds' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'outputRefIds' + ], + 'parameters' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorParameterV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'parameters' + ], + 'subdomain' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'subdomain' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/ErrorParameterV3.php b/src/Taxonomy/Types/ErrorParameterV3.php new file mode 100644 index 000000000..d0b13664d --- /dev/null +++ b/src/Taxonomy/Types/ErrorParameterV3.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'name' + ], + 'value' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'value' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/GetACategorySubtreeRestRequest.php b/src/Taxonomy/Types/GetACategorySubtreeRestRequest.php new file mode 100644 index 000000000..ef9c72032 --- /dev/null +++ b/src/Taxonomy/Types/GetACategorySubtreeRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category_id' + ], + 'category_tree_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category_tree_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/GetACategorySubtreeRestResponse.php b/src/Taxonomy/Types/GetACategorySubtreeRestResponse.php new file mode 100644 index 000000000..97036c518 --- /dev/null +++ b/src/Taxonomy/Types/GetACategorySubtreeRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Taxonomy/Types/GetACategoryTreeRestRequest.php b/src/Taxonomy/Types/GetACategoryTreeRestRequest.php new file mode 100644 index 000000000..64adc6229 --- /dev/null +++ b/src/Taxonomy/Types/GetACategoryTreeRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category_tree_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/GetACategoryTreeRestResponse.php b/src/Taxonomy/Types/GetACategoryTreeRestResponse.php new file mode 100644 index 000000000..9eb48d2aa --- /dev/null +++ b/src/Taxonomy/Types/GetACategoryTreeRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequest.php b/src/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequest.php new file mode 100644 index 000000000..f05572186 --- /dev/null +++ b/src/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponse.php b/src/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponse.php new file mode 100644 index 000000000..f0bf5fbbf --- /dev/null +++ b/src/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Taxonomy/Types/GetSuggestedCategoriesRestRequest.php b/src/Taxonomy/Types/GetSuggestedCategoriesRestRequest.php new file mode 100644 index 000000000..e2b189855 --- /dev/null +++ b/src/Taxonomy/Types/GetSuggestedCategoriesRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category_tree_id' + ], + 'q' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'q' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Taxonomy/Types/GetSuggestedCategoriesRestResponse.php b/src/Taxonomy/Types/GetSuggestedCategoriesRestResponse.php new file mode 100644 index 000000000..33b7f78f8 --- /dev/null +++ b/src/Taxonomy/Types/GetSuggestedCategoriesRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/test/Taxonomy/Enums/MarketplaceIdEnumTest.php b/test/Taxonomy/Enums/MarketplaceIdEnumTest.php new file mode 100644 index 000000000..8d3f4c1fb --- /dev/null +++ b/test/Taxonomy/Enums/MarketplaceIdEnumTest.php @@ -0,0 +1,28 @@ +obj = new MarketplaceIdEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Enums\MarketplaceIdEnum', $this->obj); + } +} diff --git a/test/Taxonomy/Mocks/Service.php b/test/Taxonomy/Mocks/Service.php new file mode 100644 index 000000000..0ffc031ff --- /dev/null +++ b/test/Taxonomy/Mocks/Service.php @@ -0,0 +1,27 @@ + [ + 'method' => 'GET', + 'resource' => 'item/{item_id}', + 'responseClass' => '\DTS\eBaySDK\Test\Mocks\ComplexClass', + 'params' => [ + ] + ] + ]; + + public function __construct(array $config) + { + parent::__construct($config); + } + + public function testOperation() + { + return $this->callOperationAsync('testOperation', new ComplexClass())->wait(); + } +} diff --git a/test/Taxonomy/Services/ServiceTest.php b/test/Taxonomy/Services/ServiceTest.php new file mode 100644 index 000000000..f5a80bd97 --- /dev/null +++ b/test/Taxonomy/Services/ServiceTest.php @@ -0,0 +1,68 @@ +assertArrayHasKey('apiVersion', $d); + $this->assertEquals([ + 'valid' => ['string'], + 'default' => TaxonomyService::API_VERSION, + 'required' => true + ], $d['apiVersion']); + + $this->assertArrayHasKey('authorization', $d); + $this->assertEquals([ + 'valid' => ['string'], + 'required' => true + ], $d['authorization']); + + $this->assertArrayHasKey('marketplaceId', $d); + $this->assertEquals([ + 'valid' => ['string'] + ], $d['marketplaceId']); + } + + public function testRequiredEbayHeaders() + { + $h = new HttpRestHandler(); + + $s = new Service([ + 'authorization' => '321', + 'httpHandler' => $h + ]); + + $s->testOperation(); + + // Test required headers first. + $this->assertArrayHasKey(TaxonomyBaseService::HDR_AUTHORIZATION, $h->headers); + $this->assertEquals('Bearer 321', $h->headers[TaxonomyBaseService::HDR_AUTHORIZATION]); + + // Test that optional headers have not been set until they have been configured. + $this->assertArrayNotHasKey(TaxonomyBaseService::HDR_MARKETPLACE_ID, $h->headers); + } + + public function testOptionalEbayHeaders() + { + $h = new HttpRestHandler(); + + $s = new Service([ + 'authorization' => '321', + 'marketplaceId' => '123', + 'httpHandler' => $h + ]); + + $s->testOperation(); + + $this->assertArrayHasKey(TaxonomyBaseService::HDR_MARKETPLACE_ID, $h->headers); + $this->assertEquals('123', $h->headers[TaxonomyBaseService::HDR_MARKETPLACE_ID]); + } +} diff --git a/test/Taxonomy/Types/AncestorReferenceTest.php b/test/Taxonomy/Types/AncestorReferenceTest.php new file mode 100644 index 000000000..a606c5e94 --- /dev/null +++ b/test/Taxonomy/Types/AncestorReferenceTest.php @@ -0,0 +1,33 @@ +obj = new AncestorReference(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\AncestorReference', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/BaseCategoryTreeTest.php b/test/Taxonomy/Types/BaseCategoryTreeTest.php new file mode 100644 index 000000000..2c04f9551 --- /dev/null +++ b/test/Taxonomy/Types/BaseCategoryTreeTest.php @@ -0,0 +1,33 @@ +obj = new BaseCategoryTree(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\BaseCategoryTree', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/CategorySubtreeTest.php b/test/Taxonomy/Types/CategorySubtreeTest.php new file mode 100644 index 000000000..38a481071 --- /dev/null +++ b/test/Taxonomy/Types/CategorySubtreeTest.php @@ -0,0 +1,33 @@ +obj = new CategorySubtree(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategorySubtree', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/CategorySuggestionResponseTest.php b/test/Taxonomy/Types/CategorySuggestionResponseTest.php new file mode 100644 index 000000000..84da63ea5 --- /dev/null +++ b/test/Taxonomy/Types/CategorySuggestionResponseTest.php @@ -0,0 +1,33 @@ +obj = new CategorySuggestionResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategorySuggestionResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/CategorySuggestionTest.php b/test/Taxonomy/Types/CategorySuggestionTest.php new file mode 100644 index 000000000..e033f7a85 --- /dev/null +++ b/test/Taxonomy/Types/CategorySuggestionTest.php @@ -0,0 +1,33 @@ +obj = new CategorySuggestion(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategorySuggestion', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/CategoryTest.php b/test/Taxonomy/Types/CategoryTest.php new file mode 100644 index 000000000..c3b1f9728 --- /dev/null +++ b/test/Taxonomy/Types/CategoryTest.php @@ -0,0 +1,33 @@ +obj = new Category(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\Category', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/CategoryTreeNodeTest.php b/test/Taxonomy/Types/CategoryTreeNodeTest.php new file mode 100644 index 000000000..e09c7f011 --- /dev/null +++ b/test/Taxonomy/Types/CategoryTreeNodeTest.php @@ -0,0 +1,33 @@ +obj = new CategoryTreeNode(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategoryTreeNode', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/CategoryTreeTest.php b/test/Taxonomy/Types/CategoryTreeTest.php new file mode 100644 index 000000000..a30416172 --- /dev/null +++ b/test/Taxonomy/Types/CategoryTreeTest.php @@ -0,0 +1,33 @@ +obj = new CategoryTree(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategoryTree', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/ErrorDetailV3Test.php b/test/Taxonomy/Types/ErrorDetailV3Test.php new file mode 100644 index 000000000..8c4a8d8ff --- /dev/null +++ b/test/Taxonomy/Types/ErrorDetailV3Test.php @@ -0,0 +1,33 @@ +obj = new ErrorDetailV3(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\ErrorDetailV3', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/ErrorParameterV3Test.php b/test/Taxonomy/Types/ErrorParameterV3Test.php new file mode 100644 index 000000000..29330bbf2 --- /dev/null +++ b/test/Taxonomy/Types/ErrorParameterV3Test.php @@ -0,0 +1,33 @@ +obj = new ErrorParameterV3(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\ErrorParameterV3', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetACategorySubtreeRestRequestTest.php b/test/Taxonomy/Types/GetACategorySubtreeRestRequestTest.php new file mode 100644 index 000000000..792e10dd9 --- /dev/null +++ b/test/Taxonomy/Types/GetACategorySubtreeRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetACategorySubtreeRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetACategorySubtreeRestResponseTest.php b/test/Taxonomy/Types/GetACategorySubtreeRestResponseTest.php new file mode 100644 index 000000000..9260c2fdf --- /dev/null +++ b/test/Taxonomy/Types/GetACategorySubtreeRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetACategorySubtreeRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetACategorySubtreeRestResponse', $this->obj); + } + + public function testExtendsCategorySubtree() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategorySubtree', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetACategoryTreeRestRequestTest.php b/test/Taxonomy/Types/GetACategoryTreeRestRequestTest.php new file mode 100644 index 000000000..557789b1b --- /dev/null +++ b/test/Taxonomy/Types/GetACategoryTreeRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetACategoryTreeRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetACategoryTreeRestResponseTest.php b/test/Taxonomy/Types/GetACategoryTreeRestResponseTest.php new file mode 100644 index 000000000..90dbcbb99 --- /dev/null +++ b/test/Taxonomy/Types/GetACategoryTreeRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetACategoryTreeRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetACategoryTreeRestResponse', $this->obj); + } + + public function testExtendsCategoryTree() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategoryTree', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequestTest.php b/test/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequestTest.php new file mode 100644 index 000000000..7f8edc252 --- /dev/null +++ b/test/Taxonomy/Types/GetADefaultCategoryTreeIdRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetADefaultCategoryTreeIdRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponseTest.php b/test/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponseTest.php new file mode 100644 index 000000000..17dc23186 --- /dev/null +++ b/test/Taxonomy/Types/GetADefaultCategoryTreeIdRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetADefaultCategoryTreeIdRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetADefaultCategoryTreeIdRestResponse', $this->obj); + } + + public function testExtendsBaseCategoryTree() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\BaseCategoryTree', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetSuggestedCategoriesRestRequestTest.php b/test/Taxonomy/Types/GetSuggestedCategoriesRestRequestTest.php new file mode 100644 index 000000000..fd1e66035 --- /dev/null +++ b/test/Taxonomy/Types/GetSuggestedCategoriesRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetSuggestedCategoriesRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Taxonomy/Types/GetSuggestedCategoriesRestResponseTest.php b/test/Taxonomy/Types/GetSuggestedCategoriesRestResponseTest.php new file mode 100644 index 000000000..11f989402 --- /dev/null +++ b/test/Taxonomy/Types/GetSuggestedCategoriesRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetSuggestedCategoriesRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\GetSuggestedCategoriesRestResponse', $this->obj); + } + + public function testExtendsCategorySuggestionResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Taxonomy\Types\CategorySuggestionResponse', $this->obj); + } +} From 4b25add2cd32139146fa2a1b65c993654aa1459e Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 1 Jun 2017 13:51:58 +0100 Subject: [PATCH 12/31] fix: add missing properties to postorder\types\error close #105 --- CHANGELOG.md | 1 + src/PostOrder/Types/Error.php | 28 +++++++++++++++++++++++ test/property_fixes/PropertyFixesTest.php | 16 +++++++++++++ 3 files changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c533e4bc..8df8f2a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ * Added missing enums to Fulfillment\Enums\PaymentMethodTypeEnum. * Added missing priceDiscount property to Fulfillment\Types\Pricingsummary. * Added missing enums to PostOrder\Enums\CancelReasonEnum. +* Added missing properties to PostOrder\Types\Error. ## 12.0.0 - 2017-05-23 diff --git a/src/PostOrder/Types/Error.php b/src/PostOrder/Types/Error.php index 70d42e344..9060acb65 100644 --- a/src/PostOrder/Types/Error.php +++ b/src/PostOrder/Types/Error.php @@ -21,6 +21,10 @@ * @property \DTS\eBaySDK\PostOrder\Types\ErrorParameter[] $parameter * @property string $longMessage * @property integer $httpStatusCode + * @property string $errorName + * @property string $resolution + * @property string $organization + * @property string $errorGroups */ class Error extends \DTS\eBaySDK\Types\BaseType { @@ -81,6 +85,30 @@ class Error extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'httpStatusCode' + ], + 'errorName' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'errorName' + ], + 'resolution' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'resolution' + ], + 'organization' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'organization' + ], + 'errorGroups' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'errorGroups' ] ]; diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index db628174b..d5284040a 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -37,12 +37,28 @@ public function testItemEligibilityResult() $this->assertInternalType('string', $obj->transactionId); } + /** + * Incorrect documentation https://developer.ebay.com/Devzone/post-order/ErrorResponse.html#ErrorResponse + * Example of correct property names returned in the API https://github.com/davidtsadler/ebay-sdk-php/issues/105 + */ public function testError() { $obj = new Sdk\PostOrder\Types\Error(); $obj->subdomain = '123'; $this->assertInternalType('string', $obj->subdomain); + + $obj->errorName = '123'; + $this->assertInternalType('string', $obj->errorName); + + $obj->resolution = '123'; + $this->assertInternalType('string', $obj->resolution); + + $obj->organization = '123'; + $this->assertInternalType('string', $obj->organization); + + $obj->errorGroups = '123'; + $this->assertInternalType('string', $obj->errorGroups); } public function testDeliveryCost() From 1257567e5d3eeffb8fe06e1b085e833f30191823 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 1 Jun 2017 15:30:08 +0100 Subject: [PATCH 13/31] feature: added compressResponse configuration option --- CHANGELOG.md | 1 + docs/guide/configuration.rst | 7 +++++++ src/Services/BaseRestService.php | 13 +++++++++++++ src/Services/BaseService.php | 13 +++++++++++++ test/Services/RestServiceTest.php | 21 +++++++++++++++++++++ test/Services/ServiceTest.php | 21 +++++++++++++++++++++ 6 files changed, 76 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8df8f2a40..ac192b1d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Features * Support Taxonomy API version v1_beta.0.0 +* Added compressResponse configuration option ### Breaking changes diff --git a/docs/guide/configuration.rst b/docs/guide/configuration.rst index 281d5de98..84ef8567c 100644 --- a/docs/guide/configuration.rst +++ b/docs/guide/configuration.rst @@ -114,6 +114,13 @@ The Trading service is different to other services in that the Auth'n'auth toke $request->RequesterCredentials = new Types\CustomSecurityHeaderType(); $request->RequesterCredentials->eBayAuthToken = ''; +compressResponse +~~~~~~~~~~~~~~~~ + +:Type: ``bool`` + +Some API responses can return a very large payload. Pass ``true`` to submit all requests with the HTTP header ``Accept-Encoding: application/gzip``. Note that not all API operations will return a gzip response. + credentials ~~~~~~~~~~~ diff --git a/src/Services/BaseRestService.php b/src/Services/BaseRestService.php index b841aae23..b9a2b071a 100644 --- a/src/Services/BaseRestService.php +++ b/src/Services/BaseRestService.php @@ -22,6 +22,11 @@ abstract class BaseRestService */ const HDR_RESPONSE_LANGUAGE = 'Accept-Language'; + /** + * HTTP header constant. Tells the server the encoding in which the client desires the response. + */ + const HDR_RESPONSE_ENCODING = 'Accept-Encoding'; + /** * @var \DTS\eBaySDK\ConfigurationResolver Resolves configuration options. */ @@ -55,6 +60,10 @@ public function __construct(array $config) public static function getConfigDefinitions() { return [ + 'compressResponse' => [ + 'valid' => ['bool'], + 'default' => false + ], 'debug' => [ 'valid' => ['bool', 'array'], 'fn' => 'DTS\eBaySDK\applyDebug', @@ -218,6 +227,10 @@ private function buildRequestHeaders($body) $headers[self::HDR_RESPONSE_LANGUAGE] = $this->getConfig('responseLanguage'); } + if ($this->getConfig('compressResponse')) { + $headers[self::HDR_RESPONSE_ENCODING] = 'application/gzip'; + } + return $headers; } diff --git a/src/Services/BaseService.php b/src/Services/BaseService.php index 95626b5af..a99ed0876 100644 --- a/src/Services/BaseService.php +++ b/src/Services/BaseService.php @@ -18,6 +18,11 @@ abstract class BaseService */ const CRLF = "\r\n"; + /** + * HTTP header constant. Tells the server the encoding in which the client desires the response. + */ + const HDR_RESPONSE_ENCODING = 'Accept-Encoding'; + /** * @var \DTS\eBaySDK\ConfigurationResolver Resolves configuration options. */ @@ -66,6 +71,10 @@ public static function getConfigDefinitions() 'valid' => ['string'], 'fn' => 'DTS\eBaySDK\applyProfile', ], + 'compressResponse' => [ + 'valid' => ['bool'], + 'default' => false + ], 'credentials' => [ 'valid' => ['DTS\eBaySDK\Credentials\CredentialsInterface', 'array', 'callable'], 'fn' => 'DTS\eBaySDK\applyCredentials', @@ -257,6 +266,10 @@ private function buildRequestHeaders($name, $request, $body) $headers['Content-Type'] = 'text/xml'; } + if ($this->getConfig('compressResponse')) { + $headers[self::HDR_RESPONSE_ENCODING] = 'application/gzip'; + } + $headers['Content-Length'] = strlen($body); return $headers; diff --git a/test/Services/RestServiceTest.php b/test/Services/RestServiceTest.php index a94a1a894..9fa2b1be5 100644 --- a/test/Services/RestServiceTest.php +++ b/test/Services/RestServiceTest.php @@ -12,6 +12,12 @@ public function testConfigDefinitions() { $d = BaseRestService::getConfigDefinitions(); + $this->assertArrayHasKey('compressResponse', $d); + $this->assertEquals([ + 'valid' => ['bool'], + 'default' => false + ], $d['compressResponse']); + $this->assertArrayHasKey('debug', $d); $this->assertEquals([ 'valid' => ['bool', 'array'], @@ -155,12 +161,14 @@ public function testCanSetConfigurationOptionsAfterInstaniation() $h = new HttpRestHandler(); $s = new RestService([ 'sandbox' => true, + 'compressResponse' => true, 'httpHandler' => $h, 'httpOptions' => [] ]); $this->assertEquals([ 'apiVersion' => 'v1', + 'compressResponse' => true, 'sandbox' => true, 'debug' => false, 'httpHandler' => $h, @@ -169,10 +177,12 @@ public function testCanSetConfigurationOptionsAfterInstaniation() $s->setConfig([ 'sandbox' => false, + 'compressResponse' => false, ]); $this->assertEquals([ 'apiVersion' => 'v1', + 'compressResponse' => false, 'sandbox' => false, 'debug' => false, 'httpHandler' => $h, @@ -192,4 +202,15 @@ public function testSetConfigWillThrow() $s->setConfig(['sandbox' => -1]); } + + public function testAcceptEncodingHttpHeadersIsCreated() + { + $h = new HttpRestHandler(); + $s = new RestService(['httpHandler' => $h, 'compressResponse' => true]); + $r = new ComplexClass(); + $s->foo($r); + + $this->assertArrayHasKey('Accept-Encoding', $h->headers); + $this->assertEquals('application/gzip', $h->headers['Accept-Encoding']); + } } diff --git a/test/Services/ServiceTest.php b/test/Services/ServiceTest.php index 5ea669b90..5a6466e4a 100644 --- a/test/Services/ServiceTest.php +++ b/test/Services/ServiceTest.php @@ -17,6 +17,12 @@ public function testConfigDefinitions() { $d = BaseService::getConfigDefinitions(); + $this->assertArrayHasKey('compressResponse', $d); + $this->assertEquals([ + 'valid' => ['bool'], + 'default' => false + ], $d['compressResponse']); + $this->assertArrayHasKey('credentials', $d); $this->assertEquals([ 'valid' => ['DTS\eBaySDK\Credentials\CredentialsInterface', 'array', 'callable'], @@ -248,6 +254,7 @@ public function testCanSetConfigurationOptionsAfterInstaniation() $h = new HttpHandler(); $s = new Service([ 'sandbox' => true, + 'compressResponse' => true, 'credentials' => [ 'appId' => '111', 'certId' => '222', @@ -259,6 +266,7 @@ public function testCanSetConfigurationOptionsAfterInstaniation() $this->assertEquals([ 'sandbox' => true, + 'compressResponse' => true, 'credentials' => new Credentials('111', '222', '333'), 'debug' => false, 'httpHandler' => $h, @@ -267,6 +275,7 @@ public function testCanSetConfigurationOptionsAfterInstaniation() $s->setConfig([ 'sandbox' => false, + 'compressResponse' => false, 'credentials' => function () { return new Credentials('444', '555', '666'); } @@ -274,6 +283,7 @@ public function testCanSetConfigurationOptionsAfterInstaniation() $this->assertEquals([ 'sandbox' => false, + 'compressResponse' => false, 'credentials' => new Credentials('444', '555', '666'), 'debug' => false, 'httpHandler' => $h, @@ -298,4 +308,15 @@ public function testSetConfigWillThrow() $s->setConfig(['sandbox' => -1]); } + + public function testAcceptEncodingHttpHeadersIsCreated() + { + $h = new HttpHandler(); + $s = new Service(['httpHandler' => $h, 'compressResponse' => true]); + $r = new ComplexClass(); + $s->foo($r); + + $this->assertArrayHasKey('Accept-Encoding', $h->headers); + $this->assertEquals('application/gzip', $h->headers['Accept-Encoding']); + } } From 8e52e61763c5eec8993ed58c4997f5840982761b Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 1 Jun 2017 16:15:59 +0100 Subject: [PATCH 14/31] feature: added affiliateCampaignId, affiliateReferenceId and contextualLocation configuration options --- CHANGELOG.md | 9 ++++--- docs/guide/configuration.rst | 32 +++++++++++++++++++++++ src/Browse/Services/BrowseBaseService.php | 28 ++++++++++++++++++++ test/Browse/Services/ServiceTest.php | 20 ++++++++++++++ 4 files changed, 85 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac192b1d6..3a0a3a3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,17 @@ ## Features -* Support Taxonomy API version v1_beta.0.0 -* Added compressResponse configuration option +* Support Taxonomy API version v1_beta.0.0. +* Added compressResponse configuration option. +* Added affiliateCampaignId, affiliateReferenceId and contextualLocation configuration options. ### Breaking changes * Support Marketing API version 1.2.0. -* Support Order API version v1_beta.6.0 +* Support Order API version v1_beta.6.0. * Support Trading API version 1007. * Support Shopping API version 1007. -* Support Browse API version v1_beta.6.0 +* Support Browse API version v1_beta.6.0. ### Fixes diff --git a/docs/guide/configuration.rst b/docs/guide/configuration.rst index 84ef8567c..843b73878 100644 --- a/docs/guide/configuration.rst +++ b/docs/guide/configuration.rst @@ -24,6 +24,22 @@ Refer to the :doc:`basic usage guide ` for informa Some configuration options are only applicable to certain services. Where this is the case the services will be noted in the documentation for the configuration option. +affiliateCampaignId +~~~~~~~~~~~~~~~~~~~ + +:Type: ``string`` +:Services: ``Browse`` + +Affiliate parameter for applications that have registered on the `eBay Partner Network `_. + +affiliateReferenceId +~~~~~~~~~~~~~~~~~~~~ + +:Type: ``string`` +:Services: ``Browse`` + +Affiliate parameter for applications that have registered on the `eBay Partner Network `_. + affiliateUserId ~~~~~~~~~~~~~~~ @@ -121,6 +137,22 @@ compressResponse Some API responses can return a very large payload. Pass ``true`` to submit all requests with the HTTP header ``Accept-Encoding: application/gzip``. Note that not all API operations will return a gzip response. +contextualLocation +~~~~~~~~~~~~~~~~~~ + +:Type: ``string`` +:Services: ``Browse`` + +Required by some operations in the Browse service. Increases the accuracy of the estimated delivery window information and is needed for the calculated shipping information. When using this header, you must include the country code and you also include the zip code if zip codes are used in that country. + +.. code-block:: php + + use DTS\eBaySDK\Browse\Services\BrowseService; + + $service = new BrowseService([ + 'contextualLocation' => 'country=US,zip=19406' + ]); + credentials ~~~~~~~~~~~ diff --git a/src/Browse/Services/BrowseBaseService.php b/src/Browse/Services/BrowseBaseService.php index c58a9a5c0..72ad24856 100644 --- a/src/Browse/Services/BrowseBaseService.php +++ b/src/Browse/Services/BrowseBaseService.php @@ -24,6 +24,11 @@ class BrowseBaseService extends \DTS\eBaySDK\Services\BaseRestService */ const HDR_MARKETPLACE_ID = 'X-EBAY-C-MARKETPLACE-ID'; + /** + * HTTP header constant. + */ + const HDR_END_USER_CTX = 'X-EBAY-C-ENDUSERCTX'; + /** * @param array $config Configuration option values. */ @@ -42,6 +47,12 @@ public static function getConfigDefinitions() $definitions = parent::getConfigDefinitions(); return $definitions + [ + 'affiliateCampaignId' => [ + 'valid' => ['string'] + ], + 'affiliateReferenceId' => [ + 'valid' => ['string'] + ], 'apiVersion' => [ 'valid' => ['string'], 'default' => \DTS\eBaySDK\Browse\Services\BrowseService::API_VERSION, @@ -51,6 +62,9 @@ public static function getConfigDefinitions() 'valid' => ['string'], 'required' => true ], + 'contextualLocation' => [ + 'valid' => ['string'] + ], 'marketplaceId' => [ 'valid' => ['string'] ] @@ -74,6 +88,20 @@ protected function getEbayHeaders() $headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId'); } + $endUserCTX = []; + if ($this->getConfig('affiliateCampaignId')) { + $endUserCTX[ ] = 'affiliateCampaignId='.$this->getConfig('affiliateCampaignId'); + } + if ($this->getConfig('affiliateReferenceId')) { + $endUserCTX[ ] = 'affiliateReferenceId='.$this->getConfig('affiliateReferenceId'); + } + if ($this->getConfig('contextualLocation')) { + $endUserCTX[ ] = 'contextualLocation='.$this->getConfig('contextualLocation'); + } + if (count($endUserCTX)) { + $headers[self::HDR_END_USER_CTX ] = implode(',', $endUserCTX); + } + return $headers; } } diff --git a/test/Browse/Services/ServiceTest.php b/test/Browse/Services/ServiceTest.php index 795d81cbc..52b525ae2 100644 --- a/test/Browse/Services/ServiceTest.php +++ b/test/Browse/Services/ServiceTest.php @@ -12,6 +12,16 @@ public function testConfigDefinitions() { $d = BrowseBaseService::getConfigDefinitions(); + $this->assertArrayHasKey('affiliateCampaignId', $d); + $this->assertEquals([ + 'valid' => ['string'] + ], $d['affiliateCampaignId']); + + $this->assertArrayHasKey('affiliateReferenceId', $d); + $this->assertEquals([ + 'valid' => ['string'] + ], $d['affiliateReferenceId']); + $this->assertArrayHasKey('apiVersion', $d); $this->assertEquals([ 'valid' => ['string'], @@ -25,6 +35,11 @@ public function testConfigDefinitions() 'required' => true ], $d['authorization']); + $this->assertArrayHasKey('contextualLocation', $d); + $this->assertEquals([ + 'valid' => ['string'] + ], $d['contextualLocation']); + $this->assertArrayHasKey('marketplaceId', $d); $this->assertEquals([ 'valid' => ['string'] @@ -48,6 +63,7 @@ public function testRequiredEbayHeaders() // Test that optional headers have not been set until they have been configured. $this->assertArrayNotHasKey(BrowseBaseService::HDR_MARKETPLACE_ID, $h->headers); + $this->assertArrayNotHasKey(BrowseBaseService::HDR_END_USER_CTX, $h->headers); } public function testOptionalEbayHeaders() @@ -56,6 +72,9 @@ public function testOptionalEbayHeaders() $s = new Service([ 'authorization' => '321', + 'affiliateCampaignId' => 'foo', + 'affiliateReferenceId' => 'bar', + 'contextualLocation' => 'baz', 'marketplaceId' => '123', 'httpHandler' => $h ]); @@ -64,5 +83,6 @@ public function testOptionalEbayHeaders() $this->assertArrayHasKey(BrowseBaseService::HDR_MARKETPLACE_ID, $h->headers); $this->assertEquals('123', $h->headers[BrowseBaseService::HDR_MARKETPLACE_ID]); + $this->assertEquals('affiliateCampaignId=foo,affiliateReferenceId=bar,contextualLocation=baz', $h->headers[BrowseBaseService::HDR_END_USER_CTX ]); } } From 642ef52b3bd9a73c5fb252ad0ba66b7ed4ac7cd3 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 2 Jun 2017 10:23:02 +0100 Subject: [PATCH 15/31] api: api: support marketing api version 1.3.0 --- CHANGELOG.md | 1 + src/Marketing/Services/MarketingService.php | 41 +++++ src/Marketing/Types/BaseResponse.php | 46 ++++++ .../Types/CreateItemPromotionRestResponse.php | 2 +- .../Types/GetAPromotionReportRestRequest.php | 74 +++++++++ .../Types/GetAPromotionReportRestResponse.php | 65 ++++++++ src/Marketing/Types/PromotionReportDetail.php | 144 ++++++++++++++++++ .../Types/PromotionsReportPagedCollection.php | 88 +++++++++++ .../Types/UpdateItemPromotionRestResponse.php | 2 +- test/Marketing/Types/BaseResponseTest.php | 33 ++++ .../CreateItemPromotionRestResponseTest.php | 4 +- .../GetAPromotionReportRestRequestTest.php | 33 ++++ .../GetAPromotionReportRestResponseTest.php | 33 ++++ .../Types/PromotionReportDetailTest.php | 33 ++++ .../PromotionsReportPagedCollectionTest.php | 33 ++++ .../UpdateItemPromotionRestResponseTest.php | 4 +- 16 files changed, 630 insertions(+), 6 deletions(-) create mode 100644 src/Marketing/Types/BaseResponse.php create mode 100644 src/Marketing/Types/GetAPromotionReportRestRequest.php create mode 100644 src/Marketing/Types/GetAPromotionReportRestResponse.php create mode 100644 src/Marketing/Types/PromotionReportDetail.php create mode 100644 src/Marketing/Types/PromotionsReportPagedCollection.php create mode 100644 test/Marketing/Types/BaseResponseTest.php create mode 100644 test/Marketing/Types/GetAPromotionReportRestRequestTest.php create mode 100644 test/Marketing/Types/GetAPromotionReportRestResponseTest.php create mode 100644 test/Marketing/Types/PromotionReportDetailTest.php create mode 100644 test/Marketing/Types/PromotionsReportPagedCollectionTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a0a3a3df..77f8d1a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Breaking changes +* Support Marketing API version 1.3.0. * Support Marketing API version 1.2.0. * Support Order API version v1_beta.6.0. * Support Trading API version 1007. diff --git a/src/Marketing/Services/MarketingService.php b/src/Marketing/Services/MarketingService.php index 725abc8f0..b50742467 100644 --- a/src/Marketing/Services/MarketingService.php +++ b/src/Marketing/Services/MarketingService.php @@ -531,6 +531,29 @@ class MarketingService extends \DTS\eBaySDK\Marketing\Services\MarketingBaseServ 'required' => true ] ] + ], + 'GetAPromotionReport' => [ + 'method' => 'GET', + 'resource' => 'promotion_report', + 'responseClass' => '\DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestResponse', + 'params' => [ + 'limit' => [ + 'valid' => ['string'] + ], + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ], + 'offset' => [ + 'valid' => ['string'] + ], + 'promotion_status' => [ + 'valid' => ['string'] + ], + 'q' => [ + 'valid' => ['string'] + ] + ] ] ]; @@ -1279,4 +1302,22 @@ public function getSpecificReportTaskAsync(\DTS\eBaySDK\Marketing\Types\GetSpeci { return $this->callOperationAsync('GetSpecificReportTask', $request); } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestRequest $request + * @return \DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestResponse + */ + public function getAPromotionReport(\DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestRequest $request) + { + return $this->getAPromotionReportAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getAPromotionReportAsync(\DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestRequest $request) + { + return $this->callOperationAsync('GetAPromotionReport', $request); + } } diff --git a/src/Marketing/Types/BaseResponse.php b/src/Marketing/Types/BaseResponse.php new file mode 100644 index 000000000..a08855361 --- /dev/null +++ b/src/Marketing/Types/BaseResponse.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/CreateItemPromotionRestResponse.php b/src/Marketing/Types/CreateItemPromotionRestResponse.php index 43b6e51a5..0e2f73839 100644 --- a/src/Marketing/Types/CreateItemPromotionRestResponse.php +++ b/src/Marketing/Types/CreateItemPromotionRestResponse.php @@ -18,7 +18,7 @@ * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $errors * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $warnings */ -class CreateItemPromotionRestResponse extends \DTS\eBaySDK\Types\BaseType +class CreateItemPromotionRestResponse extends \DTS\eBaySDK\Marketing\Types\BaseResponse { use StatusCodeTrait; use HttpHeadersTrait; diff --git a/src/Marketing/Types/GetAPromotionReportRestRequest.php b/src/Marketing/Types/GetAPromotionReportRestRequest.php new file mode 100644 index 000000000..793f5abc2 --- /dev/null +++ b/src/Marketing/Types/GetAPromotionReportRestRequest.php @@ -0,0 +1,74 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'limit' + ], + 'marketplace_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ], + 'offset' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'offset' + ], + 'promotion_status' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'promotion_status' + ], + 'q' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'q' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/GetAPromotionReportRestResponse.php b/src/Marketing/Types/GetAPromotionReportRestResponse.php new file mode 100644 index 000000000..766cbdb7a --- /dev/null +++ b/src/Marketing/Types/GetAPromotionReportRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Marketing/Types/PromotionReportDetail.php b/src/Marketing/Types/PromotionReportDetail.php new file mode 100644 index 000000000..73b48a662 --- /dev/null +++ b/src/Marketing/Types/PromotionReportDetail.php @@ -0,0 +1,144 @@ + [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'averageItemDiscount' + ], + 'averageItemRevenue' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'averageItemRevenue' + ], + 'averageOrderDiscount' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'averageOrderDiscount' + ], + 'averageOrderRevenue' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'averageOrderRevenue' + ], + 'averageOrderSize' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'averageOrderSize' + ], + 'baseSale' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'baseSale' + ], + 'itemsSoldQuantity' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemsSoldQuantity' + ], + 'numberOfOrdersSold' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'numberOfOrdersSold' + ], + 'percentageSalesLift' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'percentageSalesLift' + ], + 'promotionHref' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'promotionHref' + ], + 'promotionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'promotionId' + ], + 'promotionReportId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'promotionReportId' + ], + 'promotionSale' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'promotionSale' + ], + 'totalDiscount' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'totalDiscount' + ], + 'totalSale' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\Amount', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'totalSale' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/PromotionsReportPagedCollection.php b/src/Marketing/Types/PromotionsReportPagedCollection.php new file mode 100644 index 000000000..0fb41c7a6 --- /dev/null +++ b/src/Marketing/Types/PromotionsReportPagedCollection.php @@ -0,0 +1,88 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'href' + ], + 'limit' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'limit' + ], + 'next' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'next' + ], + 'offset' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'offset' + ], + 'prev' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'prev' + ], + 'promotionReports' => [ + 'type' => 'DTS\eBaySDK\Marketing\Types\PromotionReportDetail', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'promotionReports' + ], + 'total' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'total' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Marketing/Types/UpdateItemPromotionRestResponse.php b/src/Marketing/Types/UpdateItemPromotionRestResponse.php index 61e073bf3..ee46c1d3f 100644 --- a/src/Marketing/Types/UpdateItemPromotionRestResponse.php +++ b/src/Marketing/Types/UpdateItemPromotionRestResponse.php @@ -18,7 +18,7 @@ * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $errors * @property \DTS\eBaySDK\Marketing\Types\ErrorDetailV3[] $warnings */ -class UpdateItemPromotionRestResponse extends \DTS\eBaySDK\Types\BaseType +class UpdateItemPromotionRestResponse extends \DTS\eBaySDK\Marketing\Types\BaseResponse { use StatusCodeTrait; use HttpHeadersTrait; diff --git a/test/Marketing/Types/BaseResponseTest.php b/test/Marketing/Types/BaseResponseTest.php new file mode 100644 index 000000000..d49ac0d9c --- /dev/null +++ b/test/Marketing/Types/BaseResponseTest.php @@ -0,0 +1,33 @@ +obj = new BaseResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BaseResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/CreateItemPromotionRestResponseTest.php b/test/Marketing/Types/CreateItemPromotionRestResponseTest.php index e3ef65a40..70e410e63 100644 --- a/test/Marketing/Types/CreateItemPromotionRestResponseTest.php +++ b/test/Marketing/Types/CreateItemPromotionRestResponseTest.php @@ -26,8 +26,8 @@ public function testCanBeCreated() $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\CreateItemPromotionRestResponse', $this->obj); } - public function testExtendsBaseType() + public function testExtendsBaseResponse() { - $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BaseResponse', $this->obj); } } diff --git a/test/Marketing/Types/GetAPromotionReportRestRequestTest.php b/test/Marketing/Types/GetAPromotionReportRestRequestTest.php new file mode 100644 index 000000000..7d7576af5 --- /dev/null +++ b/test/Marketing/Types/GetAPromotionReportRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetAPromotionReportRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/GetAPromotionReportRestResponseTest.php b/test/Marketing/Types/GetAPromotionReportRestResponseTest.php new file mode 100644 index 000000000..294179dee --- /dev/null +++ b/test/Marketing/Types/GetAPromotionReportRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetAPromotionReportRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\GetAPromotionReportRestResponse', $this->obj); + } + + public function testExtendsPromotionsReportPagedCollection() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\PromotionsReportPagedCollection', $this->obj); + } +} diff --git a/test/Marketing/Types/PromotionReportDetailTest.php b/test/Marketing/Types/PromotionReportDetailTest.php new file mode 100644 index 000000000..4d57138b0 --- /dev/null +++ b/test/Marketing/Types/PromotionReportDetailTest.php @@ -0,0 +1,33 @@ +obj = new PromotionReportDetail(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\PromotionReportDetail', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/PromotionsReportPagedCollectionTest.php b/test/Marketing/Types/PromotionsReportPagedCollectionTest.php new file mode 100644 index 000000000..954176af3 --- /dev/null +++ b/test/Marketing/Types/PromotionsReportPagedCollectionTest.php @@ -0,0 +1,33 @@ +obj = new PromotionsReportPagedCollection(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\PromotionsReportPagedCollection', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Marketing/Types/UpdateItemPromotionRestResponseTest.php b/test/Marketing/Types/UpdateItemPromotionRestResponseTest.php index 226341d81..431545b6f 100644 --- a/test/Marketing/Types/UpdateItemPromotionRestResponseTest.php +++ b/test/Marketing/Types/UpdateItemPromotionRestResponseTest.php @@ -26,8 +26,8 @@ public function testCanBeCreated() $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\UpdateItemPromotionRestResponse', $this->obj); } - public function testExtendsBaseType() + public function testExtendsBaseResponse() { - $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + $this->assertInstanceOf('\DTS\eBaySDK\Marketing\Types\BaseResponse', $this->obj); } } From c10636a9b3de17e1a7c2d8468c7380a75ee503a8 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 2 Jun 2017 11:57:52 +0100 Subject: [PATCH 16/31] fix: add missing properties to postorder\types\canceldetail close #107 --- CHANGELOG.md | 2 ++ src/PostOrder/Types/CancelActivityHistory.php | 19 +++++++++----- src/PostOrder/Types/CancelDetail.php | 12 ++++----- test/property_fixes/PropertyFixesTest.php | 26 +++++++++++++++++++ 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f8d1a64..5ef2a1989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ * Added missing priceDiscount property to Fulfillment\Types\Pricingsummary. * Added missing enums to PostOrder\Enums\CancelReasonEnum. * Added missing properties to PostOrder\Types\Error. +* Added missing properties to PostOrder\Types\CancelDetail. +* Added missing properties to PostOrder\Types\CancelActivityHistory. ## 12.0.0 - 2017-05-23 diff --git a/src/PostOrder/Types/CancelActivityHistory.php b/src/PostOrder/Types/CancelActivityHistory.php index 6586bb05d..b5a30d314 100644 --- a/src/PostOrder/Types/CancelActivityHistory.php +++ b/src/PostOrder/Types/CancelActivityHistory.php @@ -15,8 +15,9 @@ * @property \DTS\eBaySDK\PostOrder\Types\DateTime $actionDate * @property string $activityParty * @property \DTS\eBaySDK\PostOrder\Enums\CancelActivityTypeEnum $activityType - * @property string $stateFrom - * @property string $stateTo + * @property string $cancelStateFrom + * @property string $cancelStateTo + * @property string $cancelStatetateTo */ class CancelActivityHistory extends \DTS\eBaySDK\Types\BaseType { @@ -42,17 +43,23 @@ class CancelActivityHistory extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'activityType' ], - 'stateFrom' => [ + 'cancelStateFrom' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'stateFrom' + 'elementName' => 'cancelStateFrom' ], - 'stateTo' => [ + 'cancelStateTo' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'stateTo' + 'elementName' => 'cancelStateTo' + ], + 'cancelStatetateTo' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'cancelStatetateTo' ] ]; diff --git a/src/PostOrder/Types/CancelDetail.php b/src/PostOrder/Types/CancelDetail.php index 3a1e31b66..e00772f9a 100644 --- a/src/PostOrder/Types/CancelDetail.php +++ b/src/PostOrder/Types/CancelDetail.php @@ -28,8 +28,8 @@ * @property \DTS\eBaySDK\PostOrder\Types\Amount $requestRefundAmount * @property \DTS\eBaySDK\PostOrder\Types\DateTime $sellerResponseDueDate * @property \DTS\eBaySDK\PostOrder\Types\DateTime $shipmentDate - * @property string $state - * @property string $status + * @property string $cancelState + * @property string $cancelStatus * @property string $transactionId */ class CancelDetail extends \DTS\eBaySDK\Types\BaseType @@ -134,17 +134,17 @@ class CancelDetail extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'shipmentDate' ], - 'state' => [ + 'cancelState' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'state' + 'elementName' => 'cancelState' ], - 'status' => [ + 'cancelStatus' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'status' + 'elementName' => 'cancelStatus' ], 'transactionId' => [ 'type' => 'string', diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index d5284040a..960a1feda 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -102,4 +102,30 @@ public function testPriceDiscountSubtotalDoesNotExist() $obj->priceDiscountSubtotal = new Sdk\Fulfillment\Types\Amount(); } + + /** + * Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/CancelDetail.html + * Example of correct property names returned in the API https://github.com/davidtsadler/ebay-sdk-php/issues/107 + */ + public function testCancelDetail() + { + $obj = new Sdk\PostOrder\Types\CancelDetail(); + + $this->assertEquals(null, $obj->cancelState); + $this->assertEquals(null, $obj->cancelStatus); + } + + /** + * Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/CancelActivityHistory.html + * Example of correct property names returned in the API https://github.com/davidtsadler/ebay-sdk-php/issues/107 + */ + public function testCancelActivityHistory() + { + $obj = new Sdk\PostOrder\Types\CancelActivityHistory(); + + $this->assertEquals(null, $obj->cancelStateFrom); + $this->assertEquals(null, $obj->cancelStateTo); + /** Yes this is because there is a typo in the actual response from the API! */ + $this->assertEquals(null, $obj->cancelStatetateTo); + } } From f0c84f90a9197c6d9c14684810e6dc2825ca9881 Mon Sep 17 00:00:00 2001 From: Diego Vieira Date: Thu, 8 Jun 2017 14:16:31 +0100 Subject: [PATCH 17/31] fix: correct type for postorder/types/casesummarytype::casestatusenum close #109 close #110 --- src/PostOrder/Types/CaseSummaryType.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PostOrder/Types/CaseSummaryType.php b/src/PostOrder/Types/CaseSummaryType.php index c4459f7e4..4364f546f 100644 --- a/src/PostOrder/Types/CaseSummaryType.php +++ b/src/PostOrder/Types/CaseSummaryType.php @@ -14,7 +14,7 @@ * * @property string $buyer * @property integer $caseId - * @property \DTS\eBaySDK\PostOrder\Types\Rsp:CaseStatusEnum $caseStatusEnum + * @property \DTS\eBaySDK\PostOrder\Enums\CaseStatusEnum $caseStatusEnum * @property \DTS\eBaySDK\PostOrder\Types\Amount $claimAmount * @property \DTS\eBaySDK\PostOrder\Types\DateTime $creationDate * @property integer $itemId @@ -42,7 +42,7 @@ class CaseSummaryType extends \DTS\eBaySDK\Types\BaseType 'elementName' => 'caseId' ], 'caseStatusEnum' => [ - 'type' => 'DTS\eBaySDK\PostOrder\Types\Rsp:CaseStatusEnum', + 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'caseStatusEnum' From 74ee88ee24536181af8355cc67f7e78fff6c7f42 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Tue, 13 Jun 2017 17:08:57 +0100 Subject: [PATCH 18/31] api: support feed api version v1_beta.0.0 --- CHANGELOG.md | 1 + Makefile | 4 + docs/guide/configuration.rst | 8 +- src/Feed/Enums/CurrencyCodeEnum.php | 170 +++++++++++++++ src/Feed/Services/FeedBaseService.php | 79 +++++++ src/Feed/Services/FeedService.php | 67 ++++++ src/Feed/Types/ErrorDetailV3.php | 102 +++++++++ src/Feed/Types/ErrorParameterV3.php | 53 +++++ src/Feed/Types/GetItemFeedRestRequest.php | 60 ++++++ src/Feed/Types/GetItemFeedRestResponse.php | 65 ++++++ src/Feed/Types/ItemFeed.php | 193 ++++++++++++++++++ src/Feed/Types/ItemFeedResponse.php | 46 +++++ test/Feed/Enums/CurrencyCodeEnumTest.php | 28 +++ test/Feed/Mocks/Service.php | 27 +++ test/Feed/Services/ServiceTest.php | 68 ++++++ test/Feed/Types/ErrorDetailV3Test.php | 33 +++ test/Feed/Types/ErrorParameterV3Test.php | 33 +++ .../Feed/Types/GetItemFeedRestRequestTest.php | 33 +++ .../Types/GetItemFeedRestResponseTest.php | 33 +++ test/Feed/Types/ItemFeedResponseTest.php | 33 +++ test/Feed/Types/ItemFeedTest.php | 33 +++ 21 files changed, 1165 insertions(+), 4 deletions(-) create mode 100644 src/Feed/Enums/CurrencyCodeEnum.php create mode 100644 src/Feed/Services/FeedBaseService.php create mode 100644 src/Feed/Services/FeedService.php create mode 100644 src/Feed/Types/ErrorDetailV3.php create mode 100644 src/Feed/Types/ErrorParameterV3.php create mode 100644 src/Feed/Types/GetItemFeedRestRequest.php create mode 100644 src/Feed/Types/GetItemFeedRestResponse.php create mode 100644 src/Feed/Types/ItemFeed.php create mode 100644 src/Feed/Types/ItemFeedResponse.php create mode 100644 test/Feed/Enums/CurrencyCodeEnumTest.php create mode 100644 test/Feed/Mocks/Service.php create mode 100644 test/Feed/Services/ServiceTest.php create mode 100644 test/Feed/Types/ErrorDetailV3Test.php create mode 100644 test/Feed/Types/ErrorParameterV3Test.php create mode 100644 test/Feed/Types/GetItemFeedRestRequestTest.php create mode 100644 test/Feed/Types/GetItemFeedRestResponseTest.php create mode 100644 test/Feed/Types/ItemFeedResponseTest.php create mode 100644 test/Feed/Types/ItemFeedTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ef2a1989..c4d921959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## Features +* Support Feed API version v1_beta.0.0 * Support Taxonomy API version v1_beta.0.0. * Added compressResponse configuration option. * Added affiliateCampaignId, affiliateReferenceId and contextualLocation configuration options. diff --git a/Makefile b/Makefile index 1636394b2..fd6f0695f 100644 --- a/Makefile +++ b/Makefile @@ -99,6 +99,10 @@ sync_bus: rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/BusinessPoliciesManagement/src/BusinessPoliciesManagement/ src/BusinessPoliciesManagement/ rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/BusinessPoliciesManagement/test/BusinessPoliciesManagement/ test/BusinessPoliciesManagement/ +sync_feed: + rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Feed/src/Feed/ src/Feed/ + rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Feed/test/Feed/ test/Feed/ + sync_feedback: rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Feedback/src/Feedback/ src/Feedback/ rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Feedback/test/Feedback/ test/Feedback/ diff --git a/docs/guide/configuration.rst b/docs/guide/configuration.rst index 843b73878..c3ffab517 100644 --- a/docs/guide/configuration.rst +++ b/docs/guide/configuration.rst @@ -93,7 +93,7 @@ authorization ~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Trading``, ``Taxonomy`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Feed``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Trading``, ``Taxonomy`` :Required: true, except for the Trading service. All eBay RESTful services use OAuth 2.0 access tokens for application authentication and user authorization. The token passed via ``authorization`` can be either an User or Application token. You must ensure that the token has the require scope for the operation that you are calling. @@ -441,7 +441,7 @@ marketplaceId ~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Feed``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` The string identifier for the eBay site your API requests are to be sent to. For example, you would pass the value ``EBAY-UK`` to specify the eBay UK site. @@ -467,7 +467,7 @@ requestLanguage ~~~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Feed``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` This configuration option will set the ``Content-Language`` HTTP header for the request. @@ -475,7 +475,7 @@ responseLanguage ~~~~~~~~~~~~~~~~ :Type: ``string`` -:Services: ``Account``, ``Analytics``, ``Browse``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` +:Services: ``Account``, ``Analytics``, ``Browse``, ``Feed``, ``Fulfillment``, ``Inventory``, ``Marketing``, ``Metadata``, ``Order``, ``Taxonomy`` This configuration option will set the ``Accept-Language`` HTTP header for the request. diff --git a/src/Feed/Enums/CurrencyCodeEnum.php b/src/Feed/Enums/CurrencyCodeEnum.php new file mode 100644 index 000000000..c62d8e8a8 --- /dev/null +++ b/src/Feed/Enums/CurrencyCodeEnum.php @@ -0,0 +1,170 @@ + 'https://api.sandbox.ebay.com/buy/feed', + 'production' => 'https://api.ebay.com/buy/feed' + ]; + + /** + * HTTP header constant. The Authentication Token that is used to validate the caller has permission to access the eBay servers. + */ + const HDR_AUTHORIZATION = 'Authorization'; + + /** + * HTTP header constant. The global ID of the eBay site on which the transaction took place. + */ + const HDR_MARKETPLACE_ID = 'X-EBAY-C-MARKETPLACE-ID'; + + /** + * @param array $config Configuration option values. + */ + public function __construct(array $config) + { + parent::__construct($config); + } + + /** + * Returns definitions for each configuration option that is supported. + * + * @return array An associative array of configuration definitions. + */ + public static function getConfigDefinitions() + { + $definitions = parent::getConfigDefinitions(); + + return $definitions + [ + 'apiVersion' => [ + 'valid' => ['string'], + 'default' => \DTS\eBaySDK\Feed\Services\FeedService::API_VERSION, + 'required' => true + ], + 'authorization' => [ + 'valid' => ['string'], + 'required' => true + ], + 'marketplaceId' => [ + 'valid' => ['string'] + ] + ]; + } + + /** + * Builds the needed eBay HTTP headers. + * + * @return array An associative array of eBay HTTP headers. + */ + protected function getEbayHeaders() + { + $headers = []; + + // Add required headers first. + $headers[self::HDR_AUTHORIZATION] = 'Bearer '.$this->getConfig('authorization'); + + // Add optional headers. + if ($this->getConfig('marketplaceId')) { + $headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId'); + } + + return $headers; + } +} diff --git a/src/Feed/Services/FeedService.php b/src/Feed/Services/FeedService.php new file mode 100644 index 000000000..61b54465c --- /dev/null +++ b/src/Feed/Services/FeedService.php @@ -0,0 +1,67 @@ + [ + 'method' => 'GET', + 'resource' => 'item_summary', + 'responseClass' => '\DTS\eBaySDK\Feed\Types\GetItemFeedRestResponse', + 'params' => [ + 'category_id' => [ + 'valid' => ['string'], + 'required' => true + ], + 'date' => [ + 'valid' => ['string'], + 'required' => true + ], + 'feed_type' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ] + ]; + + /** + * @param array $config Configuration option values. + */ + public function __construct(array $config = []) + { + parent::__construct($config); + } + + /** + * @param \DTS\eBaySDK\Feed\Types\GetItemFeedRestRequest $request + * @return \DTS\eBaySDK\Feed\Types\GetItemFeedRestResponse + */ + public function getItemFeed(\DTS\eBaySDK\Feed\Types\GetItemFeedRestRequest $request) + { + return $this->getItemFeedAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Feed\Types\GetItemFeedRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getItemFeedAsync(\DTS\eBaySDK\Feed\Types\GetItemFeedRestRequest $request) + { + return $this->callOperationAsync('GetItemFeed', $request); + } +} diff --git a/src/Feed/Types/ErrorDetailV3.php b/src/Feed/Types/ErrorDetailV3.php new file mode 100644 index 000000000..56ce19543 --- /dev/null +++ b/src/Feed/Types/ErrorDetailV3.php @@ -0,0 +1,102 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category' + ], + 'domain' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'domain' + ], + 'errorId' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'errorId' + ], + 'inputRefIds' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inputRefIds' + ], + 'longMessage' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'longMessage' + ], + 'message' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'message' + ], + 'outputRefIds' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'outputRefIds' + ], + 'parameters' => [ + 'type' => 'DTS\eBaySDK\Feed\Types\ErrorParameterV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'parameters' + ], + 'subDomain' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'subDomain' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Feed/Types/ErrorParameterV3.php b/src/Feed/Types/ErrorParameterV3.php new file mode 100644 index 000000000..9fa0586d9 --- /dev/null +++ b/src/Feed/Types/ErrorParameterV3.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'name' + ], + 'value' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'value' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Feed/Types/GetItemFeedRestRequest.php b/src/Feed/Types/GetItemFeedRestRequest.php new file mode 100644 index 000000000..78b62094c --- /dev/null +++ b/src/Feed/Types/GetItemFeedRestRequest.php @@ -0,0 +1,60 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category_id' + ], + 'date' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'date' + ], + 'feed_type' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'feed_type' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Feed/Types/GetItemFeedRestResponse.php b/src/Feed/Types/GetItemFeedRestResponse.php new file mode 100644 index 000000000..51df95ee9 --- /dev/null +++ b/src/Feed/Types/GetItemFeedRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Feed\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Feed\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Feed/Types/ItemFeed.php b/src/Feed/Types/ItemFeed.php new file mode 100644 index 000000000..90bb57676 --- /dev/null +++ b/src/Feed/Types/ItemFeed.php @@ -0,0 +1,193 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'ageGroup' + ], + 'brand' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'brand' + ], + 'category' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'category' + ], + 'categoryId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'color' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'color' + ], + 'condition' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'condition' + ], + 'conditionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'conditionId' + ], + 'gender' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'gender' + ], + 'gtin' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'gtin' + ], + 'imageUrl' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'imageUrl' + ], + 'itemEndDate' => [ + 'type' => 'DateTime', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemEndDate' + ], + 'itemId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemId' + ], + 'material' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'material' + ], + 'mpn' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'mpn' + ], + 'priceCurrency' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'priceCurrency' + ], + 'priceValue' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'priceValue' + ], + 'sellerFeedbackPercentage' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'sellerFeedbackPercentage' + ], + 'sellerFeedbackScore' => [ + 'type' => 'double', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'sellerFeedbackScore' + ], + 'sellerUsername' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'sellerUsername' + ], + 'size' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'size' + ], + 'sizeType' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'sizeType' + ], + 'title' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'title' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Feed/Types/ItemFeedResponse.php b/src/Feed/Types/ItemFeedResponse.php new file mode 100644 index 000000000..72ee6a314 --- /dev/null +++ b/src/Feed/Types/ItemFeedResponse.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Feed\Types\ItemFeed', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'itemFeeds' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/test/Feed/Enums/CurrencyCodeEnumTest.php b/test/Feed/Enums/CurrencyCodeEnumTest.php new file mode 100644 index 000000000..00e8fd36a --- /dev/null +++ b/test/Feed/Enums/CurrencyCodeEnumTest.php @@ -0,0 +1,28 @@ +obj = new CurrencyCodeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Enums\CurrencyCodeEnum', $this->obj); + } +} diff --git a/test/Feed/Mocks/Service.php b/test/Feed/Mocks/Service.php new file mode 100644 index 000000000..148e718e3 --- /dev/null +++ b/test/Feed/Mocks/Service.php @@ -0,0 +1,27 @@ + [ + 'method' => 'GET', + 'resource' => 'item/{item_id}', + 'responseClass' => '\DTS\eBaySDK\Test\Mocks\ComplexClass', + 'params' => [ + ] + ] + ]; + + public function __construct(array $config) + { + parent::__construct($config); + } + + public function testOperation() + { + return $this->callOperationAsync('testOperation', new ComplexClass())->wait(); + } +} diff --git a/test/Feed/Services/ServiceTest.php b/test/Feed/Services/ServiceTest.php new file mode 100644 index 000000000..f243e83b8 --- /dev/null +++ b/test/Feed/Services/ServiceTest.php @@ -0,0 +1,68 @@ +assertArrayHasKey('apiVersion', $d); + $this->assertEquals([ + 'valid' => ['string'], + 'default' => FeedService::API_VERSION, + 'required' => true + ], $d['apiVersion']); + + $this->assertArrayHasKey('authorization', $d); + $this->assertEquals([ + 'valid' => ['string'], + 'required' => true + ], $d['authorization']); + + $this->assertArrayHasKey('marketplaceId', $d); + $this->assertEquals([ + 'valid' => ['string'] + ], $d['marketplaceId']); + } + + public function testRequiredEbayHeaders() + { + $h = new HttpRestHandler(); + + $s = new Service([ + 'authorization' => '321', + 'httpHandler' => $h + ]); + + $s->testOperation(); + + // Test required headers first. + $this->assertArrayHasKey(FeedBaseService::HDR_AUTHORIZATION, $h->headers); + $this->assertEquals('Bearer 321', $h->headers[FeedBaseService::HDR_AUTHORIZATION]); + + // Test that optional headers have not been set until they have been configured. + $this->assertArrayNotHasKey(FeedBaseService::HDR_MARKETPLACE_ID, $h->headers); + } + + public function testOptionalEbayHeaders() + { + $h = new HttpRestHandler(); + + $s = new Service([ + 'authorization' => '321', + 'marketplaceId' => '123', + 'httpHandler' => $h + ]); + + $s->testOperation(); + + $this->assertArrayHasKey(FeedBaseService::HDR_MARKETPLACE_ID, $h->headers); + $this->assertEquals('123', $h->headers[FeedBaseService::HDR_MARKETPLACE_ID]); + } +} diff --git a/test/Feed/Types/ErrorDetailV3Test.php b/test/Feed/Types/ErrorDetailV3Test.php new file mode 100644 index 000000000..be80959ec --- /dev/null +++ b/test/Feed/Types/ErrorDetailV3Test.php @@ -0,0 +1,33 @@ +obj = new ErrorDetailV3(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\ErrorDetailV3', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Feed/Types/ErrorParameterV3Test.php b/test/Feed/Types/ErrorParameterV3Test.php new file mode 100644 index 000000000..de7297f7f --- /dev/null +++ b/test/Feed/Types/ErrorParameterV3Test.php @@ -0,0 +1,33 @@ +obj = new ErrorParameterV3(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\ErrorParameterV3', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Feed/Types/GetItemFeedRestRequestTest.php b/test/Feed/Types/GetItemFeedRestRequestTest.php new file mode 100644 index 000000000..a43a61469 --- /dev/null +++ b/test/Feed/Types/GetItemFeedRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetItemFeedRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\GetItemFeedRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Feed/Types/GetItemFeedRestResponseTest.php b/test/Feed/Types/GetItemFeedRestResponseTest.php new file mode 100644 index 000000000..84f8a0ff0 --- /dev/null +++ b/test/Feed/Types/GetItemFeedRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetItemFeedRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\GetItemFeedRestResponse', $this->obj); + } + + public function testExtendsItemFeedResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\ItemFeedResponse', $this->obj); + } +} diff --git a/test/Feed/Types/ItemFeedResponseTest.php b/test/Feed/Types/ItemFeedResponseTest.php new file mode 100644 index 000000000..77753e4c1 --- /dev/null +++ b/test/Feed/Types/ItemFeedResponseTest.php @@ -0,0 +1,33 @@ +obj = new ItemFeedResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\ItemFeedResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Feed/Types/ItemFeedTest.php b/test/Feed/Types/ItemFeedTest.php new file mode 100644 index 000000000..8128636e5 --- /dev/null +++ b/test/Feed/Types/ItemFeedTest.php @@ -0,0 +1,33 @@ +obj = new ItemFeed(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Feed\Types\ItemFeed', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} From 3824b7e3582f5e69913c1be7687274eee2eb1925 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 14 Jun 2017 15:12:05 +0100 Subject: [PATCH 19/31] api: support browse api version v1_beta.7.0 --- CHANGELOG.md | 1 + src/Browse/Services/BrowseService.php | 3 +++ src/Browse/Types/SearchForItemsRestRequest.php | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d921959..dc5763955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * Support Order API version v1_beta.6.0. * Support Trading API version 1007. * Support Shopping API version 1007. +* Support Browse API version v1_beta.7.0. * Support Browse API version v1_beta.6.0. ### Fixes diff --git a/src/Browse/Services/BrowseService.php b/src/Browse/Services/BrowseService.php index 34048a66a..b284eb3e3 100644 --- a/src/Browse/Services/BrowseService.php +++ b/src/Browse/Services/BrowseService.php @@ -77,6 +77,9 @@ class BrowseService extends \DTS\eBaySDK\Browse\Services\BrowseBaseService 'filter' => [ 'valid' => ['string'] ], + 'gtin' => [ + 'valid' => ['string'] + ], 'limit' => [ 'valid' => ['string'] ], diff --git a/src/Browse/Types/SearchForItemsRestRequest.php b/src/Browse/Types/SearchForItemsRestRequest.php index 7bbaf7ec4..c61cbd727 100644 --- a/src/Browse/Types/SearchForItemsRestRequest.php +++ b/src/Browse/Types/SearchForItemsRestRequest.php @@ -17,6 +17,7 @@ * @property string $epid * @property string $fieldgroups * @property string $filter + * @property string $gtin * @property string $limit * @property string $offset * @property string $q @@ -58,6 +59,12 @@ class SearchForItemsRestRequest extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'filter' ], + 'gtin' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'gtin' + ], 'limit' => [ 'type' => 'string', 'repeatable' => false, From a5876e15cb18a54a1e2f443577660aadb8dbd784 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 15 Jun 2017 16:19:09 +0100 Subject: [PATCH 20/31] api: support shopping api version 1019 --- CHANGELOG.md | 1 + src/Trading/Services/TradingService.php | 2 +- src/Trading/Types/RateTableDetailsType.php | 21 +++++++++++++++++++++ src/Trading/Types/TransactionType.php | 7 +++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 217793bc4..eea752dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Support Marketing API version 1.3.0. * Support Marketing API version 1.2.0. * Support Order API version v1_beta.6.0. +* Support Trading API version 1019. * Support Trading API version 1007. * Support Shopping API version 1007. * Support Browse API version v1_beta.7.0. diff --git a/src/Trading/Services/TradingService.php b/src/Trading/Services/TradingService.php index f059424a9..1ad2878ad 100644 --- a/src/Trading/Services/TradingService.php +++ b/src/Trading/Services/TradingService.php @@ -12,7 +12,7 @@ class TradingService extends \DTS\eBaySDK\Trading\Services\TradingBaseService { - const API_VERSION = '1007'; + const API_VERSION = '1019'; /** * @param array $config Configuration option values. diff --git a/src/Trading/Types/RateTableDetailsType.php b/src/Trading/Types/RateTableDetailsType.php index 8d38f755f..9a51688fe 100644 --- a/src/Trading/Types/RateTableDetailsType.php +++ b/src/Trading/Types/RateTableDetailsType.php @@ -13,6 +13,9 @@ /** * * @property string $DomesticRateTable + * @property string $InternationalRateTable + * @property string $DomesticRateTableId + * @property string $InternationalRateTableId */ class RateTableDetailsType extends \DTS\eBaySDK\Types\BaseType { @@ -25,6 +28,24 @@ class RateTableDetailsType extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'DomesticRateTable' + ], + 'InternationalRateTable' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'InternationalRateTable' + ], + 'DomesticRateTableId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'DomesticRateTableId' + ], + 'InternationalRateTableId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'InternationalRateTableId' ] ]; diff --git a/src/Trading/Types/TransactionType.php b/src/Trading/Types/TransactionType.php index 467765157..ceb58b946 100644 --- a/src/Trading/Types/TransactionType.php +++ b/src/Trading/Types/TransactionType.php @@ -79,6 +79,7 @@ * @property \DTS\eBaySDK\Trading\Types\DigitalDeliverySelectedType $DigitalDeliverySelected * @property boolean $Gift * @property boolean $GuaranteedShipping + * @property boolean $GuaranteedDelivery */ class TransactionType extends \DTS\eBaySDK\Types\BaseType { @@ -487,6 +488,12 @@ class TransactionType extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'GuaranteedShipping' + ], + 'GuaranteedDelivery' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'GuaranteedDelivery' ] ]; From 36848db757524b8e71e50dda702401bdfd57a3ea Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 15 Jun 2017 17:02:27 +0100 Subject: [PATCH 21/31] fix: add missing properties to postorder\types\cancelsummary close 108 --- CHANGELOG.md | 2 ++ src/PostOrder/Types/CancelSummary.php | 7 +++++++ src/PostOrder/Types/OrderCancelLineItem.php | 14 +++++++++++++ test/property_fixes/PropertyFixesTest.php | 22 +++++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eea752dfc..86d147637 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ * Added missing properties to PostOrder\Types\Error. * Added missing properties to PostOrder\Types\CancelDetail. * Added missing properties to PostOrder\Types\CancelActivityHistory. +* Added missing property lineItems to PostOrder\Types\CancelSummary. +* Added missing properties itemTitle, cancelQuantity to PostOrder\Types\OrderCancelLineItem. ## 12.0.1 - 2017-06-15 diff --git a/src/PostOrder/Types/CancelSummary.php b/src/PostOrder/Types/CancelSummary.php index d9e55c9c8..4740917e7 100644 --- a/src/PostOrder/Types/CancelSummary.php +++ b/src/PostOrder/Types/CancelSummary.php @@ -19,6 +19,7 @@ * @property string $cancelReason * @property \DTS\eBaySDK\PostOrder\Types\DateTime $cancelRequestDate * @property string $legacyOrderId + * @property \DTS\eBaySDK\PostOrder\Types\OrderCancelLineItem[] $lineItems * @property \DTS\eBaySDK\PostOrder\Enums\MarketplaceIdEnum $marketplaceId * @property string $paymentStatus * @property string $requestorType @@ -76,6 +77,12 @@ class CancelSummary extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'legacyOrderId' ], + 'lineItems' => [ + 'type' => 'DTS\eBaySDK\PostOrder\Types\OrderCancelLineItem', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'lineItems' + ], 'marketplaceId' => [ 'type' => 'string', 'repeatable' => false, diff --git a/src/PostOrder/Types/OrderCancelLineItem.php b/src/PostOrder/Types/OrderCancelLineItem.php index 703e802a7..721acb34a 100644 --- a/src/PostOrder/Types/OrderCancelLineItem.php +++ b/src/PostOrder/Types/OrderCancelLineItem.php @@ -14,6 +14,8 @@ * * @property string $itemId * @property string $transactionId + * @property string $itemTitle + * @property integer $cancelQuantity */ class OrderCancelLineItem extends \DTS\eBaySDK\Types\BaseType { @@ -32,6 +34,18 @@ class OrderCancelLineItem extends \DTS\eBaySDK\Types\BaseType 'repeatable' => false, 'attribute' => false, 'elementName' => 'transactionId' + ], + 'itemTitle' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemTitle' + ], + 'cancelQuantity' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'cancelQuantity' ] ]; diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index 960a1feda..4e92a931d 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -13,6 +13,7 @@ class PropertyFixesTest extends \PHPUnit_Framework_TestCase /** * Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/CancelSummary.html * Example of correct property names returned in the API https://developer.ebay.com/Devzone/post-order/post-order_v2_cancellation_search__get.html#Output + * Example of correct property names returned in the API https://github.com/davidtsadler/ebay-sdk-php/issues/108 */ public function testCancelSummary() { @@ -20,6 +21,7 @@ public function testCancelSummary() $this->assertEquals(null, $obj->cancelState); $this->assertEquals(null, $obj->cancelStatus); + $this->assertInstanceOf('\DTS\eBaySDK\Types\RepeatableType', $obj->lineItems); } /** @@ -128,4 +130,24 @@ public function testCancelActivityHistory() /** Yes this is because there is a typo in the actual response from the API! */ $this->assertEquals(null, $obj->cancelStatetateTo); } + + /** + * Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/CancelSummary.html + * Incorrect documentation https://developer.ebay.com/Devzone/post-order/types/OrderCancelLineItem.html + * Example of correct property names returned in the API https://github.com/davidtsadler/ebay-sdk-php/issues/108 + * + * This is a bit of an odd one. CancelSummary::lineItems does not exist. Yet the API is returning it. + * Adding this property means that is needs a lineItem class. Since I didn't want to create a new one + * I've re-used OrderCancelLineItem. + */ + public function testOrderCancelLineItem() + { + $obj = new Sdk\PostOrder\Types\OrderCancelLineItem(); + + $obj->itemTitle = 'foo'; + $this->assertInternalType('string', $obj->itemTitle); + + $obj->cancelQuantity = 123; + $this->assertInternalType('integer', $obj->cancelQuantity); + } } From dffee9c7abd086ea2c85e8399fe543ea7d7a4485 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 22 Jun 2017 11:25:50 +0100 Subject: [PATCH 22/31] fix: add missing enum to order\enums\lineitempaymentstatusenum --- CHANGELOG.md | 1 + src/Order/Enums/LineItemPaymentStatusEnum.php | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d147637..34ea8b321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ * Added missing properties to PostOrder\Types\CancelActivityHistory. * Added missing property lineItems to PostOrder\Types\CancelSummary. * Added missing properties itemTitle, cancelQuantity to PostOrder\Types\OrderCancelLineItem. +* Added missing enum to Order\Enums\LineItemPaymentStatusEnum. ## 12.0.1 - 2017-06-15 diff --git a/src/Order/Enums/LineItemPaymentStatusEnum.php b/src/Order/Enums/LineItemPaymentStatusEnum.php index 891a1be77..cbda4b760 100644 --- a/src/Order/Enums/LineItemPaymentStatusEnum.php +++ b/src/Order/Enums/LineItemPaymentStatusEnum.php @@ -13,6 +13,7 @@ class LineItemPaymentStatusEnum { const C_FAILED = 'FAILED'; + const C_NOT_PAID = 'NOT_PAID'; const C_PAID = 'PAID'; const C_PENDING = 'PENDING'; } From 23e77f8bc930c389122f940dd0dd27a14b5f69c2 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 22 Jun 2017 11:58:30 +0100 Subject: [PATCH 23/31] feature: add bulk migrate listings operation to the inventory service --- CHANGELOG.md | 1 + src/Inventory/Services/InventoryService.php | 25 ++++++ src/Inventory/Types/BulkMigrateListing.php | 46 ++++++++++ .../Types/BulkMigrateListingResponse.php | 46 ++++++++++ .../Types/BulkMigrateListingsRestRequest.php | 39 ++++++++ .../Types/BulkMigrateListingsRestResponse.php | 65 ++++++++++++++ src/Inventory/Types/InventoryItemListing.php | 53 +++++++++++ src/Inventory/Types/MigrateListing.php | 46 ++++++++++ .../Types/MigrateListingResponse.php | 88 +++++++++++++++++++ .../Types/BulkMigrateListingResponseTest.php | 33 +++++++ .../Types/BulkMigrateListingTest.php | 33 +++++++ .../BulkMigrateListingsRestRequestTest.php | 33 +++++++ .../BulkMigrateListingsRestResponseTest.php | 33 +++++++ .../Types/InventoryItemListingTest.php | 33 +++++++ .../Types/MigrateListingResponseTest.php | 33 +++++++ test/Inventory/Types/MigrateListingTest.php | 33 +++++++ 16 files changed, 640 insertions(+) create mode 100644 src/Inventory/Types/BulkMigrateListing.php create mode 100644 src/Inventory/Types/BulkMigrateListingResponse.php create mode 100644 src/Inventory/Types/BulkMigrateListingsRestRequest.php create mode 100644 src/Inventory/Types/BulkMigrateListingsRestResponse.php create mode 100644 src/Inventory/Types/InventoryItemListing.php create mode 100644 src/Inventory/Types/MigrateListing.php create mode 100644 src/Inventory/Types/MigrateListingResponse.php create mode 100644 test/Inventory/Types/BulkMigrateListingResponseTest.php create mode 100644 test/Inventory/Types/BulkMigrateListingTest.php create mode 100644 test/Inventory/Types/BulkMigrateListingsRestRequestTest.php create mode 100644 test/Inventory/Types/BulkMigrateListingsRestResponseTest.php create mode 100644 test/Inventory/Types/InventoryItemListingTest.php create mode 100644 test/Inventory/Types/MigrateListingResponseTest.php create mode 100644 test/Inventory/Types/MigrateListingTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ea8b321..076d59b8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Support Taxonomy API version v1_beta.0.0. * Added compressResponse configuration option. * Added affiliateCampaignId, affiliateReferenceId and contextualLocation configuration options. +* Added Bulk Migrate Listings operation to the Inventory service. ### Breaking changes diff --git a/src/Inventory/Services/InventoryService.php b/src/Inventory/Services/InventoryService.php index ae6a72afe..916cda596 100644 --- a/src/Inventory/Services/InventoryService.php +++ b/src/Inventory/Services/InventoryService.php @@ -104,6 +104,13 @@ class InventoryService extends \DTS\eBaySDK\Inventory\Services\InventoryBaseServ ] ] ], + 'BulkMigrateListings' => [ + 'method' => 'POST', + 'resource' => 'bulk_migrate_listing', + 'responseClass' => '\DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestResponse', + 'params' => [ + ] + ], 'CreateInventoryLocation' => [ 'method' => 'POST', 'resource' => 'location/{merchantLocationKey}', @@ -451,6 +458,24 @@ public function getInventoryItemGroupAsync(\DTS\eBaySDK\Inventory\Types\GetInven return $this->callOperationAsync('GetInventoryItemGroup', $request); } + /** + * @param \DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestRequest $request + * @return \DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestResponse + */ + public function bulkMigrateListings(\DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestRequest $request) + { + return $this->bulkMigrateListingsAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function bulkMigrateListingsAsync(\DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestRequest $request) + { + return $this->callOperationAsync('BulkMigrateListings', $request); + } + /** * @param \DTS\eBaySDK\Inventory\Types\CreateInventoryLocationRestRequest $request * @return \DTS\eBaySDK\Inventory\Types\CreateInventoryLocationRestResponse diff --git a/src/Inventory/Types/BulkMigrateListing.php b/src/Inventory/Types/BulkMigrateListing.php new file mode 100644 index 000000000..0de97cb54 --- /dev/null +++ b/src/Inventory/Types/BulkMigrateListing.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Inventory\Types\MigrateListing', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'requests' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Inventory/Types/BulkMigrateListingResponse.php b/src/Inventory/Types/BulkMigrateListingResponse.php new file mode 100644 index 000000000..724bcd982 --- /dev/null +++ b/src/Inventory/Types/BulkMigrateListingResponse.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Inventory\Types\MigrateListingResponse', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'responses' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Inventory/Types/BulkMigrateListingsRestRequest.php b/src/Inventory/Types/BulkMigrateListingsRestRequest.php new file mode 100644 index 000000000..8be2ad858 --- /dev/null +++ b/src/Inventory/Types/BulkMigrateListingsRestRequest.php @@ -0,0 +1,39 @@ +setValues(__CLASS__, $childValues); + } +} diff --git a/src/Inventory/Types/BulkMigrateListingsRestResponse.php b/src/Inventory/Types/BulkMigrateListingsRestResponse.php new file mode 100644 index 000000000..7939128f3 --- /dev/null +++ b/src/Inventory/Types/BulkMigrateListingsRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Inventory\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Inventory\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Inventory/Types/InventoryItemListing.php b/src/Inventory/Types/InventoryItemListing.php new file mode 100644 index 000000000..cfe00c455 --- /dev/null +++ b/src/Inventory/Types/InventoryItemListing.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'offerId' + ], + 'sku' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'sku' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Inventory/Types/MigrateListing.php b/src/Inventory/Types/MigrateListing.php new file mode 100644 index 000000000..fb5bbf5a8 --- /dev/null +++ b/src/Inventory/Types/MigrateListing.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'listingId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Inventory/Types/MigrateListingResponse.php b/src/Inventory/Types/MigrateListingResponse.php new file mode 100644 index 000000000..4a8d703ba --- /dev/null +++ b/src/Inventory/Types/MigrateListingResponse.php @@ -0,0 +1,88 @@ + [ + 'type' => 'DTS\eBaySDK\Inventory\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'inventoryItemGroupKey' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'inventoryItemGroupKey' + ], + 'inventoryItems' => [ + 'type' => 'DTS\eBaySDK\Inventory\Types\InventoryItemListing', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'inventoryItems' + ], + 'listingId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'listingId' + ], + 'marketplaceId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplaceId' + ], + 'statusCode' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'statusCode' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Inventory\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/test/Inventory/Types/BulkMigrateListingResponseTest.php b/test/Inventory/Types/BulkMigrateListingResponseTest.php new file mode 100644 index 000000000..71660102f --- /dev/null +++ b/test/Inventory/Types/BulkMigrateListingResponseTest.php @@ -0,0 +1,33 @@ +obj = new BulkMigrateListingResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\BulkMigrateListingResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Inventory/Types/BulkMigrateListingTest.php b/test/Inventory/Types/BulkMigrateListingTest.php new file mode 100644 index 000000000..fb9d08964 --- /dev/null +++ b/test/Inventory/Types/BulkMigrateListingTest.php @@ -0,0 +1,33 @@ +obj = new BulkMigrateListing(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\BulkMigrateListing', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Inventory/Types/BulkMigrateListingsRestRequestTest.php b/test/Inventory/Types/BulkMigrateListingsRestRequestTest.php new file mode 100644 index 000000000..751e64747 --- /dev/null +++ b/test/Inventory/Types/BulkMigrateListingsRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new BulkMigrateListingsRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestRequest', $this->obj); + } + + public function testExtendsBulkMigrateListing() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\BulkMigrateListing', $this->obj); + } +} diff --git a/test/Inventory/Types/BulkMigrateListingsRestResponseTest.php b/test/Inventory/Types/BulkMigrateListingsRestResponseTest.php new file mode 100644 index 000000000..e9bbe6cc9 --- /dev/null +++ b/test/Inventory/Types/BulkMigrateListingsRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new BulkMigrateListingsRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\BulkMigrateListingsRestResponse', $this->obj); + } + + public function testExtendsBulkMigrateListingResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\BulkMigrateListingResponse', $this->obj); + } +} diff --git a/test/Inventory/Types/InventoryItemListingTest.php b/test/Inventory/Types/InventoryItemListingTest.php new file mode 100644 index 000000000..3d11b26ce --- /dev/null +++ b/test/Inventory/Types/InventoryItemListingTest.php @@ -0,0 +1,33 @@ +obj = new InventoryItemListing(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\InventoryItemListing', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Inventory/Types/MigrateListingResponseTest.php b/test/Inventory/Types/MigrateListingResponseTest.php new file mode 100644 index 000000000..0b0ca0869 --- /dev/null +++ b/test/Inventory/Types/MigrateListingResponseTest.php @@ -0,0 +1,33 @@ +obj = new MigrateListingResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\MigrateListingResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Inventory/Types/MigrateListingTest.php b/test/Inventory/Types/MigrateListingTest.php new file mode 100644 index 000000000..de2b757ac --- /dev/null +++ b/test/Inventory/Types/MigrateListingTest.php @@ -0,0 +1,33 @@ +obj = new MigrateListing(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\MigrateListing', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} From faf1704ce390fdc923603f2ab83688576af3bccc Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 22 Jun 2017 12:25:17 +0100 Subject: [PATCH 24/31] fix: correct properties in metadata\types\errordetailv3 class --- CHANGELOG.md | 2 ++ src/Metadata/Types/ErrorDetailV3.php | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 076d59b8e..638561147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ * Support Shopping API version 1007. * Support Browse API version v1_beta.7.0. * Support Browse API version v1_beta.6.0. +* Property subDomain changed to subdomain for the Metadata\Types\ErrorDetailV3 class. +* Properties inputRefIds and outputRefIds are repeatable for the Metadata\Types\ErrorDetailV3 class. ### Fixes diff --git a/src/Metadata/Types/ErrorDetailV3.php b/src/Metadata/Types/ErrorDetailV3.php index e9c116129..47fc6c9fc 100644 --- a/src/Metadata/Types/ErrorDetailV3.php +++ b/src/Metadata/Types/ErrorDetailV3.php @@ -15,12 +15,12 @@ * @property string $category * @property string $domain * @property integer $errorId - * @property string $inputRefIds + * @property string[] $inputRefIds * @property string $longMessage * @property string $message - * @property string $outputRefIds + * @property string[] $outputRefIds * @property \DTS\eBaySDK\Metadata\Types\ErrorParameterV3[] $parameters - * @property string $subDomain + * @property string $subdomain */ class ErrorDetailV3 extends \DTS\eBaySDK\Types\BaseType { @@ -48,7 +48,7 @@ class ErrorDetailV3 extends \DTS\eBaySDK\Types\BaseType ], 'inputRefIds' => [ 'type' => 'string', - 'repeatable' => false, + 'repeatable' => true, 'attribute' => false, 'elementName' => 'inputRefIds' ], @@ -66,7 +66,7 @@ class ErrorDetailV3 extends \DTS\eBaySDK\Types\BaseType ], 'outputRefIds' => [ 'type' => 'string', - 'repeatable' => false, + 'repeatable' => true, 'attribute' => false, 'elementName' => 'outputRefIds' ], @@ -76,11 +76,11 @@ class ErrorDetailV3 extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'parameters' ], - 'subDomain' => [ + 'subdomain' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, - 'elementName' => 'subDomain' + 'elementName' => 'subdomain' ] ]; From 7d399d46ac87863c2542b6593e04d9b9c0802698 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 22 Jun 2017 14:25:29 +0100 Subject: [PATCH 25/31] api: support metadata api version 1.1.0 --- CHANGELOG.md | 1 + src/Metadata/Enums/CompatibilityTypeEnum.php | 17 ++ .../Enums/CompatibleVehicleTypeEnum.php | 37 ++++ src/Metadata/Services/MetadataService.php | 160 ++++++++++++++++++ .../AutomotivePartsCompatibilityPolicy.php | 74 ++++++++ ...motivePartsCompatibilityPolicyResponse.php | 53 ++++++ ...esForAutoPartsCompatibilityRestRequest.php | 53 ++++++ ...sForAutoPartsCompatibilityRestResponse.php | 65 +++++++ ...GetPoliciesForItemConditionRestRequest.php | 53 ++++++ ...etPoliciesForItemConditionRestResponse.php | 65 +++++++ ...oliciesForListingStructuresRestRequest.php | 53 ++++++ ...liciesForListingStructuresRestResponse.php | 65 +++++++ ...tPoliciesForNegotiatedPriceRestRequest.php | 53 ++++++ ...PoliciesForNegotiatedPriceRestResponse.php | 65 +++++++ .../GetPoliciesForReturnsRestRequest.php | 53 ++++++ .../GetPoliciesForReturnsRestResponse.php | 65 +++++++ src/Metadata/Types/ItemCondition.php | 53 ++++++ src/Metadata/Types/ItemConditionPolicy.php | 67 ++++++++ .../Types/ItemConditionPolicyResponse.php | 53 ++++++ src/Metadata/Types/ListingStructurePolicy.php | 60 +++++++ .../Types/ListingStructurePolicyResponse.php | 53 ++++++ src/Metadata/Types/NegotiatedPricePolicy.php | 74 ++++++++ .../Types/NegotiatedPricePolicyResponse.php | 53 ++++++ src/Metadata/Types/ReturnPolicy.php | 60 +++++++ src/Metadata/Types/ReturnPolicyResponse.php | 53 ++++++ .../Enums/CompatibilityTypeEnumTest.php | 28 +++ .../Enums/CompatibleVehicleTypeEnumTest.php | 28 +++ ...vePartsCompatibilityPolicyResponseTest.php | 33 ++++ ...AutomotivePartsCompatibilityPolicyTest.php | 33 ++++ ...rAutoPartsCompatibilityRestRequestTest.php | 33 ++++ ...AutoPartsCompatibilityRestResponseTest.php | 33 ++++ ...oliciesForItemConditionRestRequestTest.php | 33 ++++ ...liciesForItemConditionRestResponseTest.php | 33 ++++ ...iesForListingStructuresRestRequestTest.php | 33 ++++ ...esForListingStructuresRestResponseTest.php | 33 ++++ ...iciesForNegotiatedPriceRestRequestTest.php | 33 ++++ ...ciesForNegotiatedPriceRestResponseTest.php | 33 ++++ .../GetPoliciesForReturnsRestRequestTest.php | 33 ++++ .../GetPoliciesForReturnsRestResponseTest.php | 33 ++++ .../Types/ItemConditionPolicyResponseTest.php | 33 ++++ .../Types/ItemConditionPolicyTest.php | 33 ++++ test/Metadata/Types/ItemConditionTest.php | 33 ++++ .../ListingStructurePolicyResponseTest.php | 33 ++++ .../Types/ListingStructurePolicyTest.php | 33 ++++ .../NegotiatedPricePolicyResponseTest.php | 33 ++++ .../Types/NegotiatedPricePolicyTest.php | 33 ++++ .../Types/ReturnPolicyResponseTest.php | 33 ++++ test/Metadata/Types/ReturnPolicyTest.php | 33 ++++ 48 files changed, 2207 insertions(+) create mode 100644 src/Metadata/Enums/CompatibilityTypeEnum.php create mode 100644 src/Metadata/Enums/CompatibleVehicleTypeEnum.php create mode 100644 src/Metadata/Types/AutomotivePartsCompatibilityPolicy.php create mode 100644 src/Metadata/Types/AutomotivePartsCompatibilityPolicyResponse.php create mode 100644 src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequest.php create mode 100644 src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponse.php create mode 100644 src/Metadata/Types/GetPoliciesForItemConditionRestRequest.php create mode 100644 src/Metadata/Types/GetPoliciesForItemConditionRestResponse.php create mode 100644 src/Metadata/Types/GetPoliciesForListingStructuresRestRequest.php create mode 100644 src/Metadata/Types/GetPoliciesForListingStructuresRestResponse.php create mode 100644 src/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequest.php create mode 100644 src/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponse.php create mode 100644 src/Metadata/Types/GetPoliciesForReturnsRestRequest.php create mode 100644 src/Metadata/Types/GetPoliciesForReturnsRestResponse.php create mode 100644 src/Metadata/Types/ItemCondition.php create mode 100644 src/Metadata/Types/ItemConditionPolicy.php create mode 100644 src/Metadata/Types/ItemConditionPolicyResponse.php create mode 100644 src/Metadata/Types/ListingStructurePolicy.php create mode 100644 src/Metadata/Types/ListingStructurePolicyResponse.php create mode 100644 src/Metadata/Types/NegotiatedPricePolicy.php create mode 100644 src/Metadata/Types/NegotiatedPricePolicyResponse.php create mode 100644 src/Metadata/Types/ReturnPolicy.php create mode 100644 src/Metadata/Types/ReturnPolicyResponse.php create mode 100644 test/Metadata/Enums/CompatibilityTypeEnumTest.php create mode 100644 test/Metadata/Enums/CompatibleVehicleTypeEnumTest.php create mode 100644 test/Metadata/Types/AutomotivePartsCompatibilityPolicyResponseTest.php create mode 100644 test/Metadata/Types/AutomotivePartsCompatibilityPolicyTest.php create mode 100644 test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequestTest.php create mode 100644 test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponseTest.php create mode 100644 test/Metadata/Types/GetPoliciesForItemConditionRestRequestTest.php create mode 100644 test/Metadata/Types/GetPoliciesForItemConditionRestResponseTest.php create mode 100644 test/Metadata/Types/GetPoliciesForListingStructuresRestRequestTest.php create mode 100644 test/Metadata/Types/GetPoliciesForListingStructuresRestResponseTest.php create mode 100644 test/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequestTest.php create mode 100644 test/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponseTest.php create mode 100644 test/Metadata/Types/GetPoliciesForReturnsRestRequestTest.php create mode 100644 test/Metadata/Types/GetPoliciesForReturnsRestResponseTest.php create mode 100644 test/Metadata/Types/ItemConditionPolicyResponseTest.php create mode 100644 test/Metadata/Types/ItemConditionPolicyTest.php create mode 100644 test/Metadata/Types/ItemConditionTest.php create mode 100644 test/Metadata/Types/ListingStructurePolicyResponseTest.php create mode 100644 test/Metadata/Types/ListingStructurePolicyTest.php create mode 100644 test/Metadata/Types/NegotiatedPricePolicyResponseTest.php create mode 100644 test/Metadata/Types/NegotiatedPricePolicyTest.php create mode 100644 test/Metadata/Types/ReturnPolicyResponseTest.php create mode 100644 test/Metadata/Types/ReturnPolicyTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 638561147..4a0cc355a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Added compressResponse configuration option. * Added affiliateCampaignId, affiliateReferenceId and contextualLocation configuration options. * Added Bulk Migrate Listings operation to the Inventory service. +* Support Metadata API version 1.1.0. ### Breaking changes diff --git a/src/Metadata/Enums/CompatibilityTypeEnum.php b/src/Metadata/Enums/CompatibilityTypeEnum.php new file mode 100644 index 000000000..fef2051c9 --- /dev/null +++ b/src/Metadata/Enums/CompatibilityTypeEnum.php @@ -0,0 +1,17 @@ + true ] ] + ], + 'GetPoliciesForAutoPartsCompatibility' => [ + 'method' => 'GET', + 'resource' => 'marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies', + 'responseClass' => '\DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestResponse', + 'params' => [ + 'filter' => [ + 'valid' => ['string'] + ], + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetPoliciesForItemCondition' => [ + 'method' => 'GET', + 'resource' => 'marketplace/{marketplace_id}/get_item_condition_policies', + 'responseClass' => '\DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestResponse', + 'params' => [ + 'filter' => [ + 'valid' => ['string'] + ], + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetPoliciesForListingStructures' => [ + 'method' => 'GET', + 'resource' => 'marketplace/{marketplace_id}/get_listing_structure_policies', + 'responseClass' => '\DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestResponse', + 'params' => [ + 'filter' => [ + 'valid' => ['string'] + ], + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetPoliciesForNegotiatedPrice' => [ + 'method' => 'GET', + 'resource' => 'marketplace/{marketplace_id}/get_negotiated_price_policies', + 'responseClass' => '\DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestResponse', + 'params' => [ + 'filter' => [ + 'valid' => ['string'] + ], + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] + ], + 'GetPoliciesForReturns' => [ + 'method' => 'GET', + 'resource' => 'marketplace/{marketplace_id}/get_return_policies', + 'responseClass' => '\DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestResponse', + 'params' => [ + 'filter' => [ + 'valid' => ['string'] + ], + 'marketplace_id' => [ + 'valid' => ['string'], + 'required' => true + ] + ] ] ]; @@ -56,4 +126,94 @@ public function getSalesTaxJurisdictionsAsync(\DTS\eBaySDK\Metadata\Types\GetSal { return $this->callOperationAsync('GetSalesTaxJurisdictions', $request); } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestRequest $request + * @return \DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestResponse + */ + public function getPoliciesForAutoPartsCompatibility(\DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestRequest $request) + { + return $this->getPoliciesForAutoPartsCompatibilityAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPoliciesForAutoPartsCompatibilityAsync(\DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestRequest $request) + { + return $this->callOperationAsync('GetPoliciesForAutoPartsCompatibility', $request); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestRequest $request + * @return \DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestResponse + */ + public function getPoliciesForItemCondition(\DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestRequest $request) + { + return $this->getPoliciesForItemConditionAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPoliciesForItemConditionAsync(\DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestRequest $request) + { + return $this->callOperationAsync('GetPoliciesForItemCondition', $request); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestRequest $request + * @return \DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestResponse + */ + public function getPoliciesForListingStructures(\DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestRequest $request) + { + return $this->getPoliciesForListingStructuresAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPoliciesForListingStructuresAsync(\DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestRequest $request) + { + return $this->callOperationAsync('GetPoliciesForListingStructures', $request); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestRequest $request + * @return \DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestResponse + */ + public function getPoliciesForNegotiatedPrice(\DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestRequest $request) + { + return $this->getPoliciesForNegotiatedPriceAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPoliciesForNegotiatedPriceAsync(\DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestRequest $request) + { + return $this->callOperationAsync('GetPoliciesForNegotiatedPrice', $request); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestRequest $request + * @return \DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestResponse + */ + public function getPoliciesForReturns(\DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestRequest $request) + { + return $this->getPoliciesForReturnsAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPoliciesForReturnsAsync(\DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestRequest $request) + { + return $this->callOperationAsync('GetPoliciesForReturns', $request); + } } diff --git a/src/Metadata/Types/AutomotivePartsCompatibilityPolicy.php b/src/Metadata/Types/AutomotivePartsCompatibilityPolicy.php new file mode 100644 index 000000000..080797962 --- /dev/null +++ b/src/Metadata/Types/AutomotivePartsCompatibilityPolicy.php @@ -0,0 +1,74 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'compatibilityBasedOn' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'compatibilityBasedOn' + ], + 'compatibleVehicleTypes' => [ + 'type' => 'string', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'compatibleVehicleTypes' + ], + 'maxNumberOfCompatibleVehicles' => [ + 'type' => 'integer', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'maxNumberOfCompatibleVehicles' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/AutomotivePartsCompatibilityPolicyResponse.php b/src/Metadata/Types/AutomotivePartsCompatibilityPolicyResponse.php new file mode 100644 index 000000000..6c44b27b2 --- /dev/null +++ b/src/Metadata/Types/AutomotivePartsCompatibilityPolicyResponse.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\AutomotivePartsCompatibilityPolicy', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'automotivePartsCompatibilityPolicies' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequest.php b/src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequest.php new file mode 100644 index 000000000..fd097463b --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'filter' + ], + 'marketplace_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponse.php b/src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponse.php new file mode 100644 index 000000000..168993002 --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Metadata/Types/GetPoliciesForItemConditionRestRequest.php b/src/Metadata/Types/GetPoliciesForItemConditionRestRequest.php new file mode 100644 index 000000000..6c0c5e120 --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForItemConditionRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'filter' + ], + 'marketplace_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/GetPoliciesForItemConditionRestResponse.php b/src/Metadata/Types/GetPoliciesForItemConditionRestResponse.php new file mode 100644 index 000000000..d9f88be6e --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForItemConditionRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Metadata/Types/GetPoliciesForListingStructuresRestRequest.php b/src/Metadata/Types/GetPoliciesForListingStructuresRestRequest.php new file mode 100644 index 000000000..7866e5459 --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForListingStructuresRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'filter' + ], + 'marketplace_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/GetPoliciesForListingStructuresRestResponse.php b/src/Metadata/Types/GetPoliciesForListingStructuresRestResponse.php new file mode 100644 index 000000000..166f816a7 --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForListingStructuresRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequest.php b/src/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequest.php new file mode 100644 index 000000000..0dccafacb --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'filter' + ], + 'marketplace_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponse.php b/src/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponse.php new file mode 100644 index 000000000..8c11d5cdd --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Metadata/Types/GetPoliciesForReturnsRestRequest.php b/src/Metadata/Types/GetPoliciesForReturnsRestRequest.php new file mode 100644 index 000000000..f5d432021 --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForReturnsRestRequest.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'filter' + ], + 'marketplace_id' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'marketplace_id' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/GetPoliciesForReturnsRestResponse.php b/src/Metadata/Types/GetPoliciesForReturnsRestResponse.php new file mode 100644 index 000000000..7da9acb63 --- /dev/null +++ b/src/Metadata/Types/GetPoliciesForReturnsRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Metadata/Types/ItemCondition.php b/src/Metadata/Types/ItemCondition.php new file mode 100644 index 000000000..18ef62978 --- /dev/null +++ b/src/Metadata/Types/ItemCondition.php @@ -0,0 +1,53 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'conditionDescription' + ], + 'conditionId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'conditionId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/ItemConditionPolicy.php b/src/Metadata/Types/ItemConditionPolicy.php new file mode 100644 index 000000000..990a1ccaf --- /dev/null +++ b/src/Metadata/Types/ItemConditionPolicy.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'itemConditionRequired' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'itemConditionRequired' + ], + 'itemConditions' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ItemCondition', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'itemConditions' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/ItemConditionPolicyResponse.php b/src/Metadata/Types/ItemConditionPolicyResponse.php new file mode 100644 index 000000000..c90bd8ee0 --- /dev/null +++ b/src/Metadata/Types/ItemConditionPolicyResponse.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ItemConditionPolicy', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'itemConditionPolicies' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/ListingStructurePolicy.php b/src/Metadata/Types/ListingStructurePolicy.php new file mode 100644 index 000000000..642072abe --- /dev/null +++ b/src/Metadata/Types/ListingStructurePolicy.php @@ -0,0 +1,60 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'variationsSupported' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'variationsSupported' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/ListingStructurePolicyResponse.php b/src/Metadata/Types/ListingStructurePolicyResponse.php new file mode 100644 index 000000000..f65f348cd --- /dev/null +++ b/src/Metadata/Types/ListingStructurePolicyResponse.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ListingStructurePolicy', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'listingStructurePolicies' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/NegotiatedPricePolicy.php b/src/Metadata/Types/NegotiatedPricePolicy.php new file mode 100644 index 000000000..56c5383a9 --- /dev/null +++ b/src/Metadata/Types/NegotiatedPricePolicy.php @@ -0,0 +1,74 @@ + [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'bestOfferAutoAcceptEnabled' + ], + 'bestOfferAutoDeclineEnabled' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'bestOfferAutoDeclineEnabled' + ], + 'bestOfferCounterEnabled' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'bestOfferCounterEnabled' + ], + 'categoryId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/NegotiatedPricePolicyResponse.php b/src/Metadata/Types/NegotiatedPricePolicyResponse.php new file mode 100644 index 000000000..246f2bfbc --- /dev/null +++ b/src/Metadata/Types/NegotiatedPricePolicyResponse.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\NegotiatedPricePolicy', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'negotiatedPricePolicies' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/ReturnPolicy.php b/src/Metadata/Types/ReturnPolicy.php new file mode 100644 index 000000000..8131dfa37 --- /dev/null +++ b/src/Metadata/Types/ReturnPolicy.php @@ -0,0 +1,60 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryId' + ], + 'categoryTreeId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'categoryTreeId' + ], + 'required' => [ + 'type' => 'boolean', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'required' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Metadata/Types/ReturnPolicyResponse.php b/src/Metadata/Types/ReturnPolicyResponse.php new file mode 100644 index 000000000..ff1d4d869 --- /dev/null +++ b/src/Metadata/Types/ReturnPolicyResponse.php @@ -0,0 +1,53 @@ + [ + 'type' => 'DTS\eBaySDK\Metadata\Types\Sel:ReturnsPolicy', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'returnPolicies' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Metadata\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/test/Metadata/Enums/CompatibilityTypeEnumTest.php b/test/Metadata/Enums/CompatibilityTypeEnumTest.php new file mode 100644 index 000000000..02991d3f0 --- /dev/null +++ b/test/Metadata/Enums/CompatibilityTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new CompatibilityTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Enums\CompatibilityTypeEnum', $this->obj); + } +} diff --git a/test/Metadata/Enums/CompatibleVehicleTypeEnumTest.php b/test/Metadata/Enums/CompatibleVehicleTypeEnumTest.php new file mode 100644 index 000000000..b39397e44 --- /dev/null +++ b/test/Metadata/Enums/CompatibleVehicleTypeEnumTest.php @@ -0,0 +1,28 @@ +obj = new CompatibleVehicleTypeEnum(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Enums\CompatibleVehicleTypeEnum', $this->obj); + } +} diff --git a/test/Metadata/Types/AutomotivePartsCompatibilityPolicyResponseTest.php b/test/Metadata/Types/AutomotivePartsCompatibilityPolicyResponseTest.php new file mode 100644 index 000000000..bd1992b41 --- /dev/null +++ b/test/Metadata/Types/AutomotivePartsCompatibilityPolicyResponseTest.php @@ -0,0 +1,33 @@ +obj = new AutomotivePartsCompatibilityPolicyResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\AutomotivePartsCompatibilityPolicyResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/AutomotivePartsCompatibilityPolicyTest.php b/test/Metadata/Types/AutomotivePartsCompatibilityPolicyTest.php new file mode 100644 index 000000000..5012371c4 --- /dev/null +++ b/test/Metadata/Types/AutomotivePartsCompatibilityPolicyTest.php @@ -0,0 +1,33 @@ +obj = new AutomotivePartsCompatibilityPolicy(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\AutomotivePartsCompatibilityPolicy', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequestTest.php b/test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequestTest.php new file mode 100644 index 000000000..def2b61f1 --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForAutoPartsCompatibilityRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponseTest.php b/test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponseTest.php new file mode 100644 index 000000000..b76388359 --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForAutoPartsCompatibilityRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForAutoPartsCompatibilityRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForAutoPartsCompatibilityRestResponse', $this->obj); + } + + public function testExtendsAutomotivePartsCompatibilityPolicyResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\AutomotivePartsCompatibilityPolicyResponse', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForItemConditionRestRequestTest.php b/test/Metadata/Types/GetPoliciesForItemConditionRestRequestTest.php new file mode 100644 index 000000000..3fac09dcb --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForItemConditionRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForItemConditionRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForItemConditionRestResponseTest.php b/test/Metadata/Types/GetPoliciesForItemConditionRestResponseTest.php new file mode 100644 index 000000000..3cb89449e --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForItemConditionRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForItemConditionRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForItemConditionRestResponse', $this->obj); + } + + public function testExtendsItemConditionPolicyResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ItemConditionPolicyResponse', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForListingStructuresRestRequestTest.php b/test/Metadata/Types/GetPoliciesForListingStructuresRestRequestTest.php new file mode 100644 index 000000000..532ebcfea --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForListingStructuresRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForListingStructuresRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForListingStructuresRestResponseTest.php b/test/Metadata/Types/GetPoliciesForListingStructuresRestResponseTest.php new file mode 100644 index 000000000..bece71245 --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForListingStructuresRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForListingStructuresRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForListingStructuresRestResponse', $this->obj); + } + + public function testExtendsListingStructurePolicyResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ListingStructurePolicyResponse', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequestTest.php b/test/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequestTest.php new file mode 100644 index 000000000..f055edde2 --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForNegotiatedPriceRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForNegotiatedPriceRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponseTest.php b/test/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponseTest.php new file mode 100644 index 000000000..900e7359a --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForNegotiatedPriceRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForNegotiatedPriceRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForNegotiatedPriceRestResponse', $this->obj); + } + + public function testExtendsNegotiatedPricePolicyResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\NegotiatedPricePolicyResponse', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForReturnsRestRequestTest.php b/test/Metadata/Types/GetPoliciesForReturnsRestRequestTest.php new file mode 100644 index 000000000..724f97b06 --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForReturnsRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForReturnsRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/GetPoliciesForReturnsRestResponseTest.php b/test/Metadata/Types/GetPoliciesForReturnsRestResponseTest.php new file mode 100644 index 000000000..56fe4ae51 --- /dev/null +++ b/test/Metadata/Types/GetPoliciesForReturnsRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetPoliciesForReturnsRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\GetPoliciesForReturnsRestResponse', $this->obj); + } + + public function testExtendsReturnPolicyResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ReturnPolicyResponse', $this->obj); + } +} diff --git a/test/Metadata/Types/ItemConditionPolicyResponseTest.php b/test/Metadata/Types/ItemConditionPolicyResponseTest.php new file mode 100644 index 000000000..b07cf23f0 --- /dev/null +++ b/test/Metadata/Types/ItemConditionPolicyResponseTest.php @@ -0,0 +1,33 @@ +obj = new ItemConditionPolicyResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ItemConditionPolicyResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/ItemConditionPolicyTest.php b/test/Metadata/Types/ItemConditionPolicyTest.php new file mode 100644 index 000000000..920dc7127 --- /dev/null +++ b/test/Metadata/Types/ItemConditionPolicyTest.php @@ -0,0 +1,33 @@ +obj = new ItemConditionPolicy(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ItemConditionPolicy', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/ItemConditionTest.php b/test/Metadata/Types/ItemConditionTest.php new file mode 100644 index 000000000..f79ff4b5c --- /dev/null +++ b/test/Metadata/Types/ItemConditionTest.php @@ -0,0 +1,33 @@ +obj = new ItemCondition(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ItemCondition', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/ListingStructurePolicyResponseTest.php b/test/Metadata/Types/ListingStructurePolicyResponseTest.php new file mode 100644 index 000000000..3c1676a25 --- /dev/null +++ b/test/Metadata/Types/ListingStructurePolicyResponseTest.php @@ -0,0 +1,33 @@ +obj = new ListingStructurePolicyResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ListingStructurePolicyResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/ListingStructurePolicyTest.php b/test/Metadata/Types/ListingStructurePolicyTest.php new file mode 100644 index 000000000..6bfb0c574 --- /dev/null +++ b/test/Metadata/Types/ListingStructurePolicyTest.php @@ -0,0 +1,33 @@ +obj = new ListingStructurePolicy(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ListingStructurePolicy', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/NegotiatedPricePolicyResponseTest.php b/test/Metadata/Types/NegotiatedPricePolicyResponseTest.php new file mode 100644 index 000000000..3b82e562e --- /dev/null +++ b/test/Metadata/Types/NegotiatedPricePolicyResponseTest.php @@ -0,0 +1,33 @@ +obj = new NegotiatedPricePolicyResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\NegotiatedPricePolicyResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/NegotiatedPricePolicyTest.php b/test/Metadata/Types/NegotiatedPricePolicyTest.php new file mode 100644 index 000000000..421ff6019 --- /dev/null +++ b/test/Metadata/Types/NegotiatedPricePolicyTest.php @@ -0,0 +1,33 @@ +obj = new NegotiatedPricePolicy(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\NegotiatedPricePolicy', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/ReturnPolicyResponseTest.php b/test/Metadata/Types/ReturnPolicyResponseTest.php new file mode 100644 index 000000000..f8e1949c6 --- /dev/null +++ b/test/Metadata/Types/ReturnPolicyResponseTest.php @@ -0,0 +1,33 @@ +obj = new ReturnPolicyResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ReturnPolicyResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Metadata/Types/ReturnPolicyTest.php b/test/Metadata/Types/ReturnPolicyTest.php new file mode 100644 index 000000000..b0c86c8d0 --- /dev/null +++ b/test/Metadata/Types/ReturnPolicyTest.php @@ -0,0 +1,33 @@ +obj = new ReturnPolicy(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Metadata\Types\ReturnPolicy', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} From 23268684e33f42a988aa56b9b66b99c4ded9c679 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 22 Jun 2017 16:00:46 +0100 Subject: [PATCH 26/31] feature: add get shipping rate tables operation to the account service --- CHANGELOG.md | 2 + src/Account/Services/AccountService.php | 28 ++++++++ .../GetShippingRateTablesRestRequest.php | 46 +++++++++++++ .../GetShippingRateTablesRestResponse.php | 65 ++++++++++++++++++ src/Account/Types/RateTable.php | 67 +++++++++++++++++++ src/Account/Types/RateTableResponse.php | 46 +++++++++++++ src/Account/Types/ShippingOption.php | 7 ++ .../GetShippingRateTablesRestRequestTest.php | 33 +++++++++ .../GetShippingRateTablesRestResponseTest.php | 33 +++++++++ test/Account/Types/RateTableResponseTest.php | 33 +++++++++ test/Account/Types/RateTableTest.php | 33 +++++++++ 11 files changed, 393 insertions(+) create mode 100644 src/Account/Types/GetShippingRateTablesRestRequest.php create mode 100644 src/Account/Types/GetShippingRateTablesRestResponse.php create mode 100644 src/Account/Types/RateTable.php create mode 100644 src/Account/Types/RateTableResponse.php create mode 100644 test/Account/Types/GetShippingRateTablesRestRequestTest.php create mode 100644 test/Account/Types/GetShippingRateTablesRestResponseTest.php create mode 100644 test/Account/Types/RateTableResponseTest.php create mode 100644 test/Account/Types/RateTableTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a0cc355a..accd70437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ * Added affiliateCampaignId, affiliateReferenceId and contextualLocation configuration options. * Added Bulk Migrate Listings operation to the Inventory service. * Support Metadata API version 1.1.0. +* Added Get Shipping Rate Tables operation to the Account service. Note that eBay have not officaly released this + operation so it may be subject to change. ### Breaking changes diff --git a/src/Account/Services/AccountService.php b/src/Account/Services/AccountService.php index f4cd27614..8d2de30eb 100644 --- a/src/Account/Services/AccountService.php +++ b/src/Account/Services/AccountService.php @@ -178,6 +178,16 @@ class AccountService extends \DTS\eBaySDK\Account\Services\AccountBaseService 'params' => [ ] ], + 'GetShippingRateTables' => [ + 'method' => 'POST', + 'resource' => 'rate_table', + 'responseClass' => '\DTS\eBaySDK\Account\Types\GetShippingRateTablesRestResponse', + 'params' => [ + 'country_code' => [ + 'valid' => ['string'] + ] + ] + ], 'CreateAReturnPolicy' => [ 'method' => 'POST', 'resource' => 'return_policy', @@ -594,6 +604,24 @@ public function optOutOfProgramAsync(\DTS\eBaySDK\Account\Types\OptOutOfProgramR return $this->callOperationAsync('OptOutOfProgram', $request); } + /** + * @param \DTS\eBaySDK\Account\Types\GetShippingRateTablesRestRequest $request + * @return \DTS\eBaySDK\Account\Types\GetShippingRateTablesRestResponse + */ + public function getShippingRateTables(\DTS\eBaySDK\Account\Types\GetShippingRateTablesRestRequest $request) + { + return $this->getShippingRateTablesAsync($request)->wait(); + } + + /** + * @param \DTS\eBaySDK\Account\Types\GetShippingRateTablesRestRequest $request + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getShippingRateTablesAsync(\DTS\eBaySDK\Account\Types\GetShippingRateTablesRestRequest $request) + { + return $this->callOperationAsync('GetShippingRateTables', $request); + } + /** * @param \DTS\eBaySDK\Account\Types\CreateAReturnPolicyRestRequest $request * @return \DTS\eBaySDK\Account\Types\CreateAReturnPolicyRestResponse diff --git a/src/Account/Types/GetShippingRateTablesRestRequest.php b/src/Account/Types/GetShippingRateTablesRestRequest.php new file mode 100644 index 000000000..5b8a952a7 --- /dev/null +++ b/src/Account/Types/GetShippingRateTablesRestRequest.php @@ -0,0 +1,46 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'country_code' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Account/Types/GetShippingRateTablesRestResponse.php b/src/Account/Types/GetShippingRateTablesRestResponse.php new file mode 100644 index 000000000..f97b61b6d --- /dev/null +++ b/src/Account/Types/GetShippingRateTablesRestResponse.php @@ -0,0 +1,65 @@ + [ + 'type' => 'DTS\eBaySDK\Account\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'errors' + ], + 'warnings' => [ + 'type' => 'DTS\eBaySDK\Account\Types\ErrorDetailV3', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'warnings' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + * @param int $statusCode Status code + * @param array $headers HTTP Response headers. + */ + public function __construct(array $values = [], $statusCode = 200, array $headers = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + + $this->statusCode = (int)$statusCode; + + $this->setHeaders($headers); + } +} diff --git a/src/Account/Types/RateTable.php b/src/Account/Types/RateTable.php new file mode 100644 index 000000000..3cb70a50d --- /dev/null +++ b/src/Account/Types/RateTable.php @@ -0,0 +1,67 @@ + [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'countryCode' + ], + 'locality' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'locality' + ], + 'name' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'name' + ], + 'rateTableId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'rateTableId' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Account/Types/RateTableResponse.php b/src/Account/Types/RateTableResponse.php new file mode 100644 index 000000000..cade0e6dc --- /dev/null +++ b/src/Account/Types/RateTableResponse.php @@ -0,0 +1,46 @@ + [ + 'type' => 'DTS\eBaySDK\Account\Types\RateTable', + 'repeatable' => true, + 'attribute' => false, + 'elementName' => 'rateTables' + ] + ]; + + /** + * @param array $values Optional properties and values to assign to the object. + */ + public function __construct(array $values = []) + { + list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); + + parent::__construct($parentValues); + + if (!array_key_exists(__CLASS__, self::$properties)) { + self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); + } + + $this->setValues(__CLASS__, $childValues); + } +} diff --git a/src/Account/Types/ShippingOption.php b/src/Account/Types/ShippingOption.php index bb7400271..4f6fd32ad 100644 --- a/src/Account/Types/ShippingOption.php +++ b/src/Account/Types/ShippingOption.php @@ -17,6 +17,7 @@ * @property boolean $insuranceOffered * @property \DTS\eBaySDK\Account\Enums\ShippingOptionTypeEnum $optionType * @property \DTS\eBaySDK\Account\Types\Amount $packageHandlingCost + * @property string $rateTableId * @property \DTS\eBaySDK\Account\Types\ShippingService[] $shippingServices */ class ShippingOption extends \DTS\eBaySDK\Types\BaseType @@ -55,6 +56,12 @@ class ShippingOption extends \DTS\eBaySDK\Types\BaseType 'attribute' => false, 'elementName' => 'packageHandlingCost' ], + 'rateTableId' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'rateTableId' + ], 'shippingServices' => [ 'type' => 'DTS\eBaySDK\Account\Types\ShippingService', 'repeatable' => true, diff --git a/test/Account/Types/GetShippingRateTablesRestRequestTest.php b/test/Account/Types/GetShippingRateTablesRestRequestTest.php new file mode 100644 index 000000000..7c46e0ebc --- /dev/null +++ b/test/Account/Types/GetShippingRateTablesRestRequestTest.php @@ -0,0 +1,33 @@ +obj = new GetShippingRateTablesRestRequest(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Account\Types\GetShippingRateTablesRestRequest', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Account/Types/GetShippingRateTablesRestResponseTest.php b/test/Account/Types/GetShippingRateTablesRestResponseTest.php new file mode 100644 index 000000000..334623e22 --- /dev/null +++ b/test/Account/Types/GetShippingRateTablesRestResponseTest.php @@ -0,0 +1,33 @@ +obj = new GetShippingRateTablesRestResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Account\Types\GetShippingRateTablesRestResponse', $this->obj); + } + + public function testExtendsRateTableResponse() + { + $this->assertInstanceOf('\DTS\eBaySDK\Account\Types\RateTableResponse', $this->obj); + } +} diff --git a/test/Account/Types/RateTableResponseTest.php b/test/Account/Types/RateTableResponseTest.php new file mode 100644 index 000000000..70896fd5d --- /dev/null +++ b/test/Account/Types/RateTableResponseTest.php @@ -0,0 +1,33 @@ +obj = new RateTableResponse(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Account\Types\RateTableResponse', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} diff --git a/test/Account/Types/RateTableTest.php b/test/Account/Types/RateTableTest.php new file mode 100644 index 000000000..e5df1593c --- /dev/null +++ b/test/Account/Types/RateTableTest.php @@ -0,0 +1,33 @@ +obj = new RateTable(); + } + + public function testCanBeCreated() + { + $this->assertInstanceOf('\DTS\eBaySDK\Account\Types\RateTable', $this->obj); + } + + public function testExtendsBaseType() + { + $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); + } +} From fc12a4c23b2cde492cd9168d9fa702609c5ebb7e Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Thu, 22 Jun 2017 16:39:18 +0100 Subject: [PATCH 27/31] update: link to devbay forum --- CHANGELOG.md | 1 + README.md | 2 +- docs/_templates/social.html | 2 +- docs/index.rst | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index accd70437..16082f895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Support Metadata API version 1.1.0. * Added Get Shipping Rate Tables operation to the Account service. Note that eBay have not officaly released this operation so it may be subject to change. +* Link to forum at https://forum.devbay.net/c/php-sdk ### Breaking changes diff --git a/README.md b/README.md index 792840a7b..8ade9548d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This is a personal project that has been developed by me, [David T. Sadler](http - [User Guides](http://devbay.net/sdk/guides/) - Getting started guide and in-depth information. - [Examples](https://github.com/davidtsadler/ebay-sdk-examples) - Several examples of using the SDK. - - [Google Group](https://groups.google.com/forum/#!forum/ebay-sdk-php) - Join for support with the SDK. + - [Forum](https://forum.devbay.net/c/php-sdk) - Join for support with the SDK. - [@devbaydotnet](https://twitter.com/devbaydotnet) - Follow on Twitter for announcements of releases, important changes and so on. ## Requirements diff --git a/docs/_templates/social.html b/docs/_templates/social.html index 8c763edbe..5b8da6d71 100644 --- a/docs/_templates/social.html +++ b/docs/_templates/social.html @@ -14,7 +14,7 @@

Community


- Google Group - Join for support with the SDK. + Forum - Join for support with the SDK.
Recent Blog Posts diff --git a/docs/index.rst b/docs/index.rst index 4681f0e3b..2e4376ad5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,7 +13,7 @@ The `eBay SDK for PHP `_ enables P External links: `API Docs `_ | `GitHub `_ | `Twitter `_ -| `Support Group `_ +| `Forum `_ | `Packagist `_ From 2b77b05591cf3a2687ba34daf2f0b6df8dcf060d Mon Sep 17 00:00:00 2001 From: Philip Brown Date: Thu, 22 Jun 2017 22:11:05 -0400 Subject: [PATCH 28/31] Fixed refesh typos Replaced refesh typos with refresh to help with IDE usage. --- src/OAuth/Types/GetAppTokenRestResponse.php | 2 +- src/OAuth/Types/GetUserTokenRestResponse.php | 4 ++-- src/OAuth/Types/RefreshUserTokenRestResponse.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OAuth/Types/GetAppTokenRestResponse.php b/src/OAuth/Types/GetAppTokenRestResponse.php index c949b9881..4cac4d6b2 100644 --- a/src/OAuth/Types/GetAppTokenRestResponse.php +++ b/src/OAuth/Types/GetAppTokenRestResponse.php @@ -9,7 +9,7 @@ * @property string $access_token * @property string $token_type * @property integer $expires_in - * @property string $refesh_token + * @property string $refresh_token * @property string $error * @property string $error_description * @property string $error_uri diff --git a/src/OAuth/Types/GetUserTokenRestResponse.php b/src/OAuth/Types/GetUserTokenRestResponse.php index 48a8d0bb8..e4378986b 100644 --- a/src/OAuth/Types/GetUserTokenRestResponse.php +++ b/src/OAuth/Types/GetUserTokenRestResponse.php @@ -9,8 +9,8 @@ * @property string $access_token * @property string $token_type * @property integer $expires_in - * @property string $refesh_token - * @property string $refesh_token_expires_in + * @property string $refresh_token + * @property string $refresh_token_expires_in * @property string $error * @property string $error_description * @property string $error_uri diff --git a/src/OAuth/Types/RefreshUserTokenRestResponse.php b/src/OAuth/Types/RefreshUserTokenRestResponse.php index daa8d710d..3d5c56f1a 100644 --- a/src/OAuth/Types/RefreshUserTokenRestResponse.php +++ b/src/OAuth/Types/RefreshUserTokenRestResponse.php @@ -9,7 +9,7 @@ * @property string $access_token * @property string $token_type * @property integer $expires_in - * @property string $refesh_token + * @property string $refresh_token * @property string $error * @property string $error_description * @property string $error_uri From 8a63a978dd03a4a1ddca2a53a55297f5225264ba Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 23 Jun 2017 16:04:50 +0100 Subject: [PATCH 29/31] feature: add galleryurl to trading\types\picturedetailstype GalleryURL was removed from the Trading API version 997. However it has been seen in the API response. If your project makes use of GalleryURL be aware that eBay may stop returning this information! close #113 --- CHANGELOG.md | 3 +++ src/Trading/Types/PictureDetailsType.php | 7 +++++++ test/property_fixes/PropertyFixesTest.php | 12 ++++++++++++ 3 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16082f895..f13beb8da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ * Added Get Shipping Rate Tables operation to the Account service. Note that eBay have not officaly released this operation so it may be subject to change. * Link to forum at https://forum.devbay.net/c/php-sdk +* Add GalleryURL to Trading\Types\PictureDetailsType. + GalleryURL was removed from the Trading API version 997. However it has been seen in the API response. If your project + makes use of GalleryURL be aware that eBay may stop returning this information! ### Breaking changes diff --git a/src/Trading/Types/PictureDetailsType.php b/src/Trading/Types/PictureDetailsType.php index 706e873b5..5164dc42c 100644 --- a/src/Trading/Types/PictureDetailsType.php +++ b/src/Trading/Types/PictureDetailsType.php @@ -12,6 +12,7 @@ /** * + * @property string $GalleryURL * @property \DTS\eBaySDK\Trading\Enums\GalleryTypeCodeType $GalleryType * @property \DTS\eBaySDK\Trading\Enums\PhotoDisplayCodeType $PhotoDisplay * @property string[] $PictureURL @@ -28,6 +29,12 @@ class PictureDetailsType extends \DTS\eBaySDK\Types\BaseType * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ + 'GalleryURL' => [ + 'type' => 'string', + 'repeatable' => false, + 'attribute' => false, + 'elementName' => 'GalleryURL' + ], 'GalleryType' => [ 'type' => 'string', 'repeatable' => false, diff --git a/test/property_fixes/PropertyFixesTest.php b/test/property_fixes/PropertyFixesTest.php index 4e92a931d..35b02c6c9 100644 --- a/test/property_fixes/PropertyFixesTest.php +++ b/test/property_fixes/PropertyFixesTest.php @@ -150,4 +150,16 @@ public function testOrderCancelLineItem() $obj->cancelQuantity = 123; $this->assertInternalType('integer', $obj->cancelQuantity); } + + /** + * Even though the documentation says that GalleryURL is not a member of PictureDetailsType + * it is been returned in the API for various calls. E.g GetItem and GetMyeBaySelling. + */ + public function testGaleryURL() + { + $obj = new Sdk\Trading\Types\PictureDetailsType(); + + $obj->GalleryURL = 'foo'; + $this->assertInternalType('string', $obj->GalleryURL); + } } From e752f17f0378d096a1f9eedacea89054785cf231 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 23 Jun 2017 16:48:20 +0100 Subject: [PATCH 30/31] doc: correct changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f13beb8da..c12afd5ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -## Features +### Features * Support Feed API version v1_beta.0.0 * Support Taxonomy API version v1_beta.0.0. @@ -49,7 +49,7 @@ ## 12.0.1 - 2017-06-15 -## Fixes +### Fixes * SDK now ignores properties in the JSON response that would normally trigger an DTS\eBaySDK\Exceptions\UnknownPropertyException exception. @@ -77,7 +77,7 @@ * Support Trading API version 997. -## Features +### Features * Can now use SDK to handle generation of OAUTH tokens for the RESTFul services. @@ -151,7 +151,7 @@ ## 5.0.0 - 2016-06-04 -## Doc +### Doc * Fixed issue with JMS seriallizer. Documentation was incorrectly using @returns instead of @return. From d6083106b5caa059f423c393c584119041e35936 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 23 Jun 2017 16:50:11 +0100 Subject: [PATCH 31/31] update: bump version to 13.0.0 --- CHANGELOG.md | 2 +- src/Sdk.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c12afd5ee..9a84d80e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # CHANGELOG -## Unreleased +## 13.0.0 - 2017-06-23 ### Features diff --git a/src/Sdk.php b/src/Sdk.php index 931962b85..32b185ef9 100644 --- a/src/Sdk.php +++ b/src/Sdk.php @@ -30,7 +30,7 @@ */ class Sdk { - const VERSION = '12.0.1'; + const VERSION = '13.0.0'; /** * @var bool Controls if the SDK should enforce strict types