/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AddProductToShippingCartDto } from "../models/AddProductToShippingCartDto";
import type { ShippingCartUpdateBillingAddressesDto } from "../models/ShippingCartUpdateBillingAddressesDto";
import type { ShippingCartUpdateShippingMethodDto } from "../models/ShippingCartUpdateShippingMethodDto";
import type { UpdateShippingCartPaymentMethodDto } from "../models/UpdateShippingCartPaymentMethodDto";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";
import { AddAllProductToShippingCartDto } from "../models/AddAllProductToShippingCartDto";
export class ShippingCartService {
  /**
   * @param orderId
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerGetShippingCart(
    orderId: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/shipping-cart/{orderId}",
      path: {
        orderId: orderId,
      },
    });
  }
  /**
   * @param orderId
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerAddShippingCartForAllProduct(
    orderId: string,
    requestBody: AddAllProductToShippingCartDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/v1/shipping-cart/{orderId}",
      path: {
        orderId: orderId,
      },
      body: requestBody,
      mediaType: "application/json",
    });
  }

  /**
   * @param orderId
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerAddShippingCartProduct(
    orderId: string,
    requestBody: AddProductToShippingCartDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/v1/shipping-cart/{orderId}/items",
      path: {
        orderId: orderId,
      },
      body: requestBody,
      mediaType: "application/json",
      isServerAction: true,
    });
  }
  /**
   * @param state
   * @param orderId
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerUpdateCartState(
    state: string,
    orderId: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{orderId}/cart-state/{state}",
      path: {
        state: state,
        orderId: orderId,
      },
    });
  }
  /**
   * @param type
   * @param id
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerUpdateAddresses(
    type: string,
    id: number,
    requestBody: ShippingCartUpdateBillingAddressesDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{id}/address/{type}",
      path: {
        type: type,
        id: id,
      },
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param id
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerUpdateShippingMethod(
    id: number,
    requestBody: ShippingCartUpdateShippingMethodDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{id}/shipping-method",
      path: {
        id: id,
      },
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param shippingCartId
   * @param storeId
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerUpdatePickupStore(
    shippingCartId: number,
    storeId: number,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{shippingCartId}/store/{storeId}",
      path: {
        shippingCartId: shippingCartId,
        storeId: storeId,
      },
    });
  }
  /**
   * @param shippingCartId
   * @param requestBody
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerUpdatePaymentMethod(
    shippingCartId: number,
    requestBody: UpdateShippingCartPaymentMethodDto,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{shippingCartId}/payment-method",
      path: {
        shippingCartId: shippingCartId,
      },
      body: requestBody,
      mediaType: "application/json",
    });
  }
  /**
   * @param shippingCartId
   * @param shippingMethodId
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerGetALlowedShippingOrPickupCountries(
    shippingCartId: number,
    shippingMethodId: number,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/shipping-cart/{shippingCartId}/allowed-shipping-countries/{shippingMethodId}",
      path: {
        shippingCartId: shippingCartId,
        shippingMethodId: shippingMethodId,
      },
    });
  }
  /**
   * @param shippingCartId
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerClearPaymentMethodOnCart(
    shippingCartId: number,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "GET",
      url: "/v1/shipping-cart/{shippingCartId}/clear-payment-method",
      path: {
        shippingCartId: shippingCartId,
      },
    });
  }

  /**
   * @param type
   * @param id
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerResetAddresses(
    type: string,
    id: number,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{id}/reset-address/{type}",
      path: {
        type: type,
        id: id,
      },
    });
  }
  /**
   * @param mode
   * @param orderId
   * @returns any
   * @throws ApiError
   */
  public static shippingCartControllerValidateCart(
    mode: string,
    orderId: string,
  ): CancelablePromise<any> {
    return __request(OpenAPI, {
      method: "PATCH",
      url: "/v1/shipping-cart/{orderId}/refresh/{mode}",
      path: {
        mode: mode,
        orderId: orderId,
      },
    });
  }
}
