Skip to content

Commit b07f606

Browse files
committed
Fix indirect recursive DTO reference generation
1 parent b62f52f commit b07f606

File tree

11 files changed

+186
-54
lines changed

11 files changed

+186
-54
lines changed

resources/models/seller/finances/v2024-06-19.json

Lines changed: 112 additions & 37 deletions
Large diffs are not rendered by default.

src/Seller/FinancesV20240619/Dto/Breakdown.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414

1515
final class Breakdown extends Dto
1616
{
17+
protected static array $complexArrayTypes = ['breakdowns' => Breakdown::class];
18+
1719
/**
1820
* @param ?string $breakdownType The type of charge.
1921
* @param ?Currency $breakdownAmount A currency type and amount.
20-
* @param ?Breakdown $breakdowns Breakdown provides details regarding the money movement under the financial transaction. Breakdowns get categorized further into breakdown types, breakdown amounts, and further breakdowns into a hierarchical structure.
22+
* @param Breakdown[]|null $breakdowns A list of breakdowns that detail how the total amount is calculated for the transaction.
2123
*/
2224
public function __construct(
2325
public ?string $breakdownType = null,
2426
public ?Currency $breakdownAmount = null,
25-
public ?Breakdown $breakdowns = null,
27+
public ?array $breakdowns = null,
2628
) {}
2729
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\FinancesV20240619\Dto;
12+
13+
use SellingPartnerApi\Dto;
14+
15+
final class BusinessContext extends Dto
16+
{
17+
/**
18+
* @param ?string $storeName The store name associated with the transaction.
19+
*/
20+
public function __construct(
21+
public ?string $storeName = null,
22+
) {}
23+
}

src/Seller/FinancesV20240619/Dto/Context.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
final class Context extends Dto
1616
{
1717
/**
18-
* @param ?string $storeName Store name related to transaction.
18+
* @param ?string $storeName The store name associated with the transaction.
1919
* @param ?string $orderType Order type of the transaction.
2020
* @param ?string $channel Channel details of related transaction.
2121
* @param ?string $asin Amazon Standard Identification Number (ASIN) of the item.

src/Seller/FinancesV20240619/Dto/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class Item extends Dto
2424
* @param ?string $description Description of items in the transaction
2525
* @param ItemRelatedIdentifier[]|null $relatedIdentifiers Related Business identifiers of the item in Transaction.
2626
* @param ?Currency $totalAmount A currency type and amount.
27-
* @param Breakdown[]|null $breakdowns List of breakdowns which will provide the details on how the total amount is calculated for the financial transaction.
27+
* @param Breakdown[]|null $breakdowns A list of breakdowns that detail how the total amount is calculated for the transaction.
2828
* @param Context[]|null $contexts List of additional Information about the item.
2929
*/
3030
public function __construct(

src/Seller/FinancesV20240619/Dto/MarketplaceDetails.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
final class MarketplaceDetails extends Dto
1616
{
1717
/**
18-
* @param ?string $marketplaceId The identifier of the marketplace where the transaction was made.
18+
* @param ?string $marketplaceId The identifier of the marketplace where the transaction occurred. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
1919
* @param ?string $marketplaceName The name of the marketplace where the transaction occurred.
2020
*
2121
* Example: 'Amazon.com','Amazon.in'

src/Seller/FinancesV20240619/Dto/SellingPartnerMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class SellingPartnerMetadata extends Dto
1717
/**
1818
* @param ?string $sellingPartnerId Unique seller identifier.
1919
* @param ?string $accountType Account type of transaction.
20-
* @param ?string $marketplaceId Marketplace identifier of transaction.
20+
* @param ?string $marketplaceId The identifier of the marketplace where the transaction occurred. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
2121
*/
2222
public function __construct(
2323
public ?string $sellingPartnerId = null,

src/Seller/FinancesV20240619/Dto/Transaction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class Transaction extends Dto
3636
*
3737
* * `DEFERRED`: the transaction is currently deferred.
3838
* * `RELEASED`: the transaction is currently released.
39-
* * `DEFERRED_RELEASED`: the transaction was deferred in the past, but is now released. Deferred transactions will have their status updated to `DEFERRED_RELEASED` when released.
39+
* * `DEFERRED_RELEASED`: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to `DEFERRED_RELEASED` when the transaction is released.
4040
* @param ?string $description Describes the reasons for the transaction.
4141
*
4242
* Example: 'Order Payment','Refund Order'
@@ -45,7 +45,7 @@ final class Transaction extends Dto
4545
* @param ?MarketplaceDetails $marketplaceDetails Information about the marketplace where the transaction occurred.
4646
* @param Item[]|null $items List of items in the transaction
4747
* @param Context[]|null $contexts List of additional Information about the item.
48-
* @param Breakdown[]|null $breakdowns List of breakdowns which will provide the details on how the total amount is calculated for the financial transaction.
48+
* @param Breakdown[]|null $breakdowns A list of breakdowns that detail how the total amount is calculated for the transaction.
4949
*/
5050
public function __construct(
5151
public ?SellingPartnerMetadata $sellingPartnerMetadata = null,
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated by Saloon SDK Generator
5+
* Generator: Crescat\SaloonSdkGenerator\Generators\DtoGenerator
6+
* Do not modify it directly.
7+
*/
8+
9+
declare(strict_types=1);
10+
11+
namespace SellingPartnerApi\Seller\FinancesV20240619\Dto;
12+
13+
use SellingPartnerApi\Dto;
14+
15+
final class TransactionsPayload extends Dto
16+
{
17+
protected static array $complexArrayTypes = ['transactions' => Transaction::class];
18+
19+
/**
20+
* @param ?string $nextToken When present and not empty, pass this string token in the next request to return the next response page.
21+
* @param Transaction[]|null $transactions Contains transactions within a given time period.
22+
*/
23+
public function __construct(
24+
public ?string $nextToken = null,
25+
public ?array $transactions = null,
26+
) {}
27+
}

src/Seller/FinancesV20240619/Requests/ListTransactions.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,23 @@ class ListTransactions extends Request
2525
protected Method $method = Method::GET;
2626

2727
/**
28-
* @param \DateTimeInterface $postedAfter A date used for selecting transactions posted after (or at) a specified time. The date-time must be no later than two minutes before the request was submitted, in ISO 8601 date time format.
28+
* @param \DateTimeInterface $postedAfter The response includes financial events posted on or after this date. This date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The date-time must be more than two minutes before the time of the request.
2929
* @param ?\DateTimeInterface $postedBefore A date used for selecting transactions posted before (but not at) a specified time. The date-time must be later than PostedAfter and no later than two minutes before the request was submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no transactions are returned. You must specify the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.
30-
* @param ?string $marketplaceId A string token used to select Marketplace ID.
30+
* @param ?string $marketplaceId The identifier of the marketplace from which you want to retrieve transactions. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
31+
* @param ?string $transactionStatus The status of the transaction.
32+
*
33+
* **Possible values:**
34+
*
35+
* * `DEFERRED`: the transaction is currently deferred.
36+
* * `RELEASED`: the transaction is currently released.
37+
* * `DEFERRED_RELEASED`: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to `DEFERRED_RELEASED` when the transaction is released.
3138
* @param ?string $nextToken A string token returned in the response of your previous request.
3239
*/
3340
public function __construct(
3441
protected \DateTimeInterface $postedAfter,
3542
protected ?\DateTimeInterface $postedBefore = null,
3643
protected ?string $marketplaceId = null,
44+
protected ?string $transactionStatus = null,
3745
protected ?string $nextToken = null,
3846
) {}
3947

@@ -60,6 +68,7 @@ public function defaultQuery(): array
6068
'postedAfter' => $this->postedAfter?->format('Y-m-d\TH:i:s\Z'),
6169
'postedBefore' => $this->postedBefore?->format('Y-m-d\TH:i:s\Z'),
6270
'marketplaceId' => $this->marketplaceId,
71+
'transactionStatus' => $this->transactionStatus,
6372
'nextToken' => $this->nextToken,
6473
]);
6574
}

0 commit comments

Comments
 (0)