# 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 .notification_target import NotificationTarget


class AutoRotate(UniversalBaseModel):
    """
    +label=Enable Auto Rotation
    +sort=4
    +usage=Enable Auto Rotation to automatically rotate the token
    +message=Enable Auto Rotation to automatically rotate the token
    +uiProps={"disableEdit":true}
    """

    auto_rotate_interval: int = pydantic.Field(default=360)
    """
    +label=Rotation Interval in days
    +sort=1
    +usage=Rotation Interval in days after which the token will be rotated. Minimum value is 30.
    """

    grace_period: int = pydantic.Field(default=30)
    """
    +label=Grace Period in days
    +sort=2
    +usage=Grace Period in days for which the token will be valid after rotation interval. Minimum value is 1.
    """

    notification_target: typing.Optional[NotificationTarget] = None

    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
