/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Body_upload_product_image } from '../models/Body_upload_product_image';
import type { GetProductBarcodePdfRequest } from '../models/GetProductBarcodePdfRequest';
import type { GetProductBarcodePdfResponse } from '../models/GetProductBarcodePdfResponse';
import type { GetProductBarcodeRequest } from '../models/GetProductBarcodeRequest';
import type { GetProductBarcodeResponse } from '../models/GetProductBarcodeResponse';
import type { ProductAddBarcodeRequest } from '../models/ProductAddBarcodeRequest';
import type { ProductAddBarcodeResponse } from '../models/ProductAddBarcodeResponse';
import type { ProductCreateRequest } from '../models/ProductCreateRequest';
import type { ProductCreateResponse } from '../models/ProductCreateResponse';
import type { ProductDeleteRequest } from '../models/ProductDeleteRequest';
import type { ProductDeleteResponse } from '../models/ProductDeleteResponse';
import type { ProductExistsBarcodeResponse } from '../models/ProductExistsBarcodeResponse';
import type { ProductGenerateBarcodeRequest } from '../models/ProductGenerateBarcodeRequest';
import type { ProductGenerateBarcodeResponse } from '../models/ProductGenerateBarcodeResponse';
import type { ProductGetResponse } from '../models/ProductGetResponse';
import type { ProductSchema } from '../models/ProductSchema';
import type { ProductUpdateRequest } from '../models/ProductUpdateRequest';
import type { ProductUpdateResponse } from '../models/ProductUpdateResponse';
import type { ProductUploadImageResponse } from '../models/ProductUploadImageResponse';
import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
export class ProductService {
    /**
     * Create Product
     * @returns ProductCreateResponse Successful Response
     * @throws ApiError
     */
    public static createProduct({
        requestBody,
    }: {
        requestBody: ProductCreateRequest,
    }): CancelablePromise<ProductCreateResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/create',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Delete Product
     * @returns ProductDeleteResponse Successful Response
     * @throws ApiError
     */
    public static deleteProduct({
        requestBody,
    }: {
        requestBody: ProductDeleteRequest,
    }): CancelablePromise<ProductDeleteResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/delete',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Delete Product
     * @returns ProductUpdateResponse Successful Response
     * @throws ApiError
     */
    public static updateProduct({
        requestBody,
    }: {
        requestBody: ProductUpdateRequest,
    }): CancelablePromise<ProductUpdateResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/update',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Product
     * @returns ProductGetResponse Successful Response
     * @throws ApiError
     */
    public static getProductsByClientId({
        clientId,
        searchInput,
        page,
        itemsPerPage,
    }: {
        clientId: number,
        searchInput: string,
        page?: (number | null),
        itemsPerPage?: (number | null),
    }): CancelablePromise<ProductGetResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/product/get',
            query: {
                'client_id': clientId,
                'search_input': searchInput,
                'page': page,
                'items_per_page': itemsPerPage,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Product By Id
     * @returns ProductSchema Successful Response
     * @throws ApiError
     */
    public static getProductById({
        productId,
    }: {
        productId: number,
    }): CancelablePromise<ProductSchema> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/product/get-by-id',
            query: {
                'product_id': productId,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Add Product Barcode
     * @returns ProductAddBarcodeResponse Successful Response
     * @throws ApiError
     */
    public static addProductBarcode({
        requestBody,
    }: {
        requestBody: ProductAddBarcodeRequest,
    }): CancelablePromise<ProductAddBarcodeResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/barcode/add',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Exists Product Barcode
     * @returns ProductExistsBarcodeResponse Successful Response
     * @throws ApiError
     */
    public static existsProductBarcode({
        productId,
        barcode,
    }: {
        productId: number,
        barcode: string,
    }): CancelablePromise<ProductExistsBarcodeResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/product/barcode/exists',
            query: {
                'product_id': productId,
                'barcode': barcode,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Generate Product Barcode
     * @returns ProductGenerateBarcodeResponse Successful Response
     * @throws ApiError
     */
    public static generateProductBarcode({
        requestBody,
    }: {
        requestBody: ProductGenerateBarcodeRequest,
    }): CancelablePromise<ProductGenerateBarcodeResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/barcode/generate',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Product Barcode
     * @returns GetProductBarcodeResponse Successful Response
     * @throws ApiError
     */
    public static getProductBarcode({
        requestBody,
    }: {
        requestBody: GetProductBarcodeRequest,
    }): CancelablePromise<GetProductBarcodeResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/barcode/get',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Product Barcode Pdf
     * @returns GetProductBarcodePdfResponse Successful Response
     * @throws ApiError
     */
    public static getProductBarcodePdf({
        requestBody,
    }: {
        requestBody: GetProductBarcodePdfRequest,
    }): CancelablePromise<GetProductBarcodePdfResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/barcode/get-pdf',
            body: requestBody,
            mediaType: 'application/json',
            errors: {
                422: `Validation Error`,
            },
        });
    }
    /**
     * Upload Product Image
     * @returns ProductUploadImageResponse Successful Response
     * @throws ApiError
     */
    public static uploadProductImage({
        productId,
        formData,
    }: {
        productId: number,
        formData: Body_upload_product_image,
    }): CancelablePromise<ProductUploadImageResponse> {
        return __request(OpenAPI, {
            method: 'POST',
            url: '/product/images/upload/{product_id}',
            path: {
                'product_id': productId,
            },
            formData: formData,
            mediaType: 'multipart/form-data',
            errors: {
                422: `Validation Error`,
            },
        });
    }
}
