# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import TYPE_CHECKING, Dict, List, Optional
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from .._models import BaseModel
from .shared.metadata import Metadata

__all__ = ["Memory"]


class Memory(BaseModel):
    """Response model for the GET /memories/get endpoint."""

    resource_id: str

    source: Literal[
        "reddit",
        "notion",
        "slack",
        "google_calendar",
        "google_mail",
        "box",
        "dropbox",
        "google_drive",
        "github",
        "vault",
        "web_crawler",
        "trace",
        "microsoft_teams",
    ]

    type: str
    """The type of document (e.g. Document, Website, Email)"""

    data: Optional[List[object]] = None
    """The structured content of the document"""

    memories: Optional[List[str]] = None
    """Summaries of all memories extracted from this document"""

    metadata: Optional[Metadata] = None

    title: Optional[str] = None

    if TYPE_CHECKING:
        # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
        # value to this field, so for compatibility we avoid doing it at runtime.
        __pydantic_extra__: Dict[str, object] = FieldInfo(init=False)  # pyright: ignore[reportIncompatibleVariableOverride]

        # Stub to indicate that arbitrary properties are accepted.
        # To access properties that are not valid identifiers you can use `getattr`, e.g.
        # `getattr(obj, '$type')`
        def __getattr__(self, attr: str) -> object: ...
    else:
        __pydantic_extra__: Dict[str, object]
