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

import typing

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


class BlueGreen(UniversalBaseModel):
    """
    This strategy brings up the new release completely before switching the complete load to the new release.
    This minimizes the time that two versions are serving traffic at the same time.
    """

    type: typing.Literal["blue_green"] = pydantic.Field(default="blue_green")
    """
    +value=blue_green
    """

    enable_auto_promotion: typing.Optional[bool] = pydantic.Field(default=False)
    """
    Promote the new release to handle the complete traffic. A manual promotion would be needed if this is disabled
    """

    auto_promotion_seconds: typing.Optional[int] = pydantic.Field(default=30)
    """
    Promote the new release to handle the complete traffic after waiting for these many seconds
    """

    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
