From b269d84a3f0a6de77627637f40c48cc9eb1c1ea9 Mon Sep 17 00:00:00 2001 From: EJ Mercado Date: Mon, 22 Jun 2020 18:36:27 +0800 Subject: [PATCH] fix: expose parameters fulfillment inventory --- src/sections/fulfillment-inventory.ts | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) 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,