"""TypeBox-compatible schema helpers for Python."""

from __future__ import annotations

from typing import Any


def string_enum(values: list[str], options: dict[str, Any] | None = None) -> dict[str, Any]:
    """Create a string enum schema compatible with Google API and other providers.

    Returns a JSON Schema object with type "string" and enum values.
    """
    schema: dict[str, Any] = {
        "type": "string",
        "enum": list(values),
    }
    if options:
        if "description" in options and options["description"]:
            schema["description"] = options["description"]
        if "default" in options and options["default"]:
            schema["default"] = options["default"]
    return schema
