/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { AttachProductsToProductCategoryRequest, CreateProductCategoryRequest, DetachProductsFromProductCategoryRequest, GenericResponse, PaginatedProductCategoryListResourceResponse, PreviewAutomationRulesRequest, PreviewAutomationRulesResource, ProductCategoryHierarchyResourceArrayResponse, ProductCategoryListResourceArrayResponse, ProductCategoryLiteResourceArrayResponse, ProductCategoryResource, SearchAllProductCategoriesRequest, SearchProductCategoriesRequest, SiteIdRequest, UpdateProductCategoryRequest, } from '../models/index'; import { AttachProductsToProductCategoryRequestFromJSON, AttachProductsToProductCategoryRequestToJSON, CreateProductCategoryRequestFromJSON, CreateProductCategoryRequestToJSON, DetachProductsFromProductCategoryRequestFromJSON, DetachProductsFromProductCategoryRequestToJSON, GenericResponseFromJSON, GenericResponseToJSON, PaginatedProductCategoryListResourceResponseFromJSON, PaginatedProductCategoryListResourceResponseToJSON, PreviewAutomationRulesRequestFromJSON, PreviewAutomationRulesRequestToJSON, PreviewAutomationRulesResourceFromJSON, PreviewAutomationRulesResourceToJSON, ProductCategoryHierarchyResourceArrayResponseFromJSON, ProductCategoryHierarchyResourceArrayResponseToJSON, ProductCategoryListResourceArrayResponseFromJSON, ProductCategoryListResourceArrayResponseToJSON, ProductCategoryLiteResourceArrayResponseFromJSON, ProductCategoryLiteResourceArrayResponseToJSON, ProductCategoryResourceFromJSON, ProductCategoryResourceToJSON, SearchAllProductCategoriesRequestFromJSON, SearchAllProductCategoriesRequestToJSON, SearchProductCategoriesRequestFromJSON, SearchProductCategoriesRequestToJSON, SiteIdRequestFromJSON, SiteIdRequestToJSON, UpdateProductCategoryRequestFromJSON, UpdateProductCategoryRequestToJSON, } from '../models/index'; export interface AttachProductsProductCategoryRequest { productCategory: number; attachProductsToProductCategoryRequest?: AttachProductsToProductCategoryRequest; } export interface BulkDetachProductsProductCategoryRequest { productCategory: number; } export interface DestroyProductCategoryRequest { productCategory: number; } export interface DetachProductsProductCategoryRequest { productCategory: number; detachProductsFromProductCategoryRequest?: DetachProductsFromProductCategoryRequest; } export interface GetAllChildrenProductCategoryRequest { productCategory: number; searchAllProductCategoriesRequest?: SearchAllProductCategoriesRequest; } export interface GetAllProductCategoryRequest { searchAllProductCategoriesRequest?: SearchAllProductCategoriesRequest; } export interface GetChildrenProductCategoryRequest { productCategory: number; searchProductCategoriesRequest?: SearchProductCategoriesRequest; } export interface GetHierarchyProductCategoryRequest { siteIdRequest?: SiteIdRequest; } export interface IndexProductCategoryRequest { searchProductCategoriesRequest?: SearchProductCategoriesRequest; } export interface PreviewAutomationRulesProductCategoryRequest { previewAutomationRulesRequest?: PreviewAutomationRulesRequest; } export interface ShowProductCategoryRequest { productCategory: number; } export interface StoreProductCategoryRequest { createProductCategoryRequest?: CreateProductCategoryRequest; } export interface UpdateProductCategoryOperationRequest { productCategory: number; updateProductCategoryRequest?: UpdateProductCategoryRequest; } /** * */ export class ProductCategoryApi extends runtime.BaseAPI { /** * Auto-generated: attachProductsProductCategory */ async attachProductsProductCategoryRaw(requestParameters: AttachProductsProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling attachProductsProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/{productCategory}/attach-products`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: AttachProductsToProductCategoryRequestToJSON(requestParameters['attachProductsToProductCategoryRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryResourceFromJSON(jsonValue)); } /** * Auto-generated: attachProductsProductCategory */ async attachProductsProductCategory(requestParameters: AttachProductsProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.attachProductsProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: bulkDetachProductsProductCategory */ async bulkDetachProductsProductCategoryRaw(requestParameters: BulkDetachProductsProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling bulkDetachProductsProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; let urlPath = `/admin-api/product-category/{productCategory}/bulk-detach-products`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => GenericResponseFromJSON(jsonValue)); } /** * Auto-generated: bulkDetachProductsProductCategory */ async bulkDetachProductsProductCategory(requestParameters: BulkDetachProductsProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.bulkDetachProductsProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: destroyProductCategory */ async destroyProductCategoryRaw(requestParameters: DestroyProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling destroyProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; let urlPath = `/admin-api/product-category/{productCategory}/delete`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => GenericResponseFromJSON(jsonValue)); } /** * Auto-generated: destroyProductCategory */ async destroyProductCategory(requestParameters: DestroyProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.destroyProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: detachProductsProductCategory */ async detachProductsProductCategoryRaw(requestParameters: DetachProductsProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling detachProductsProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/{productCategory}/detach-products`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: DetachProductsFromProductCategoryRequestToJSON(requestParameters['detachProductsFromProductCategoryRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryResourceFromJSON(jsonValue)); } /** * Auto-generated: detachProductsProductCategory */ async detachProductsProductCategory(requestParameters: DetachProductsProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.detachProductsProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: getAllChildrenProductCategory */ async getAllChildrenProductCategoryRaw(requestParameters: GetAllChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling getAllChildrenProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/{productCategory}/children/all`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SearchAllProductCategoriesRequestToJSON(requestParameters['searchAllProductCategoriesRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryListResourceArrayResponseFromJSON(jsonValue)); } /** * Auto-generated: getAllChildrenProductCategory */ async getAllChildrenProductCategory(requestParameters: GetAllChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getAllChildrenProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: getAllProductCategory */ async getAllProductCategoryRaw(requestParameters: GetAllProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/all`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SearchAllProductCategoriesRequestToJSON(requestParameters['searchAllProductCategoriesRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryLiteResourceArrayResponseFromJSON(jsonValue)); } /** * Auto-generated: getAllProductCategory */ async getAllProductCategory(requestParameters: GetAllProductCategoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getAllProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: getChildrenProductCategory */ async getChildrenProductCategoryRaw(requestParameters: GetChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling getChildrenProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/{productCategory}/children`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, body: SearchProductCategoriesRequestToJSON(requestParameters['searchProductCategoriesRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedProductCategoryListResourceResponseFromJSON(jsonValue)); } /** * Auto-generated: getChildrenProductCategory */ async getChildrenProductCategory(requestParameters: GetChildrenProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getChildrenProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: getHierarchyProductCategory */ async getHierarchyProductCategoryRaw(requestParameters: GetHierarchyProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/hierarchy`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SiteIdRequestToJSON(requestParameters['siteIdRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryHierarchyResourceArrayResponseFromJSON(jsonValue)); } /** * Auto-generated: getHierarchyProductCategory */ async getHierarchyProductCategory(requestParameters: GetHierarchyProductCategoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getHierarchyProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: indexProductCategory */ async indexProductCategoryRaw(requestParameters: IndexProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/list`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SearchProductCategoriesRequestToJSON(requestParameters['searchProductCategoriesRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedProductCategoryListResourceResponseFromJSON(jsonValue)); } /** * Auto-generated: indexProductCategory */ async indexProductCategory(requestParameters: IndexProductCategoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.indexProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: previewAutomationRulesProductCategory */ async previewAutomationRulesProductCategoryRaw(requestParameters: PreviewAutomationRulesProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/preview-automation-rules`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: PreviewAutomationRulesRequestToJSON(requestParameters['previewAutomationRulesRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PreviewAutomationRulesResourceFromJSON(jsonValue)); } /** * Auto-generated: previewAutomationRulesProductCategory */ async previewAutomationRulesProductCategory(requestParameters: PreviewAutomationRulesProductCategoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.previewAutomationRulesProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: showProductCategory */ async showProductCategoryRaw(requestParameters: ShowProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling showProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; let urlPath = `/admin-api/product-category/{productCategory}`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryResourceFromJSON(jsonValue)); } /** * Auto-generated: showProductCategory */ async showProductCategory(requestParameters: ShowProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.showProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: storeProductCategory */ async storeProductCategoryRaw(requestParameters: StoreProductCategoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/create`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateProductCategoryRequestToJSON(requestParameters['createProductCategoryRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryResourceFromJSON(jsonValue)); } /** * Auto-generated: storeProductCategory */ async storeProductCategory(requestParameters: StoreProductCategoryRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.storeProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: updateProductCategory */ async updateProductCategoryRaw(requestParameters: UpdateProductCategoryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['productCategory'] == null) { throw new runtime.RequiredError( 'productCategory', 'Required parameter "productCategory" was null or undefined when calling updateProductCategory().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/product-category/{productCategory}/update`; urlPath = urlPath.replace(`{${"productCategory"}}`, encodeURIComponent(String(requestParameters['productCategory']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: UpdateProductCategoryRequestToJSON(requestParameters['updateProductCategoryRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ProductCategoryResourceFromJSON(jsonValue)); } /** * Auto-generated: updateProductCategory */ async updateProductCategory(requestParameters: UpdateProductCategoryOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateProductCategoryRaw(requestParameters, initOverrides); return await response.value(); } }