Skip to content

Commit e01da05

Browse files
authored
Make optional parameters nullable even when they have a default value (#561)
1 parent 48c72b9 commit e01da05

File tree

19 files changed

+66
-66
lines changed

19 files changed

+66
-66
lines changed

resources/php-amazon-selling-partner-api/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
6464
* @param AccessToken $accessToken
6565
* @param string $region
6666
{{#allParams}}
67-
* @param {{{dataType}}}{{^required}}{{#defaultValue}}{{/defaultValue}}{{^defaultValue}}|null{{/defaultValue}}{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
67+
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
6868
{{/allParams}}
6969
*
7070
* @throws ApiException on non-2xx response

src/AmazonPHP/SellingPartner/Api/CatalogApi/CatalogItemSDK.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,14 @@ public function getCatalogItemRequest(AccessToken $accessToken, string $region,
268268
* @param null|string[] $keywords A comma-delimited list of words to search the Amazon catalog for. **Note:** Cannot be used with `identifiers`. (optional)
269269
* @param null|string[] $brand_names A comma-delimited list of brand names to limit the search for `keywords`-based queries. **Note:** Cannot be used with `identifiers`. (optional)
270270
* @param null|string[] $classification_ids A comma-delimited list of classification identifiers to limit the search for `keywords`-based queries. **Note:** Cannot be used with `identifiers`. (optional)
271-
* @param int $page_size Number of results to be returned per page. (optional, default to 10)
271+
* @param null|int $page_size Number of results to be returned per page. (optional, default to 10)
272272
* @param null|string $page_token A token to fetch a certain page when there are multiple pages worth of results. (optional)
273273
* @param null|string $keywords_locale The language of the keywords provided for `keywords`-based queries. Defaults to the primary locale of the marketplace. **Note:** Cannot be used with `identifiers`. (optional)
274274
*
275275
* @throws ApiException on non-2xx response
276276
* @throws InvalidArgumentException
277277
*/
278-
public function searchCatalogItems(AccessToken $accessToken, string $region, array $marketplace_ids, ?array $identifiers = null, ?string $identifiers_type = null, ?array $included_data = null, ?string $locale = null, ?string $seller_id = null, ?array $keywords = null, ?array $brand_names = null, ?array $classification_ids = null, int $page_size = 10, ?string $page_token = null, ?string $keywords_locale = null) : \AmazonPHP\SellingPartner\Model\CatalogItem\ItemSearchResults
278+
public function searchCatalogItems(AccessToken $accessToken, string $region, array $marketplace_ids, ?array $identifiers = null, ?string $identifiers_type = null, ?array $included_data = null, ?string $locale = null, ?string $seller_id = null, ?array $keywords = null, ?array $brand_names = null, ?array $classification_ids = null, ?int $page_size = 10, ?string $page_token = null, ?string $keywords_locale = null) : \AmazonPHP\SellingPartner\Model\CatalogItem\ItemSearchResults
279279
{
280280
$request = $this->searchCatalogItemsRequest($accessToken, $region, $marketplace_ids, $identifiers, $identifiers_type, $included_data, $locale, $seller_id, $keywords, $brand_names, $classification_ids, $page_size, $page_token, $keywords_locale);
281281

src/AmazonPHP/SellingPartner/Api/DefaultApi/FinancesSDK.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ public function __construct(private readonly ClientInterface $client, private re
3535
/**
3636
* Operation listFinancialEventGroups.
3737
*
38-
* @param int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
38+
* @param null|int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
3939
* @param null|\DateTimeInterface $financial_event_group_started_before A date used for selecting financial event groups that opened before (but not at) a specified date and time, in ISO 8601 format. The date-time must be later than FinancialEventGroupStartedAfter and no later than two minutes before the request was submitted. If FinancialEventGroupStartedAfter and FinancialEventGroupStartedBefore are more than 180 days apart, no financial event groups are returned. (optional)
4040
* @param null|\DateTimeInterface $financial_event_group_started_after A date used for selecting financial event groups that opened after (or at) a specified date and time, in ISO 8601 format. The date-time must be no later than two minutes before the request was submitted. (optional)
4141
* @param null|string $next_token A string token returned in the response of your previous request. (optional)
4242
*
4343
* @throws ApiException on non-2xx response
4444
* @throws InvalidArgumentException
4545
*/
46-
public function listFinancialEventGroups(AccessToken $accessToken, string $region, int $max_results_per_page = 100, ?\DateTimeInterface $financial_event_group_started_before = null, ?\DateTimeInterface $financial_event_group_started_after = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventGroupsResponse
46+
public function listFinancialEventGroups(AccessToken $accessToken, string $region, ?int $max_results_per_page = 100, ?\DateTimeInterface $financial_event_group_started_before = null, ?\DateTimeInterface $financial_event_group_started_after = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventGroupsResponse
4747
{
4848
$request = $this->listFinancialEventGroupsRequest($accessToken, $region, $max_results_per_page, $financial_event_group_started_before, $financial_event_group_started_after, $next_token);
4949

@@ -253,15 +253,15 @@ public function listFinancialEventGroupsRequest(AccessToken $accessToken, string
253253
/**
254254
* Operation listFinancialEvents.
255255
*
256-
* @param int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
256+
* @param null|int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
257257
* @param null|\DateTimeInterface $posted_after A date used for selecting financial events posted after (or at) a specified time. The date-time must be no later than two minutes before the request was submitted, in ISO 8601 date time format. (optional)
258258
* @param null|\DateTimeInterface $posted_before A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than PostedAfter and no later than two minutes before the request was submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no financial events are returned. You must specify the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes. (optional)
259259
* @param null|string $next_token A string token returned in the response of your previous request. (optional)
260260
*
261261
* @throws ApiException on non-2xx response
262262
* @throws InvalidArgumentException
263263
*/
264-
public function listFinancialEvents(AccessToken $accessToken, string $region, int $max_results_per_page = 100, ?\DateTimeInterface $posted_after = null, ?\DateTimeInterface $posted_before = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventsResponse
264+
public function listFinancialEvents(AccessToken $accessToken, string $region, ?int $max_results_per_page = 100, ?\DateTimeInterface $posted_after = null, ?\DateTimeInterface $posted_before = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventsResponse
265265
{
266266
$request = $this->listFinancialEventsRequest($accessToken, $region, $max_results_per_page, $posted_after, $posted_before, $next_token);
267267

@@ -472,15 +472,15 @@ public function listFinancialEventsRequest(AccessToken $accessToken, string $reg
472472
* Operation listFinancialEventsByGroupId.
473473
*
474474
* @param string $event_group_id The identifier of the financial event group to which the events belong. (required)
475-
* @param int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
475+
* @param null|int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
476476
* @param null|\DateTimeInterface $posted_after A date used for selecting financial events posted after (or at) a specified time. The date-time **must** be more than two minutes before the time of the request, in ISO 8601 date time format. (optional)
477477
* @param null|\DateTimeInterface $posted_before A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than `PostedAfter` and no later than two minutes before the request was submitted, in ISO 8601 date time format. If `PostedAfter` and `PostedBefore` are more than 180 days apart, no financial events are returned. You must specify the `PostedAfter` parameter if you specify the `PostedBefore` parameter. Default: Now minus two minutes. (optional)
478478
* @param null|string $next_token A string token returned in the response of your previous request. (optional)
479479
*
480480
* @throws ApiException on non-2xx response
481481
* @throws InvalidArgumentException
482482
*/
483-
public function listFinancialEventsByGroupId(AccessToken $accessToken, string $region, string $event_group_id, int $max_results_per_page = 100, ?\DateTimeInterface $posted_after = null, ?\DateTimeInterface $posted_before = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventsResponse
483+
public function listFinancialEventsByGroupId(AccessToken $accessToken, string $region, string $event_group_id, ?int $max_results_per_page = 100, ?\DateTimeInterface $posted_after = null, ?\DateTimeInterface $posted_before = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventsResponse
484484
{
485485
$request = $this->listFinancialEventsByGroupIdRequest($accessToken, $region, $event_group_id, $max_results_per_page, $posted_after, $posted_before, $next_token);
486486

@@ -708,13 +708,13 @@ public function listFinancialEventsByGroupIdRequest(AccessToken $accessToken, st
708708
* Operation listFinancialEventsByOrderId.
709709
*
710710
* @param string $order_id An Amazon-defined order identifier, in 3-7-7 format. (required)
711-
* @param int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
711+
* @param null|int $max_results_per_page The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (optional, default to 100)
712712
* @param null|string $next_token A string token returned in the response of your previous request. (optional)
713713
*
714714
* @throws ApiException on non-2xx response
715715
* @throws InvalidArgumentException
716716
*/
717-
public function listFinancialEventsByOrderId(AccessToken $accessToken, string $region, string $order_id, int $max_results_per_page = 100, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventsResponse
717+
public function listFinancialEventsByOrderId(AccessToken $accessToken, string $region, string $order_id, ?int $max_results_per_page = 100, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\Finances\ListFinancialEventsResponse
718718
{
719719
$request = $this->listFinancialEventsByOrderIdRequest($accessToken, $region, $order_id, $max_results_per_page, $next_token);
720720

src/AmazonPHP/SellingPartner/Api/DefinitionsApi/ProductTypesDefinitionsSDK.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ public function __construct(private readonly ClientInterface $client, private re
3838
* @param string $product_type The Amazon product type name. (required)
3939
* @param string[] $marketplace_ids A comma-delimited list of Amazon marketplace identifiers for the request. Note: This parameter is limited to one marketplaceId at this time. (required)
4040
* @param null|string $seller_id A selling partner identifier. When provided, seller-specific requirements and values are populated within the product type definition schema, such as brand names associated with the selling partner. (optional)
41-
* @param string $product_type_version The version of the Amazon product type to retrieve. Defaults to \"LATEST\",. Prerelease versions of product type definitions may be retrieved with \"RELEASE_CANDIDATE\". If no prerelease version is currently available, the \"LATEST\" live version will be provided. (optional, default to 'LATEST')
42-
* @param string $requirements The name of the requirements set to retrieve requirements for. (optional, default to 'LISTING')
43-
* @param string $requirements_enforced Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to 'ENFORCED')
44-
* @param string $locale Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to 'DEFAULT')
41+
* @param null|string $product_type_version The version of the Amazon product type to retrieve. Defaults to \"LATEST\",. Prerelease versions of product type definitions may be retrieved with \"RELEASE_CANDIDATE\". If no prerelease version is currently available, the \"LATEST\" live version will be provided. (optional, default to 'LATEST')
42+
* @param null|string $requirements The name of the requirements set to retrieve requirements for. (optional, default to 'LISTING')
43+
* @param null|string $requirements_enforced Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all the required attributes being present (such as for partial updates). (optional, default to 'ENFORCED')
44+
* @param null|string $locale Locale for retrieving display labels and other presentation details. Defaults to the default language of the first marketplace in the request. (optional, default to 'DEFAULT')
4545
*
4646
* @throws ApiException on non-2xx response
4747
* @throws InvalidArgumentException
4848
*/
49-
public function getDefinitionsProductType(AccessToken $accessToken, string $region, string $product_type, array $marketplace_ids, ?string $seller_id = null, string $product_type_version = 'LATEST', string $requirements = 'LISTING', string $requirements_enforced = 'ENFORCED', string $locale = 'DEFAULT') : \AmazonPHP\SellingPartner\Model\ProductTypesDefinitions\ProductTypeDefinition
49+
public function getDefinitionsProductType(AccessToken $accessToken, string $region, string $product_type, array $marketplace_ids, ?string $seller_id = null, ?string $product_type_version = 'LATEST', ?string $requirements = 'LISTING', ?string $requirements_enforced = 'ENFORCED', ?string $locale = 'DEFAULT') : \AmazonPHP\SellingPartner\Model\ProductTypesDefinitions\ProductTypeDefinition
5050
{
5151
$request = $this->getDefinitionsProductTypeRequest($accessToken, $region, $product_type, $marketplace_ids, $seller_id, $product_type_version, $requirements, $requirements_enforced, $locale);
5252

src/AmazonPHP/SellingPartner/Api/FbaInventoryApi/FBAInventorySDK.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(private readonly ClientInterface $client, private re
3838
* @param string $granularity_type The granularity type for the inventory aggregation level. (required)
3939
* @param string $granularity_id The granularity ID for the inventory aggregation level. (required)
4040
* @param string[] $marketplace_ids The marketplace ID for the marketplace for which to return inventory summaries. (required)
41-
* @param bool $details true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). (optional, default to false)
41+
* @param null|bool $details true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). (optional, default to false)
4242
* @param null|\DateTimeInterface $start_date_time A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected. (optional)
4343
* @param null|string[] $seller_skus A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs. (optional)
4444
* @param null|string $seller_sku A single seller SKU used for querying the specified seller SKU inventory summaries. (optional)
@@ -47,7 +47,7 @@ public function __construct(private readonly ClientInterface $client, private re
4747
* @throws ApiException on non-2xx response
4848
* @throws InvalidArgumentException
4949
*/
50-
public function getInventorySummaries(AccessToken $accessToken, string $region, string $granularity_type, string $granularity_id, array $marketplace_ids, bool $details = false, ?\DateTimeInterface $start_date_time = null, ?array $seller_skus = null, ?string $seller_sku = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\FBAInventory\GetInventorySummariesResponse
50+
public function getInventorySummaries(AccessToken $accessToken, string $region, string $granularity_type, string $granularity_id, array $marketplace_ids, ?bool $details = false, ?\DateTimeInterface $start_date_time = null, ?array $seller_skus = null, ?string $seller_sku = null, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\FBAInventory\GetInventorySummariesResponse
5151
{
5252
$request = $this->getInventorySummariesRequest($accessToken, $region, $granularity_type, $granularity_id, $marketplace_ids, $details, $start_date_time, $seller_skus, $seller_sku, $next_token);
5353

0 commit comments

Comments
 (0)