import { ApiResponse , RequestOptions } from '../core' ; import { BatchChangeInventoryRequest , batchChangeInventoryRequestSchema , } from '../models/batchChangeInventoryRequest' ; import { BatchChangeInventoryResponse , batchChangeInventoryResponseSchema , } from '../models/batchChangeInventoryResponse' ; import { BatchRetrieveInventoryChangesRequest , batchRetrieveInventoryChangesRequestSchema , } from '../models/batchRetrieveInventoryChangesRequest' ; import { BatchRetrieveInventoryChangesResponse , batchRetrieveInventoryChangesResponseSchema , } from '../models/batchRetrieveInventoryChangesResponse' ; import { BatchRetrieveInventoryCountsRequest , batchRetrieveInventoryCountsRequestSchema , } from '../models/batchRetrieveInventoryCountsRequest' ; import { BatchRetrieveInventoryCountsResponse , batchRetrieveInventoryCountsResponseSchema , } from '../models/batchRetrieveInventoryCountsResponse' ; import { RetrieveInventoryAdjustmentResponse , retrieveInventoryAdjustmentResponseSchema , } from '../models/retrieveInventoryAdjustmentResponse' ; import { RetrieveInventoryChangesResponse , retrieveInventoryChangesResponseSchema , } from '../models/retrieveInventoryChangesResponse' ; import { RetrieveInventoryCountResponse , retrieveInventoryCountResponseSchema , } from '../models/retrieveInventoryCountResponse' ; import { RetrieveInventoryPhysicalCountResponse , retrieveInventoryPhysicalCountResponseSchema , } from '../models/retrieveInventoryPhysicalCountResponse' ; import { RetrieveInventoryTransferResponse , retrieveInventoryTransferResponseSchema , } from '../models/retrieveInventoryTransferResponse' ; import { optional , string } from '../schema' ; import { BaseApi } from './baseApi' ; export class InventoryApi extends BaseApi { param adjustmentId return deprecated async deprecatedRetrieveInventoryAdjustment ( adjustmentId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { adjustmentId : [ adjustmentId , string ( ) ] } ) ; req . appendTemplatePath `/v2/inventory/adjustment/${ mapped . adjustmentId }` ; req . deprecated ( 'InventoryApi.deprecatedRetrieveInventoryAdjustment' ) ; return req . callAsJson ( retrieveInventoryAdjustmentResponseSchema , requestOptions ) ; } param adjustmentId return async retrieveInventoryAdjustment ( adjustmentId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { adjustmentId : [ adjustmentId , string ( ) ] } ) ; req . appendTemplatePath `/v2/inventory/adjustments/${ mapped . adjustmentId }` ; return req . callAsJson ( retrieveInventoryAdjustmentResponseSchema , requestOptions ) ; } param body return deprecated async deprecatedBatchChangeInventory ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/inventory/batch-change' ) ; const mapped = req . prepareArgs ( { body : [ body , batchChangeInventoryRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . deprecated ( 'InventoryApi.deprecatedBatchChangeInventory' ) ; return req . callAsJson ( batchChangeInventoryResponseSchema , requestOptions ) ; } param body return deprecated async deprecatedBatchRetrieveInventoryChanges ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/inventory/batch-retrieve-changes' ) ; const mapped = req . prepareArgs ( { body : [ body , batchRetrieveInventoryChangesRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . deprecated ( 'InventoryApi.deprecatedBatchRetrieveInventoryChanges' ) ; return req . callAsJson ( batchRetrieveInventoryChangesResponseSchema , requestOptions ) ; } param body return deprecated async deprecatedBatchRetrieveInventoryCounts ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/inventory/batch-retrieve-counts' ) ; const mapped = req . prepareArgs ( { body : [ body , batchRetrieveInventoryCountsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; req . deprecated ( 'InventoryApi.deprecatedBatchRetrieveInventoryCounts' ) ; return req . callAsJson ( batchRetrieveInventoryCountsResponseSchema , requestOptions ) ; } param body return async batchChangeInventory ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/inventory/changes/batch-create' ) ; const mapped = req . prepareArgs ( { body : [ body , batchChangeInventoryRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( batchChangeInventoryResponseSchema , requestOptions ) ; } param body return async batchRetrieveInventoryChanges ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/inventory/changes/batch-retrieve' ) ; const mapped = req . prepareArgs ( { body : [ body , batchRetrieveInventoryChangesRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( batchRetrieveInventoryChangesResponseSchema , requestOptions ) ; } param body return async batchRetrieveInventoryCounts ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/inventory/counts/batch-retrieve' ) ; const mapped = req . prepareArgs ( { body : [ body , batchRetrieveInventoryCountsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( batchRetrieveInventoryCountsResponseSchema , requestOptions ) ; } param physicalCountId return deprecated async deprecatedRetrieveInventoryPhysicalCount ( physicalCountId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { physicalCountId : [ physicalCountId , string ( ) ] , } ) ; req . appendTemplatePath `/v2/inventory/physical-count/${ mapped . physicalCountId }` ; req . deprecated ( 'InventoryApi.deprecatedRetrieveInventoryPhysicalCount' ) ; return req . callAsJson ( retrieveInventoryPhysicalCountResponseSchema , requestOptions ) ; } param physicalCountId return async retrieveInventoryPhysicalCount ( physicalCountId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { physicalCountId : [ physicalCountId , string ( ) ] , } ) ; req . appendTemplatePath `/v2/inventory/physical-counts/${ mapped . physicalCountId }` ; return req . callAsJson ( retrieveInventoryPhysicalCountResponseSchema , requestOptions ) ; } param transferId return async retrieveInventoryTransfer ( transferId , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { transferId : [ transferId , string ( ) ] } ) ; req . appendTemplatePath `/v2/inventory/transfers/${ mapped . transferId }` ; return req . callAsJson ( retrieveInventoryTransferResponseSchema , requestOptions ) ; } param catalogObjectId param locationIds param cursor return async retrieveInventoryCount ( catalogObjectId , locationIds ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { catalogObjectId : [ catalogObjectId , string ( ) ] , locationIds : [ locationIds , optional ( string ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'location_ids' , mapped . locationIds ) ; req . query ( 'cursor' , mapped . cursor ) ; req . appendTemplatePath `/v2/inventory/${ mapped . catalogObjectId }` ; return req . callAsJson ( retrieveInventoryCountResponseSchema , requestOptions ) ; } param catalogObjectId param locationIds param cursor return deprecated async retrieveInventoryChanges ( catalogObjectId , locationIds ? , cursor ? , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { catalogObjectId : [ catalogObjectId , string ( ) ] , locationIds : [ locationIds , optional ( string ( ) ) ] , cursor : [ cursor , optional ( string ( ) ) ] , } ) ; req . query ( 'location_ids' , mapped . locationIds ) ; req . query ( 'cursor' , mapped . cursor ) ; req . appendTemplatePath `/v2/inventory/${ mapped . catalogObjectId }/changes` ; req . deprecated ( 'InventoryApi.retrieveInventoryChanges' ) ; return req . callAsJson ( retrieveInventoryChangesResponseSchema , requestOptions ) ; } }