/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddProductToCartDto } from "../models/AddProductToCartDto";
import type { DeletCartProductsArrayDto } from "../models/DeletCartProductsArrayDto";
import type { RemoveProductToCartDto } from "../models/RemoveProductToCartDto";
import type { UpdateCartBillingAddressesDto } from "../models/UpdateCartBillingAddressesDto";
import type { UpdateCartPaymentMethodDto } from "../models/UpdateCartPaymentMethodDto";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
export class CartsService {
  /**
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerGetCart(): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/carts",
    });
  }
  /**
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerDeleteCart(): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "DELETE",
      url: "/v1/carts",
    });
  }
  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerAddCartProduct(
    requestBody: AddProductToCartDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/v1/carts/add-product",
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param state
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerUpdateCartState(
    state: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/update-state/{state}",
      path: {
        state: state,
      },
    });
  }
  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerRemoveCartProduct(
    requestBody: RemoveProductToCartDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/remove-product",
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerUpdatePaymentMethod(
    requestBody: UpdateCartPaymentMethodDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/update-payment-method",
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerUpdateAddresses(
    requestBody: UpdateCartBillingAddressesDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/update-billing-address",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerShippingAddresses(
    requestBody: UpdateCartBillingAddressesDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/update-shipping-address",
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerDeleteCartProducts(
    requestBody: DeletCartProductsArrayDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/remove-products",
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param mode
   * @returns any
   * @throws ApiError
   */
  public static cartsControllerValidateCart(
    mode: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/refresh/{mode}",
      path: {
        mode: mode,
      },
    });
  }

  /**
   * @param shippingMethodId
   * @returns any
   * @throws ApiError
   */
  public static getCountriesByShippingMethod(
    shippingMethodId: number,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/carts/allowed-shipping-countries/{shippingMethodId}",
      path: {
        shippingMethodId: shippingMethodId,
      },
    });
  }

  /**
   * @param type
   * @returns any
   * @throws ApiError
   */
  public static resetCartAddresses(type: string): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/carts/reset-address/{type}",
      path: {
        type: type,
      },
    });
  }
}
