/**
 * Selling Partner API for Product Type Definitions
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/product-type-definitions-api-use-case-guide/definitions-product-types-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 ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface ProductType { type { string } memberof name : string ; type { Array < string > } memberof marketplaceIds : Array < string > ; } export interface export interface ProductTypeDefinition { type { SchemaLink } memberof metaSchema ? : SchemaLink ; type { SchemaLink } memberof schema : SchemaLink ; type { string } memberof requirements : ProductTypeDefinitionRequirementsEnum | 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' ; type { string } memberof requirementsEnforced : ProductTypeDefinitionRequirementsEnforcedEnum | 'ENFORCED' | 'NOT_ENFORCED' ; type { { [ key : string ] : PropertyGroup ; } } memberof propertyGroups : { [ key ] : PropertyGroup ; } ; type { string } memberof locale : string ; type { Array < string > } memberof marketplaceIds : Array < string > ; type { string } memberof productType : string ; type { ProductTypeVersion } memberof productTypeVersion : ProductTypeVersion ; } export enum { string } export enum ProductTypeDefinitionRequirementsEnum { Listing = 'LISTING' , ListingProductOnly = 'LISTING_PRODUCT_ONLY' , ListingOfferOnly = 'LISTING_OFFER_ONLY' } export enum { string } export enum ProductTypeDefinitionRequirementsEnforcedEnum { Enforced = 'ENFORCED' , NotEnforced = 'NOT_ENFORCED' } export interface export interface ProductTypeList { type { Array < ProductType > } memberof productTypes : Array < ProductType > ; } export interface export interface ProductTypeVersion { type { string } memberof version : string ; type { boolean } memberof latest : boolean ; type { boolean } memberof releaseCandidate ? : boolean ; } export interface export interface PropertyGroup { type { string } memberof title ? : string ; type { string } memberof description ? : string ; type { Array < string > } memberof propertyNames ? : Array < string > ; } export interface export interface SchemaLink { type { SchemaLinkLink } memberof link : SchemaLinkLink ; type { string } memberof checksum : string ; } export interface export interface SchemaLinkLink { type { string } memberof resource : string ; type { string } memberof verb : SchemaLinkLinkVerbEnum | 'GET' ; } export enum { string } export enum SchemaLinkLinkVerbEnum { Get = 'GET' } export export const DefinitionsApiAxiosParamCreator = function ( configuration ? ) { return { param { string } productType param { Array < string > } marketplaceIds param { string } sellerId param { string } productTypeVersion param { 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' } requirements param { 'ENFORCED' | 'NOT_ENFORCED' } requirementsEnforced param { 'DEFAULT' | 'ar' | 'ar_AE' | 'de' | 'de_DE' | 'en' | 'en_AE' | 'en_AU' | 'en_CA' | 'en_GB' | 'en_IN' | 'en_SG' | 'en_US' | 'es' | 'es_ES' | 'es_MX' | 'es_US' | 'fr' | 'fr_CA' | 'fr_FR' | 'it' | 'it_IT' | 'ja' | 'ja_JP' | 'nl' | 'nl_NL' | 'pl' | 'pl_PL' | 'pt' | 'pt_BR' | 'pt_PT' | 'sv' | 'sv_SE' | 'tr' | 'tr_TR' | 'zh' | 'zh_CN' | 'zh_TW' } locale param { * } options throws getDefinitionsProductType : async ( productType , marketplaceIds , sellerId ? , productTypeVersion ? , requirements ? , requirementsEnforced ? , locale ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getDefinitionsProductType' , 'productType' , productType ) ; assertParamExists ( 'getDefinitionsProductType' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/definitions/2020-09-01/productTypes/{productType}` . replace ( `{${ "productType" }}` , encodeURIComponent ( String ( productType ) ) ) ; 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 ( sellerId !== undefined ) { localVarQueryParameter [ 'sellerId' ] = sellerId ; } if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( productTypeVersion !== undefined ) { localVarQueryParameter [ 'productTypeVersion' ] = productTypeVersion ; } if ( requirements !== undefined ) { localVarQueryParameter [ 'requirements' ] = requirements ; } if ( requirementsEnforced !== undefined ) { localVarQueryParameter [ 'requirementsEnforced' ] = requirementsEnforced ; } 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 > } marketplaceIds param { Array < string > } keywords param { * } options throws searchDefinitionsProductTypes : async ( marketplaceIds , keywords ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'searchDefinitionsProductTypes' , 'marketplaceIds' , marketplaceIds ) ; const localVarPath = `/definitions/2020-09-01/productTypes` ; 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 ) ; } 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 DefinitionsApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = DefinitionsApiAxiosParamCreator ( configuration ) ; return { param { string } productType param { Array < string > } marketplaceIds param { string } sellerId param { string } productTypeVersion param { 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' } requirements param { 'ENFORCED' | 'NOT_ENFORCED' } requirementsEnforced param { 'DEFAULT' | 'ar' | 'ar_AE' | 'de' | 'de_DE' | 'en' | 'en_AE' | 'en_AU' | 'en_CA' | 'en_GB' | 'en_IN' | 'en_SG' | 'en_US' | 'es' | 'es_ES' | 'es_MX' | 'es_US' | 'fr' | 'fr_CA' | 'fr_FR' | 'it' | 'it_IT' | 'ja' | 'ja_JP' | 'nl' | 'nl_NL' | 'pl' | 'pl_PL' | 'pt' | 'pt_BR' | 'pt_PT' | 'sv' | 'sv_SE' | 'tr' | 'tr_TR' | 'zh' | 'zh_CN' | 'zh_TW' } locale param { * } options throws async getDefinitionsProductType ( productType , marketplaceIds , sellerId ? , productTypeVersion ? , requirements ? , requirementsEnforced ? , locale ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getDefinitionsProductType ( productType , marketplaceIds , sellerId , productTypeVersion , requirements , requirementsEnforced , locale , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { Array < string > } marketplaceIds param { Array < string > } keywords param { * } options throws async searchDefinitionsProductTypes ( marketplaceIds , keywords ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . searchDefinitionsProductTypes ( marketplaceIds , keywords , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const DefinitionsApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = DefinitionsApiFp ( configuration ) ; return { param { string } productType param { Array < string > } marketplaceIds param { string } sellerId param { string } productTypeVersion param { 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' } requirements param { 'ENFORCED' | 'NOT_ENFORCED' } requirementsEnforced param { 'DEFAULT' | 'ar' | 'ar_AE' | 'de' | 'de_DE' | 'en' | 'en_AE' | 'en_AU' | 'en_CA' | 'en_GB' | 'en_IN' | 'en_SG' | 'en_US' | 'es' | 'es_ES' | 'es_MX' | 'es_US' | 'fr' | 'fr_CA' | 'fr_FR' | 'it' | 'it_IT' | 'ja' | 'ja_JP' | 'nl' | 'nl_NL' | 'pl' | 'pl_PL' | 'pt' | 'pt_BR' | 'pt_PT' | 'sv' | 'sv_SE' | 'tr' | 'tr_TR' | 'zh' | 'zh_CN' | 'zh_TW' } locale param { * } options throws getDefinitionsProductType ( productType , marketplaceIds , sellerId ? , productTypeVersion ? , requirements ? , requirementsEnforced ? , locale ? , options ? ) { return localVarFp . getDefinitionsProductType ( productType , marketplaceIds , sellerId , productTypeVersion , requirements , requirementsEnforced , locale , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { Array < string > } marketplaceIds param { Array < string > } keywords param { * } options throws searchDefinitionsProductTypes ( marketplaceIds , keywords ? , options ? ) { return localVarFp . searchDefinitionsProductTypes ( marketplaceIds , keywords , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface DefinitionsApiGetDefinitionsProductTypeRequest { type { string } memberof readonly productType : string ; type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { string } memberof readonly sellerId ? : string ; type { string } memberof readonly productTypeVersion ? : string ; type { 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' } memberof readonly requirements ? : 'LISTING' | 'LISTING_PRODUCT_ONLY' | 'LISTING_OFFER_ONLY' ; type { 'ENFORCED' | 'NOT_ENFORCED' } memberof readonly requirementsEnforced ? : 'ENFORCED' | 'NOT_ENFORCED' ; type { 'DEFAULT' | 'ar' | 'ar_AE' | 'de' | 'de_DE' | 'en' | 'en_AE' | 'en_AU' | 'en_CA' | 'en_GB' | 'en_IN' | 'en_SG' | 'en_US' | 'es' | 'es_ES' | 'es_MX' | 'es_US' | 'fr' | 'fr_CA' | 'fr_FR' | 'it' | 'it_IT' | 'ja' | 'ja_JP' | 'nl' | 'nl_NL' | 'pl' | 'pl_PL' | 'pt' | 'pt_BR' | 'pt_PT' | 'sv' | 'sv_SE' | 'tr' | 'tr_TR' | 'zh' | 'zh_CN' | 'zh_TW' } memberof readonly locale ? : 'DEFAULT' | 'ar' | 'ar_AE' | 'de' | 'de_DE' | 'en' | 'en_AE' | 'en_AU' | 'en_CA' | 'en_GB' | 'en_IN' | 'en_SG' | 'en_US' | 'es' | 'es_ES' | 'es_MX' | 'es_US' | 'fr' | 'fr_CA' | 'fr_FR' | 'it' | 'it_IT' | 'ja' | 'ja_JP' | 'nl' | 'nl_NL' | 'pl' | 'pl_PL' | 'pt' | 'pt_BR' | 'pt_PT' | 'sv' | 'sv_SE' | 'tr' | 'tr_TR' | 'zh' | 'zh_CN' | 'zh_TW' ; } export interface export interface DefinitionsApiSearchDefinitionsProductTypesRequest { type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { Array < string > } memberof readonly keywords ? : Array < string > ; } export class extends BaseAPI export class DefinitionsApi extends BaseAPI { param { DefinitionsApiGetDefinitionsProductTypeRequest } requestParameters param { * } options throws memberof public getDefinitionsProductType ( requestParameters , options ? ) { return DefinitionsApiFp ( this . configuration ) . getDefinitionsProductType ( requestParameters . productType , requestParameters . marketplaceIds , requestParameters . sellerId , requestParameters . productTypeVersion , requestParameters . requirements , requestParameters . requirementsEnforced , requestParameters . locale , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { DefinitionsApiSearchDefinitionsProductTypesRequest } requestParameters param { * } options throws memberof public searchDefinitionsProductTypes ( requestParameters , options ? ) { return DefinitionsApiFp ( this . configuration ) . searchDefinitionsProductTypes ( requestParameters . marketplaceIds , requestParameters . keywords , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }