import typing as t

from ellar.pydantic.types import Undefined

from ...params import params

_Unset: t.Any = Undefined


def Path(
    default: t.Any = ...,
    *,
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected path in Route Function Parameter
    """
    return params.PathFieldInfo(
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def Query(
    default: t.Any = ...,
    *,
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected query in Route Function Parameter
    """
    return params.QueryFieldInfo(
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def Header(
    default: t.Any = ...,
    *,
    convert_underscores: bool = True,
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected header in Route Function Parameter
    """
    return params.HeaderFieldInfo(
        convert_underscores=convert_underscores,
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def Cookie(
    default: t.Any = ...,
    *,
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected cookie in Route Function Parameter
    """
    return params.CookieFieldInfo(
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def Body(
    default: t.Any = ...,
    *,
    embed: bool = False,
    media_type: str = "application/json",
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected body object in Route Function Parameter
    """
    return params.BodyFieldInfo(
        embed=embed,
        media_type=media_type,
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def Form(
    default: t.Any = ...,
    *,
    media_type: str = "application/x-www-form-urlencoded",
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected form parameter in Route Function Parameter
    """
    return params.FormFieldInfo(
        media_type=media_type,
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def File(
    default: t.Any = ...,
    *,
    media_type: str = "multipart/form-data",
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected file data in Route Function Parameter
    """
    return params.FileFieldInfo(
        media_type=media_type,
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )


def WsBody(
    default: t.Any = ...,
    *,
    embed: bool = False,
    media_type: str = "application/json",
    default_factory: t.Union[t.Callable[[], t.Any], None] = _Unset,
    alias: t.Optional[str] = None,
    alias_priority: t.Union[int, None] = _Unset,
    validation_alias: t.Union[str, None] = None,
    serialization_alias: t.Union[str, None] = None,
    title: t.Optional[str] = None,
    description: t.Optional[str] = None,
    gt: t.Optional[float] = None,
    ge: t.Optional[float] = None,
    lt: t.Optional[float] = None,
    le: t.Optional[float] = None,
    min_length: t.Optional[int] = None,
    max_length: t.Optional[int] = None,
    pattern: t.Optional[str] = None,
    discriminator: t.Union[str, None] = None,
    strict: t.Union[bool, None] = _Unset,
    multiple_of: t.Union[float, None] = _Unset,
    allow_inf_nan: t.Union[bool, None] = _Unset,
    max_digits: t.Union[int, None] = _Unset,
    decimal_places: t.Union[int, None] = _Unset,
    examples: t.Optional[t.List[t.Any]] = None,
    deprecated: t.Optional[bool] = None,
    include_in_schema: bool = True,
    json_schema_extra: t.Union[t.Dict[str, t.Any], None] = None,
    **extra: t.Any,
) -> t.Any:
    """
    Defines expected body object in websocket Route Function Parameter
    """
    return params.WsBodyFieldInfo(
        embed=embed,
        media_type=media_type,
        default=default,
        default_factory=default_factory,
        alias=alias,
        title=title,
        description=description,
        gt=gt,
        ge=ge,
        lt=lt,
        le=le,
        min_length=min_length,
        max_length=max_length,
        discriminator=discriminator,
        multiple_of=multiple_of,
        allow_inf_nan=allow_inf_nan,
        max_digits=max_digits,
        decimal_places=decimal_places,
        pattern=pattern,
        alias_priority=alias_priority,
        validation_alias=validation_alias,
        serialization_alias=serialization_alias,
        strict=strict,
        json_schema_extra=json_schema_extra,
        examples=examples,
        include_in_schema=include_in_schema,
        deprecated=deprecated,
        **extra,
    )
