/**
 * Selling Partner API for Direct Fulfillment Inventory Updates
 * The Selling Partner API for Direct Fulfillment Inventory Updates provides programmatic access to a direct fulfillment vendor\'s inventory updates.
 *
 * The version of the OpenAPI document: v1
 *
 *
 * 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 InventoryUpdate { type { PartyIdentification } memberof sellingParty : PartyIdentification ; type { boolean } memberof isFullUpdate : boolean ; type { Array < ItemDetails > } memberof items : Array < ItemDetails > ; } export interface export interface ItemDetails { type { string } memberof buyerProductIdentifier ? : string ; type { string } memberof vendorProductIdentifier ? : string ; type { ItemQuantity } memberof availableQuantity : ItemQuantity ; type { boolean } memberof isObsolete ? : boolean ; } export interface export interface ItemQuantity { type { number } memberof amount ? : number ; type { string } memberof unitOfMeasure : string ; } export interface export interface ModelError { type { string } memberof code : string ; type { string } memberof message : string ; type { string } memberof details ? : string ; } export interface export interface PartyIdentification { type { string } memberof partyId : string ; } export interface export interface SubmitInventoryUpdateRequest { type { InventoryUpdate } memberof inventory ? : InventoryUpdate ; } export interface export interface SubmitInventoryUpdateResponse { type { TransactionReference } memberof payload ? : TransactionReference ; type { Array < Error > } memberof errors ? : Array < Error > ; } export interface export interface TransactionReference { type { string } memberof transactionId ? : string ; } export export const UpdateInventoryApiAxiosParamCreator = function ( configuration ? ) { return { param { string } warehouseId param { SubmitInventoryUpdateRequest } body param { * } options throws submitInventoryUpdate : async ( warehouseId , body , options = { } ) : Promise < RequestArgs > => { assertParamExists ( 'submitInventoryUpdate' , 'warehouseId' , warehouseId ) ; assertParamExists ( 'submitInventoryUpdate' , 'body' , body ) ; const localVarPath = `/vendor/directFulfillment/inventory/v1/warehouses/{warehouseId}/items` . replace ( `{${ "warehouseId" }}` , encodeURIComponent ( String ( warehouseId ) ) ) ; 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 UpdateInventoryApiFp = function ( configuration ? ) { const localVarAxiosParamCreator = UpdateInventoryApiAxiosParamCreator ( configuration ) ; return { param { string } warehouseId param { SubmitInventoryUpdateRequest } body param { * } options throws async submitInventoryUpdate ( warehouseId , body , options ? ) { const localVarAxiosArgs = await localVarAxiosParamCreator . submitInventoryUpdate ( warehouseId , body , options ) ; return createRequestFunction ( localVarAxiosArgs , globalAxios , BASE_PATH , configuration ) ; } , } ; } ; export export const UpdateInventoryApiFactory = function ( configuration ? , basePath ? , axios ? ) { const localVarFp = UpdateInventoryApiFp ( configuration ) ; return { param { string } warehouseId param { SubmitInventoryUpdateRequest } body param { * } options throws submitInventoryUpdate ( warehouseId , body , options ? ) { return localVarFp . submitInventoryUpdate ( warehouseId , body , options ) . then ( ( request ) => request ( axios , basePath ) ) ; } , } ; } ; export interface export interface UpdateInventoryApiSubmitInventoryUpdateRequest { type { string } memberof readonly warehouseId : string ; type { SubmitInventoryUpdateRequest } memberof readonly body : SubmitInventoryUpdateRequest ; } export class extends BaseAPI export class UpdateInventoryApi extends BaseAPI { param { UpdateInventoryApiSubmitInventoryUpdateRequest } requestParameters param { * } options throws memberof public submitInventoryUpdate ( requestParameters , options ? ) { return UpdateInventoryApiFp ( this . configuration ) . submitInventoryUpdate ( requestParameters . warehouseId , requestParameters . body , options ) . then ( ( request ) => request ( this . axios , this . basePath ) ) ; } }