/**
 * Selling Partner API for Catalog Items
 * The Selling Partner API for Catalog Items provides programmatic access to information about items in the Amazon catalog.  For more information, see the [Catalog Items API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/catalog-items-api-use-case-guide/catalog-items-api-use-case-guide_2020-12-01.md).
 *
 * The version of the OpenAPI document: 2020-12-01
 *
 *
 * 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 BrandRefinement { type { number } memberof numberOfResults : number ; type { string } memberof brandName : string ; } export interface export interface ClassificationRefinement { type { number } memberof numberOfResults : number ; type { string } memberof displayName : string ; type { string } memberof classificationId : string ; } export interface export interface ErrorList { type { Array < Error > } memberof errors : Array < Error > ; } export interface export interface Item { type { string } memberof asin : string ; type { object } memberof attributes ? : object ; type { Array < ItemIdentifiersByMarketplace > } memberof identifiers ? : Array < ItemIdentifiersByMarketplace > ; type { Array < ItemImagesByMarketplace > } memberof images ? : Array < ItemImagesByMarketplace > ; type { Array < ItemProductTypeByMarketplace > } memberof productTypes ? : Array < ItemProductTypeByMarketplace > ; type { Array < ItemSalesRanksByMarketplace > } memberof salesRanks ? : Array < ItemSalesRanksByMarketplace > ; type { Array < ItemSummaryByMarketplace > } memberof summaries ? : Array < ItemSummaryByMarketplace > ; type { Array < ItemVariationsByMarketplace > } memberof variations ? : Array < ItemVariationsByMarketplace > ; type { Array < ItemVendorDetailsByMarketplace > } memberof vendorDetails ? : Array < ItemVendorDetailsByMarketplace > ; } export interface export interface ItemIdentifier { type { string } memberof identifierType : string ; type { string } memberof identifier : string ; } export interface export interface ItemIdentifiersByMarketplace { type { string } memberof marketplaceId : string ; type { Array < ItemIdentifier > } memberof identifiers : Array < ItemIdentifier > ; } export interface export interface ItemImage { type { string } memberof variant : ItemImageVariantEnum | 'MAIN' | 'PT01' | 'PT02' | 'PT03' | 'PT04' | 'PT05' | 'PT06' | 'PT07' | 'PT08' | 'SWCH' ; type { string } memberof link : string ; type { number } memberof height : number ; type { number } memberof width : number ; } export enum { string } export enum ItemImageVariantEnum { Main = 'MAIN' , Pt01 = 'PT01' , Pt02 = 'PT02' , Pt03 = 'PT03' , Pt04 = 'PT04' , Pt05 = 'PT05' , Pt06 = 'PT06' , Pt07 = 'PT07' , Pt08 = 'PT08' , Swch = 'SWCH' } export interface export interface ItemImagesByMarketplace { type { string } memberof marketplaceId : string ; type { Array < ItemImage > } memberof images : Array < ItemImage > ; } export interface export interface ItemProductTypeByMarketplace { type { string } memberof marketplaceId ? : string ; type { string } memberof productType ? : string ; } export interface export interface ItemSalesRank { type { string } memberof title : string ; type { string } memberof link ? : string ; type { number } memberof rank : number ; } export interface export interface ItemSalesRanksByMarketplace { type { string } memberof marketplaceId : string ; type { Array < ItemSalesRank > } memberof ranks : Array < ItemSalesRank > ; } export interface export interface ItemSearchResults { type { number } memberof numberOfResults : number ; type { Pagination } memberof pagination : Pagination ; type { Refinements } memberof refinements : Refinements ; type { Array < Item > } memberof items : Array < Item > ; } export interface export interface ItemSummaryByMarketplace { type { string } memberof marketplaceId : string ; type { string } memberof brandName ? : string ; type { string } memberof browseNode ? : string ; type { string } memberof colorName ? : string ; type { string } memberof itemName ? : string ; type { string } memberof manufacturer ? : string ; type { string } memberof modelNumber ? : string ; type { string } memberof sizeName ? : string ; type { string } memberof styleName ? : string ; } export interface export interface ItemVariationsByMarketplace { type { string } memberof marketplaceId : string ; type { Array < string > } memberof asins : Array < string > ; type { string } memberof variationType : ItemVariationsByMarketplaceVariationTypeEnum | 'PARENT' | 'CHILD' ; } export enum { string } export enum ItemVariationsByMarketplaceVariationTypeEnum { Parent = 'PARENT' , Child = 'CHILD' } export interface export interface ItemVendorDetailsByMarketplace { type { string } memberof marketplaceId : string ; type { string } memberof brandCode ? : string ; type { string } memberof categoryCode ? : string ; type { string } memberof manufacturerCode ? : string ; type { string } memberof manufacturerCodeParent ? : string ; type { string } memberof productGroup ? : string ; type { string } memberof replenishmentCategory ? : ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum | 'ALLOCATED' | 'BASIC_REPLENISHMENT' | 'IN_SEASON' | 'LIMITED_REPLENISHMENT' | 'MANUFACTURER_OUT_OF_STOCK' | 'NEW_PRODUCT' | 'NON_REPLENISHABLE' | 'NON_STOCKUPABLE' | 'OBSOLETE' | 'PLANNED_REPLENISHMENT' ; type { string } memberof subcategoryCode ? : string ; } export enum { string } export enum ItemVendorDetailsByMarketplaceReplenishmentCategoryEnum { Allocated = 'ALLOCATED' , BasicReplenishment = 'BASIC_REPLENISHMENT' , InSeason = 'IN_SEASON' , LimitedReplenishment = 'LIMITED_REPLENISHMENT' , ManufacturerOutOfStock = 'MANUFACTURER_OUT_OF_STOCK' , NewProduct = 'NEW_PRODUCT' , NonReplenishable = 'NON_REPLENISHABLE' , NonStockupable = 'NON_STOCKUPABLE' , Obsolete = 'OBSOLETE' , PlannedReplenishment = 'PLANNED_REPLENISHMENT' } 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 ; type { string } memberof previousToken ? : string ; } export interface export interface Refinements { type { Array < BrandRefinement > } memberof brands : Array < BrandRefinement > ; type { Array < ClassificationRefinement > } memberof classifications : Array < ClassificationRefinement > ; } export export const CatalogApiAxiosParamCreator = function ( configuration ? ) { return { param { string } asin param { Array < string > } marketplaceIds param { Array < 'attributes' | 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } includedData param { string } locale param { * } options throws getCatalogItem : async ( asin , marketplaceIds , includedData ? , locale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getCatalogItem' , 'asin' , asin ) ; assertParamExists ( 'getCatalogItem' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/catalog/2020-12-01/items/{asin}` . replace ( `{${ "asin" }}` , encodeURIComponent ( String ( asin ) ) ) ; 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 ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( includedData ) { localVarQueryParameter [ 'includedData' ] = includedData . join ( COLLECTION_FORMATS . csv ) ; } if ( locale !== undefined ) { localVarQueryParameter [ 'locale' ] = locale ; } setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , param { Array < string > } keywords param { Array < string > } marketplaceIds param { Array < 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } includedData param { Array < string > } brandNames param { Array < string > } classificationIds param { number } pageSize param { string } pageToken param { string } keywordsLocale param { string } locale param { * } options throws searchCatalogItems : async ( keywords , marketplaceIds , includedData ? , brandNames ? , classificationIds ? , pageSize ? , pageToken ? , keywordsLocale ? , locale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'searchCatalogItems' , 'keywords' , keywords ) ; assertParamExists ( 'searchCatalogItems' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/catalog/2020-12-01/items` ; 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 ( keywords ) { localVarQueryParameter [ 'keywords' ] = keywords . join ( COLLECTION_FORMATS . csv ) ; } if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( includedData ) { localVarQueryParameter [ 'includedData' ] = includedData . join ( COLLECTION_FORMATS . csv ) ; } if ( brandNames ) { localVarQueryParameter [ 'brandNames' ] = brandNames . join ( COLLECTION_FORMATS . csv ) ; } if ( classificationIds ) { localVarQueryParameter [ 'classificationIds' ] = classificationIds . join ( COLLECTION_FORMATS . csv ) ; } if ( pageSize !== undefined ) { localVarQueryParameter [ 'pageSize' ] = pageSize ; } if ( pageToken !== undefined ) { localVarQueryParameter [ 'pageToken' ] = pageToken ; } if ( keywordsLocale !== undefined ) { localVarQueryParameter [ 'keywordsLocale' ] = keywordsLocale ; } if ( locale !== undefined ) { localVarQueryParameter [ 'locale' ] = locale ; } 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 CatalogApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = CatalogApiAxiosParamCreator ( configuration ) ; return { param { string } asin param { Array < string > } marketplaceIds param { Array < 'attributes' | 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } includedData param { string } locale param { * } options throws async getCatalogItem ( asin , marketplaceIds , includedData ? , locale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getCatalogItem ( asin , marketplaceIds , includedData , locale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { Array < string > } keywords param { Array < string > } marketplaceIds param { Array < 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } includedData param { Array < string > } brandNames param { Array < string > } classificationIds param { number } pageSize param { string } pageToken param { string } keywordsLocale param { string } locale param { * } options throws async searchCatalogItems ( keywords , marketplaceIds , includedData ? , brandNames ? , classificationIds ? , pageSize ? , pageToken ? , keywordsLocale ? , locale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . searchCatalogItems ( keywords , marketplaceIds , includedData , brandNames , classificationIds , pageSize , pageToken , keywordsLocale , locale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const CatalogApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = CatalogApiFp ( configuration ) ; return { param { string } asin param { Array < string > } marketplaceIds param { Array < 'attributes' | 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } includedData param { string } locale param { * } options throws getCatalogItem ( asin , marketplaceIds , includedData ? , locale ? , options ? ) { return localVarFp . getCatalogItem ( asin , marketplaceIds , includedData , locale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { Array < string > } keywords param { Array < string > } marketplaceIds param { Array < 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } includedData param { Array < string > } brandNames param { Array < string > } classificationIds param { number } pageSize param { string } pageToken param { string } keywordsLocale param { string } locale param { * } options throws searchCatalogItems ( keywords , marketplaceIds , includedData ? , brandNames ? , classificationIds ? , pageSize ? , pageToken ? , keywordsLocale ? , locale ? , options ? ) { return localVarFp . searchCatalogItems ( keywords , marketplaceIds , includedData , brandNames , classificationIds , pageSize , pageToken , keywordsLocale , locale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface CatalogApiGetCatalogItemRequest { type { string } memberof readonly asin : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { Array < 'attributes' | 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } memberof readonly includedData ? : Array < 'attributes' | 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > ; type { string } memberof readonly locale ? : string ; } export interface export interface CatalogApiSearchCatalogItemsRequest { type { Array < string > } memberof readonly keywords : Array < string > ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { Array < 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > } memberof readonly includedData ? : Array < 'identifiers' | 'images' | 'productTypes' | 'salesRanks' | 'summaries' | 'variations' | 'vendorDetails' > ; type { Array < string > } memberof readonly brandNames ? : Array < string > ; type { Array < string > } memberof readonly classificationIds ? : Array < string > ; type { number } memberof readonly pageSize ? : number ; type { string } memberof readonly pageToken ? : string ; type { string } memberof readonly keywordsLocale ? : string ; type { string } memberof readonly locale ? : string ; } export class extends BaseAPI export class CatalogApi extends BaseAPI { param { CatalogApiGetCatalogItemRequest } requestParameters param { * } options throws memberof public getCatalogItem ( requestParameters , options ? ) { return CatalogApiFp ( this . configuration ) . getCatalogItem ( requestParameters . asin , requestParameters . marketplaceIds , requestParameters . includedData , requestParameters . locale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { CatalogApiSearchCatalogItemsRequest } requestParameters param { * } options throws memberof public searchCatalogItems ( requestParameters , options ? ) { return CatalogApiFp ( this . configuration ) . searchCatalogItems ( requestParameters . keywords , requestParameters . marketplaceIds , requestParameters . includedData , requestParameters . brandNames , requestParameters . classificationIds , requestParameters . pageSize , requestParameters . pageToken , requestParameters . keywordsLocale , requestParameters . locale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }