/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { PlaceShipmentOrderDto } from "../models/PlaceShipmentOrderDto";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
export class ShipmentOrdersService {
  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static shippingOrdersControllerPlaceOrder(
    requestBody: PlaceShipmentOrderDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/v1/shipment-orders",
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param page
   * @param limit
   * @param sort
   * @param sortBy
   * @param keyword
   * @returns any
   * @throws ApiError
   */
  public static shippingOrdersControllerGetOrders(
    page: number = 1,
    limit: number = 30,
    sort: string = "desc",
    sortBy: string = "createdAt",
    keyword?: string | null,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/shipment-orders",
      query: {
        page: page,
        limit: limit,
        sort: sort,
        sortBy: sortBy,
        keyword: keyword,
      },
      isServerAction: true,
    });
  }

  /**
   * @param id
   * @returns any
   * @throws ApiError
   */
  public static shippingOrdersControllerGetOrder(
    id: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/shipment-orders/{id}",
      path: {
        id: id,
      },
    });
  }

  /**
   * @param shipmentOrderId
   * @returns any
   * @throws ApiError
   */
  public static shippingOrdersControllerGetOrderInvoice(
    shipmentOrderId: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/shipment-orders/{shipmentOrderId}/invoice",
      path: {
        shipmentOrderId: shipmentOrderId,
      },
    });
  }
}
