Skip to content

Commit 7d7b13b

Browse files
authored
Correct templates so that optional request method params are nullable. (#702)
1 parent 8cc2f70 commit 7d7b13b

File tree

43 files changed

+282
-222
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+282
-222
lines changed

.github/workflows/automatino-pr-description-validate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "Automation - PR Description Validate"
22

33
on:
4-
pull_request:
5-
types: ["opened", "edited", "reopened", "ready_for_review"]
4+
pull_request_target:
5+
types: ["opened", "edited", "reopened", "ready_for_review", "synchronize"]
66

77
jobs:
88
automation:

.github/workflows/automation-changelog-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: "Automation - Changelog Release"
22

33
on:
44
push:
5-
tags:
6-
- '*'
5+
tags: [ '*' ]
76

87
jobs:
98
automation:
109
uses: aeon-php/actions/.github/workflows/automation-changelog-release.yml@main
1110
secrets:
12-
automation_github_token: "${{ secrets.GITHUB_TOKEN }}"
11+
automation_github_token: "${{ secrets.ACCESS_TOKEN }}"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "Automation - Changelog Update"
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- "6.x"
@@ -9,4 +10,4 @@ jobs:
910
automation:
1011
uses: aeon-php/actions/.github/workflows/automation-changelog-update.yml@main
1112
secrets:
12-
automation_github_token: "${{ secrets.GITHUB_TOKEN }}"
13+
automation_github_token: "${{ secrets.ACCESS_TOKEN }}"

.github/workflows/automation-release-description-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ jobs:
99
automation:
1010
uses: aeon-php/actions/.github/workflows/automation-release-description-update.yml@main
1111
secrets:
12-
automation_github_token: "${{ secrets.GITHUB_TOKEN }}"
12+
automation_github_token: "${{ secrets.ACCESS_TOKEN }}"

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: "Checkout"
17-
uses: "actions/checkout@v2"
17+
uses: "actions/checkout@v4"
1818

1919
- name: "MD Link Linter"
2020
uses: "docker://norberttech/md-link-linter:latest"

.github/workflows/test-suite.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: "Checkout"
19-
uses: "actions/checkout@v2"
19+
uses: "actions/checkout@v4"
2020

2121
- name: "Install PHP"
2222
uses: "shivammathur/setup-php@v2"
@@ -32,7 +32,7 @@ jobs:
3232
echo "::set-output name=dir::$(composer config cache-files-dir)"
3333
3434
- name: "Cache Composer dependencies"
35-
uses: "actions/cache@v2"
35+
uses: "actions/cache@v4"
3636
with:
3737
path: |
3838
${{ steps.composer-cache.outputs.dir }}
@@ -62,7 +62,7 @@ jobs:
6262

6363
steps:
6464
- name: "Checkout"
65-
uses: "actions/checkout@v2"
65+
uses: "actions/checkout@v4"
6666

6767
- name: "Install PHP"
6868
uses: "shivammathur/setup-php@v2"
@@ -78,7 +78,7 @@ jobs:
7878
echo "::set-output name=dir::$(composer config cache-files-dir)"
7979
8080
- name: "Cache Composer dependencies"
81-
uses: "actions/cache@v2"
81+
uses: "actions/cache@v4"
8282
with:
8383
path: |
8484
${{ steps.composer-cache.outputs.dir }}

.github/workflows/update-models.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: "Checkout"
23-
uses: "actions/checkout@v2"
23+
uses: "actions/checkout@v4"
2424

2525
- name: "Install PHP"
2626
uses: "shivammathur/setup-php@v2"
@@ -30,7 +30,7 @@ jobs:
3030
ini-values: memory_limit=-1
3131

3232
- name: "Cache dependencies"
33-
uses: "actions/cache@v2"
33+
uses: "actions/cache@v4"
3434
with:
3535
path: |
3636
~/.composer/cache

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
189189
* @param AccessToken $accessToken
190190
* @param string $region
191191
{{#allParams}}
192-
* @param {{{dataType}}}{{^required}}{{#defaultValue}}{{/defaultValue}}{{^defaultValue}}|null{{/defaultValue}}{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
192+
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
193193
{{/allParams}}
194194
*
195195
* @throws \{{invokerPackage}}\Exception\InvalidArgumentException

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use Psr\Http\Message\RequestInterface;
4747
* @param AccessToken $accessToken
4848
* @param string $region
4949
{{#allParams}}
50-
* @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}}
50+
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
5151
{{/allParams}}
5252
*
5353
* @throws ApiException on non-2xx response

src/AmazonPHP/SellingPartner/Api/AwdApi/WarehousingAndDistributionSDK.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,12 @@ public function listInboundShipments(AccessToken $accessToken, string $region, ?
344344
* @param null|string $shipment_status Filter by inbound shipment status. (optional)
345345
* @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)
346346
* @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)
347-
* @param int $max_results Maximum number of results to return. (optional, default to 25)
347+
* @param null|int $max_results Maximum number of results to return. (optional, default to 25)
348348
* @param null|string $next_token Token to retrieve the next set of paginated results. (optional)
349349
*
350350
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
351351
*/
352-
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
352+
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
353353
{
354354
if ($max_results !== null && $max_results > 200) {
355355
throw new InvalidArgumentException('invalid value for "$max_results" when calling AwdApi.listInboundShipments, must be smaller than or equal to 200.');
@@ -589,11 +589,11 @@ public function listInventory(AccessToken $accessToken, string $region, ?string
589589
* @param null|string $sort_order Sort the response in `ASCENDING` or `DESCENDING` order. (optional)
590590
* @param null|string $details Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals. (optional)
591591
* @param null|string $next_token Token to retrieve the next set of paginated results. (optional)
592-
* @param int $max_results Maximum number of results to return. (optional, default to 25)
592+
* @param null|int $max_results Maximum number of results to return. (optional, default to 25)
593593
*
594594
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
595595
*/
596-
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
596+
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
597597
{
598598
if ($max_results !== null && $max_results > 200) {
599599
throw new InvalidArgumentException('invalid value for "$max_results" when calling AwdApi.listInventory, must be smaller than or equal to 200.');

0 commit comments

Comments
 (0)