# 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 .lifecycle_rule import LifecycleRule


class StorageBucket(UniversalBaseModel):
    """
    Cloud Storage bucket
    """

    name: str = pydantic.Field()
    """
    Bucket name
    """

    location: typing.Optional[str] = pydantic.Field(default=None)
    """
    Bucket location
    """

    storage_class: typing.Optional[str] = pydantic.Field(default=None)
    """
    Storage class
    """

    versioning_enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether versioning is enabled
    """

    lifecycle_rules: typing.Optional[typing.List[LifecycleRule]] = pydantic.Field(default=None)
    """
    Lifecycle rules
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    Creation timestamp
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    Last update timestamp
    """

    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
