/**
 * Selling Partner API for Uploads
 * The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API.
 *
 * The version of the OpenAPI document: 2020-11-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 CreateUploadDestinationResponse { type { UploadDestination } memberof payload ? : UploadDestination ; 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 UploadDestination { type { string } memberof uploadDestinationId ? : string ; type { string } memberof url ? : string ; type { object } memberof headers ? : object ; } export export const UploadsApiAxiosParamCreator = function ( configuration ? ) { return { param { Array < string > } marketplaceIds param { string } contentMD5 param { string } resource param { string } contentType param { * } options throws createUploadDestinationForResource : async ( marketplaceIds , contentMD5 , resource , contentType ? , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'createUploadDestinationForResource' , 'marketplaceIds' , marketplaceIds ) ; assertParamExists ( 'createUploadDestinationForResource' , 'contentMD5' , contentMD5 ) ; assertParamExists ( 'createUploadDestinationForResource' , 'resource' , resource ) ; const localVarPath = `/uploads/2020-11-01/uploadDestinations/{resource}` . replace ( `{${ "resource" }}` , encodeURIComponent ( String ( resource ) ) ) ; 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 ; if ( marketplaceIds ) { localVarQueryParameter [ 'marketplaceIds' ] = marketplaceIds . join ( COLLECTION_FORMATS . csv ) ; } if ( contentMD5 !== undefined ) { localVarQueryParameter [ 'contentMD5' ] = contentMD5 ; } if ( contentType !== undefined ) { localVarQueryParameter [ 'contentType' ] = contentType ; } 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 UploadsApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = UploadsApiAxiosParamCreator ( configuration ) ; return { param { Array < string > } marketplaceIds param { string } contentMD5 param { string } resource param { string } contentType param { * } options throws async createUploadDestinationForResource ( marketplaceIds , contentMD5 , resource , contentType ? , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . createUploadDestinationForResource ( marketplaceIds , contentMD5 , resource , contentType , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const UploadsApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = UploadsApiFp ( configuration ) ; return { param { Array < string > } marketplaceIds param { string } contentMD5 param { string } resource param { string } contentType param { * } options throws createUploadDestinationForResource ( marketplaceIds , contentMD5 , resource , contentType ? , options ? ) { return localVarFp . createUploadDestinationForResource ( marketplaceIds , contentMD5 , resource , contentType , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface UploadsApiCreateUploadDestinationForResourceRequest { type { Array < string > } memberof readonly marketplaceIds : Array < string > ; type { string } memberof readonly contentMD5 : string ; type { string } memberof readonly resource : string ; type { string } memberof readonly contentType ? : string ; } export class extends BaseAPI export class UploadsApi extends BaseAPI { param { UploadsApiCreateUploadDestinationForResourceRequest } requestParameters param { * } options throws memberof public createUploadDestinationForResource ( requestParameters , options ? ) { return UploadsApiFp ( this . configuration ) . createUploadDestinationForResource ( requestParameters . marketplaceIds , requestParameters . contentMD5 , requestParameters . resource , requestParameters . contentType , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }