/**
 * Selling Partner API for Product Fees
 * The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing.
 *
 * The version of the OpenAPI document: v0
 *
 *
 * 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 FeeDetail { type { string } memberof FeeType : string ; type { MoneyType } memberof FeeAmount : MoneyType ; type { MoneyType } memberof FeePromotion ? : MoneyType ; type { MoneyType } memberof TaxAmount ? : MoneyType ; type { MoneyType } memberof FinalFee : MoneyType ; type { Array < IncludedFeeDetail > } memberof IncludedFeeDetailList ? : Array < IncludedFeeDetail > ; } export interface export interface FeesEstimate { type { string } memberof TimeOfFeesEstimation : string ; type { MoneyType } memberof TotalFeesEstimate ? : MoneyType ; type { Array < FeeDetail > } memberof FeeDetailList ? : Array < FeeDetail > ; } export interface export interface FeesEstimateError { type { string } memberof Type : string ; type { string } memberof Code : string ; type { string } memberof Message : string ; type { Array < object > } memberof Detail : Array < object > ; } export interface export interface FeesEstimateIdentifier { type { string } memberof MarketplaceId ? : string ; type { string } memberof SellerId ? : string ; type { string } memberof IdType ? : string ; type { string } memberof IdValue ? : string ; type { boolean } memberof IsAmazonFulfilled ? : boolean ; type { PriceToEstimateFees } memberof PriceToEstimateFees ? : PriceToEstimateFees ; type { string } memberof SellerInputIdentifier ? : string ; type { OptionalFulfillmentProgram } memberof OptionalFulfillmentProgram ? : OptionalFulfillmentProgram | 'FBA_CORE' | 'FBA_SNL' | 'FBA_EFN' ; } export interface export interface FeesEstimateRequest { type { string } memberof MarketplaceId : string ; type { boolean } memberof IsAmazonFulfilled ? : boolean ; type { PriceToEstimateFees } memberof PriceToEstimateFees : PriceToEstimateFees ; type { string } memberof Identifier : string ; type { OptionalFulfillmentProgram } memberof OptionalFulfillmentProgram ? : OptionalFulfillmentProgram | 'FBA_CORE' | 'FBA_SNL' | 'FBA_EFN' ; } export interface export interface FeesEstimateResult { type { string } memberof Status ? : string ; type { FeesEstimateIdentifier } memberof FeesEstimateIdentifier ? : FeesEstimateIdentifier ; type { FeesEstimate } memberof FeesEstimate ? : FeesEstimate ; type { FeesEstimateError } memberof Error ? : FeesEstimateError ; } export interface export interface GetMyFeesEstimateRequest { type { FeesEstimateRequest } memberof FeesEstimateRequest ? : FeesEstimateRequest ; } export interface export interface GetMyFeesEstimateResponse { type { GetMyFeesEstimateResult } memberof payload ? : GetMyFeesEstimateResult ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface GetMyFeesEstimateResult { type { FeesEstimateResult } memberof FeesEstimateResult ? : FeesEstimateResult ; } export interface export interface IncludedFeeDetail { type { string } memberof FeeType : string ; type { MoneyType } memberof FeeAmount : MoneyType ; type { MoneyType } memberof FeePromotion ? : MoneyType ; type { MoneyType } memberof TaxAmount ? : MoneyType ; type { MoneyType } memberof FinalFee : MoneyType ; } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface MoneyType { type { string } memberof CurrencyCode ? : string ; type { number } memberof Amount ? : number ; } export enum { string } export enum OptionalFulfillmentProgram { Core = 'FBA_CORE' , Snl = 'FBA_SNL' , Efn = 'FBA_EFN' } export interface export interface Points { type { number } memberof PointsNumber ? : number ; type { MoneyType } memberof PointsMonetaryValue ? : MoneyType ; } export interface export interface PriceToEstimateFees { type { MoneyType } memberof ListingPrice : MoneyType ; type { MoneyType } memberof Shipping ? : MoneyType ; type { Points } memberof Points ? : Points ; } export export const FeesApiAxiosParamCreator = function ( configuration ? ) { return { param { string } asin param { GetMyFeesEstimateRequest } body param { * } options throws getMyFeesEstimateForASIN : async ( asin , body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getMyFeesEstimateForASIN' , 'asin' , asin ) ; assertParamExists ( 'getMyFeesEstimateForASIN' , 'body' , body ) ; const localVarPath = `/products/fees/v0/items/{Asin}/feesEstimate` . replace ( `{${ "Asin" }}` , encodeURIComponent ( String ( asin ) ) ) ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'POST' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; 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 } sellerSKU param { GetMyFeesEstimateRequest } body param { * } options throws getMyFeesEstimateForSKU : async ( sellerSKU , body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getMyFeesEstimateForSKU' , 'sellerSKU' , sellerSKU ) ; assertParamExists ( 'getMyFeesEstimateForSKU' , 'body' , body ) ; const localVarPath = `/products/fees/v0/listings/{SellerSKU}/feesEstimate` . replace ( `{${ "SellerSKU" }}` , encodeURIComponent ( String ( sellerSKU ) ) ) ; const localVarUrlObj = new URL ( localVarPath , DUMMY_BASE_URL ) ; let baseOptions ; if ( configuration ) { baseOptions = configuration . baseOptions ; } const localVarRequestOptions = { method : 'POST' , ... baseOptions , ... options } ; const localVarHeaderParameter = { } as any ; const localVarQueryParameter = { } as any ; 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 FeesApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = FeesApiAxiosParamCreator ( configuration ) ; return { param { string } asin param { GetMyFeesEstimateRequest } body param { * } options throws async getMyFeesEstimateForASIN ( asin , body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getMyFeesEstimateForASIN ( asin , body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } sellerSKU param { GetMyFeesEstimateRequest } body param { * } options throws async getMyFeesEstimateForSKU ( sellerSKU , body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getMyFeesEstimateForSKU ( sellerSKU , body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const FeesApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = FeesApiFp ( configuration ) ; return { param { string } asin param { GetMyFeesEstimateRequest } body param { * } options throws getMyFeesEstimateForASIN ( asin , body , options ? ) { return localVarFp . getMyFeesEstimateForASIN ( asin , body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } sellerSKU param { GetMyFeesEstimateRequest } body param { * } options throws getMyFeesEstimateForSKU ( sellerSKU , body , options ? ) { return localVarFp . getMyFeesEstimateForSKU ( sellerSKU , body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface FeesApiGetMyFeesEstimateForASINRequest { type { string } memberof readonly asin : string ; type { GetMyFeesEstimateRequest } memberof readonly body : GetMyFeesEstimateRequest ; } export interface export interface FeesApiGetMyFeesEstimateForSKURequest { type { string } memberof readonly sellerSKU : string ; type { GetMyFeesEstimateRequest } memberof readonly body : GetMyFeesEstimateRequest ; } export class extends BaseAPI export class FeesApi extends BaseAPI { param { FeesApiGetMyFeesEstimateForASINRequest } requestParameters param { * } options throws memberof public getMyFeesEstimateForASIN ( requestParameters , options ? ) { return FeesApiFp ( this . configuration ) . getMyFeesEstimateForASIN ( requestParameters . asin , requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { FeesApiGetMyFeesEstimateForSKURequest } requestParameters param { * } options throws memberof public getMyFeesEstimateForSKU ( requestParameters , options ? ) { return FeesApiFp ( this . configuration ) . getMyFeesEstimateForSKU ( requestParameters . sellerSKU , requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }