# DO NOT EDIT — generated by _gen/convenience_emitter.py from convenience.json.
# Regenerate with: cd clients/v2 && python -c "from _gen.convenience_emitter import generate_convenience; generate_convenience()"

"""Spaces API namespace — generated from convenience.json."""

from __future__ import annotations

from typing import Any

from goodmem._api_base.spaces import SpacesAPIBase, AsyncSpacesAPIBase


# --- Convenience imports ---
from goodmem._transforms import apply_convenience_transforms
from goodmem._transforms import _transform_list_kwargs


class SpacesAPI(SpacesAPIBase):
    def create(self, **kwargs: Any) -> Any:
        apply_convenience_transforms(("spaces", "create"), kwargs)
        return super().create(**kwargs)

    def list(self, *, labels: dict[str, str] | None = None, **kwargs: Any) -> Paginator:
        max_items = _transform_list_kwargs(kwargs)
        paginator = super().list(labels=labels, **kwargs)
        paginator._max_items = max_items
        return paginator



class AsyncSpacesAPI(AsyncSpacesAPIBase):
    async def create(self, **kwargs: Any) -> Any:
        apply_convenience_transforms(("spaces", "create"), kwargs)
        return await super().create(**kwargs)

    def list(self, *, labels: dict[str, str] | None = None, **kwargs: Any) -> AsyncPaginator:
        max_items = _transform_list_kwargs(kwargs)
        paginator = super().list(labels=labels, **kwargs)
        paginator._max_items = max_items
        return paginator

