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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .version_status import VersionStatus


class RollbackResponse(UniversalBaseModel):
    """
    Response from a rollback operation.
    """

    branch_id: str = pydantic.Field()
    """
    Branch ID
    """

    from_git_hash: str = pydantic.Field()
    """
    Git hash of the previous version
    """

    from_version_id: str = pydantic.Field()
    """
    Version ID that was rolled back FROM
    """

    message: str = pydantic.Field()
    """
    Human-readable status message
    """

    to_git_hash: str = pydantic.Field()
    """
    Git hash of the target version
    """

    to_version_id: str = pydantic.Field()
    """
    Version ID that was rolled back TO
    """

    version_status: VersionStatus = pydantic.Field()
    """
    Target version status
    """

    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
