# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from ..._models import BaseModel

__all__ = ["MaintenanceConfigUpdateResponse", "Compaction", "SnapshotExpiration"]


class Compaction(BaseModel):
    """Configures compaction for catalog maintenance."""

    state: Literal["enabled", "disabled"]
    """Specifies the state of maintenance operations."""

    target_size_mb: Literal["64", "128", "256", "512"]
    """Sets the target file size for compaction in megabytes. Defaults to "128"."""


class SnapshotExpiration(BaseModel):
    """Configures snapshot expiration settings."""

    max_snapshot_age: str
    """Specifies the maximum age for snapshots.

    The system deletes snapshots older than this age. Format: <number><unit> where
    unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7
    days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d".
    """

    min_snapshots_to_keep: int
    """Specifies the minimum number of snapshots to retain. Defaults to 100."""

    state: Literal["enabled", "disabled"]
    """Specifies the state of maintenance operations."""


class MaintenanceConfigUpdateResponse(BaseModel):
    """Configures maintenance for the catalog."""

    compaction: Optional[Compaction] = None
    """Configures compaction for catalog maintenance."""

    snapshot_expiration: Optional[SnapshotExpiration] = None
    """Configures snapshot expiration settings."""
