"""
Cohere SDK for Compass.

This package provides Python clients for interacting with the Cohere Compass API,
including document parsing, indexing, searching, and access control.
"""

# Python imports
from enum import Enum
from importlib import metadata

from pydantic import BaseModel

# Local imports
from cohere_compass.models import ParserConfig, ValidatedModel
from cohere_compass.models.documents import DocumentId

__version__ = metadata.version("cohere-compass-sdk")


# TODO Those models should be moved to a separate module.


class ProcessFileParameters(ValidatedModel):
    """Model for use with the process_file parser API."""

    parser_config: ParserConfig
    doc_id: DocumentId | None = None
    content_type: str | None = None


class ProcessFilesParameters(ValidatedModel):
    """Model for use with the process_files parser API."""

    doc_ids: list[str] | None = None
    parser_config: ParserConfig


class GroupAuthorizationActions(str, Enum):
    """Enum for use with the update_group_authorization API to specify the edit type."""

    ADD = "add"
    REMOVE = "remove"


class GroupAuthorizationInput(BaseModel):
    """Model for use with the update_group_authorization API."""

    document_ids: list[str]
    authorized_groups: list[str]
    action: GroupAuthorizationActions
    wait_for_completion: bool = False
