/**
 * 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 [Listing 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_2020-09-01.md).
 *
 * The version of the OpenAPI document: 2020-09-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 Issue { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof severity : IssueSeverityEnum | 'ERROR' | 'WARNING' | 'INFO' ; type { string } memberof attributeName ? : string ; } export enum { string } export enum IssueSeverityEnum { Error = 'ERROR' , Warning = 'WARNING' , Info = 'INFO' } 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 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 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/2020-09-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 { 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/2020-09-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/2020-09-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 { 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 { 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 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 { 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 ) ) ; } }