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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .agent_branch_basic_info import AgentBranchBasicInfo
from .agent_version_metadata import AgentVersionMetadata
from .branch_protection_status import BranchProtectionStatus
from .resource_access_info import ResourceAccessInfo


class AgentBranchResponse(UncheckedBaseModel):
    id: str
    name: str
    agent_id: str
    description: str
    created_at: int
    last_committed_at: int
    is_archived: bool
    protection_status: typing.Optional[BranchProtectionStatus] = None
    access_info: typing.Optional[ResourceAccessInfo] = pydantic.Field(default=None)
    """
    Access information for the branch
    """

    current_live_percentage: typing.Optional[float] = pydantic.Field(default=None)
    """
    Percentage of traffic live on the branch
    """

    parent_branch: typing.Optional[AgentBranchBasicInfo] = pydantic.Field(default=None)
    """
    Parent branch of the branch
    """

    most_recent_versions: typing.Optional[typing.List[AgentVersionMetadata]] = pydantic.Field(default=None)
    """
    Most recent versions on the branch
    """

    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
