# generated by datamodel-codegen:
#   filename:  <stdin>
#   timestamp: 1985-10-26T08:21:00+00:00

from __future__ import annotations

from collections import defaultdict
from collections.abc import Callable, Mapping, Sequence
from typing import Any, Literal, TypeAlias, TypedDict

from datamodel_code_generator.enums import StrictTypes
from datamodel_code_generator.validators import ModelValidators
from typing_extensions import NotRequired, TypedDict

AllExportsCollisionStrategy: TypeAlias = Literal[
    'error', 'minimal-prefix', 'full-prefix'
]


AllExportsScope: TypeAlias = Literal['children', 'recursive']


AllOfClassHierarchy: TypeAlias = Literal['if-no-conflict', 'always']


AllOfMergeMode: TypeAlias = Literal['constraints', 'all', 'none']


ClassNameAffixScope: TypeAlias = Literal['all', 'models', 'enums']


CollapseRootModelsNameStrategy: TypeAlias = Literal['child', 'parent']


DataModelType: TypeAlias = Literal[
    'pydantic_v2.BaseModel',
    'pydantic_v2.dataclass',
    'dataclasses.dataclass',
    'typing.TypedDict',
    'msgspec.Struct',
]


class DataclassArguments(TypedDict, closed=True):
    init: NotRequired[bool]
    repr: NotRequired[bool]
    eq: NotRequired[bool]
    order: NotRequired[bool]
    unsafe_hash: NotRequired[bool]
    frozen: NotRequired[bool]
    match_args: NotRequired[bool]
    kw_only: NotRequired[bool]
    slots: NotRequired[bool]
    weakref_slot: NotRequired[bool]


DateClassType: TypeAlias = Literal['date', 'PastDate', 'FutureDate']


DatetimeClassType: TypeAlias = Literal[
    'datetime', 'AwareDatetime', 'NaiveDatetime', 'PastDatetime', 'FutureDatetime'
]


FieldTypeCollisionStrategy: TypeAlias = Literal['rename-field', 'rename-type']


Formatter: TypeAlias = Literal['black', 'isort', 'ruff-check', 'ruff-format']


GraphQLScope: TypeAlias = Literal['schema']


InputFileType: TypeAlias = Literal[
    'auto', 'openapi', 'jsonschema', 'json', 'yaml', 'dict', 'csv', 'graphql'
]


LiteralType: TypeAlias = Literal['all', 'one', 'none']


ModuleSplitMode: TypeAlias = Literal['single']


NamingStrategy: TypeAlias = Literal[
    'numbered', 'parent-prefixed', 'full-path', 'primary-first'
]


OpenAPIScope: TypeAlias = Literal[
    'schemas', 'paths', 'tags', 'parameters', 'webhooks', 'requestbodies'
]


PythonVersion: TypeAlias = Literal['3.10', '3.11', '3.12', '3.13', '3.14']


ReadOnlyWriteOnlyModelType: TypeAlias = Literal['request-response', 'all']


ReuseScope: TypeAlias = Literal['module', 'tree']


StrictTypesModel: TypeAlias = Literal['str', 'bytes', 'int', 'float', 'bool']


TargetPydanticVersion: TypeAlias = Literal['2', '2.11']


UnionMode: TypeAlias = Literal['smart', 'left_to_right']


ValidatorMode: TypeAlias = Literal['before', 'after', 'wrap', 'plain']


VersionMode: TypeAlias = Literal['lenient', 'strict']


class GenerateConfig(TypedDict, closed=True):
    input_filename: NotRequired[str | None]
    input_file_type: NotRequired[InputFileType]
    output: NotRequired[str | None]
    output_model_type: NotRequired[DataModelType]
    target_python_version: NotRequired[PythonVersion]
    target_pydantic_version: NotRequired[TargetPydanticVersion | None]
    base_class: NotRequired[str]
    base_class_map: NotRequired[dict[str, str | list[str]] | None]
    additional_imports: NotRequired[list[str] | None]
    class_decorators: NotRequired[list[str] | None]
    custom_template_dir: NotRequired[str | None]
    extra_template_data: NotRequired[defaultdict[str, dict[str, Any]] | None]
    validators: NotRequired[Mapping[str, ModelValidators] | None]
    validation: NotRequired[bool]
    field_constraints: NotRequired[bool]
    snake_case_field: NotRequired[bool]
    strip_default_none: NotRequired[bool]
    aliases: NotRequired[Mapping[str, str | list[str]] | None]
    disable_timestamp: NotRequired[bool]
    enable_version_header: NotRequired[bool]
    enable_command_header: NotRequired[bool]
    command_line: NotRequired[str | None]
    allow_population_by_field_name: NotRequired[bool]
    allow_extra_fields: NotRequired[bool]
    extra_fields: NotRequired[str | None]
    use_generic_base_class: NotRequired[bool]
    apply_default_values_for_required_fields: NotRequired[bool]
    force_optional_for_required_fields: NotRequired[bool]
    class_name: NotRequired[str | None]
    class_name_prefix: NotRequired[str | None]
    class_name_suffix: NotRequired[str | None]
    class_name_affix_scope: NotRequired[ClassNameAffixScope]
    use_standard_collections: NotRequired[bool]
    use_schema_description: NotRequired[bool]
    use_field_description: NotRequired[bool]
    use_field_description_example: NotRequired[bool]
    use_attribute_docstrings: NotRequired[bool]
    use_inline_field_description: NotRequired[bool]
    use_default_kwarg: NotRequired[bool]
    reuse_model: NotRequired[bool]
    reuse_scope: NotRequired[ReuseScope]
    shared_module_name: NotRequired[str]
    encoding: NotRequired[str]
    enum_field_as_literal: NotRequired[LiteralType | None]
    enum_field_as_literal_map: NotRequired[dict[str, str] | None]
    ignore_enum_constraints: NotRequired[bool]
    use_one_literal_as_default: NotRequired[bool]
    use_enum_values_in_discriminator: NotRequired[bool]
    set_default_enum_member: NotRequired[bool]
    use_subclass_enum: NotRequired[bool]
    use_specialized_enum: NotRequired[bool]
    strict_nullable: NotRequired[bool]
    use_generic_container_types: NotRequired[bool]
    enable_faux_immutability: NotRequired[bool]
    disable_appending_item_suffix: NotRequired[bool]
    strict_types: NotRequired[Sequence[StrictTypes] | None]
    empty_enum_field_name: NotRequired[str | None]
    custom_class_name_generator: NotRequired[Callable[[str], str] | None]
    field_extra_keys: NotRequired[set[str] | None]
    field_include_all_keys: NotRequired[bool]
    field_extra_keys_without_x_prefix: NotRequired[set[str] | None]
    model_extra_keys: NotRequired[set[str] | None]
    model_extra_keys_without_x_prefix: NotRequired[set[str] | None]
    openapi_scopes: NotRequired[list[OpenAPIScope] | None]
    include_path_parameters: NotRequired[bool]
    openapi_include_paths: NotRequired[list[str] | None]
    graphql_scopes: NotRequired[list[GraphQLScope] | None]
    graphql_no_typename: NotRequired[bool]
    wrap_string_literal: NotRequired[bool | None]
    use_title_as_name: NotRequired[bool]
    use_operation_id_as_name: NotRequired[bool]
    use_unique_items_as_set: NotRequired[bool]
    use_tuple_for_fixed_items: NotRequired[bool]
    use_closed_typed_dict: NotRequired[bool]
    allof_merge_mode: NotRequired[AllOfMergeMode]
    allof_class_hierarchy: NotRequired[AllOfClassHierarchy]
    allow_remote_refs: NotRequired[bool | None]
    http_headers: NotRequired[Sequence[tuple[str, str]] | None]
    http_ignore_tls: NotRequired[bool]
    http_timeout: NotRequired[float | None]
    use_annotated: NotRequired[bool]
    use_serialize_as_any: NotRequired[bool]
    use_non_positive_negative_number_constrained_types: NotRequired[bool]
    use_decimal_for_multiple_of: NotRequired[bool]
    original_field_name_delimiter: NotRequired[str | None]
    use_double_quotes: NotRequired[bool]
    use_union_operator: NotRequired[bool]
    collapse_root_models: NotRequired[bool]
    collapse_root_models_name_strategy: NotRequired[
        CollapseRootModelsNameStrategy | None
    ]
    collapse_reuse_models: NotRequired[bool]
    skip_root_model: NotRequired[bool]
    use_type_alias: NotRequired[bool]
    use_root_model_type_alias: NotRequired[bool]
    special_field_name_prefix: NotRequired[str | None]
    remove_special_field_name_prefix: NotRequired[bool]
    capitalise_enum_members: NotRequired[bool]
    keep_model_order: NotRequired[bool]
    custom_file_header: NotRequired[str | None]
    custom_file_header_path: NotRequired[str | None]
    custom_formatters: NotRequired[list[str] | None]
    custom_formatters_kwargs: NotRequired[dict[str, Any] | None]
    use_pendulum: NotRequired[bool]
    use_standard_primitive_types: NotRequired[bool]
    http_query_parameters: NotRequired[Sequence[tuple[str, str]] | None]
    treat_dot_as_module: NotRequired[bool | None]
    use_exact_imports: NotRequired[bool]
    use_type_checking_imports: NotRequired[bool | None]
    union_mode: NotRequired[UnionMode | None]
    output_datetime_class: NotRequired[DatetimeClassType | None]
    output_date_class: NotRequired[DateClassType | None]
    keyword_only: NotRequired[bool]
    frozen_dataclasses: NotRequired[bool]
    no_alias: NotRequired[bool]
    use_serialization_alias: NotRequired[bool]
    use_frozen_field: NotRequired[bool]
    use_default_factory_for_optional_nested_models: NotRequired[bool]
    formatters: NotRequired[list[Formatter] | None]
    settings_path: NotRequired[str | None]
    parent_scoped_naming: NotRequired[bool]
    naming_strategy: NotRequired[NamingStrategy | None]
    duplicate_name_suffix: NotRequired[dict[str, str] | None]
    dataclass_arguments: NotRequired[DataclassArguments | None]
    disable_future_imports: NotRequired[bool]
    type_mappings: NotRequired[list[str] | None]
    type_overrides: NotRequired[dict[str, str] | None]
    read_only_write_only_model_type: NotRequired[ReadOnlyWriteOnlyModelType | None]
    use_status_code_in_response_name: NotRequired[bool]
    all_exports_scope: NotRequired[AllExportsScope | None]
    all_exports_collision_strategy: NotRequired[AllExportsCollisionStrategy | None]
    field_type_collision_strategy: NotRequired[FieldTypeCollisionStrategy | None]
    module_split_mode: NotRequired[ModuleSplitMode | None]
    default_value_overrides: NotRequired[Mapping[str, Any] | None]
    schema_version: NotRequired[str | None]
    schema_version_mode: NotRequired[VersionMode | None]
    external_ref_mapping: NotRequired[dict[str, str] | None]


class ValidatorDefinition(TypedDict):
    field: NotRequired[str | None]
    fields: NotRequired[list[str] | None]
    function: str
    mode: NotRequired[ValidatorMode]


class ModelValidatorsModel(TypedDict):
    validators: list[ValidatorDefinition]
