import { ApiResponse , FileWrapper , RequestOptions } from '../core' ; import { BatchDeleteCatalogObjectsRequest , batchDeleteCatalogObjectsRequestSchema , } from '../models/batchDeleteCatalogObjectsRequest' ; import { BatchDeleteCatalogObjectsResponse , batchDeleteCatalogObjectsResponseSchema , } from '../models/batchDeleteCatalogObjectsResponse' ; import { BatchRetrieveCatalogObjectsRequest , batchRetrieveCatalogObjectsRequestSchema , } from '../models/batchRetrieveCatalogObjectsRequest' ; import { BatchRetrieveCatalogObjectsResponse , batchRetrieveCatalogObjectsResponseSchema , } from '../models/batchRetrieveCatalogObjectsResponse' ; import { BatchUpsertCatalogObjectsRequest , batchUpsertCatalogObjectsRequestSchema , } from '../models/batchUpsertCatalogObjectsRequest' ; import { BatchUpsertCatalogObjectsResponse , batchUpsertCatalogObjectsResponseSchema , } from '../models/batchUpsertCatalogObjectsResponse' ; import { CatalogInfoResponse , catalogInfoResponseSchema , } from '../models/catalogInfoResponse' ; import { CreateCatalogImageRequest , createCatalogImageRequestSchema , } from '../models/createCatalogImageRequest' ; import { CreateCatalogImageResponse , createCatalogImageResponseSchema , } from '../models/createCatalogImageResponse' ; import { DeleteCatalogObjectResponse , deleteCatalogObjectResponseSchema , } from '../models/deleteCatalogObjectResponse' ; import { ListCatalogResponse , listCatalogResponseSchema , } from '../models/listCatalogResponse' ; import { RetrieveCatalogObjectResponse , retrieveCatalogObjectResponseSchema , } from '../models/retrieveCatalogObjectResponse' ; import { SearchCatalogItemsRequest , searchCatalogItemsRequestSchema , } from '../models/searchCatalogItemsRequest' ; import { SearchCatalogItemsResponse , searchCatalogItemsResponseSchema , } from '../models/searchCatalogItemsResponse' ; import { SearchCatalogObjectsRequest , searchCatalogObjectsRequestSchema , } from '../models/searchCatalogObjectsRequest' ; import { SearchCatalogObjectsResponse , searchCatalogObjectsResponseSchema , } from '../models/searchCatalogObjectsResponse' ; import { UpdateCatalogImageRequest , updateCatalogImageRequestSchema , } from '../models/updateCatalogImageRequest' ; import { UpdateCatalogImageResponse , updateCatalogImageResponseSchema , } from '../models/updateCatalogImageResponse' ; import { UpdateItemModifierListsRequest , updateItemModifierListsRequestSchema , } from '../models/updateItemModifierListsRequest' ; import { UpdateItemModifierListsResponse , updateItemModifierListsResponseSchema , } from '../models/updateItemModifierListsResponse' ; import { UpdateItemTaxesRequest , updateItemTaxesRequestSchema , } from '../models/updateItemTaxesRequest' ; import { UpdateItemTaxesResponse , updateItemTaxesResponseSchema , } from '../models/updateItemTaxesResponse' ; import { UpsertCatalogObjectRequest , upsertCatalogObjectRequestSchema , } from '../models/upsertCatalogObjectRequest' ; import { UpsertCatalogObjectResponse , upsertCatalogObjectResponseSchema , } from '../models/upsertCatalogObjectResponse' ; import { bigint , boolean , optional , string } from '../schema' ; import { BaseApi } from './baseApi' ; export class CatalogApi extends BaseApi { param body return async batchDeleteCatalogObjects ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/batch-delete' ) ; const mapped = req . prepareArgs ( { body : [ body , batchDeleteCatalogObjectsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( batchDeleteCatalogObjectsResponseSchema , requestOptions ) ; } param body return async batchRetrieveCatalogObjects ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/batch-retrieve' ) ; const mapped = req . prepareArgs ( { body : [ body , batchRetrieveCatalogObjectsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( batchRetrieveCatalogObjectsResponseSchema , requestOptions ) ; } param body return async batchUpsertCatalogObjects ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/batch-upsert' ) ; const mapped = req . prepareArgs ( { body : [ body , batchUpsertCatalogObjectsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( batchUpsertCatalogObjectsResponseSchema , requestOptions ) ; } param request param imageFile return async createCatalogImage ( request ? , imageFile ? , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/images' ) ; const mapped = req . prepareArgs ( { request : [ request , optional ( createCatalogImageRequestSchema ) ] , } ) ; req . formData ( { request : JSON . stringify ( mapped . request ) , image_file : imageFile , } ) ; return req . callAsJson ( createCatalogImageResponseSchema , requestOptions ) ; } param imageId param request param imageFile return async updateCatalogImage ( imageId , request ? , imageFile ? , requestOptions ? ) { const req = this . createRequest ( 'PUT' ) ; const mapped = req . prepareArgs ( { imageId : [ imageId , string ( ) ] , request : [ request , optional ( updateCatalogImageRequestSchema ) ] , } ) ; req . formData ( { request : JSON . stringify ( mapped . request ) , image_file : imageFile , } ) ; req . appendTemplatePath `/v2/catalog/images/${ mapped . imageId }` ; return req . callAsJson ( updateCatalogImageResponseSchema , requestOptions ) ; } return async catalogInfo ( requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/catalog/info' ) ; return req . callAsJson ( catalogInfoResponseSchema , requestOptions ) ; } param cursor param types param catalogVersion return async listCatalog ( cursor ? , types ? , catalogVersion ? , requestOptions ? ) { const req = this . createRequest ( 'GET' , '/v2/catalog/list' ) ; const mapped = req . prepareArgs ( { cursor : [ cursor , optional ( string ( ) ) ] , types : [ types , optional ( string ( ) ) ] , catalogVersion : [ catalogVersion , optional ( bigint ( ) ) ] , } ) ; req . query ( 'cursor' , mapped . cursor ) ; req . query ( 'types' , mapped . types ) ; req . query ( 'catalog_version' , mapped . catalogVersion ) ; return req . callAsJson ( listCatalogResponseSchema , requestOptions ) ; } param body return async upsertCatalogObject ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/object' ) ; const mapped = req . prepareArgs ( { body : [ body , upsertCatalogObjectRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( upsertCatalogObjectResponseSchema , requestOptions ) ; } param objectId return async deleteCatalogObject ( objectId , requestOptions ? ) { const req = this . createRequest ( 'DELETE' ) ; const mapped = req . prepareArgs ( { objectId : [ objectId , string ( ) ] } ) ; req . appendTemplatePath `/v2/catalog/object/${ mapped . objectId }` ; return req . callAsJson ( deleteCatalogObjectResponseSchema , requestOptions ) ; } param objectId param includeRelatedObjects param catalogVersion return async retrieveCatalogObject ( objectId , includeRelatedObjects ? , catalogVersion ? , requestOptions ? ) { const req = this . createRequest ( 'GET' ) ; const mapped = req . prepareArgs ( { objectId : [ objectId , string ( ) ] , includeRelatedObjects : [ includeRelatedObjects , optional ( boolean ( ) ) ] , catalogVersion : [ catalogVersion , optional ( bigint ( ) ) ] , } ) ; req . query ( 'include_related_objects' , mapped . includeRelatedObjects ) ; req . query ( 'catalog_version' , mapped . catalogVersion ) ; req . appendTemplatePath `/v2/catalog/object/${ mapped . objectId }` ; return req . callAsJson ( retrieveCatalogObjectResponseSchema , requestOptions ) ; } param body return async searchCatalogObjects ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/search' ) ; const mapped = req . prepareArgs ( { body : [ body , searchCatalogObjectsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( searchCatalogObjectsResponseSchema , requestOptions ) ; } param body return async searchCatalogItems ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/search-catalog-items' ) ; const mapped = req . prepareArgs ( { body : [ body , searchCatalogItemsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( searchCatalogItemsResponseSchema , requestOptions ) ; } param body return async updateItemModifierLists ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/update-item-modifier-lists' ) ; const mapped = req . prepareArgs ( { body : [ body , updateItemModifierListsRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( updateItemModifierListsResponseSchema , requestOptions ) ; } param body return async updateItemTaxes ( body , requestOptions ? ) { const req = this . createRequest ( 'POST' , '/v2/catalog/update-item-taxes' ) ; const mapped = req . prepareArgs ( { body : [ body , updateItemTaxesRequestSchema ] , } ) ; req . header ( 'Content-Type' , 'application/json' ) ; req . json ( mapped . body ) ; return req . callAsJson ( updateItemTaxesResponseSchema , requestOptions ) ; } }