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

from ......core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .network_endpoint import NetworkEndpoint
from ......core.pydantic_utilities import IS_PYDANTIC_V2


class EndpointConnection(UncheckedBaseModel):
    """
    The Endpoint Connection object contains information detailing a connection attempt to an endpoint.
    """

    code: typing.Optional[int] = pydantic.Field(default=None)
    """
    A numerical response status code providing details about the connection.
    """

    network_endpoint: typing.Optional[NetworkEndpoint] = pydantic.Field(default=None)
    """
    Provides characteristics of the network endpoint.
    """

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

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