# 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 .storage_bucket_lifecycle_rule_action import StorageBucketLifecycleRuleAction
from .storage_bucket_lifecycle_rule_condition import StorageBucketLifecycleRuleCondition


class StorageBucketLifecycleRule(UniversalBaseModel):
    """
    A lifecycle rule for a bucket
    """

    action: StorageBucketLifecycleRuleAction = pydantic.Field()
    """
    Rule action
    """

    condition: StorageBucketLifecycleRuleCondition = pydantic.Field()
    """
    Rule condition
    """

    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
