# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .form_field_file_config_category_enum import FormFieldFileConfigCategoryEnum
from .form_field_file_config_storage import FormFieldFileConfigStorage


class FormFieldFileConfig(UniversalBaseModel):
    multiple: typing.Optional[bool] = None
    storage: typing.Optional[FormFieldFileConfigStorage] = None
    categories: typing.Optional[typing.List[FormFieldFileConfigCategoryEnum]] = None
    extensions: typing.Optional[typing.List[str]] = None
    max_size: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="maxSize"), pydantic.Field(alias="maxSize")
    ] = None
    max_files: typing_extensions.Annotated[
        typing.Optional[int], FieldMetadata(alias="maxFiles"), pydantic.Field(alias="maxFiles")
    ] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
