/**
 * Selling Partner API for Listings Restrictions
 * The Selling Partner API for Listings Restrictions provides programmatic access to restrictions on Amazon catalog listings.  For more information, see the [Listings Restrictions API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/listings-restrictions-api-use-case-guide/listings-restrictions-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 Link { type { string } memberof resource : string ; type { string } memberof verb : LinkVerbEnum | 'GET' ; type { string } memberof title ? : string ; type { string } memberof type ? : string ; } export enum { string } export enum LinkVerbEnum { Get = 'GET' } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface Reason { type { string } memberof message : string ; type { string } memberof reasonCode ? : ReasonReasonCodeEnum | 'APPROVAL_REQUIRED' | 'ASIN_NOT_FOUND' | 'NOT_ELIGIBLE' ; type { Array < Link > } memberof links ? : Array < Link > ; } export enum { string } export enum ReasonReasonCodeEnum { ApprovalRequired = 'APPROVAL_REQUIRED' , AsinNotFound = 'ASIN_NOT_FOUND' , NotEligible = 'NOT_ELIGIBLE' } export interface export interface Restriction { type { string } memberof marketplaceId : string ; type { string } memberof conditionType ? : RestrictionConditionTypeEnum | '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 < Reason > } memberof reasons ? : Array < Reason > ; } export enum { string } export enum RestrictionConditionTypeEnum { 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 interface export interface RestrictionList { type { Array < Restriction > } memberof restrictions : Array < Restriction > ; } export export const ListingsApiAxiosParamCreator = function ( configuration ? ) { return { param { string } asin param { string } sellerId param { Array < string > } marketplaceIds param { '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' } conditionType param { string } reasonLocale param { * } options throws getListingsRestrictions : async ( asin , sellerId , marketplaceIds , conditionType ? , reasonLocale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getListingsRestrictions' , 'asin' , asin ) ; assertParamExists ( 'getListingsRestrictions' , 'sellerId' , sellerId ) ; assertParamExists ( 'getListingsRestrictions' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/listings/2021-08-01/restrictions` ; 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 ( asin !== undefined ) { localVarQueryParameter [ 'asin' ] = asin ; } if ( conditionType !== undefined ) { localVarQueryParameter [ 'conditionType' ] = conditionType ; } if ( sellerId !== undefined ) { localVarQueryParameter [ 'sellerId' ] = sellerId ; } if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( reasonLocale !== undefined ) { localVarQueryParameter [ 'reasonLocale' ] = reasonLocale ; } 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 ListingsApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = ListingsApiAxiosParamCreator ( configuration ) ; return { param { string } asin param { string } sellerId param { Array < string > } marketplaceIds param { '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' } conditionType param { string } reasonLocale param { * } options throws async getListingsRestrictions ( asin , sellerId , marketplaceIds , conditionType ? , reasonLocale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getListingsRestrictions ( asin , sellerId , marketplaceIds , conditionType , reasonLocale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const ListingsApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = ListingsApiFp ( configuration ) ; return { param { string } asin param { string } sellerId param { Array < string > } marketplaceIds param { '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' } conditionType param { string } reasonLocale param { * } options throws getListingsRestrictions ( asin , sellerId , marketplaceIds , conditionType ? , reasonLocale ? , options ? ) { return localVarFp . getListingsRestrictions ( asin , sellerId , marketplaceIds , conditionType , reasonLocale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface ListingsApiGetListingsRestrictionsRequest { type { string } memberof readonly asin : string ; type { string } memberof readonly sellerId : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { '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' } memberof readonly conditionType ? : '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 { string } memberof readonly reasonLocale ? : string ; } export class extends BaseAPI export class ListingsApi extends BaseAPI { param { ListingsApiGetListingsRestrictionsRequest } requestParameters param { * } options throws memberof public getListingsRestrictions ( requestParameters , options ? ) { return ListingsApiFp ( this . configuration ) . getListingsRestrictions ( requestParameters . asin , requestParameters . sellerId , requestParameters . marketplaceIds , requestParameters . conditionType , requestParameters . reasonLocale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }