Skip to content

Commit

Permalink
Correct templates so that optional request method params are nullable. (
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonhebert authored Nov 27, 2024
1 parent 8cc2f70 commit 7d7b13b
Show file tree
Hide file tree
Showing 43 changed files with 282 additions and 222 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/automatino-pr-description-validate.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Automation - PR Description Validate"

on:
pull_request:
types: ["opened", "edited", "reopened", "ready_for_review"]
pull_request_target:
types: ["opened", "edited", "reopened", "ready_for_review", "synchronize"]

jobs:
automation:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/automation-changelog-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ name: "Automation - Changelog Release"

on:
push:
tags:
- '*'
tags: [ '*' ]

jobs:
automation:
uses: aeon-php/actions/.github/workflows/automation-changelog-release.yml@main
secrets:
automation_github_token: "${{ secrets.GITHUB_TOKEN }}"
automation_github_token: "${{ secrets.ACCESS_TOKEN }}"
3 changes: 2 additions & 1 deletion .github/workflows/automation-changelog-update.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Automation - Changelog Update"

on:
workflow_dispatch:
push:
branches:
- "6.x"
Expand All @@ -9,4 +10,4 @@ jobs:
automation:
uses: aeon-php/actions/.github/workflows/automation-changelog-update.yml@main
secrets:
automation_github_token: "${{ secrets.GITHUB_TOKEN }}"
automation_github_token: "${{ secrets.ACCESS_TOKEN }}"
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
automation:
uses: aeon-php/actions/.github/workflows/automation-release-description-update.yml@main
secrets:
automation_github_token: "${{ secrets.GITHUB_TOKEN }}"
automation_github_token: "${{ secrets.ACCESS_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "MD Link Linter"
uses: "docker://norberttech/md-link-linter:latest"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand All @@ -32,7 +32,7 @@ jobs:
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache Composer dependencies"
uses: "actions/cache@v2"
uses: "actions/cache@v4"
with:
path: |
${{ steps.composer-cache.outputs.dir }}
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand All @@ -78,7 +78,7 @@ jobs:
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache Composer dependencies"
uses: "actions/cache@v2"
uses: "actions/cache@v4"
with:
path: |
${{ steps.composer-cache.outputs.dir }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v4"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand All @@ -30,7 +30,7 @@ jobs:
ini-values: memory_limit=-1

- name: "Cache dependencies"
uses: "actions/cache@v2"
uses: "actions/cache@v4"
with:
path: |
~/.composer/cache
Expand Down
2 changes: 1 addition & 1 deletion resources/php-amazon-selling-partner-api/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
* @param AccessToken $accessToken
* @param string $region
{{#allParams}}
* @param {{{dataType}}}{{^required}}{{#defaultValue}}{{/defaultValue}}{{^defaultValue}}|null{{/defaultValue}}{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
*
* @throws \{{invokerPackage}}\Exception\InvalidArgumentException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use Psr\Http\Message\RequestInterface;
* @param AccessToken $accessToken
* @param string $region
{{#allParams}}
* @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}}
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}
*
* @throws ApiException on non-2xx response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ public function listInboundShipments(AccessToken $accessToken, string $region, ?
* @param null|string $shipment_status Filter by inbound shipment status. (optional)
* @param null|\DateTimeInterface $updated_after List the inbound shipments that were updated after a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. (optional)
* @param null|\DateTimeInterface $updated_before List the inbound shipments that were updated before a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. (optional)
* @param int $max_results Maximum number of results to return. (optional, default to 25)
* @param null|int $max_results Maximum number of results to return. (optional, default to 25)
* @param null|string $next_token Token to retrieve the next set of paginated results. (optional)
*
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
*/
public function listInboundShipmentsRequest(AccessToken $accessToken, string $region, ?string $sort_by = null, ?string $sort_order = null, ?string $shipment_status = null, ?\DateTimeInterface $updated_after = null, ?\DateTimeInterface $updated_before = null, int $max_results = 25, ?string $next_token = null) : RequestInterface
public function listInboundShipmentsRequest(AccessToken $accessToken, string $region, ?string $sort_by = null, ?string $sort_order = null, ?string $shipment_status = null, ?\DateTimeInterface $updated_after = null, ?\DateTimeInterface $updated_before = null, ?int $max_results = 25, ?string $next_token = null) : RequestInterface
{
if ($max_results !== null && $max_results > 200) {
throw new InvalidArgumentException('invalid value for "$max_results" when calling AwdApi.listInboundShipments, must be smaller than or equal to 200.');
Expand Down Expand Up @@ -589,11 +589,11 @@ public function listInventory(AccessToken $accessToken, string $region, ?string
* @param null|string $sort_order Sort the response in `ASCENDING` or `DESCENDING` order. (optional)
* @param null|string $details Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals. (optional)
* @param null|string $next_token Token to retrieve the next set of paginated results. (optional)
* @param int $max_results Maximum number of results to return. (optional, default to 25)
* @param null|int $max_results Maximum number of results to return. (optional, default to 25)
*
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
*/
public function listInventoryRequest(AccessToken $accessToken, string $region, ?string $sku = null, ?string $sort_order = null, ?string $details = null, ?string $next_token = null, int $max_results = 25) : RequestInterface
public function listInventoryRequest(AccessToken $accessToken, string $region, ?string $sku = null, ?string $sort_order = null, ?string $details = null, ?string $next_token = null, ?int $max_results = 25) : RequestInterface
{
if ($max_results !== null && $max_results > 200) {
throw new InvalidArgumentException('invalid value for "$max_results" when calling AwdApi.listInventory, must be smaller than or equal to 200.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function getInboundShipment(AccessToken $accessToken, string $region, str
* @param null|string $shipment_status Filter by inbound shipment status. (optional)
* @param null|\DateTimeInterface $updated_after List the inbound shipments that were updated after a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. (optional)
* @param null|\DateTimeInterface $updated_before List the inbound shipments that were updated before a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format. (optional)
* @param int $max_results Maximum number of results to return. (optional, default to 25)
* @param null|int $max_results Maximum number of results to return. (optional, default to 25)
* @param null|string $next_token Token to retrieve the next set of paginated results. (optional)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException
*/
public function listInboundShipments(AccessToken $accessToken, string $region, ?string $sort_by = null, ?string $sort_order = null, ?string $shipment_status = null, ?\DateTimeInterface $updated_after = null, ?\DateTimeInterface $updated_before = null, int $max_results = 25, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\WarehousingAndDistribution\ShipmentListing;
public function listInboundShipments(AccessToken $accessToken, string $region, ?string $sort_by = null, ?string $sort_order = null, ?string $shipment_status = null, ?\DateTimeInterface $updated_after = null, ?\DateTimeInterface $updated_before = null, ?int $max_results = 25, ?string $next_token = null) : \AmazonPHP\SellingPartner\Model\WarehousingAndDistribution\ShipmentListing;

/**
* Operation listInventory.
Expand All @@ -66,10 +66,10 @@ public function listInboundShipments(AccessToken $accessToken, string $region, ?
* @param null|string $sort_order Sort the response in `ASCENDING` or `DESCENDING` order. (optional)
* @param null|string $details Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals. (optional)
* @param null|string $next_token Token to retrieve the next set of paginated results. (optional)
* @param int $max_results Maximum number of results to return. (optional, default to 25)
* @param null|int $max_results Maximum number of results to return. (optional, default to 25)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException
*/
public function listInventory(AccessToken $accessToken, string $region, ?string $sku = null, ?string $sort_order = null, ?string $details = null, ?string $next_token = null, int $max_results = 25) : \AmazonPHP\SellingPartner\Model\WarehousingAndDistribution\InventoryListing;
public function listInventory(AccessToken $accessToken, string $region, ?string $sku = null, ?string $sort_order = null, ?string $details = null, ?string $next_token = null, ?int $max_results = 25) : \AmazonPHP\SellingPartner\Model\WarehousingAndDistribution\InventoryListing;
}
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ public function searchCatalogItems(AccessToken $accessToken, string $region, arr
* @param null|string[] $keywords A comma-delimited list of words to search the Amazon catalog for. **Note:** Cannot be used with `identifiers`. (optional)
* @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)
* @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)
* @param int $page_size Number of results to be returned per page. (optional, default to 10)
* @param null|int $page_size Number of results to be returned per page. (optional, default to 10)
* @param null|string $page_token A token to fetch a certain page when there are multiple pages worth of results. (optional)
* @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)
*
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
*/
public function searchCatalogItemsRequest(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) : RequestInterface
public function searchCatalogItemsRequest(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) : RequestInterface
{
// verify the required parameter 'marketplace_ids' is set
if ($marketplace_ids === null || (\is_array($marketplace_ids) && \count($marketplace_ids) === 0)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public function getCatalogItem(AccessToken $accessToken, string $region, string
* @param null|string[] $keywords A comma-delimited list of words to search the Amazon catalog for. **Note:** Cannot be used with `identifiers`. (optional)
* @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)
* @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)
* @param int $page_size Number of results to be returned per page. (optional, default to 10)
* @param null|int $page_size Number of results to be returned per page. (optional, default to 10)
* @param null|string $page_token A token to fetch a certain page when there are multiple pages worth of results. (optional)
* @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)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException
*/
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;
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;
}
Loading

0 comments on commit 7d7b13b

Please sign in to comment.