Skip to content

Commit

Permalink
Add Amazon Warehousing and Distribution API
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevers committed Jun 19, 2024
1 parent 8c9fde1 commit a26e5e2
Show file tree
Hide file tree
Showing 27 changed files with 2,752 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/apis.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
{
"seller": {
"amazon-warehousing-distribution": {
"name": "Amazon Warehousing and Distribution",
"versions": [
{
"version": "2024-05-09",
"url": "https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/amazon-warehousing-and-distribution-model/awd_2024-05-09.json"
}
]
},
"application-management": {
"name": "Application Management",
"versions": [
Expand Down
1,892 changes: 1,892 additions & 0 deletions resources/models/seller/amazon-warehousing-distribution/v2024-05-09.json

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions src/Seller/AmazonWarehousingAndDistributionV20240509/Api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace SellingPartnerApi\Seller\AmazonWarehousingAndDistributionV20240509;

use Saloon\Http\Response;
use SellingPartnerApi\BaseResource;
use SellingPartnerApi\Seller\AmazonWarehousingAndDistributionV20240509\Requests\GetInboundShipment;
use SellingPartnerApi\Seller\AmazonWarehousingAndDistributionV20240509\Requests\ListInboundShipments;
use SellingPartnerApi\Seller\AmazonWarehousingAndDistributionV20240509\Requests\ListInventory;

class Api extends BaseResource
{
/**
* @param string $shipmentId ID for the shipment. A shipment contains the cases being inbounded.
*/
public function getInboundShipment(string $shipmentId): Response
{
$request = new GetInboundShipment($shipmentId);

return $this->connector->send($request);
}

/**
* @param ?string $sortBy Field to sort results by. Required if `sortOrder` is provided.
* @param ?string $sortOrder Sort the response in `ASCENDING` or `DESCENDING` order.
* @param ?string $shipmentStatus Filter by inbound shipment status.
* @param ?\DateTimeInterface $updatedAfter List the inbound shipments that were updated after a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
* @param ?\DateTimeInterface $updatedBefore List the inbound shipments that were updated before a certain time (inclusive). The date must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
* @param ?int $maxResults Maximum number of results to return.
* @param ?string $nextToken Token to retrieve the next set of paginated results.
*/
public function listInboundShipments(
?string $sortBy = null,
?string $sortOrder = null,
?string $shipmentStatus = null,
?\DateTimeInterface $updatedAfter = null,
?\DateTimeInterface $updatedBefore = null,
?int $maxResults = null,
?string $nextToken = null,
): Response {
$request = new ListInboundShipments($sortBy, $sortOrder, $shipmentStatus, $updatedAfter, $updatedBefore, $maxResults, $nextToken);

return $this->connector->send($request);
}

/**
* @param ?string $sku Filter by seller or merchant SKU for the item.
* @param ?string $sortOrder Sort the response in `ASCENDING` or `DESCENDING` order.
* @param ?string $details Set to `SHOW` to return summaries with additional inventory details. Defaults to `HIDE,` which returns only inventory summary totals.
* @param ?string $nextToken Token to retrieve the next set of paginated results.
* @param ?int $maxResults Maximum number of results to return.
*/
public function listInventory(
?string $sku = null,
?string $sortOrder = null,
?string $details = null,
?string $nextToken = null,
?int $maxResults = null,
): Response {
$request = new ListInventory($sku, $sortOrder, $details, $nextToken, $maxResults);

return $this->connector->send($request);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class Address extends Dto
{
/**
* @param string $addressLine1 First line of the address text.
* @param string $countryCode Two-digit, ISO 3166-1 alpha-2 formatted country code where this address is located.
* @param string $name Name of the person, business, or institution at this address.
* @param string $stateOrRegion State or region where this address is located. Note that this is contextual to the specified country code.
* @param ?string $addressLine2 Optional second line of the address text.
* @param ?string $addressLine3 Optional third line of the address text.
* @param ?string $city Optional city where this address is located.
* @param ?string $county Optional county where this address is located.
* @param ?string $district Optional district where this address is located.
* @param ?string $phoneNumber Optional E.164-formatted phone number for an available contact at this address.
* @param ?string $postalCode Optional postal code where this address is located.
*/
public function __construct(
public readonly string $addressLine1,
public readonly string $countryCode,
public readonly string $name,
public readonly string $stateOrRegion,
public readonly ?string $addressLine2 = null,
public readonly ?string $addressLine3 = null,
public readonly ?string $city = null,
public readonly ?string $county = null,
public readonly ?string $district = null,
public readonly ?string $phoneNumber = null,
public readonly ?string $postalCode = null,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class CarrierCode extends Dto
{
/**
* @param ?string $carrierCodeType Denotes the type for the carrier.
* @param ?string $carrierCodeValue Value of the carrier code.
*/
public function __construct(
public readonly ?string $carrierCodeType = null,
public readonly ?string $carrierCodeValue = null,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class DistributionPackage extends Dto
{
/**
* @param DistributionPackageContents $contents Represents the contents inside a package, which can be products or a nested package.
* @param MeasurementData $measurements Package weight and dimension.
* @param string $type Type of distribution packages.
*/
public function __construct(
public readonly DistributionPackageContents $contents,
public readonly MeasurementData $measurements,
public readonly string $type,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class DistributionPackageContents extends Dto
{
protected static array $complexArrayTypes = [
'packages' => [DistributionPackageQuantity::class],
'products' => [ProductQuantity::class],
];

/**
* @param DistributionPackageQuantity[]|null $packages This is required only when `DistributionPackageType=PALLET`.
* @param ProductQuantity[]|null $products This is required only when `DistributionPackageType=CASE`.
*/
public function __construct(
public readonly ?array $packages = null,
public readonly ?array $products = null,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class DistributionPackageQuantity extends Dto
{
/**
* @param int $count Number of cases or pallets with the same package configuration.
* @param DistributionPackage $distributionPackage Represents an AWD distribution package.
*/
public function __construct(
public readonly int $count,
public readonly DistributionPackage $distributionPackage,
) {}
}
27 changes: 27 additions & 0 deletions src/Seller/AmazonWarehousingAndDistributionV20240509/Dto/Error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class Error extends Dto
{
/**
* @param string $code An error code that identifies the type of error that occurred.
* @param string $message A message that describes the error condition.
* @param ?string $details Additional details that can help the caller understand or fix the issue.
*/
public function __construct(
public readonly string $code,
public readonly string $message,
public readonly ?string $details = null,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class InboundShipmentSummary extends Dto
{
/**
* @param string $orderId The AWD inbound order ID that this inbound shipment belongs to.
* @param string $shipmentId A unique shipment ID.
* @param string $shipmentStatus Possible shipment statuses used by shipments.
* @param ?\DateTimeInterface $createdAt Timestamp when the shipment was created.
* @param ?string $externalReferenceId Optional client-provided reference ID that can be used to correlate this shipment with client resources. For example, to map this shipment to an internal bookkeeping order record.
* @param ?\DateTimeInterface $updatedAt Timestamp when the shipment was updated.
*/
public function __construct(
public readonly string $orderId,
public readonly string $shipmentId,
public readonly string $shipmentStatus,
public readonly ?\DateTimeInterface $createdAt = null,
public readonly ?string $externalReferenceId = null,
public readonly ?\DateTimeInterface $updatedAt = null,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class InventoryDetails extends Dto
{
/**
* @param ?int $availableDistributableQuantity Quantity that is available for downstream channel replenishment.
* @param ?int $reservedDistributableQuantity Quantity that is reserved for a downstream channel replenishment order that is being prepared for shipment.
*/
public function __construct(
public readonly ?int $availableDistributableQuantity = null,
public readonly ?int $reservedDistributableQuantity = null,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class InventoryQuantity extends Dto
{
/**
* @param float $quantity Quantity of the respective inventory.
* @param string $unitOfMeasurement Unit of measurement for the inventory.
*/
public function __construct(
public readonly float $quantity,
public readonly string $unitOfMeasurement,
) {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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\AmazonWarehousingAndDistributionV20240509\Dto;

use SellingPartnerApi\Dto;

final class InventorySummary extends Dto
{
/**
* @param string $sku The seller or merchant SKU.
* @param ?InventoryDetails $inventoryDetails Additional inventory details. This object is only displayed if the details parameter in the request is set to `SHOW`.
* @param ?int $totalOnhandQuantity Total quantity that is present in AWD distribution centers.
*/
public function __construct(
public readonly string $sku,
public readonly ?InventoryDetails $inventoryDetails = null,
public readonly ?int $totalOnhandQuantity = null,
) {}
}
Loading

0 comments on commit a26e5e2

Please sign in to comment.