Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix: expose parameters fulfillment inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 22, 2020
1 parent 8d216f2 commit b269d84
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/sections/fulfillment-inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ const InventorySupplyList = Codec.interface({
InventorySupplyList: ensureArray('member', InventorySupply),
})

type InventorySupplyList = GetInterface<typeof InventorySupplyList>

const ListInventorySupplyResponse = Codec.interface({
ListInventorySupplyResponse: Codec.interface({
ListInventorySupplyResult: InventorySupplyList,
Expand All @@ -85,8 +83,6 @@ const InventorySupplyListByNextToken = Codec.interface({
InventorySupplyList: ensureArray('member', InventorySupply),
})

type InventorySupplyListByNextToken = GetInterface<typeof InventorySupplyListByNextToken>

const ListInventorySupplyByNextTokenResponse = Codec.interface({
ListInventorySupplyByNextTokenResponse: Codec.interface({
ListInventorySupplyByNextTokenResult: InventorySupplyListByNextToken,
Expand All @@ -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<typeof InventorySupplyList>
export type InventorySupplyListByNextToken = GetInterface<typeof InventorySupplyListByNextToken>
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,
Expand Down

0 comments on commit b269d84

Please sign in to comment.