Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevers authored Jun 18, 2024
2 parents f918ef1 + 496e7ed commit a95c993
Show file tree
Hide file tree
Showing 49 changed files with 609 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Validate and lint
name: Validate, lint, and test

on:
push:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ $connector->debugRequest(

Then make requests with the connector as usual, and you'll hit the closure above every time a request is fired. You can also debug responses in a similar fashion – check out the [Saloon docs](https://docs.saloon.dev/digging-deeper/debugging#debugging-responses) for more details.

If you want to output your debug data to a file, you can do so with the `SellingPartnerApi::debugRequestToFile()`, `SellingPartnerApi::debugResponseToFile()`, and `SellingPartnerApi::debugToFile()` methods. These methods all take an `$outputPath` argument and an optional `$die` argument.

## Supported API segments

Expand Down
3 changes: 2 additions & 1 deletion resources/generator-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"baseFilesNamespace": "SellingPartnerApi",
"namespaceSuffixes": {
"resource": null
}
},
"datetimeFormat": "Y-m-d\\TH:i:s\\Z"
}
143 changes: 140 additions & 3 deletions resources/models/seller/catalog-items/v2022-04-01.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Generator/Generators/RequestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function generateRequestClass(Endpoint $endpoint): PhpFile
if (SimpleType::isScalar($bodyType)) {
$returnValText = '[$this->%s]';
} elseif ($bodyType === 'DateTime') {
$returnValText = '$this->%s->format(\DateTime::RFC3339)';
$returnValText = '[$this->%s->format(\''.$this->config->datetimeFormat.'\')]';
} elseif (! Utils::isBuiltinType($bodyType)) {
$returnValText = '$this->%s->toArray()';
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/Seller/CatalogItemsV0/Dto/RelationshipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ final class RelationshipType extends Dto
* @param ?string $color The color variation of the item.
* @param ?string $edition The edition variation of the item.
* @param ?string $flavor The flavor variation of the item.
* @param ?string[] $gemType The gem type attributes of the item.
* @param ?string[] $gemType The gem type variations of the item.
* @param ?string $golfClubFlex The golf club flex variation of an item.
* @param ?string $handOrientation The hand orientation variation of an item.
* @param ?string $hardwarePlatform The hardware platform variation of an item.
* @param ?string[] $materialType The material type attributes of the item.
* @param ?string[] $materialType The material type variations of an item.
* @param ?string $metalType The metal type variation of an item.
* @param ?string $model The model variation of an item.
* @param ?string[] $operatingSystem The operating system attributes of the item.
* @param ?string[] $operatingSystem The operating system variations of an item.
* @param ?string $productTypeSubcategory The product type subcategory variation of an item.
* @param ?string $ringSize The ring size variation of an item.
* @param ?string $shaftMaterial The shaft material variation of an item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
final class ItemBrowseClassification extends Dto
{
/**
* @param string $displayName Display name for the classification.
* @param string $displayName Display name for the classification (browse node).
* @param string $classificationId Identifier of the classification (browse node identifier).
* @param ?ItemBrowseClassification $parent Classification (browse node) associated with an Amazon catalog item.
*/
public function __construct(
public readonly string $displayName,
public readonly string $classificationId,
public readonly ?ItemBrowseClassification $parent = null,
) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is auto-generated by Saloon SDK Generator
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
* Do not modify it directly.
*/

declare(strict_types=1);

namespace SellingPartnerApi\Seller\CatalogItemsV20220401\Dto;

use SellingPartnerApi\Dto;

final class ItemBrowseClassificationsByMarketplace extends Dto
{
protected static array $complexArrayTypes = ['classifications' => [ItemBrowseClassification::class]];

/**
* @param string $marketplaceId Amazon marketplace identifier.
* @param ItemBrowseClassification[]|null $classifications Classifications (browse nodes) associated with the item in the Amazon catalog for the indicated Amazon marketplace.
*/
public function __construct(
public readonly string $marketplaceId,
public readonly ?array $classifications = null,
) {
}
}
4 changes: 4 additions & 0 deletions src/Seller/CatalogItemsV20220401/Responses/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace SellingPartnerApi\Seller\CatalogItemsV20220401\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\CatalogItemsV20220401\Dto\ItemBrowseClassificationsByMarketplace;
use SellingPartnerApi\Seller\CatalogItemsV20220401\Dto\ItemDimensionsByMarketplace;
use SellingPartnerApi\Seller\CatalogItemsV20220401\Dto\ItemIdentifiersByMarketplace;
use SellingPartnerApi\Seller\CatalogItemsV20220401\Dto\ItemImagesByMarketplace;
Expand All @@ -23,6 +24,7 @@
final class Item extends Response
{
protected static array $complexArrayTypes = [
'classifications' => [ItemBrowseClassificationsByMarketplace::class],
'dimensions' => [ItemDimensionsByMarketplace::class],
'identifiers' => [ItemIdentifiersByMarketplace::class],
'images' => [ItemImagesByMarketplace::class],
Expand All @@ -36,6 +38,7 @@ final class Item extends Response
/**
* @param string $asin Amazon Standard Identification Number (ASIN) is the unique identifier for an item in the Amazon catalog.
* @param ?mixed[] $attributes A JSON object that contains structured item attribute data keyed by attribute name. Catalog item attributes conform to the related product type definitions available in the Selling Partner API for Product Type Definitions.
* @param ItemBrowseClassificationsByMarketplace[]|null $classifications Array of classifications (browse nodes) associated with the item in the Amazon catalog by Amazon marketplace.
* @param ItemDimensionsByMarketplace[]|null $dimensions Array of dimensions associated with the item in the Amazon catalog by Amazon marketplace.
* @param ItemIdentifiersByMarketplace[]|null $identifiers Identifiers associated with the item in the Amazon catalog, such as UPC and EAN identifiers.
* @param ItemImagesByMarketplace[]|null $images Images for an item in the Amazon catalog.
Expand All @@ -48,6 +51,7 @@ final class Item extends Response
public function __construct(
public readonly string $asin,
public readonly ?array $attributes = null,
public readonly ?array $classifications = null,
public readonly ?array $dimensions = null,
public readonly ?array $identifiers = null,
public readonly ?array $images = null,
Expand Down
24 changes: 24 additions & 0 deletions src/Seller/DataKioskV20231115/Dto/Pagination2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* This file is auto-generated by Saloon SDK Generator
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
* Do not modify it directly.
*/

declare(strict_types=1);

namespace SellingPartnerApi\Seller\DataKioskV20231115\Dto;

use SellingPartnerApi\Dto;

final class Pagination2 extends Dto
{
/**
* @param ?string $nextToken A token that can be used to fetch the next page of results.
*/
public function __construct(
public readonly ?string $nextToken = null,
) {
}
}
4 changes: 2 additions & 2 deletions src/Seller/DataKioskV20231115/Requests/GetQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function defaultQuery(): array
return array_filter([
'processingStatuses' => $this->processingStatuses,
'pageSize' => $this->pageSize,
'createdSince' => $this->createdSince?->format(\DateTime::RFC3339),
'createdUntil' => $this->createdUntil?->format(\DateTime::RFC3339),
'createdSince' => $this->createdSince?->format('Y-m-d\TH:i:s\Z'),
'createdUntil' => $this->createdUntil?->format('Y-m-d\TH:i:s\Z'),
'paginationToken' => $this->paginationToken,
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
namespace SellingPartnerApi\Seller\DataKioskV20231115\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\DataKioskV20231115\Dto\Pagination;
use SellingPartnerApi\Seller\DataKioskV20231115\Dto\Pagination2;

final class GetQueriesResponse extends Response
{
protected static array $complexArrayTypes = ['queries' => [Query::class]];

/**
* @param Query[] $queries A list of queries.
* @param ?Pagination $pagination When a query produces results that are not included in the data document, pagination occurs. This means the results are divided into pages. To retrieve the next page, you must pass a `CreateQuerySpecification` object with `paginationToken` set to this object's `nextToken` and with `query` set to this object's `query` in the subsequent `createQuery` request. When there are no more pages to fetch, the `nextToken` field will be absent.
* @param ?Pagination2 $pagination When a request has results that are not included in this response, pagination occurs. This means the results are divided into pages. To retrieve the next page, you must pass the `nextToken` as the `paginationToken` query parameter in the subsequent `getQueries` request. All other parameters must be provided with the same values that were provided with the request that generated this token, with the exception of `pageSize` which can be modified between calls to `getQueries`. When there are no more pages to fetch, the `nextToken` field will be absent.
*/
public function __construct(
public readonly array $queries,
public readonly ?Pagination $pagination = null,
public readonly ?Pagination2 $pagination = null,
) {
}
}
2 changes: 1 addition & 1 deletion src/Seller/FBAInboundV0/Requests/ConfirmPreorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(

public function defaultQuery(): array
{
return array_filter(['NeedByDate' => $this->needByDate?->format(\DateTime::RFC3339), 'MarketplaceId' => $this->marketplaceId]);
return array_filter(['NeedByDate' => $this->needByDate?->format('Y-m-d\TH:i:s\Z'), 'MarketplaceId' => $this->marketplaceId]);
}

public function resolveEndpoint(): string
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV0/Requests/GetShipmentItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function defaultQuery(): array
return array_filter([
'QueryType' => $this->queryType,
'MarketplaceId' => $this->marketplaceId,
'LastUpdatedAfter' => $this->lastUpdatedAfter?->format(\DateTime::RFC3339),
'LastUpdatedBefore' => $this->lastUpdatedBefore?->format(\DateTime::RFC3339),
'LastUpdatedAfter' => $this->lastUpdatedAfter?->format('Y-m-d\TH:i:s\Z'),
'LastUpdatedBefore' => $this->lastUpdatedBefore?->format('Y-m-d\TH:i:s\Z'),
'NextToken' => $this->nextToken,
]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV0/Requests/GetShipments.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function defaultQuery(): array
'MarketplaceId' => $this->marketplaceId,
'ShipmentStatusList' => $this->shipmentStatusList,
'ShipmentIdList' => $this->shipmentIdList,
'LastUpdatedAfter' => $this->lastUpdatedAfter?->format(\DateTime::RFC3339),
'LastUpdatedBefore' => $this->lastUpdatedBefore?->format(\DateTime::RFC3339),
'LastUpdatedAfter' => $this->lastUpdatedAfter?->format('Y-m-d\TH:i:s\Z'),
'LastUpdatedBefore' => $this->lastUpdatedBefore?->format('Y-m-d\TH:i:s\Z'),
'NextToken' => $this->nextToken,
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function defaultQuery(): array
'granularityId' => $this->granularityId,
'marketplaceIds' => $this->marketplaceIds,
'details' => $this->details,
'startDateTime' => $this->startDateTime?->format(\DateTime::RFC3339),
'startDateTime' => $this->startDateTime?->format('Y-m-d\TH:i:s\Z'),
'sellerSkus' => $this->sellerSkus,
'sellerSku' => $this->sellerSku,
'nextToken' => $this->nextToken,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(

public function defaultQuery(): array
{
return array_filter(['queryStartDate' => $this->queryStartDate?->format(\DateTime::RFC3339), 'nextToken' => $this->nextToken]);
return array_filter(['queryStartDate' => $this->queryStartDate?->format('Y-m-d\TH:i:s\Z'), 'nextToken' => $this->nextToken]);
}

public function resolveEndpoint(): string
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FeedsV20210630/Requests/GetFeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function defaultQuery(): array
'marketplaceIds' => $this->marketplaceIds,
'pageSize' => $this->pageSize,
'processingStatuses' => $this->processingStatuses,
'createdSince' => $this->createdSince?->format(\DateTime::RFC3339),
'createdUntil' => $this->createdUntil?->format(\DateTime::RFC3339),
'createdSince' => $this->createdSince?->format('Y-m-d\TH:i:s\Z'),
'createdUntil' => $this->createdUntil?->format('Y-m-d\TH:i:s\Z'),
'nextToken' => $this->nextToken,
]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FinancesV0/Requests/ListFinancialEventGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function defaultQuery(): array
{
return array_filter([
'MaxResultsPerPage' => $this->maxResultsPerPage,
'FinancialEventGroupStartedBefore' => $this->financialEventGroupStartedBefore?->format(\DateTime::RFC3339),
'FinancialEventGroupStartedAfter' => $this->financialEventGroupStartedAfter?->format(\DateTime::RFC3339),
'FinancialEventGroupStartedBefore' => $this->financialEventGroupStartedBefore?->format('Y-m-d\TH:i:s\Z'),
'FinancialEventGroupStartedAfter' => $this->financialEventGroupStartedAfter?->format('Y-m-d\TH:i:s\Z'),
'NextToken' => $this->nextToken,
]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FinancesV0/Requests/ListFinancialEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function defaultQuery(): array
{
return array_filter([
'MaxResultsPerPage' => $this->maxResultsPerPage,
'PostedAfter' => $this->postedAfter?->format(\DateTime::RFC3339),
'PostedBefore' => $this->postedBefore?->format(\DateTime::RFC3339),
'PostedAfter' => $this->postedAfter?->format('Y-m-d\TH:i:s\Z'),
'PostedBefore' => $this->postedBefore?->format('Y-m-d\TH:i:s\Z'),
'NextToken' => $this->nextToken,
]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function defaultQuery(): array
{
return array_filter([
'MaxResultsPerPage' => $this->maxResultsPerPage,
'PostedAfter' => $this->postedAfter?->format(\DateTime::RFC3339),
'PostedBefore' => $this->postedBefore?->format(\DateTime::RFC3339),
'PostedAfter' => $this->postedAfter?->format('Y-m-d\TH:i:s\Z'),
'PostedBefore' => $this->postedBefore?->format('Y-m-d\TH:i:s\Z'),
'NextToken' => $this->nextToken,
]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/MessagingV1/Dto/Embedded.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

final class Embedded extends Dto
{
protected static array $complexArrayTypes = ['actions' => [LinkObject::class]];
protected static array $complexArrayTypes = ['actions' => [GetMessagingActionResponse::class]];

/**
* @param LinkObject[] $actions Eligible actions for the specified amazonOrderId.
* @param GetMessagingActionResponse[] $actions
*/
public function __construct(
public readonly array $actions,
Expand Down
24 changes: 24 additions & 0 deletions src/Seller/MessagingV1/Dto/Embedded2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* This file is auto-generated by Saloon SDK Generator
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
* Do not modify it directly.
*/

declare(strict_types=1);

namespace SellingPartnerApi\Seller\MessagingV1\Dto;

use SellingPartnerApi\Dto;

final class Embedded2 extends Dto
{
/**
* @param ?GetSchemaResponse $schema
*/
public function __construct(
public readonly ?GetSchemaResponse $schema = null,
) {
}
}
8 changes: 4 additions & 4 deletions src/Seller/MessagingV1/Dto/GetMessagingActionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ final class GetMessagingActionResponse extends Dto
protected static array $complexArrayTypes = ['errors' => [Error::class]];

/**
* @param ?Links $links
* @param ?Embedded $embedded
* @param ?Links2 $links
* @param ?Embedded2 $embedded
* @param ?MessagingAction $payload A simple object containing the name of the template.
* @param Error[]|null $errors A list of error responses returned when a request is unsuccessful.
*/
public function __construct(
public readonly ?Links $links = null,
public readonly ?Embedded $embedded = null,
public readonly ?Links2 $links = null,
public readonly ?Embedded2 $embedded = null,
public readonly ?MessagingAction $payload = null,
public readonly ?array $errors = null,
) {
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/MessagingV1/Dto/GetSchemaResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class GetSchemaResponse extends Dto
protected static array $complexArrayTypes = ['errors' => [Error::class]];

/**
* @param ?Links $links
* @param ?Links3 $links
* @param ?array[] $payload A JSON schema document describing the expected payload of the action. This object can be validated against <a href=http://json-schema.org/draft-04/schema>http://json-schema.org/draft-04/schema</a>.
* @param Error[]|null $errors A list of error responses returned when a request is unsuccessful.
*/
public function __construct(
public readonly ?Links $links = null,
public readonly ?Links3 $links = null,
public readonly ?array $payload = null,
public readonly ?array $errors = null,
) {
Expand Down
26 changes: 26 additions & 0 deletions src/Seller/MessagingV1/Dto/Links2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* This file is auto-generated by Saloon SDK Generator
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
* Do not modify it directly.
*/

declare(strict_types=1);

namespace SellingPartnerApi\Seller\MessagingV1\Dto;

use SellingPartnerApi\Dto;

final class Links2 extends Dto
{
/**
* @param LinkObject $self A Link object.
* @param LinkObject $schema A Link object.
*/
public function __construct(
public readonly LinkObject $self,
public readonly LinkObject $schema,
) {
}
}
Loading

0 comments on commit a95c993

Please sign in to comment.