diff --git a/src/sections/fulfillment-inventory.ts b/src/sections/fulfillment-inventory.ts index 38868c6f..154409c5 100644 --- a/src/sections/fulfillment-inventory.ts +++ b/src/sections/fulfillment-inventory.ts @@ -72,8 +72,6 @@ const InventorySupplyList = Codec.interface({ InventorySupplyList: ensureArray('member', InventorySupply), }) -type InventorySupplyList = GetInterface - const ListInventorySupplyResponse = Codec.interface({ ListInventorySupplyResponse: Codec.interface({ ListInventorySupplyResult: InventorySupplyList, @@ -85,8 +83,6 @@ const InventorySupplyListByNextToken = Codec.interface({ InventorySupplyList: ensureArray('member', InventorySupply), }) -type InventorySupplyListByNextToken = GetInterface - const ListInventorySupplyByNextTokenResponse = Codec.interface({ ListInventorySupplyByNextTokenResponse: Codec.interface({ ListInventorySupplyByNextTokenResult: InventorySupplyListByNextToken, @@ -102,21 +98,22 @@ const canonicalizeParameters = (parameters: ListInventorySupplyRequestParameters } } -interface ListInventorySupplyRequestParameters { - SellerSku?: string[] - QueryStartDateTime?: Date - ResponseGroup?: 'Basic' | 'Detailed' - MarketplaceId?: string -} - +export type ListInventorySupplyRequestParameters = RequireOnlyOne< + { + SellerSku?: string[] + QueryStartDateTime?: Date + ResponseGroup?: 'Basic' | 'Detailed' + MarketplaceId?: string + }, + 'MarketplaceId' | 'QueryStartDateTime' +> +export type InventorySupplyList = GetInterface +export type InventorySupplyListByNextToken = GetInterface export class FulfillmentInventory { constructor(private httpClient: HttpClient) {} async listInventorySupply( - parameters: RequireOnlyOne< - ListInventorySupplyRequestParameters, - 'MarketplaceId' | 'QueryStartDateTime' - >, + parameters: ListInventorySupplyRequestParameters, ): Promise<[InventorySupplyList, RequestMeta]> { const [response, meta] = await this.httpClient.request('POST', { resource: Resource.FulfilmentInventory,