# Copyright (c) CloudZero - ALL RIGHTS RESERVED - PROPRIETARY AND CONFIDENTIAL
# Unauthorized copying of this file and/or project, via any medium is strictly prohibited.
# Direct all questions to legal@cloudzero.com

from collections.abc import Callable
from dataclasses import dataclass, field
from http import HTTPStatus
from re import Pattern

from aws_lambda_powertools.event_handler.api_gateway import CORSConfig
from aws_lambda_powertools.event_handler.middlewares import BaseMiddlewareHandler


@dataclass
class BaseApiConfiguration:
    cors: CORSConfig | None = None
    debug: bool | None = None
    serializer: Callable[[dict], str] | None = None
    strip_prefixes: list[str | Pattern] | None = None
    enable_validation: bool = True
    response_validation_error_http_code: HTTPStatus | int | None = None
    additional_middlewares: list[BaseMiddlewareHandler] = field(default_factory=list)
    swagger_path: str = '/swagger'
    additional_paths_to_bypass_auth: list[str] = field(default_factory=list)


@dataclass
class WebApiConfiguration(BaseApiConfiguration):
    """
    Configuration for the Web API.
    """


@dataclass
class PublicApiConfiguration(BaseApiConfiguration):
    """
    Configuration for the Public API.
    """
