# 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 .canary_step import CanaryStep


class Canary(UniversalBaseModel):
    """
    This strategy brings up the new release without bringing the older release down. Traffic is shifted from the older release to the newer release in a staged manner.
    This can help with verifying the health of the new release without shifting complete traffic.
    """

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

    steps: typing.List[CanaryStep] = pydantic.Field()
    """
    These steps would be executed in order to enable shifting of traffic slowly from stable to canary version
    """

    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
