/**
 * Selling Partner API for FBA Inventory
 * The Selling Partner API for FBA Inventory lets you programmatically retrieve information about inventory in Amazon\'s fulfillment network. Today this API is available only in the North America region. In 2021 we plan to release this API in the Europe and Far East regions.
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */ import { Configuration } from './configuration' ; import globalAxios , { AxiosPromise , AxiosInstance } from 'axios' ; import { DUMMY_BASE_URL , assertParamExists , setApiKeyToObject , setBasicAuthToObject , setBearerAuthToObject , setOAuthToObject , setSearchParams , serializeDataIfNeeded , toPathString , createRequestFunction } from './common' ; import { BASE_PATH , COLLECTION_FORMATS , RequestArgs , BaseAPI , RequiredError } from './base' ; export interface export interface GetInventorySummariesResponse { type { GetInventorySummariesResult } memberof payload ? : GetInventorySummariesResult ; type { Pagination } memberof pagination ? : Pagination ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface GetInventorySummariesResult { type { Granularity } memberof granularity : Granularity ; type { Array < InventorySummary > } memberof inventorySummaries : Array < InventorySummary > ; } export interface export interface Granularity { type { string } memberof granularityType ? : string ; type { string } memberof granularityId ? : string ; } export interface export interface InventoryDetails { type { number } memberof fulfillableQuantity ? : number ; type { number } memberof inboundWorkingQuantity ? : number ; type { number } memberof inboundShippedQuantity ? : number ; type { number } memberof inboundReceivingQuantity ? : number ; type { ReservedQuantity } memberof reservedQuantity ? : ReservedQuantity ; type { ResearchingQuantity } memberof researchingQuantity ? : ResearchingQuantity ; type { UnfulfillableQuantity } memberof unfulfillableQuantity ? : UnfulfillableQuantity ; } export interface export interface InventorySummary { type { string } memberof asin ? : string ; type { string } memberof fnSku ? : string ; type { string } memberof sellerSku ? : string ; type { string } memberof condition ? : string ; type { InventoryDetails } memberof inventoryDetails ? : InventoryDetails ; type { string } memberof lastUpdatedTime ? : string ; type { string } memberof productName ? : string ; type { number } memberof totalQuantity ? : number ; } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message ? : string ; type { string } memberof details ? : string ; } export interface export interface Pagination { type { string } memberof nextToken ? : string ; } export interface export interface ResearchingQuantity { type { number } memberof totalResearchingQuantity ? : number ; type { Array < ResearchingQuantityEntry > } memberof researchingQuantityBreakdown ? : Array < ResearchingQuantityEntry > ; } export interface export interface ResearchingQuantityEntry { type { string } memberof name : ResearchingQuantityEntryNameEnum | 'researchingQuantityInShortTerm' | 'researchingQuantityInMidTerm' | 'researchingQuantityInLongTerm' ; type { number } memberof quantity : number ; } export enum { string } export enum ResearchingQuantityEntryNameEnum { ResearchingQuantityInShortTerm = 'researchingQuantityInShortTerm' , ResearchingQuantityInMidTerm = 'researchingQuantityInMidTerm' , ResearchingQuantityInLongTerm = 'researchingQuantityInLongTerm' } export interface export interface ReservedQuantity { type { number } memberof totalReservedQuantity ? : number ; type { number } memberof pendingCustomerOrderQuantity ? : number ; type { number } memberof pendingTransshipmentQuantity ? : number ; type { number } memberof fcProcessingQuantity ? : number ; } export interface export interface UnfulfillableQuantity { type { number } memberof totalUnfulfillableQuantity ? : number ; type { number } memberof customerDamagedQuantity ? : number ; type { number } memberof warehouseDamagedQuantity ? : number ; type { number } memberof distributorDamagedQuantity ? : number ; type { number } memberof carrierDamagedQuantity ? : number ; type { number } memberof defectiveQuantity ? : number ; type { number } memberof expiredQuantity ? : number ; } export export const FbaInventoryApiAxiosParamCreator = function ( configuration ? ) { return { param { 'Marketplace' } granularityType param { string } granularityId param { Array < string > } marketplaceIds param { boolean } details param { string } startDateTime param { Array < string > } sellerSkus param { string } nextToken param { * } options throws getInventorySummaries : async ( granularityType , granularityId , marketplaceIds , details ? , startDateTime ? , sellerSkus ? , nextToken ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getInventorySummaries' , 'granularityType' , granularityType ) ; assertParamExists ( 'getInventorySummaries' , 'granularityId' , granularityId ) ; assertParamExists ( 'getInventorySummaries' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/fba/inventory/v1/summaries` ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'GET' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( details !== undefined ) { localVarQueryParameter [ 'details' ] = details ; } if ( granularityType !== undefined ) { localVarQueryParameter [ 'granularityType' ] = granularityType ; } if ( granularityId !== undefined ) { localVarQueryParameter [ 'granularityId' ] = granularityId ; } if ( startDateTime !== undefined ) { localVarQueryParameter [ 'startDateTime' ] = ( startDateTime as any instanceof Date ) ? ( startDateTime as any ) . toISOString ( ) : startDateTime ; } if ( sellerSkus ) { localVarQueryParameter [ 'sellerSkus' ] = sellerSkus . join ( COLLECTION_FORMATS . csv ) ; } if ( nextToken !== undefined ) { localVarQueryParameter [ 'nextToken' ] = nextToken ; } if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , } ; } ; export export const FbaInventoryApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = FbaInventoryApiAxiosParamCreator ( configuration ) ; return { param { 'Marketplace' } granularityType param { string } granularityId param { Array < string > } marketplaceIds param { boolean } details param { string } startDateTime param { Array < string > } sellerSkus param { string } nextToken param { * } options throws async getInventorySummaries ( granularityType , granularityId , marketplaceIds , details ? , startDateTime ? , sellerSkus ? , nextToken ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getInventorySummaries ( granularityType , granularityId , marketplaceIds , details , startDateTime , sellerSkus , nextToken , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const FbaInventoryApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = FbaInventoryApiFp ( configuration ) ; return { param { 'Marketplace' } granularityType param { string } granularityId param { Array < string > } marketplaceIds param { boolean } details param { string } startDateTime param { Array < string > } sellerSkus param { string } nextToken param { * } options throws getInventorySummaries ( granularityType , granularityId , marketplaceIds , details ? , startDateTime ? , sellerSkus ? , nextToken ? , options ? ) { return localVarFp . getInventorySummaries ( granularityType , granularityId , marketplaceIds , details , startDateTime , sellerSkus , nextToken , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface FbaInventoryApiGetInventorySummariesRequest { type { 'Marketplace' } memberof readonly granularityType : 'Marketplace' ; type { string } memberof readonly granularityId : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { boolean } memberof readonly details ? : boolean ; type { string } memberof readonly startDateTime ? : string ; type { Array < string > } memberof readonly sellerSkus ? : Array < string > ; type { string } memberof readonly nextToken ? : string ; } export class extends BaseAPI export class FbaInventoryApi extends BaseAPI { param { FbaInventoryApiGetInventorySummariesRequest } requestParameters param { * } options throws memberof public getInventorySummaries ( requestParameters , options ? ) { return FbaInventoryApiFp ( this . configuration ) . getInventorySummaries ( requestParameters . granularityType , requestParameters . granularityId , requestParameters . marketplaceIds , requestParameters . details , requestParameters . startDateTime , requestParameters . sellerSkus , requestParameters . nextToken , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }