/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
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 { ProductGetResponse } from '../models/ProductGetResponse';
import type { ProductUpdateRequest } from '../models/ProductUpdateRequest';
import type { ProductUpdateResponse } from '../models/ProductUpdateResponse';
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,
        page,
        itemsPerPage,
    }: {
        clientId: number,
        page?: (number | null),
        itemsPerPage?: (number | null),
    }): CancelablePromise<ProductGetResponse> {
        return __request(OpenAPI, {
            method: 'GET',
            url: '/product/get',
            query: {
                'client_id': clientId,
                'page': page,
                'items_per_page': itemsPerPage,
            },
            errors: {
                422: `Validation Error`,
            },
        });
    }
}
