Skip to content

Commit 037804e

Browse files
committed
- catchup with java 1.49 (march 6. changes)
1 parent 7c93d69 commit 037804e

4 files changed

Lines changed: 84 additions & 96 deletions

File tree

src/objects/Category.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ final class Category
2323
*/
2424
public $name;
2525

26+
/**
27+
* The context free category name.
28+
* @var string|null
29+
*/
30+
public $contextFreeName;
31+
2632
/**
2733
* List of all sub categories. null or [] (empty array) if the category has no sub categories.
2834
* @var int[]|null

src/objects/Product.php

Lines changed: 15 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,6 @@ class Product
3232
*/
3333
public $variationCSV = null;
3434

35-
/**
36-
* @deprecated use first upcList entry instead.
37-
* The UPC of the product. Caution: leading zeros are truncated.
38-
* @var string
39-
*/
40-
public $upc = 0;
41-
42-
/**
43-
* @deprecated use first eanList entry instead.
44-
* The EAN of the product. Caution: leading zeros are truncated.
45-
* @var string
46-
*/
47-
public $ean = 0;
48-
49-
/**
50-
* The manufacturer’s part number.
51-
* @var string|null
52-
*/
53-
public $mpn = null;
54-
5535
/**
5636
* Comma separated list of image names of the product. Full Amazon image path:<br>
5737
* https://images-na.ssl-images-amazon.com/images/I/_image name_
@@ -106,24 +86,6 @@ class Product
10686
*/
10787
public $brand = null;
10888

109-
/**
110-
* The item's label. null if not available.
111-
* @var string|null
112-
*/
113-
public $label = null;
114-
115-
/**
116-
* The item's department. null if not available.
117-
* @var string|null
118-
*/
119-
public $department = null;
120-
121-
/**
122-
* The item's publisher. null if not available.
123-
* @var string|null
124-
*/
125-
public $publisher = null;
126-
12789
/**
12890
* The item's productGroup. null if not available.
12991
* @var string|null
@@ -136,18 +98,6 @@ class Product
13698
*/
13799
public $partNumber = null;
138100

139-
/**
140-
* The item's studio. null if not available.
141-
* @var string|null
142-
*/
143-
public $studio = null;
144-
145-
/**
146-
* The item's genre. null if not available.
147-
* @var string|null
148-
*/
149-
public $genre = null;
150-
151101
/**
152102
* The item's model. null if not available.
153103
* @var string|null
@@ -172,12 +122,6 @@ class Product
172122
*/
173123
public $edition = null;
174124

175-
/**
176-
* The item's platform. null if not available.
177-
* @var string|null
178-
*/
179-
public $platform = null;
180-
181125
/**
182126
* The item's format. null if not available.
183127
* @var string|null
@@ -266,12 +210,6 @@ class Product
266210
*/
267211
public $description = null;
268212

269-
/**
270-
* The item's format. null if not available.
271-
* @var int|null
272-
*/
273-
public $hazardousMaterialType = null;
274-
275213
/**
276214
* The package's height in millimeter. 0 or -1 if not available.
277215
* @var int
@@ -377,11 +315,25 @@ class Product
377315
public $lastEbayUpdate = 0;
378316

379317
/**
380-
* Availability of the Amazon offer {@link Product.AvailabilityType}.
318+
* Availability of the Amazon offer {@link Product.AvailabilityType}. If Amazon offer exists but does not hold the buy box the value will be 2 (unknown).
319+
* To request the Amazon availability in such cases the offers parameter is required.
381320
* @var int
382321
*/
383322
public $availabilityAmazon = -1;
384323

324+
/**
325+
* Contains subcategory rank histories. Each key represents the categoryId of the rank with the history in the corresponding value.
326+
* @var array|null
327+
*/
328+
public $salesRanks = null;
329+
330+
/**
331+
* The category node id of the main sales rank. -1 if not available.
332+
* @var int
333+
*/
334+
public $salesRankReference = -1;
335+
336+
385337
/**
386338
* States the last time we have updated the product rating and review count, in Keepa Time minutes.<br>
387339
* Use {@link KeepaTime#keepaMinuteToUnixInMillis(int)} (long)} to get an uncompressed timestamp (Unix epoch time).

src/objects/Stats.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,50 @@ class Stats
238238
*/
239239
public $buyBoxIsMAP = null;
240240

