Skip to content

Commit e6af6e5

Browse files
authored
Add FulfillmentInbound V0 back to the library (#645)
Add @deprecated and deprecation notice to API methods marked as such. Adjust tests and ObjectSerializer to account for the FulfillmentInbound V0 API.
1 parent d81b9b6 commit e6af6e5

File tree

99 files changed

+27219
-29
lines changed

Some content is hidden

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

99 files changed

+27219
-29
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ Some minor adjustments were made in the template files for models/api.
9191
[6.x](https://github.com/amazon-php/sp-api-sdk/tree/6.x) comes with changes to the Fulfillment Inbound API as well as other additions and removals.
9292
- Additions
9393
- Fulfillment Inbound API v2024-03-20
94+
- This is a major change. The ```v2024-03-20``` version takes the place of the ```V0``` version in namespace whereas the ```V0``` version SDK is now ```FulfillmentInboundV0SDK``` and the ```V0``` models are within the ```Model\FulfillmentInboundV0``` directory.
9495
- Amazon Warehousing and Distribution API v2024-05-09
9596
- Application Management API v2023-11-30
9697
- Removals
97-
- Fulfillment Inbound API v0
9898
- Authorization API
9999
- FBA Small and Light API
100100
- You can retrieve the new fees for affected products by using the Product Fees API and/or the relevant FBA and Referral Fee reports.
@@ -108,6 +108,7 @@ Some minor adjustments were made in the template files for models/api.
108108
- [CatalogItemSDK](/src/AmazonPHP/SellingPartner/Api/CatalogApi/CatalogItemSDK.php)
109109
- [FBAInboundSDK](/src/AmazonPHP/SellingPartner/Api/FbaInboundApi/FBAInboundSDK.php)
110110
- [FBAInventorySDK](/src/AmazonPHP/SellingPartner/Api/FbaInventoryApi/FBAInventorySDK.php)
111+
- [FulfillmentInboundV0SDK](/src/AmazonPHP/SellingPartner/Api/FbaInboundApi/FulfillmentInboundV0SDK.php)
111112
- [FulfillmentInboundSDK](/src/AmazonPHP/SellingPartner/Api/FbaInboundApi/FulfillmentInboundSDK.php)
112113
- [FeedsSDK](/src/AmazonPHP/SellingPartner/Api/FeedsApi/FeedsSDK.php)
113114
- [FinancesSDK](/src/AmazonPHP/SellingPartner/Api/DefaultApi/FinancesSDK.php)

bin/generate.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ docker run --user "$(id -u)":"$(id -g)" --rm -v "${PWD}:/sp-api" openapitools/op
4747
--language-specific-primitives \\DateTimeInterface \
4848
--type-mappings date=\\DateTimeInterface,Date=\\DateTimeInterface,DateTime=\\DateTimeInterface
4949

50+
docker run --user "$(id -u)":"$(id -g)" --rm -v "${PWD}:/sp-api" openapitools/openapi-generator-cli generate \
51+
-i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/fulfillment-inbound-api-model/fulfillmentInboundV0.json \
52+
-c /sp-api/config/generator-fulfillment-inbound-v0.yaml \
53+
--global-property models,apis,apiDocs=false,modelDocs=false,modelTests=false,apiTests=false,supportingFiles=false \
54+
-o /sp-api \
55+
--language-specific-primitives \\DateTimeInterface \
56+
--type-mappings date=\\DateTimeInterface,Date=\\DateTimeInterface,DateTime=\\DateTimeInterface
57+
5058
docker run --user "$(id -u)":"$(id -g)" --rm -v "${PWD}:/sp-api" openapitools/openapi-generator-cli generate \
5159
-i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/fulfillment-inbound-api-model/fulfillmentInbound_2024-03-20.json \
5260
-c /sp-api/config/generator-fulfillment-inbound.yaml \
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
generatorName: php
2+
templateDir: sp-api/resources/php-amazon-selling-partner-api
3+
additionalProperties:
4+
invokerPackage: AmazonPHP\SellingPartner
5+
srcBasePath: src/AmazonPHP/SellingPartner
6+
modelPackage: Model\FulfillmentInboundV0
7+
packageName: FulfillmentInboundV0
8+
files:
9+
api.mustache:
10+
templateType: API
11+
destinationFilename: /FulfillmentInboundV0SDK.php
12+
api_interface.mustache:
13+
templateType: API
14+
destinationFilename: /FulfillmentInboundV0SDKInterface.php

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,18 @@ final {{#operations}}class {{packageName}}SDK implements {{packageName}}SDKInter
6666
{{#allParams}}
6767
* @param {{{dataType}}}{{^required}}|null{{/required}} ${{paramName}} {{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
6868
{{/allParams}}
69-
*
69+
*{{#isDeprecated}}
70+
* @deprecated
71+
*{{/isDeprecated}}
7072
* @throws ApiException on non-2xx response
7173
* @throws InvalidArgumentException
7274
* @return {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}
7375
*/
7476
public function {{operationId}}(AccessToken $accessToken, string $region{{^vendorExtensions.x-group-parameters}}{{#allParams}}, ${{paramName}}{{^required}} = {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}{{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}, $associative_array{{/vendorExtensions.x-group-parameters}})
7577
{
76-
$request = $this->{{operationId}}Request($accessToken, $region{{^vendorExtensions.x-group-parameters}}{{#allParams}}, ${{paramName}}{{^-last}}{{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}, $associative_array{{/vendorExtensions.x-group-parameters}});
78+
{{#isDeprecated}}trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
79+
80+
{{/isDeprecated}}$request = $this->{{operationId}}Request($accessToken, $region{{^vendorExtensions.x-group-parameters}}{{#allParams}}, ${{paramName}}{{^-last}}{{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}, $associative_array{{/vendorExtensions.x-group-parameters}});
7781

7882
$this->configuration->extensions()->preRequest('{{packageName}}', '{{operationId}}', $request);
7983

0 commit comments

Comments
 (0)