Skip to content

Commit

Permalink
Merge pull request #741 from KhorneHoly/main
Browse files Browse the repository at this point in the history
Added a modification to the catalog-items 2022 data, Pagination and Refinements must be nullable.
  • Loading branch information
jlevers authored Jun 26, 2024
2 parents 9ed95b0 + 2d5ddd1 commit 2fff6c1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
13 changes: 13 additions & 0 deletions resources/metadata/modifications.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@
]
}
]
},
"catalog-items": {
"2022-04-01": [
{
"comment": "Remove required 'Pagination' and 'Refinements', see https://github.com/jlevers/selling-partner-api/issues/740",
"action": "replace",
"path": "components.schemas.ItemSearchResults.required",
"value": [
"items",
"numberOfResults"
]
}
]
}
}
}
4 changes: 1 addition & 3 deletions resources/models/seller/catalog-items/v2022-04-01.json
Original file line number Diff line number Diff line change
Expand Up @@ -4111,9 +4111,7 @@
"ItemSearchResults": {
"required": [
"items",
"numberOfResults",
"pagination",
"refinements"
"numberOfResults"
],
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ final class ItemSearchResults extends Response
* @param int $numberOfResults For `identifiers`-based searches, the total number of Amazon catalog items found. For `keywords`-based searches, the estimated total number of Amazon catalog items matched by the search query (only results up to the page count limit will be returned per request regardless of the number found).
*
* Note: The maximum number of items (ASINs) that can be returned and paged through is 1000.
* @param Pagination $pagination When a request produces a response that exceeds the `pageSize`, pagination occurs. This means the response is divided into individual pages. To retrieve the next page or the previous page, you must pass the `nextToken` value or the `previousToken` value as the `pageToken` parameter in the next request. When you receive the last page, there will be no `nextToken` key in the pagination object.
* @param Refinements $refinements Search refinements.
* @param Item[] $items A list of items from the Amazon catalog.
* @param ?Pagination $pagination When a request produces a response that exceeds the `pageSize`, pagination occurs. This means the response is divided into individual pages. To retrieve the next page or the previous page, you must pass the `nextToken` value or the `previousToken` value as the `pageToken` parameter in the next request. When you receive the last page, there will be no `nextToken` key in the pagination object.
* @param ?Refinements $refinements Search refinements.
*/
public function __construct(
public readonly int $numberOfResults,
public readonly Pagination $pagination,
public readonly Refinements $refinements,
public readonly array $items,
public readonly ?Pagination $pagination = null,
public readonly ?Refinements $refinements = null,
) {}
}

0 comments on commit 2fff6c1

Please sign in to comment.