/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */

import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
export class ProductsService {
  /**
   * @param categoryCode
   * @param reference
   * @param page
   * @param limit
   * @param sort
   * @param sortBy
   * @returns any
   * @throws ApiError
   */
  public static productsControllerGetProducts(
    categoryCode?:
      | "minter"
      | "quantwise"
      | "license"
      | "combo"
      | "kminting"
      | "supernode"
      | "global-pool-layer-k"
      | "subscription"
      | "mobile-app",
    reference?: string,
    page: number = 1,
    limit: number = 30,
    sort: string = "desc",
    sortBy: string = "createdAt",
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/products",
      query: {
        categoryCode: categoryCode,
        reference: reference,
        page: page,
        limit: limit,
        sort: sort,
        sortBy: sortBy,
      },
      isServerAction: true,
    });
  }
  /**
   * @param id
   * @returns any
   * @throws ApiError
   */
  public static productsControllerGetProduct(
    id: number,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/products/{id}",
      path: {
        id: id,
      },
      isServerAction: true,
    });
  }
}
