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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .retention_rule_public_level import RetentionRulePublicLevel
from .retention_rule_public_retention import RetentionRulePublicRetention


class RetentionRulePublic(UniversalBaseModel):
    id: typing.Optional[str] = None
    workspace_id: typing.Optional[str] = None
    project_id: typing.Optional[str] = None
    level: typing.Optional[RetentionRulePublicLevel] = pydantic.Field(default=None)
    """
    Computed from projectId and organizationLevel
    """

    retention: RetentionRulePublicRetention
    apply_to_past: typing.Optional[bool] = None
    enabled: typing.Optional[bool] = None
    created_by: typing.Optional[str] = None
    created_at: typing.Optional[dt.datetime] = None
    last_updated_by: typing.Optional[str] = None
    last_updated_at: typing.Optional[dt.datetime] = None
    catch_up_cursor: typing.Optional[str] = pydantic.Field(default=None)
    """
    Current position of historical data cleanup
    """

    catch_up_done: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether historical catch-up is complete
    """

    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
