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

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.add_thread_to_space_response import AddThreadToSpaceResponse
from ..types.add_vector_store_to_space_response import AddVectorStoreToSpaceResponse
from ..types.space_list_response import SpaceListResponse
from ..types.space_response import SpaceResponse
from ..types.space_thread_list_response import SpaceThreadListResponse
from ..types.space_vector_store_list_response import SpaceVectorStoreListResponse
from .raw_client import AsyncRawSpacesClient, RawSpacesClient

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class SpacesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawSpacesClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawSpacesClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSpacesClient
        """
        return self._raw_client

    def list_spaces(
        self,
        *,
        organization_id: str,
        limit: typing.Optional[int] = None,
        cursor: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceListResponse:
        """
        List all spaces user has access to in an organization

        Parameters
        ----------
        organization_id : str
            Organization ID to filter by

        limit : typing.Optional[int]
            Maximum number of results

        cursor : typing.Optional[str]
            Pagination cursor

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.list_spaces(
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.list_spaces(
            organization_id=organization_id, limit=limit, cursor=cursor, request_options=request_options
        )
        return _response.data

    def create_space(
        self,
        *,
        organization_id: str,
        name: str,
        description: typing.Optional[str] = OMIT,
        access_mode: typing.Optional[str] = OMIT,
        access_users: typing.Optional[typing.Sequence[str]] = OMIT,
        access_departments: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_users: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        visible_to_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceResponse:
        """
        Create a new space with auto-linked vector store for memory management

        Parameters
        ----------
        organization_id : str
            Organization ID

        name : str
            Space name

        description : typing.Optional[str]
            Optional space description

        access_mode : typing.Optional[str]
            Access mode: private, organization, or public

        access_users : typing.Optional[typing.Sequence[str]]
            User IDs with view access

        access_departments : typing.Optional[typing.Sequence[str]]
            Department IDs with view access

        editable_by_users : typing.Optional[typing.Sequence[str]]
            User IDs with edit access (supports wildcard '*')

        editable_by_roles : typing.Optional[typing.Sequence[str]]
            Role IDs with edit access

        visible_to_roles : typing.Optional[typing.Sequence[str]]
            Role IDs with view access

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.create_space(
            organization_id="org_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
            name="Project Alpha",
            description="Shared space for Project Alpha team",
            access_mode="organization",
        )
        """
        _response = self._raw_client.create_space(
            organization_id=organization_id,
            name=name,
            description=description,
            access_mode=access_mode,
            access_users=access_users,
            access_departments=access_departments,
            editable_by_users=editable_by_users,
            editable_by_roles=editable_by_roles,
            visible_to_roles=visible_to_roles,
            request_options=request_options,
        )
        return _response.data

    def get_space(
        self, space_id: str, *, organization_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> SpaceResponse:
        """
        Retrieve space details by ID with access validation

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.get_space(
            space_id="space_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.get_space(
            space_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def delete_space(
        self, space_id: str, *, organization_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Soft delete space (requires owner access)

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.delete_space(
            space_id="space_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.delete_space(
            space_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def update_space(
        self,
        space_id: str,
        *,
        organization_id: str,
        name: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        access_mode: typing.Optional[str] = OMIT,
        access_users: typing.Optional[typing.Sequence[str]] = OMIT,
        access_departments: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_users: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        visible_to_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceResponse:
        """
        Update space properties with access validation

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        name : typing.Optional[str]
            New space name

        description : typing.Optional[str]
            New space description

        access_mode : typing.Optional[str]
            New access mode

        access_users : typing.Optional[typing.Sequence[str]]
            New access users list

        access_departments : typing.Optional[typing.Sequence[str]]
            New access departments list

        editable_by_users : typing.Optional[typing.Sequence[str]]
            New editable users list

        editable_by_roles : typing.Optional[typing.Sequence[str]]
            New editable roles list

        visible_to_roles : typing.Optional[typing.Sequence[str]]
            New visible roles list

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.update_space(
            space_id="space_id",
            organization_id="organization_id",
            name="Updated Space Name",
            description="Updated description",
            access_mode="private",
        )
        """
        _response = self._raw_client.update_space(
            space_id,
            organization_id=organization_id,
            name=name,
            description=description,
            access_mode=access_mode,
            access_users=access_users,
            access_departments=access_departments,
            editable_by_users=editable_by_users,
            editable_by_roles=editable_by_roles,
            visible_to_roles=visible_to_roles,
            request_options=request_options,
        )
        return _response.data

    def add_thread_to_space(
        self,
        space_id: str,
        thread_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddThreadToSpaceResponse:
        """
        Associate a thread with a space (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        thread_id : str
            Thread ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddThreadToSpaceResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.add_thread_to_space(
            space_id="space_id",
            thread_id="thread_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.add_thread_to_space(
            space_id, thread_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def remove_thread_from_space(
        self,
        space_id: str,
        thread_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Remove thread from space and cleanup vectors (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        thread_id : str
            Thread ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.remove_thread_from_space(
            space_id="space_id",
            thread_id="thread_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.remove_thread_from_space(
            space_id, thread_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def list_space_threads(
        self,
        space_id: str,
        *,
        organization_id: str,
        limit: typing.Optional[int] = None,
        cursor: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceThreadListResponse:
        """
        List all threads associated with a space (requires view access)

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        limit : typing.Optional[int]
            Maximum number of threads to return

        cursor : typing.Optional[str]
            Pagination cursor from previous response

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceThreadListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.list_space_threads(
            space_id="space_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.list_space_threads(
            space_id, organization_id=organization_id, limit=limit, cursor=cursor, request_options=request_options
        )
        return _response.data

    def add_vector_store_to_space(
        self,
        space_id: str,
        vector_store_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddVectorStoreToSpaceResponse:
        """
        Attach an additional external vector store to a space (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        vector_store_id : str
            Vector store ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddVectorStoreToSpaceResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.add_vector_store_to_space(
            space_id="space_id",
            vector_store_id="vector_store_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.add_vector_store_to_space(
            space_id, vector_store_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def remove_vector_store_from_space(
        self,
        space_id: str,
        vector_store_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Remove an additional vector store from a space (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        vector_store_id : str
            Vector store ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.remove_vector_store_from_space(
            space_id="space_id",
            vector_store_id="vector_store_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.remove_vector_store_from_space(
            space_id, vector_store_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    def list_space_vector_stores(
        self, space_id: str, *, organization_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> SpaceVectorStoreListResponse:
        """
        List all additional vector stores attached to a space (requires view access)

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceVectorStoreListResponse
            Successful Response

        Examples
        --------
        from aitronos import Aitronos

        client = Aitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )
        client.spaces.list_space_vector_stores(
            space_id="space_id",
            organization_id="organization_id",
        )
        """
        _response = self._raw_client.list_space_vector_stores(
            space_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data


class AsyncSpacesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawSpacesClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawSpacesClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSpacesClient
        """
        return self._raw_client

    async def list_spaces(
        self,
        *,
        organization_id: str,
        limit: typing.Optional[int] = None,
        cursor: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceListResponse:
        """
        List all spaces user has access to in an organization

        Parameters
        ----------
        organization_id : str
            Organization ID to filter by

        limit : typing.Optional[int]
            Maximum number of results

        cursor : typing.Optional[str]
            Pagination cursor

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.list_spaces(
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_spaces(
            organization_id=organization_id, limit=limit, cursor=cursor, request_options=request_options
        )
        return _response.data

    async def create_space(
        self,
        *,
        organization_id: str,
        name: str,
        description: typing.Optional[str] = OMIT,
        access_mode: typing.Optional[str] = OMIT,
        access_users: typing.Optional[typing.Sequence[str]] = OMIT,
        access_departments: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_users: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        visible_to_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceResponse:
        """
        Create a new space with auto-linked vector store for memory management

        Parameters
        ----------
        organization_id : str
            Organization ID

        name : str
            Space name

        description : typing.Optional[str]
            Optional space description

        access_mode : typing.Optional[str]
            Access mode: private, organization, or public

        access_users : typing.Optional[typing.Sequence[str]]
            User IDs with view access

        access_departments : typing.Optional[typing.Sequence[str]]
            Department IDs with view access

        editable_by_users : typing.Optional[typing.Sequence[str]]
            User IDs with edit access (supports wildcard '*')

        editable_by_roles : typing.Optional[typing.Sequence[str]]
            Role IDs with edit access

        visible_to_roles : typing.Optional[typing.Sequence[str]]
            Role IDs with view access

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.create_space(
                organization_id="org_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
                name="Project Alpha",
                description="Shared space for Project Alpha team",
                access_mode="organization",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_space(
            organization_id=organization_id,
            name=name,
            description=description,
            access_mode=access_mode,
            access_users=access_users,
            access_departments=access_departments,
            editable_by_users=editable_by_users,
            editable_by_roles=editable_by_roles,
            visible_to_roles=visible_to_roles,
            request_options=request_options,
        )
        return _response.data

    async def get_space(
        self, space_id: str, *, organization_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> SpaceResponse:
        """
        Retrieve space details by ID with access validation

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.get_space(
                space_id="space_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_space(
            space_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def delete_space(
        self, space_id: str, *, organization_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Soft delete space (requires owner access)

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.delete_space(
                space_id="space_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete_space(
            space_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def update_space(
        self,
        space_id: str,
        *,
        organization_id: str,
        name: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        access_mode: typing.Optional[str] = OMIT,
        access_users: typing.Optional[typing.Sequence[str]] = OMIT,
        access_departments: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_users: typing.Optional[typing.Sequence[str]] = OMIT,
        editable_by_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        visible_to_roles: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceResponse:
        """
        Update space properties with access validation

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        name : typing.Optional[str]
            New space name

        description : typing.Optional[str]
            New space description

        access_mode : typing.Optional[str]
            New access mode

        access_users : typing.Optional[typing.Sequence[str]]
            New access users list

        access_departments : typing.Optional[typing.Sequence[str]]
            New access departments list

        editable_by_users : typing.Optional[typing.Sequence[str]]
            New editable users list

        editable_by_roles : typing.Optional[typing.Sequence[str]]
            New editable roles list

        visible_to_roles : typing.Optional[typing.Sequence[str]]
            New visible roles list

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.update_space(
                space_id="space_id",
                organization_id="organization_id",
                name="Updated Space Name",
                description="Updated description",
                access_mode="private",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_space(
            space_id,
            organization_id=organization_id,
            name=name,
            description=description,
            access_mode=access_mode,
            access_users=access_users,
            access_departments=access_departments,
            editable_by_users=editable_by_users,
            editable_by_roles=editable_by_roles,
            visible_to_roles=visible_to_roles,
            request_options=request_options,
        )
        return _response.data

    async def add_thread_to_space(
        self,
        space_id: str,
        thread_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddThreadToSpaceResponse:
        """
        Associate a thread with a space (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        thread_id : str
            Thread ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddThreadToSpaceResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.add_thread_to_space(
                space_id="space_id",
                thread_id="thread_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.add_thread_to_space(
            space_id, thread_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def remove_thread_from_space(
        self,
        space_id: str,
        thread_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Remove thread from space and cleanup vectors (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        thread_id : str
            Thread ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.remove_thread_from_space(
                space_id="space_id",
                thread_id="thread_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.remove_thread_from_space(
            space_id, thread_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def list_space_threads(
        self,
        space_id: str,
        *,
        organization_id: str,
        limit: typing.Optional[int] = None,
        cursor: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SpaceThreadListResponse:
        """
        List all threads associated with a space (requires view access)

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        limit : typing.Optional[int]
            Maximum number of threads to return

        cursor : typing.Optional[str]
            Pagination cursor from previous response

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceThreadListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.list_space_threads(
                space_id="space_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_space_threads(
            space_id, organization_id=organization_id, limit=limit, cursor=cursor, request_options=request_options
        )
        return _response.data

    async def add_vector_store_to_space(
        self,
        space_id: str,
        vector_store_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddVectorStoreToSpaceResponse:
        """
        Attach an additional external vector store to a space (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        vector_store_id : str
            Vector store ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AddVectorStoreToSpaceResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.add_vector_store_to_space(
                space_id="space_id",
                vector_store_id="vector_store_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.add_vector_store_to_space(
            space_id, vector_store_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def remove_vector_store_from_space(
        self,
        space_id: str,
        vector_store_id: str,
        *,
        organization_id: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Remove an additional vector store from a space (requires edit access)

        Parameters
        ----------
        space_id : str
            Space ID

        vector_store_id : str
            Vector store ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.remove_vector_store_from_space(
                space_id="space_id",
                vector_store_id="vector_store_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.remove_vector_store_from_space(
            space_id, vector_store_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data

    async def list_space_vector_stores(
        self, space_id: str, *, organization_id: str, request_options: typing.Optional[RequestOptions] = None
    ) -> SpaceVectorStoreListResponse:
        """
        List all additional vector stores attached to a space (requires view access)

        Parameters
        ----------
        space_id : str
            Space ID

        organization_id : str
            Organization ID

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SpaceVectorStoreListResponse
            Successful Response

        Examples
        --------
        import asyncio

        from aitronos import AsyncAitronos

        client = AsyncAitronos(
            api_key="YOUR_API_KEY",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.spaces.list_space_vector_stores(
                space_id="space_id",
                organization_id="organization_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list_space_vector_stores(
            space_id, organization_id=organization_id, request_options=request_options
        )
        return _response.data
