# 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 .mode_5 import Mode5
from .mode_s import ModeS
from .transponder_codes_mode_4_interrogation_response import TransponderCodesMode4InterrogationResponse


class TransponderCodes(UniversalBaseModel):
    """
    A message describing any transponder codes associated with Mode 1, 2, 3, 4, 5, S interrogations.
    """

    mode_1: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="mode1")] = pydantic.Field(
        default=None
    )
    """
    The mode 1 code assigned to military assets.
    """

    mode_2: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="mode2")] = pydantic.Field(
        default=None
    )
    """
    The Mode 2 code assigned to military assets.
    """

    mode_3: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="mode3")] = pydantic.Field(
        default=None
    )
    """
    The Mode 3 code assigned by ATC to the asset.
    """

    mode_4_interrogation_response: typing_extensions.Annotated[
        typing.Optional[TransponderCodesMode4InterrogationResponse], FieldMetadata(alias="mode4InterrogationResponse")
    ] = pydantic.Field(default=None)
    """
    The validity of the response from the Mode 4 interrogation.
    """

    mode_5: typing_extensions.Annotated[typing.Optional[Mode5], FieldMetadata(alias="mode5")] = pydantic.Field(
        default=None
    )
    """
    The Mode 5 transponder codes.
    """

    mode_s: typing_extensions.Annotated[typing.Optional[ModeS], FieldMetadata(alias="modeS")] = pydantic.Field(
        default=None
    )
    """
    The Mode S transponder codes.
    """

    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
