import datetime
import enum
from typing import Optional

import pydantic


class BucketEntityType(enum.Enum):
    bucket = "Bucket"
    folder = "Folder"
    file = "File"


class BucketEntity(pydantic.BaseModel):
    name: str = pydantic.Field(description="Name of the item.")
    size: Optional[int] = pydantic.Field(
        default=None, description="Size of the item in bytes."
    )
    last_modified: Optional[datetime.datetime] = pydantic.Field(
        default=None, description="Last modified timestamp of the item."
    )
    type: BucketEntityType = pydantic.Field(description="Type of the item.")
