/**
 * Selling Partner API for Feeds
 * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.
 *
 * The version of the OpenAPI document: 2021-06-30
 *
 *
 * 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 CreateFeedDocumentResponse { type { string } memberof feedDocumentId : string ; type { string } memberof url : string ; } export interface export interface CreateFeedDocumentSpecification { type { string } memberof contentType : string ; } export interface export interface CreateFeedResponse { type { string } memberof feedId : string ; } export interface export interface CreateFeedSpecification { type { string } memberof feedType : string ; type { Array < string > } memberof marketplaceIds : Array < string > ; type { string } memberof inputFeedDocumentId : string ; type { { [ key : string ] : string ; } } memberof feedOptions ? : { [ key ] : string ; } ; } export interface export interface ErrorList { type { Array < Error > } memberof errors : Array < Error > ; } export interface export interface Feed { type { string } memberof feedId : string ; type { string } memberof feedType : string ; type { Array < string > } memberof marketplaceIds ? : Array < string > ; type { string } memberof createdTime : string ; type { string } memberof processingStatus : FeedProcessingStatusEnum | 'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE' ; type { string } memberof processingStartTime ? : string ; type { string } memberof processingEndTime ? : string ; type { string } memberof resultFeedDocumentId ? : string ; } export enum { string } export enum FeedProcessingStatusEnum { Cancelled = 'CANCELLED' , Done = 'DONE' , Fatal = 'FATAL' , InProgress = 'IN_PROGRESS' , InQueue = 'IN_QUEUE' } export interface export interface FeedDocument { type { string } memberof feedDocumentId : string ; type { string } memberof url : string ; type { string } memberof compressionAlgorithm ? : FeedDocumentCompressionAlgorithmEnum | 'GZIP' ; } export enum { string } export enum FeedDocumentCompressionAlgorithmEnum { Gzip = 'GZIP' } export interface export interface GetFeedsResponse { type { Array < Feed > } memberof feeds : Array < Feed > ; type { string } memberof nextToken ? : string ; } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export export const FeedsApiAxiosParamCreator = function ( configuration ? ) { return { param { string } feedId param { * } options throws cancelFeed : async ( feedId , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'cancelFeed' , 'feedId' , feedId ) ; const localVarPath = `/feeds/2021-06-30/feeds/{feedId}` . replace ( `{${ "feedId" }}` , encodeURIComponent ( String ( feedId ) ) ) ; 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 ; 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 { CreateFeedSpecification } body param { * } options throws createFeed : async ( body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'createFeed' , 'body' , body ) ; const localVarPath = `/feeds/2021-06-30/feeds` ; 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 { CreateFeedDocumentSpecification } body param { * } options throws createFeedDocument : async ( body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'createFeedDocument' , 'body' , body ) ; const localVarPath = `/feeds/2021-06-30/documents` ; 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 } feedId param { * } options throws getFeed : async ( feedId , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getFeed' , 'feedId' , feedId ) ; const localVarPath = `/feeds/2021-06-30/feeds/{feedId}` . replace ( `{${ "feedId" }}` , encodeURIComponent ( String ( feedId ) ) ) ; 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 ; 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 } feedDocumentId param { * } options throws getFeedDocument : async ( feedDocumentId , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'getFeedDocument' , 'feedDocumentId' , feedDocumentId ) ; const localVarPath = `/feeds/2021-06-30/documents/{feedDocumentId}` . replace ( `{${ "feedDocumentId" }}` , encodeURIComponent ( String ( feedDocumentId ) ) ) ; 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 ; 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 > } feedTypes param { Array < string > } marketplaceIds param { number } pageSize param { Array < 'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE' > } processingStatuses param { string } createdSince param { string } createdUntil param { string } nextToken param { * } options throws getFeeds : async ( feedTypes ? , marketplaceIds ? , pageSize ? , processingStatuses ? , createdSince ? , createdUntil ? , nextToken ? , options = { } ) : Promise < RequestArgs > => { const localVarPath = `/feeds/2021-06-30/feeds` ; 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 ( feedTypes ) { localVarQueryParameter [ 'feedTypes' ] = feedTypes . join ( COLLECTION_FORMATS . csv ) ; } if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( pageSize !== undefined ) { localVarQueryParameter [ 'pageSize' ] = pageSize ; } if ( processingStatuses ) { localVarQueryParameter [ 'processingStatuses' ] = processingStatuses . join ( COLLECTION_FORMATS . csv ) ; } if ( createdSince !== undefined ) { localVarQueryParameter [ 'createdSince' ] = ( createdSince as any instanceof Date ) ? ( createdSince as any ) . toISOString ( ) : createdSince ; } if ( createdUntil !== undefined ) { localVarQueryParameter [ 'createdUntil' ] = ( createdUntil as any instanceof Date ) ? ( createdUntil as any ) . toISOString ( ) : createdUntil ; } if ( nextToken !== undefined ) { localVarQueryParameter [ 'nextToken' ] = nextToken ; } 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 FeedsApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = FeedsApiAxiosParamCreator ( configuration ) ; return { param { string } feedId param { * } options throws async cancelFeed ( feedId , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . cancelFeed ( feedId , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { CreateFeedSpecification } body param { * } options throws async createFeed ( body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . createFeed ( body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { CreateFeedDocumentSpecification } body param { * } options throws async createFeedDocument ( body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . createFeedDocument ( body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } feedId param { * } options throws async getFeed ( feedId , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getFeed ( feedId , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { string } feedDocumentId param { * } options throws async getFeedDocument ( feedDocumentId , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getFeedDocument ( feedDocumentId , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , param { Array < string > } feedTypes param { Array < string > } marketplaceIds param { number } pageSize param { Array < 'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE' > } processingStatuses param { string } createdSince param { string } createdUntil param { string } nextToken param { * } options throws async getFeeds ( feedTypes ? , marketplaceIds ? , pageSize ? , processingStatuses ? , createdSince ? , createdUntil ? , nextToken ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . getFeeds ( feedTypes , marketplaceIds , pageSize , processingStatuses , createdSince , createdUntil , nextToken , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const FeedsApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = FeedsApiFp ( configuration ) ; return { param { string } feedId param { * } options throws cancelFeed ( feedId , options ? ) { return localVarFp . cancelFeed ( feedId , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { CreateFeedSpecification } body param { * } options throws createFeed ( body , options ? ) { return localVarFp . createFeed ( body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { CreateFeedDocumentSpecification } body param { * } options throws createFeedDocument ( body , options ? ) { return localVarFp . createFeedDocument ( body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } feedId param { * } options throws getFeed ( feedId , options ? ) { return localVarFp . getFeed ( feedId , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { string } feedDocumentId param { * } options throws getFeedDocument ( feedDocumentId , options ? ) { return localVarFp . getFeedDocument ( feedDocumentId , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , param { Array < string > } feedTypes param { Array < string > } marketplaceIds param { number } pageSize param { Array < 'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE' > } processingStatuses param { string } createdSince param { string } createdUntil param { string } nextToken param { * } options throws getFeeds ( feedTypes ? , marketplaceIds ? , pageSize ? , processingStatuses ? , createdSince ? , createdUntil ? , nextToken ? , options ? ) { return localVarFp . getFeeds ( feedTypes , marketplaceIds , pageSize , processingStatuses , createdSince , createdUntil , nextToken , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface FeedsApiCancelFeedRequest { type { string } memberof readonly feedId : string ; } export interface export interface FeedsApiCreateFeedRequest { type { CreateFeedSpecification } memberof readonly body : CreateFeedSpecification ; } export interface export interface FeedsApiCreateFeedDocumentRequest { type { CreateFeedDocumentSpecification } memberof readonly body : CreateFeedDocumentSpecification ; } export interface export interface FeedsApiGetFeedRequest { type { string } memberof readonly feedId : string ; } export interface export interface FeedsApiGetFeedDocumentRequest { type { string } memberof readonly feedDocumentId : string ; } export interface export interface FeedsApiGetFeedsRequest { type { Array < string > } memberof readonly feedTypes ? : Array < string > ; type { Array < string > } memberof readonly marketplaceIds ? : Array < string > ; type { number } memberof readonly pageSize ? : number ; type { Array < 'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE' > } memberof readonly processingStatuses ? : Array < 'CANCELLED' | 'DONE' | 'FATAL' | 'IN_PROGRESS' | 'IN_QUEUE' > ; type { string } memberof readonly createdSince ? : string ; type { string } memberof readonly createdUntil ? : string ; type { string } memberof readonly nextToken ? : string ; } export class extends BaseAPI export class FeedsApi extends BaseAPI { param { FeedsApiCancelFeedRequest } requestParameters param { * } options throws memberof public cancelFeed ( requestParameters , options ? ) { return FeedsApiFp ( this . configuration ) . cancelFeed ( requestParameters . feedId , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { FeedsApiCreateFeedRequest } requestParameters param { * } options throws memberof public createFeed ( requestParameters , options ? ) { return FeedsApiFp ( this . configuration ) . createFeed ( requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { FeedsApiCreateFeedDocumentRequest } requestParameters param { * } options throws memberof public createFeedDocument ( requestParameters , options ? ) { return FeedsApiFp ( this . configuration ) . createFeedDocument ( requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { FeedsApiGetFeedRequest } requestParameters param { * } options throws memberof public getFeed ( requestParameters , options ? ) { return FeedsApiFp ( this . configuration ) . getFeed ( requestParameters . feedId , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { FeedsApiGetFeedDocumentRequest } requestParameters param { * } options throws memberof public getFeedDocument ( requestParameters , options ? ) { return FeedsApiFp ( this . configuration ) . getFeedDocument ( requestParameters . feedDocumentId , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } param { FeedsApiGetFeedsRequest } requestParameters param { * } options throws memberof public getFeeds ( requestParameters = { } , options ? ) { return FeedsApiFp ( this . configuration ) . getFeeds ( requestParameters . feedTypes , requestParameters . marketplaceIds , requestParameters . pageSize , requestParameters . processingStatuses , requestParameters . createdSince , requestParameters . createdUntil , requestParameters . nextToken , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }