Skip to content

Commit

Permalink
Fixed SDK namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed May 31, 2021
1 parent 48d38a8 commit ce2f6f8
Show file tree
Hide file tree
Showing 165 changed files with 1,189 additions and 511 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
/docs export-ignore
/tests export-ignore
/tools export-ignore
/config export-ignore

/.php_cs export-ignore
/composer.lock export-ignore
/README.md export-ignore
/psalm.xml export-ignore

/.gitattributes export-ignore
/.gitignore export-ignore
2 changes: 1 addition & 1 deletion bin/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docker run --rm -v "${PWD}:/sp-api" openapitools/openapi-generator-cli generate

docker run --rm -v "${PWD}:/sp-api" openapitools/openapi-generator-cli generate \
-i https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/fba-inbound-eligibility-api-model/fbaInbound.json \
-c /sp-api/config/generator-fba-inbound-eligibility.yaml \
-c /sp-api/config/generator-fba-inbound.yaml \
--global-property models,apis,apiDocs=false,modelDocs=false,modelTests=false,apiTests=false,supportingFiles=false \
-o /sp-api

Expand Down
26 changes: 25 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@
"psr-4": { "AmazonPHP\\Test\\" : "test/" }
},
"scripts": {
"clean": [
"rm -rf src/AmazonPHP/SellingPartner/API",
"rm -rf src/AmazonPHP/SellingPartner/Model"
],
"generate": [
"Composer\\Config::disableProcessTimeout",
"@clean",
"bin/generate.sh",
"@rector:process:force",
"@rector:process:force",
"@cs:php:fix"
"@cs:php:fix",
"@cs:php:fix:namespaces"
],
"build": [
"@static:analyze"
Expand All @@ -62,6 +68,24 @@
],
"post-update-cmd": [
"@tools:install"
],
"cs:php:fix:namespaces": [
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\AplusContentApi\\APlusSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/AplusContentApi",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\AuthorizationApi\\AuthorizationSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/AuthorizationApi",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\CatalogApi\\CatalogItemSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/CatalogApi",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\FbaInboundApi\\FBAInboundSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/FbaInboundApi",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\FbaInventoryApi\\FBAInventorySDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/FbaInventoryApi",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\OrdersV0Api\\OrdersSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/OrdersV0Api",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\ReportsApi\\ReportsSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/ReportsApi",
"tools/vendor/bin/psalm-refactor --move \"AmazonPHP\\SellingPartner\\Api\\TokensApi\\TokensSDK\" --into \"AmazonPHP\\SellingPartner\\Api\"",
"rm -rf src/AmazonPHP/SellingPartner/Api/TokensApi"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ additionalProperties:
invokerPackage: AmazonPHP\SellingPartner
srcBasePath: src/AmazonPHP/SellingPartner
variableNamingConvention: camelCase
modelPackage: Model\FBAInboundEligibility
packageName: FBAInboundEligibilitySDK
modelPackage: Model\FBAInbound
packageName: FBAInboundSDK
files:
api.mustache:
templateType: API
destinationFilename: /FBAInboundEligibilitySDK.php
destinationFilename: /FBAInboundSDK.php
15 changes: 15 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
2 changes: 1 addition & 1 deletion resources/php-amazon-selling-partner-api/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use \ArrayAccess;
{{/parentSchema}}
{{/isEnum}}
use \{{invokerPackage}}\ObjectSerializer;
use \{{invokerPackage}}\Model\ModelInterface;
use \{{invokerPackage}}\ModelInterface;

/**
* This class was auto-generated by https://github.com/OpenAPITools/openapi-generator/.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace AmazonPHP\SellingPartner\Api\AuthorizationApi;
namespace AmazonPHP\SellingPartner\Api;

use AmazonPHP\SellingPartner\Exception\ApiException;
use AmazonPHP\SellingPartner\Exception\InvalidArgumentException;
Expand Down Expand Up @@ -32,8 +32,8 @@ public function __construct(OAuth $authentication)
* @param string $developerId Your developer ID. This must be one of the developer ID values that you provided when you registered your application in Developer Central. (required)
* @param string $mwsAuthToken The MWS Auth Token that was generated when the seller authorized your application on the Marketplace Appstore. (required)
*
* @throws \AmazonPHP\SellingPartner\Exception\ApiException on non-2xx response
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException
*/
public function getAuthorizationCode(string $sellingPartnerId, string $developerId, string $mwsAuthToken) : \AmazonPHP\SellingPartner\Model\Authorization\GetAuthorizationCodeResponse
{
Expand All @@ -49,7 +49,7 @@ public function getAuthorizationCode(string $sellingPartnerId, string $developer
* @param string $developerId Your developer ID. This must be one of the developer ID values that you provided when you registered your application in Developer Central. (required)
* @param string $mwsAuthToken The MWS Auth Token that was generated when the seller authorized your application on the Marketplace Appstore. (required)
*
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
* @throws InvalidArgumentException
*
* @return RequestInterface
*/
Expand Down Expand Up @@ -178,10 +178,10 @@ public function getAuthorizationCodeRequest(string $sellingPartnerId, string $de
* @param string $developerId Your developer ID. This must be one of the developer ID values that you provided when you registered your application in Developer Central. (required)
* @param string $mwsAuthToken The MWS Auth Token that was generated when the seller authorized your application on the Marketplace Appstore. (required)
*
* @throws \AmazonPHP\SellingPartner\Exception\ApiException on non-2xx response
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException
*
* @return array<\AmazonPHP\SellingPartner\Model\Authorization\GetAuthorizationCodeResponse>
* @return array<array-key, \AmazonPHP\SellingPartner\Model\Authorization\GetAuthorizationCodeResponse>
*/
private function getAuthorizationCodeWithHttpInfo(string $sellingPartnerId, string $developerId, string $mwsAuthToken) : array
{
Expand Down
Loading

0 comments on commit ce2f6f8

Please sign in to comment.