# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class SpaceResponse(UniversalBaseModel):
    """
    Response schema for space.
    """

    id: str = pydantic.Field()
    """
    Space ID
    """

    organization_id: str = pydantic.Field()
    """
    Organization ID
    """

    created_by: str = pydantic.Field()
    """
    Creator user ID
    """

    name: str = pydantic.Field()
    """
    Space name
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Space description
    """

    vector_store_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Linked vector store ID
    """

    access_mode: str = pydantic.Field()
    """
    Access mode
    """

    access_users: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    User IDs with view access
    """

    access_departments: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Department IDs with view access
    """

    editable_by_users: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    User IDs with edit access
    """

    editable_by_roles: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Role IDs with edit access
    """

    visible_to_roles: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Role IDs with view access
    """

    additional_vector_store_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    IDs of additional vector stores attached to this space
    """

    last_activity_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last activity timestamp
    """

    created_at: dt.datetime = pydantic.Field()
    """
    Creation timestamp
    """

    updated_at: dt.datetime = pydantic.Field()
    """
    Last update timestamp
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
