"""
Documents API namespace.

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

from typing import Any, Dict, Optional

from ._base import AsyncBaseAPI, BaseAPI


class DocumentsAPI(BaseAPI):
    """Documents namespace: capabilities, classify, parse, types."""

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

        Get document processing capabilities."""
        params: Dict[str, Any] = {}
        return self._call("documents.capabilities", params=params, options=options, context=context)

    def classify(
        self,
        *,
        file_path: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Classify document

        Classify document type.

        Args:
        file_path: File path"""
        params: Dict[str, Any] = {}
        params["file_path"] = file_path
        return self._call("documents.classify", params=params, options=options, context=context)

    def parse(
        self,
        *,
        file_path: str,
        document_type: Optional[str] = None,
        extraction_method: Optional[str] = "auto",
        use_ocr_fallback: Optional[bool] = True,
        include_raw_text: Optional[bool] = False,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Parse document

        Parse PDF or Excel document.

        Args:
        file_path: File path
        document_type: Document type hint
        extraction_method: Extraction method
        use_ocr_fallback: Use OCR fallback
        include_raw_text: Include raw text in response"""
        params: Dict[str, Any] = {}
        params["file_path"] = file_path
        if document_type is not None:
            params["document_type"] = document_type
        if extraction_method is not None:
            params["extraction_method"] = extraction_method
        if use_ocr_fallback is not None:
            params["use_ocr_fallback"] = use_ocr_fallback
        if include_raw_text is not None:
            params["include_raw_text"] = include_raw_text
        return self._call("documents.parse", params=params, options=options, context=context)

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

        List supported document types."""
        params: Dict[str, Any] = {}
        return self._call("documents.types", params=params, options=options, context=context)



class AsyncDocumentsAPI(AsyncBaseAPI):
    """Documents namespace: capabilities, classify, parse, types."""

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

        Get document processing capabilities."""
        params: Dict[str, Any] = {}
        return await self._call("documents.capabilities", params=params, options=options, context=context)

    async def classify(
        self,
        *,
        file_path: str,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Classify document

        Classify document type.

        Args:
        file_path: File path"""
        params: Dict[str, Any] = {}
        params["file_path"] = file_path
        return await self._call("documents.classify", params=params, options=options, context=context)

    async def parse(
        self,
        *,
        file_path: str,
        document_type: Optional[str] = None,
        extraction_method: Optional[str] = "auto",
        use_ocr_fallback: Optional[bool] = True,
        include_raw_text: Optional[bool] = False,
        options: Optional[Dict[str, Any]] = None,
        context: Optional[Dict[str, Any]] = None,
    ) -> Any:
        """Parse document

        Parse PDF or Excel document.

        Args:
        file_path: File path
        document_type: Document type hint
        extraction_method: Extraction method
        use_ocr_fallback: Use OCR fallback
        include_raw_text: Include raw text in response"""
        params: Dict[str, Any] = {}
        params["file_path"] = file_path
        if document_type is not None:
            params["document_type"] = document_type
        if extraction_method is not None:
            params["extraction_method"] = extraction_method
        if use_ocr_fallback is not None:
            params["use_ocr_fallback"] = use_ocr_fallback
        if include_raw_text is not None:
            params["include_raw_text"] = include_raw_text
        return await self._call("documents.parse", params=params, options=options, context=context)

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

        List supported document types."""
        params: Dict[str, Any] = {}
        return await self._call("documents.types", params=params, options=options, context=context)


