"""
Exports API namespace.

AUTO-GENERATED by scripts/generate_sdk.py - DO NOT EDIT MANUALLY!
Regenerate with: python scripts/generate_sdk.py --category exports
"""
from __future__ import annotations

from typing import Any, Dict, Optional

from ._base import AsyncBaseAPI, BaseAPI


class ExportsAPI(BaseAPI):
    """Exports namespace: export, formats."""

    def export(
        self,
        *,
        source: str,
        source_params: Optional[Dict[str, Any]] = None,
        filename: Optional[str] = None,
        include_metadata: Optional[bool] = True,
        compression: Optional[str] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Export data

        Export data to file format.

        Args:
        source: Source action (e.g., 'securities.search')
        source_params: Parameters for source action
        filename: Output filename
        include_metadata: Include metadata
        compression: Compression (for parquet)"""
        params: Dict[str, Any] = {}
        params["source"] = source
        if source_params is not None:
            params["source_params"] = source_params
        if filename is not None:
            params["filename"] = filename
        if include_metadata is not None:
            params["include_metadata"] = include_metadata
        if compression is not None:
            params["compression"] = compression
        return self._call("exports.export", params=params, options=options, context=context)

    def formats(
        self,
        *,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """List formats

        List supported export formats."""
        params: Dict[str, Any] = {}
        return self._call("exports.formats", params=params, options=options, context=context)



class AsyncExportsAPI(AsyncBaseAPI):
    """Exports namespace: export, formats."""

    async def export(
        self,
        *,
        source: str,
        source_params: Optional[Dict[str, Any]] = None,
        filename: Optional[str] = None,
        include_metadata: Optional[bool] = True,
        compression: Optional[str] = None,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Export data

        Export data to file format.

        Args:
        source: Source action (e.g., 'securities.search')
        source_params: Parameters for source action
        filename: Output filename
        include_metadata: Include metadata
        compression: Compression (for parquet)"""
        params: Dict[str, Any] = {}
        params["source"] = source
        if source_params is not None:
            params["source_params"] = source_params
        if filename is not None:
            params["filename"] = filename
        if include_metadata is not None:
            params["include_metadata"] = include_metadata
        if compression is not None:
            params["compression"] = compression
        return await self._call("exports.export", params=params, options=options, context=context)

    async def formats(
        self,
        *,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """List formats

        List supported export formats."""
        params: Dict[str, Any] = {}
        return await self._call("exports.formats", params=params, options=options, context=context)


