Skip to content

Commit

Permalink
Fix array type hinting (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevers committed Jun 19, 2024
1 parent fa96840 commit 10e55ec
Show file tree
Hide file tree
Showing 42 changed files with 75 additions and 72 deletions.
4 changes: 2 additions & 2 deletions src/Seller/APlusContentV20201101/Dto/ParagraphComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

final class ParagraphComponent extends Dto
{
protected static array $complexArrayTypes = ['textList' => [TextItem::class]];
protected static array $complexArrayTypes = ['textList' => [TextComponent::class]];

/**
* @param TextItem[] $textList
* @param TextComponent[] $textList
*/
public function __construct(
public readonly array $textList,
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV20240320/Dto/BoxInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

final class BoxInput extends Dto
{
protected static array $complexArrayTypes = ['items' => [Item::class]];
protected static array $complexArrayTypes = ['items' => [ItemInput::class]];

/**
* @param string $contentInformationSource Indication of how box content is meant to be provided.
* @param Dimensions $dimensions Measurement of a package's dimensions.
* @param int $quantity The number of containers where all other properties like weight or dimensions are identical.
* @param Weight $weight The weight of a package.
* @param Item[]|null $items Items contained within the box.
* @param ItemInput[]|null $items The items and their quantity in the box. This must be empty if the box `contentInformationSource` is `BARCODE_2D` or `MANUAL_PROCESS`.
*/
public function __construct(
public readonly string $contentInformationSource,
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV20240320/Dto/BoxUpdateInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

final class BoxUpdateInput extends Dto
{
protected static array $complexArrayTypes = ['items' => [Item::class]];
protected static array $complexArrayTypes = ['items' => [ItemInput::class]];

/**
* @param string $contentInformationSource Indication of how box content is meant to be provided.
* @param Dimensions $dimensions Measurement of a package's dimensions.
* @param int $quantity The number of containers where all other properties like weight or dimensions are identical.
* @param Weight $weight The weight of a package.
* @param Item[]|null $items Items contained within the box.
* @param ItemInput[]|null $items The items and their quantity in the box. This must be empty if the box `contentInformationSource` is `BARCODE_2D` or `MANUAL_PROCESS`.
* @param ?string $packageId Primary key to uniquely identify a Box Package. PackageId must be provided if the intent is to update an existing box. Adding a new box will not require providing this value. Any existing PackageIds not provided will be treated as to-be-removed
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

final class CreateInboundPlanRequest extends Dto
{
protected static array $complexArrayTypes = ['items' => [Item::class]];
protected static array $complexArrayTypes = ['items' => [ItemInput::class]];

/**
* @param string[] $destinationMarketplaces Marketplaces where the items need to be shipped to. Currently only one marketplace can be selected in this request.
* @param Item[] $items Items contained within the box.
* @param ItemInput[] $items Items included in this plan.
* @param AddressInput $sourceAddress Specific details to identify a place.
* @param ?string $name Name for the Inbound Plan. If one isn't provided, a default name will be provided.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV20240320/Dto/CustomPlacementInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

final class CustomPlacementInput extends Dto
{
protected static array $complexArrayTypes = ['items' => [Item::class]];
protected static array $complexArrayTypes = ['items' => [ItemInput::class]];

/**
* @param Item[] $items Items contained within the box.
* @param ItemInput[] $items Items included while creating Inbound Plan.
* @param string $warehouseId Warehouse Id.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

final class GenerateShipmentContentUpdatePreviewsRequest extends Dto
{
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class], 'items' => [Item::class]];
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class], 'items' => [ItemInput::class]];

/**
* @param BoxUpdateInput[] $boxes A list of boxes that will be present in the shipment after the update.
* @param Item[] $items Items contained within the box.
* @param ItemInput[] $items A list of all items that will be present in the shipment after the update.
*/
public function __construct(
public readonly array $boxes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
final class LtlTrackingDetailInput extends Dto
{
/**
* @param string[] $freightBillNumber The number associated with the freight bill.
* @param string[] $freightBillNumber Number associated with the freight bill.
* @param ?string $billOfLadingNumber The number of the carrier shipment acknowledgement document.
*/
public function __construct(
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV20240320/Dto/PackageGroupingInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

final class PackageGroupingInput extends Dto
{
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class]];
protected static array $complexArrayTypes = ['boxes' => [BoxInput::class]];

/**
* @param BoxUpdateInput[] $boxes A list of boxes that will be present in the shipment after the update.
* @param BoxInput[] $boxes Box level information being provided.
* @param ?string $packingGroupId The ID of the `packingGroup` that packages are grouped according to. The `PackingGroupId` can only be provided before placement confirmation, and it must belong to the confirmed `PackingOption`. One of `ShipmentId` or `PackingGroupId` must be provided with every request.
* @param ?string $shipmentId The ID of the shipment that packages are grouped according to. The `ShipmentId` can only be provided after placement confirmation, and the shipment must belong to the confirmed placement option. One of `ShipmentId` or `PackingGroupId` must be provided with every request.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV20240320/Dto/RequestedUpdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

final class RequestedUpdates extends Dto
{
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class], 'items' => [Item::class]];
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class], 'items' => [ItemInput::class]];

/**
* @param BoxUpdateInput[]|null $boxes A list of boxes that will be present in the shipment after the update.
* @param Item[]|null $items Items contained within the box.
* @param ItemInput[]|null $items A list of all items that will be present in the shipment after the update.
*/
public function __construct(
public readonly ?array $boxes = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

final class ShipmentTransportationConfiguration extends Dto
{
protected static array $complexArrayTypes = ['pallets' => [Pallet::class]];
protected static array $complexArrayTypes = ['pallets' => [PalletInput::class]];

/**
* @param WindowInput $readyToShipWindow Contains only a starting DateTime.
* @param string $shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded.
* @param ?ContactInformation $contactInformation The seller's contact information.
* @param ?FreightInformation $freightInformation Freight information describes the skus being transported. Freight carrier options and quotes will only be returned if the freight information is provided.
* @param Pallet[]|null $pallets The pallets in an inbound plan.
* @param PalletInput[]|null $pallets List of pallet configuration inputs.
*/
public function __construct(
public readonly WindowInput $readyToShipWindow,
Expand Down
4 changes: 2 additions & 2 deletions src/Seller/FBAInboundV20240320/Dto/SpdTrackingDetailInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

final class SpdTrackingDetailInput extends Dto
{
protected static array $complexArrayTypes = ['spdTrackingItems' => [SpdTrackingItem::class]];
protected static array $complexArrayTypes = ['spdTrackingItems' => [SpdTrackingItemInput::class]];

/**
* @param SpdTrackingItem[] $spdTrackingItems List of Small Parcel Delivery (SPD) tracking items.
* @param SpdTrackingItemInput[] $spdTrackingItems List of Small Parcel Delivery (SPD) tracking items input.
*/
public function __construct(
public readonly array $spdTrackingItems,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
namespace SellingPartnerApi\Seller\FBAInboundV20240320\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\BoxUpdateInput;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Box;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Pagination;

final class ListInboundPlanBoxesResponse extends Response
{
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class]];
protected static array $complexArrayTypes = ['boxes' => [Box::class]];

/**
* @param BoxUpdateInput[] $boxes A list of boxes that will be present in the shipment after the update.
* @param Box[] $boxes A list of boxes in an inbound plan.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class ListInboundPlanItemsResponse extends Response
protected static array $complexArrayTypes = ['items' => [Item::class]];

/**
* @param Item[] $items Items contained within the box.
* @param Item[] $items The items in an inbound plan.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
namespace SellingPartnerApi\Seller\FBAInboundV20240320\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\BoxUpdateInput;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Box;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Pagination;

final class ListPackingGroupBoxesResponse extends Response
{
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class]];
protected static array $complexArrayTypes = ['boxes' => [Box::class]];

/**
* @param BoxUpdateInput[] $boxes A list of boxes that will be present in the shipment after the update.
* @param Box[] $boxes Provides the information about the list of boxes in the packing group.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class ListPackingGroupItemsResponse extends Response
protected static array $complexArrayTypes = ['items' => [Item::class]];

/**
* @param Item[] $items Items contained within the box.
* @param Item[] $items Provides the information about the list of items in the packing group.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
namespace SellingPartnerApi\Seller\FBAInboundV20240320\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\PackingOptionSummary;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\PackingOption;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Pagination;

final class ListPackingOptionsResponse extends Response
{
protected static array $complexArrayTypes = ['packingOptions' => [PackingOptionSummary::class]];
protected static array $complexArrayTypes = ['packingOptions' => [PackingOption::class]];

/**
* @param PackingOptionSummary[] $packingOptions Packing options for the inbound plan. This property will be populated when it has been generated via the corresponding operation. If there is a chosen placement option, only packing options for that placement option will be returned. If there are confirmed shipments, only packing options for those shipments will be returned. Query the packing option for more details.
* @param PackingOption[] $packingOptions List of packing options.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Pagination;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\PlacementOptionSummary;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\PlacementOption;

final class ListPlacementOptionsResponse extends Response
{
protected static array $complexArrayTypes = ['placementOptions' => [PlacementOptionSummary::class]];
protected static array $complexArrayTypes = ['placementOptions' => [PlacementOption::class]];

/**
* @param PlacementOptionSummary[] $placementOptions Placement options for the inbound plan. This property will be populated when it has been generated via the corresponding operation. If there is a chosen placement option, that will be the only returned option. Query the placement option for more details.
* @param PlacementOption[] $placementOptions Placement options generated for the inbound plan.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
namespace SellingPartnerApi\Seller\FBAInboundV20240320\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\BoxUpdateInput;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Box;
use SellingPartnerApi\Seller\FBAInboundV20240320\Dto\Pagination;

final class ListShipmentBoxesResponse extends Response
{
protected static array $complexArrayTypes = ['boxes' => [BoxUpdateInput::class]];
protected static array $complexArrayTypes = ['boxes' => [Box::class]];

/**
* @param BoxUpdateInput[] $boxes A list of boxes that will be present in the shipment after the update.
* @param Box[] $boxes A list of boxes in a shipment.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class ListShipmentItemsResponse extends Response
protected static array $complexArrayTypes = ['items' => [Item::class]];

/**
* @param Item[] $items Items contained within the box.
* @param Item[] $items The items in a shipment.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class ListShipmentPalletsResponse extends Response
protected static array $complexArrayTypes = ['pallets' => [Pallet::class]];

/**
* @param Pallet[] $pallets The pallets in an inbound plan.
* @param Pallet[] $pallets The pallets in a shipment.
* @param ?Pagination $pagination Contains tokens to fetch from a certain page.
*/
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class FulfillmentShipment extends Dto
* @param FulfillmentShipmentItem[] $fulfillmentShipmentItem An array of fulfillment shipment item information.
* @param ?\DateTimeInterface $shippingDate
* @param ?\DateTimeInterface $estimatedArrivalDate
* @param ?string[] $shippingNotes Provides additional insight into the shipment timeline when exact delivery dates are not able to be precomputed.
* @param ?string[] $shippingNotes Provides additional insight into shipment timeline. Primairly used to communicate that actual delivery dates aren't available.
* @param FulfillmentShipmentPackage[]|null $fulfillmentShipmentPackage An array of fulfillment shipment package information.
*/
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/Seller/FeedsV20210630/Dto/CreateFeedSpecification.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class CreateFeedSpecification extends Dto
{
/**
* @param string $feedType The feed type.
* @param string[] $marketplaceIds A list of identifiers for the marketplaces that the feed is applied to.
* @param string[] $marketplaceIds A list of identifiers for marketplaces that you want the feed to be applied to.
* @param string $inputFeedDocumentId The document identifier returned by the createFeedDocument operation. Upload the feed document contents before calling the createFeed operation.
* @param ?string[] $feedOptions Additional options to control the feed. These vary by feed type.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Seller/MessagingV1/Dto/CreateAmazonMotorsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class CreateAmazonMotorsRequest extends Dto
protected static array $complexArrayTypes = ['attachments' => [Attachment::class]];

/**
* @param Attachment[]|null $attachments Attachments to include in the message to the buyer.
* @param Attachment[]|null $attachments Attachments to include in the message to the buyer. If any text is included in the attachment, the text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation.
*/
public function __construct(
public readonly ?array $attachments = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class CreateLegalDisclosureRequest extends Dto
protected static array $complexArrayTypes = ['attachments' => [Attachment::class]];

/**
* @param Attachment[]|null $attachments Attachments to include in the message to the buyer.
* @param Attachment[]|null $attachments Attachments to include in the message to the buyer. If any text is included in the attachment, the text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation.
*/
public function __construct(
public readonly ?array $attachments = null,
Expand Down
2 changes: 1 addition & 1 deletion src/Seller/MessagingV1/Dto/CreateWarrantyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class CreateWarrantyRequest extends Dto
protected static array $complexArrayTypes = ['attachments' => [Attachment::class]];

/**
* @param Attachment[]|null $attachments Attachments to include in the message to the buyer.
* @param Attachment[]|null $attachments Attachments to include in the message to the buyer. If any text is included in the attachment, the text must be written in the buyer's language of preference, which can be retrieved from the GetAttributes operation.
* @param ?\DateTimeInterface $coverageStartDate The start date of the warranty coverage to include in the message to the buyer.
* @param ?\DateTimeInterface $coverageEndDate The end date of the warranty coverage to include in the message to the buyer.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class ProductType extends Dto
/**
* @param string $name The name of the Amazon product type.
* @param string $displayName The human-readable and localized description of the Amazon product type.
* @param string[] $marketplaceIds Amazon marketplace identifiers for which the product type definition is applicable.
* @param string[] $marketplaceIds The Amazon marketplace identifiers for which the product type definition is available.
*/
public function __construct(
public readonly string $name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
namespace SellingPartnerApi\Seller\ReplenishmentV20221107\Responses;

use SellingPartnerApi\Response;
use SellingPartnerApi\Seller\ReplenishmentV20221107\Dto\GetSellingPartnerMetricsResponseMetric;

final class GetSellingPartnerMetricsResponse extends Response
{
protected static array $complexArrayTypes = ['metrics' => [GetSellingPartnerMetricsResponseMetric::class]];

/**
* @param ?string[] $metrics The list of metrics requested. If no metric value is provided, data for all of the metrics will be returned.
* @param GetSellingPartnerMetricsResponseMetric[]|null $metrics A list of metrics data for the selling partner.
*/
public function __construct(
public readonly ?array $metrics = null,
Expand Down
Loading

0 comments on commit 10e55ec

Please sign in to comment.