241+
/**
242+
* The minimum order quantity of the buy box. -1 if not available, 0 if no limit exists.
243+
* @var bool|null
244+
*/
245+
public $buyBoxMinOrderQuantity = null;
246+
247+
/**
248+
* The maximum order quantity of the buy box. -1 if not available, 0 if no limit exists.
249+
* @var bool|null
250+
*/
251+
public $buyBoxMaxOrderQuantity = null;
252+
253+
/**
254+
* The availability message of the buy box. null if not available.
255+
* Example: “In Stock.”
256+
* @var string|null
257+
*/
258+
public $buyBoxAvailabilityMessage = null;
259+
260+
/**
261+
* The default shipping country of the buy box seller. null if not available. Example: “US”
262+
* @var string|null
263+
*/
264+
public $buyBoxShippingCountry = null;
265+
266+
/**
267+
* If the buy box is Prime exclusive. null if not available.
268+
* @var bool|null
269+
*/
270+
public $buyBoxIsPrimeExclusive = null;
271+
272+
/**
273+
* If the buy box is Prime eligible. null if not available.
274+
* @var bool|null
275+
*/
276+
public $buyBoxIsPrimeEligible = null;
277+
278+
/**
279+
* If the buy box is a Prime Pantry offer. null if not available.
280+
* @var bool|null
281+
*/
282+
public $buyBoxIsPrimePantry = null;
283+
284+
241285
/**
242286
* Only set when the offers parameter was used. If the product is an add-on item (add-on Items ship with orders that include $25 or more of items shipped by Amazon).
243287
* @var bool|null

src/tests/ProductRequestTest.php

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,6 @@ public function testFeatures()
162162
self::assertGreaterThan(0, count($response->products[0]->features));
163163
}
164164

165-
/**
166-
* @throws \Exception
167-
*/
168-
public function testHazardousMaterialType()
169-
{
170-
$request = Request::getProductRequest(AmazonLocale::US, 0, null, null, 0, true, ['B00EAN1APM']);
171-
172-
$response = $this->api->sendRequestWithRetry($request);
173-
self::assertEquals($response->status, "OK");
174-
self::assertNotNull($response->products[0]->hazardousMaterialType);
175-
self::assertEquals(HazardousMaterialType::ORM_D_Class, $response->products[0]->hazardousMaterialType);
176-
}
177-
178165
/**
179166
* @throws \Exception
180167
*/
@@ -201,26 +188,6 @@ public function testMap()
201188
self::assertNotNull($response->products[0]->newPriceIsMAP);
202189
}
203190

204-
/**
205-
* @throws \Exception
206-
*/
207-
public function testPromotions()
208-
{
209-
$request = Request::getProductRequest(AmazonLocale::US, 0, null, null, 0, true, ['B006XISCNA']);
210-
211-
$response = $this->api->sendRequestWithRetry($request);
212-
self::assertEquals($response->status, "OK");
213-
self::assertEquals(1, count($response->products));
214-
self::assertNotNull($response->products);
215-
self::assertGreaterThan(0, count($response->products));
216-
self::assertNotNull($response->products[0]->promotions);
217-
self::assertGreaterThan(0, count($response->products[0]->promotions));
218-
self::assertNotNull($response->products[0]->promotions[0]->benefitDescription);
219-
self::assertNotNull($response->products[0]->promotions[0]->eligibilityRequirementDescription);
220-
self::assertNotNull($response->products[0]->promotions[0]->promotionId);
221-
self::assertNotNull($response->products[0]->promotions[0]->type);
222-
}
223-
224191

225192
/**
226193
* @throws \Exception
@@ -468,4 +435,23 @@ public function testItemDimensions()
468435
self::assertGreaterThan(0, $response->products[0]->itemLength);
469436
self::assertGreaterThan(0, $response->products[0]->itemWeight);
470437
}
438+
439+
440+
/**
441+
* @throws \Exception
442+
*/
443+
public function testSalesRanks()
444+
{
445+
$request = Request::getProductRequest(AmazonLocale::DE, 20, null, null, 0, true, ['B07HB4TJH1']);
446+
447+
$response = $this->api->sendRequestWithRetry($request);
448+
self::assertEquals($response->status, "OK");
449+
self::assertEquals(1, count($response->products));
450+
self::assertNotNull($response->products[0]->salesRanks);
451+
foreach($response->products[0]->salesRanks as $caId => $historie)
452+
{
453+
self::assertGreaterThan(0, $caId);
454+
self::assertGreaterThan(0, count($historie));
455+
}
456+
}
471457
}

0 commit comments

Comments
 (0)