from typing import Any, Dict

from ..base_client import BaseClient


DEFAULT_MODEL = "volc-asset"


class Asset:
    """ByteDance Volc asset management."""

    def __init__(self, client: BaseClient):
        self._client = client

    def create_group(self, **kwargs) -> Dict[str, Any]:
        """Create an asset group."""
        return self._client.post("/volc/asset/CreateAssetGroup", {
            "model": DEFAULT_MODEL,
            **kwargs,
        })

    def list_groups(self, **kwargs) -> Dict[str, Any]:
        """List asset groups."""
        return self._client.post("/volc/asset/ListAssetGroups", {
            "model": DEFAULT_MODEL,
            **kwargs,
        })

    def create_asset(self, **kwargs) -> Dict[str, Any]:
        """Create an asset."""
        return self._client.post("/volc/asset/CreateAsset", {
            "model": DEFAULT_MODEL,
            **kwargs,
        })

    def list_assets(self, **kwargs) -> Dict[str, Any]:
        """List assets."""
        return self._client.post("/volc/asset/ListAssets", {
            "model": DEFAULT_MODEL,
            **kwargs,
        })
