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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .storage_bucket_lifecycle import StorageBucketLifecycle
from .storage_bucket_versioning import StorageBucketVersioning


class StorageBucket(UniversalBaseModel):
    """
    Cloud Storage bucket object - matches API format
    """

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

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

    storage_class: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="storageClass")] = (
        pydantic.Field(default=None)
    )
    """
    Storage class
    """

    versioning: typing.Optional[StorageBucketVersioning] = pydantic.Field(default=None)
    """
    Versioning configuration
    """

    lifecycle: typing.Optional[StorageBucketLifecycle] = pydantic.Field(default=None)
    """
    Lifecycle configuration
    """

    time_created: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="timeCreated")] = (
        pydantic.Field(default=None)
    )
    """
    Creation timestamp
    """

    updated: 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
