/**
 * Selling Partner API for Listings Items
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/listings-items-api-use-case-guide/listings-items-api-use-case-guide_2021-08-01.md).
 *
 * The version of the OpenAPI document: 2021-08-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 ErrorList { type { Array < Error > } memberof errors : Array < Error > ; } export interface export interface FulfillmentAvailability { type { string } memberof fulfillmentChannelCode : string ; type { number } memberof quantity ? : number ; } export interface export interface Issue { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof severity : IssueSeverityEnum | 'ERROR' | 'WARNING' | 'INFO' ; type { Array < string > } memberof attributeNames ? : Array < string > ; } export enum { string } export enum IssueSeverityEnum { Error = 'ERROR' , Warning = 'WARNING' , Info = 'INFO' } export interface export interface Item { type { string } memberof sku : string ; type { Array < ItemSummaryByMarketplace > } memberof summaries ? : Array < ItemSummaryByMarketplace > ; type { object } memberof attributes ? : object ; type { Array < Issue > } memberof issues ? : Array < Issue > ; type { Array < ItemOfferByMarketplace > } memberof offers ? : Array < ItemOfferByMarketplace > ; type { Array < FulfillmentAvailability > } memberof fulfillmentAvailability ? : Array < FulfillmentAvailability > ; type { ItemProcurement } memberof procurement ? : ItemProcurement ; } export interface export interface ItemImage { type { string } memberof link : string ; type { number } memberof height : number ; type { number } memberof width : number ; } export interface export interface ItemOfferByMarketplace { type { string } memberof marketplaceId : string ; type { string } memberof offerType : ItemOfferByMarketplaceOfferTypeEnum | 'B2C' | 'B2B' ; type { Money } memberof price : Money ; type { Points } memberof points ? : Points ; } export enum { string } export enum ItemOfferByMarketplaceOfferTypeEnum { B2C = 'B2C' , B2B = 'B2B' } export interface export interface ItemProcurement { type { Money } memberof costPrice : Money ; } export interface export interface ItemSummaryByMarketplace { type { string } memberof marketplaceId : string ; type { string } memberof asin : string ; type { string } memberof productType : string ; type { string } memberof conditionType ? : ItemSummaryByMarketplaceConditionTypeEnum | 'new_new' | 'new_open_box' | 'new_oem' | 'refurbished_refurbished' | 'used_like_new' | 'used_very_good' | 'used_good' | 'used_acceptable' | 'collectible_like_new' | 'collectible_very_good' | 'collectible_good' | 'collectible_acceptable' | 'club_club' ; type { Array < string > } memberof status : Array < ( ItemSummaryByMarketplaceStatusEnum | 'BUYABLE' | 'DISCOVERABLE' ) > ; type { string } memberof fnSku ? : string ; type { string } memberof itemName : string ; type { string } memberof createdDate : string ; type { string } memberof lastUpdatedDate : string ; type { ItemImage } memberof mainImage ? : ItemImage ; } export enum { string } export enum ItemSummaryByMarketplaceConditionTypeEnum { NewNew = 'new_new' , NewOpenBox = 'new_open_box' , NewOem = 'new_oem' , RefurbishedRefurbished = 'refurbished_refurbished' , UsedLikeNew = 'used_like_new' , UsedVeryGood = 'used_very_good' , UsedGood = 'used_good' , UsedAcceptable = 'used_acceptable' , CollectibleLikeNew = 'collectible_like_new' , CollectibleVeryGood = 'collectible_very_good' , CollectibleGood = 'collectible_good' , CollectibleAcceptable = 'collectible_acceptable' , ClubClub = 'club_club' } export enum { string } export enum ItemSummaryByMarketplaceStatusEnum { Buyable = 'BUYABLE' , Discoverable = 'DISCOVERABLE' } export interface export interface ListingsItemPatchRequest { type { string } memberof productType : string ; type { Array < PatchOperation > } memberof patches : Array < PatchOperation > ; } export interface export interface ListingsItemPutRequest { type { string } memberof productType : string ; type { string } memberof requirements ? : ListingsItemPutRequestRequirementsEnum | 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' ; type { object } memberof attributes : object ; } export enum { string } export enum ListingsItemPutRequestRequirementsEnum { Listing = 'LISTING' , ListingProductOnly = 'LISTING_PRODUCT_ONLY' , ListingOfferOnly = 'LISTING_OFFER_ONLY' } export interface export interface ListingsItemSubmissionResponse { type { string } memberof sku : string ; type { string } memberof status : ListingsItemSubmissionResponseStatusEnum | 'ACCEPTED' | 'INVALID' ; type { string } memberof submissionId : string ; type { Array < Issue > } memberof issues ? : Array < Issue > ; } export enum { string } export enum ListingsItemSubmissionResponseStatusEnum { Accepted = 'ACCEPTED' , Invalid = 'INVALID' } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface Money { type { string } memberof currencyCode : string ; type { string } memberof amount : string ; } export interface export interface PatchOperation { type { string } memberof op : PatchOperationOpEnum | 'add' | 'replace' | 'delete' ; type { string } memberof path : string ; type { Array < object > } memberof value ? : Array < object > ; } export enum { string } export enum PatchOperationOpEnum { Add = 'add' , Replace = 'replace' , Delete = 'delete' } export interface export interface Points { type { number } memberof pointsNumber : number ; } export export const ListingsApiAxiosParamCreator = function ( configuration ? ) { return { param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { string } issueLocale param { * } options throws deleteListingsItem : async ( sellerId , sku , marketplaceIds , issueLocale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'deleteListingsItem' , 'sellerId' , sellerId ) ; assertParamExists ( 'deleteListingsItem' , 'sku' , sku ) ; assertParamExists ( 'deleteListingsItem' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}` . replace ( `{${ "sellerId" }}` , encodeURIComponent ( String ( sellerId ) ) ) . replace ( `{${ "sku" }}` , encodeURIComponent ( String ( sku ) ) ) ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'DELETE' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( issueLocale !== undefined ) { localVarQueryParameter [ 'issueLocale' ] = issueLocale ; } 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 { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { string } issueLocale param { Array < 'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' > } includedData param { * } options throws getListingsItem : async ( sellerId , sku , marketplaceIds , issueLocale ? , includedData ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getListingsItem' , 'sellerId' , sellerId ) ; assertParamExists ( 'getListingsItem' , 'sku' , sku ) ; assertParamExists ( 'getListingsItem' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}` . replace ( `{${ "sellerId" }}` , encodeURIComponent ( String ( sellerId ) ) ) . replace ( `{${ "sku" }}` , encodeURIComponent ( String ( sku ) ) ) ; 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 ( issueLocale !== undefined ) { localVarQueryParameter [ 'issueLocale' ] = issueLocale ; } if ( includedData ) { localVarQueryParameter [ 'includedData' ] = includedData . 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 , } ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { ListingsItemPatchRequest } body param { string } issueLocale param { * } options throws patchListingsItem : async ( sellerId , sku , marketplaceIds , body , issueLocale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'patchListingsItem' , 'sellerId' , sellerId ) ; assertParamExists ( 'patchListingsItem' , 'sku' , sku ) ; assertParamExists ( 'patchListingsItem' , 'marketplaceIds' , marketplaceIds ) ; assertParamExists ( 'patchListingsItem' , 'body' , body ) ; const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}` . replace ( `{${ "sellerId" }}` , encodeURIComponent ( String ( sellerId ) ) ) . replace ( `{${ "sku" }}` , encodeURIComponent ( String ( sku ) ) ) ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'PATCH' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( issueLocale !== undefined ) { localVarQueryParameter [ 'issueLocale' ] = issueLocale ; } localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ; setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; localVarRequestOptions . data = serializeDataIfNeeded ( body , localVarRequestOptions , configuration ) ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { ListingsItemPutRequest } body param { string } issueLocale param { * } options throws putListingsItem : async ( sellerId , sku , marketplaceIds , body , issueLocale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'putListingsItem' , 'sellerId' , sellerId ) ; assertParamExists ( 'putListingsItem' , 'sku' , sku ) ; assertParamExists ( 'putListingsItem' , 'marketplaceIds' , marketplaceIds ) ; assertParamExists ( 'putListingsItem' , 'body' , body ) ; const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}` . replace ( `{${ "sellerId" }}` , encodeURIComponent ( String ( sellerId ) ) ) . replace ( `{${ "sku" }}` , encodeURIComponent ( String ( sku ) ) ) ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'PUT' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( issueLocale !== undefined ) { localVarQueryParameter [ 'issueLocale' ] = issueLocale ; } localVarHeaderParameter [ 'Content-Type' ] = 'application/json' ; setSearchParams ( localVarUrlObj , localVarQueryParameter , options . query ) ; let headersFromBaseOptions = baseOptions && baseOptions . headers ? baseOptions . headers : { } ; localVarRequestOptions . headers = { ... localVarHeaderParameter , ... headersFromBaseOptions , ... options . headers } ; localVarRequestOptions . data = serializeDataIfNeeded ( body , localVarRequestOptions , configuration ) ; return { url : toPathString ( localVarUrlObj ) , options : localVarRequestOptions , } ; } , } ; } ; export export const ListingsApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = ListingsApiAxiosParamCreator ( configuration ) ; return { param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { string } issueLocale param { * } options throws async deleteListingsItem ( sellerId , sku , marketplaceIds , issueLocale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . deleteListingsItem ( sellerId , sku , marketplaceIds , issueLocale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { string } issueLocale param { Array < 'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' > } includedData param { * } options throws async getListingsItem ( sellerId , sku , marketplaceIds , issueLocale ? , includedData ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getListingsItem ( sellerId , sku , marketplaceIds , issueLocale , includedData , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { ListingsItemPatchRequest } body param { string } issueLocale param { * } options throws async patchListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . patchListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { ListingsItemPutRequest } body param { string } issueLocale param { * } options throws async putListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . putListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const ListingsApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = ListingsApiFp ( configuration ) ; return { param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { string } issueLocale param { * } options throws deleteListingsItem ( sellerId , sku , marketplaceIds , issueLocale ? , options ? ) { return localVarFp . deleteListingsItem ( sellerId , sku , marketplaceIds , issueLocale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { string } issueLocale param { Array < 'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' > } includedData param { * } options throws getListingsItem ( sellerId , sku , marketplaceIds , issueLocale ? , includedData ? , options ? ) { return localVarFp . getListingsItem ( sellerId , sku , marketplaceIds , issueLocale , includedData , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { ListingsItemPatchRequest } body param { string } issueLocale param { * } options throws patchListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale ? , options ? ) { return localVarFp . patchListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } sellerId param { string } sku param { Array < string > } marketplaceIds param { ListingsItemPutRequest } body param { string } issueLocale param { * } options throws putListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale ? , options ? ) { return localVarFp . putListingsItem ( sellerId , sku , marketplaceIds , body , issueLocale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface ListingsApiDeleteListingsItemRequest { type { string } memberof readonly sellerId : string ; type { string } memberof readonly sku : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { string } memberof readonly issueLocale ? : string ; } export interface export interface ListingsApiGetListingsItemRequest { type { string } memberof readonly sellerId : string ; type { string } memberof readonly sku : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { string } memberof readonly issueLocale ? : string ; type { Array < 'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' > } memberof readonly includedData ? : Array < 'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' > ; } export interface export interface ListingsApiPatchListingsItemRequest { type { string } memberof readonly sellerId : string ; type { string } memberof readonly sku : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { ListingsItemPatchRequest } memberof readonly body : ListingsItemPatchRequest ; type { string } memberof readonly issueLocale ? : string ; } export interface export interface ListingsApiPutListingsItemRequest { type { string } memberof readonly sellerId : string ; type { string } memberof readonly sku : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { ListingsItemPutRequest } memberof readonly body : ListingsItemPutRequest ; type { string } memberof readonly issueLocale ? : string ; } export class extends BaseAPI export class ListingsApi extends BaseAPI { param { ListingsApiDeleteListingsItemRequest } requestParameters param { * } options throws memberof public deleteListingsItem ( requestParameters , options ? ) { return ListingsApiFp ( this . configuration ) . deleteListingsItem ( requestParameters . sellerId , requestParameters . sku , requestParameters . marketplaceIds , requestParameters . issueLocale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { ListingsApiGetListingsItemRequest } requestParameters param { * } options throws memberof public getListingsItem ( requestParameters , options ? ) { return ListingsApiFp ( this . configuration ) . getListingsItem ( requestParameters . sellerId , requestParameters . sku , requestParameters . marketplaceIds , requestParameters . issueLocale , requestParameters . includedData , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { ListingsApiPatchListingsItemRequest } requestParameters param { * } options throws memberof public patchListingsItem ( requestParameters , options ? ) { return ListingsApiFp ( this . configuration ) . patchListingsItem ( requestParameters . sellerId , requestParameters . sku , requestParameters . marketplaceIds , requestParameters . body , requestParameters . issueLocale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { ListingsApiPutListingsItemRequest } requestParameters param { * } options throws memberof public putListingsItem ( requestParameters , options ? ) { return ListingsApiFp ( this . configuration ) . putListingsItem ( requestParameters . sellerId , requestParameters . sku , requestParameters . marketplaceIds , requestParameters . body , requestParameters . issueLocale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }