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

from __future__ import annotations

import typing

import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .....commons.types.primitive import Primitive
from .....commons.types.schema_id import SchemaId


class SchemaValidationError_SchemaNameAlreadyExists(UniversalBaseModel):
    type: typing.Literal["schema_name_already_exists"] = "schema_name_already_exists"
    name: str
    id: SchemaId

    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


class SchemaValidationError_KeyNameAlreadyExists(UniversalBaseModel):
    type: typing.Literal["key_name_already_exists"] = "key_name_already_exists"
    key: str
    value_type: Primitive

    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


SchemaValidationError = typing.Union[
    SchemaValidationError_SchemaNameAlreadyExists, SchemaValidationError_KeyNameAlreadyExists
]
