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

import typing

from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.pagination import AsyncPager, SyncPager
from ...core.request_options import RequestOptions
from ...types.bulk_create_entity_response import BulkCreateEntityResponse
from ...types.entity import Entity
from .raw_client import AsyncRawEntitiesClient, RawEntitiesClient
from .types.entities_create_bulk_request_entities_item import EntitiesCreateBulkRequestEntitiesItem
from .types.entities_list_request_sort_by import EntitiesListRequestSortBy
from .types.entities_list_request_status import EntitiesListRequestStatus

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


class EntitiesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawEntitiesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawEntitiesClient
        """
        return self._raw_client

    def list(
        self,
        entity_collection_id: str,
        *,
        page: typing.Optional[int] = None,
        page_limit: typing.Optional[int] = None,
        name: typing.Optional[str] = None,
        status: typing.Optional[EntitiesListRequestStatus] = None,
        sort_by: typing.Optional[EntitiesListRequestSortBy] = None,
        sort_option: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SyncPager[Entity]:
        """
        This method returns a list of the entities in the specified entity collection.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection for which the platform will retrieve the entities.

        page : typing.Optional[int]
            A number that identifies the page to retrieve.

            **Default**: `1`.

        page_limit : typing.Optional[int]
            The number of items to return on each page.

            **Default**: `10`.
            **Max**: `50`.

        name : typing.Optional[str]
            Filter entities by name.

        status : typing.Optional[EntitiesListRequestStatus]
            Filter entities by status.

        sort_by : typing.Optional[EntitiesListRequestSortBy]
            The field to sort on. The following options are available:
            - `created_at`: Sorts by the time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the entity was created.
            - `updated_at:` Sorts by the time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the entity collection was updated.
            - `name`: Sorts by the name.

        sort_option : typing.Optional[str]
            The sorting direction. The following options are available:
            - `asc`
            - `desc`

            **Default**: `desc`.

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

        Returns
        -------
        SyncPager[Entity]
            The entities have been successfully retrieved.

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        response = client.entity_collections.entities.list(
            entity_collection_id="6298d673f1090f1100476d4c",
            page=1,
            page_limit=10,
            name="My entity",
            status="processing",
            sort_by="created_at",
            sort_option="desc",
        )
        for item in response:
            yield item
        # alternatively, you can paginate page-by-page
        for page in response.iter_pages():
            yield page
        """
        return self._raw_client.list(
            entity_collection_id,
            page=page,
            page_limit=page_limit,
            name=name,
            status=status,
            sort_by=sort_by,
            sort_option=sort_option,
            request_options=request_options,
        )

    def create(
        self,
        entity_collection_id: str,
        *,
        name: str,
        asset_ids: typing.Sequence[str],
        description: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method creates an entity within a specified entity collection. Each entity must be associated with at least one asset.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection in which to create the entity.

        name : str
            The name of the entity. Make sure you use a succinct and descriptive name.

        asset_ids : typing.Sequence[str]
            An array of asset IDs to associate with the entity. You must provide at least one value.

        description : typing.Optional[str]
            An optional description of the entity.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata for the entity, provided as key-value pairs to store additional context or attributes. Use metadata to categorize or describe the entity for easier management and search. Keys must be of type `string`, and values can be of type `string`, `integer`, `float`, or `boolean`.

            **Example**:
            ```json
            {
              "sport": "soccer",
              "teamId": 42,
              "performanceScore": 8.7,
              "isActive": true
            }
            ```

            <Note title="Note">
              To store complex data types such as objects or arrays, convert them to string values before including them in the metadata.
            </Note>

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

        Returns
        -------
        Entity
            The entity has been successfully created.

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.create(
            entity_collection_id="6298d673f1090f1100476d4c",
            name="My entity",
            asset_ids=["6298d673f1090f1100476d4c", "6298d673f1090f1100476d4d"],
        )
        """
        _response = self._raw_client.create(
            entity_collection_id,
            name=name,
            asset_ids=asset_ids,
            description=description,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    def create_bulk(
        self,
        entity_collection_id: str,
        *,
        entities: typing.Sequence[EntitiesCreateBulkRequestEntitiesItem],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> BulkCreateEntityResponse:
        """
        This method creates multiple entities within a specified entity collection in a single request. Each entity must be associated with at least one asset. This endpoint is useful for efficiently adding multiple entities, such as a roster of players or a group of characters.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection in which to create the entities.

        entities : typing.Sequence[EntitiesCreateBulkRequestEntitiesItem]

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

        Returns
        -------
        BulkCreateEntityResponse
            The entities have been successfully created.

        Examples
        --------
        from twelvelabs import TwelveLabs
        from twelvelabs.entity_collections.entities import (
            EntitiesCreateBulkRequestEntitiesItem,
        )

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.create_bulk(
            entity_collection_id="6298d673f1090f1100476d4c",
            entities=[
                EntitiesCreateBulkRequestEntitiesItem(
                    name="My entity",
                    asset_ids=["6298d673f1090f1100476d4c", "6298d673f1090f1100476d4d"],
                )
            ],
        )
        """
        _response = self._raw_client.create_bulk(
            entity_collection_id, entities=entities, request_options=request_options
        )
        return _response.data

    def retrieve(
        self, entity_collection_id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> Entity:
        """
        This method retrieves details about the specified entity.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection.

        entity_id : str
            The unique identifier of the entity to retrieve.

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

        Returns
        -------
        Entity
            The entity has been successfully retrieved.

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.retrieve(
            entity_collection_id="6298d673f1090f1100476d4c",
            entity_id="6298d673f1090f1100476d4c",
        )
        """
        _response = self._raw_client.retrieve(entity_collection_id, entity_id, request_options=request_options)
        return _response.data

    def delete(
        self, entity_collection_id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        This method deletes a specific entity from an entity collection. It permanently removes the entity and its associated data, but does not affect the assets associated with this entity.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection containing the entity to be deleted.

        entity_id : str
            The unique identifier of the entity to delete.

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

        Returns
        -------
        None

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.delete(
            entity_collection_id="6298d673f1090f1100476d4c",
            entity_id="6298d673f1090f1100476d4c",
        )
        """
        _response = self._raw_client.delete(entity_collection_id, entity_id, request_options=request_options)
        return _response.data

    def update(
        self,
        entity_collection_id: str,
        entity_id: str,
        *,
        name: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method updates the specified entity within an entity collection. This operation allows modification of the entity's name, description, or metadata. Note that this endpoint does not affect the assets associated with the entity.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection containing the entity to be updated.

        entity_id : str
            The unique identifier of the entity to update.

        name : typing.Optional[str]
            The new name for the entity.

        description : typing.Optional[str]
            An updated description for the entity.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Updated metadata for the entity. If provided, this completely replaces the existing metadata. Use this to store custom key-value pairs related to the entity.

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

        Returns
        -------
        Entity
            The entity has been successfully updated.

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.update(
            entity_collection_id="6298d673f1090f1100476d4c",
            entity_id="6298d673f1090f1100476d4c",
        )
        """
        _response = self._raw_client.update(
            entity_collection_id,
            entity_id,
            name=name,
            description=description,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    def create_assets(
        self,
        entity_collection_id: str,
        entity_id: str,
        *,
        asset_ids: typing.Sequence[str],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method adds assets to the specified entity within an entity collection. Assets are used to identify the entity in media content, and adding multiple assets can improve the accuracy of entity recognition in searches.

        When assets are added, the entity may temporarily enter the "processing" state while the platform updates the necessary data. Once processing is complete, the entity status will return to "ready."

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection that contains the entity to which assets will be added.

        entity_id : str
            The unique identifier of the entity within the specified entity collection to which the assets will be added.

        asset_ids : typing.Sequence[str]
            An array of asset IDs to add to the entity.

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

        Returns
        -------
        Entity
            The assets have been successfully added to the entity.

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.create_assets(
            entity_collection_id="6298d673f1090f1100476d4c",
            entity_id="6298d673f1090f1100476d4c",
            asset_ids=["6298d673f1090f1100476d4c", "6298d673f1090f1100476d4d"],
        )
        """
        _response = self._raw_client.create_assets(
            entity_collection_id, entity_id, asset_ids=asset_ids, request_options=request_options
        )
        return _response.data

    def delete_assets(
        self,
        entity_collection_id: str,
        entity_id: str,
        *,
        asset_ids: typing.Sequence[str],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method removes from the specified entity. Assets are used to identify the entity in media content, and removing assets may impact the accuracy of entity recognition in searches if too few assets remain.

        When assets are removed, the entity may temporarily enter a "processing" state while the system updates the necessary data. Once processing is complete, the entity status will return to "ready."

        <Note title="Notes">
          - This operation only removes the association between the entity and the specified assets; it does not delete the assets themselves.
          - An entity must always have at least one asset associated with it. You can't remove the last asset from an entity.
        </Note>

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection that contains the entity from which assets will be removed.

        entity_id : str
            The unique identifier of the entity within the specified entity collection from which the assets will be removed.

        asset_ids : typing.Sequence[str]
            An array of asset IDs to remove from the entity.

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

        Returns
        -------
        Entity
            The assets have been successfully removed from the entity.

        Examples
        --------
        from twelvelabs import TwelveLabs

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.entity_collections.entities.delete_assets(
            entity_collection_id="6298d673f1090f1100476d4c",
            entity_id="6298d673f1090f1100476d4c",
            asset_ids=["6298d673f1090f1100476d4e", "6298d673f1090f1100476d4f"],
        )
        """
        _response = self._raw_client.delete_assets(
            entity_collection_id, entity_id, asset_ids=asset_ids, request_options=request_options
        )
        return _response.data


class AsyncEntitiesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawEntitiesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawEntitiesClient
        """
        return self._raw_client

    async def list(
        self,
        entity_collection_id: str,
        *,
        page: typing.Optional[int] = None,
        page_limit: typing.Optional[int] = None,
        name: typing.Optional[str] = None,
        status: typing.Optional[EntitiesListRequestStatus] = None,
        sort_by: typing.Optional[EntitiesListRequestSortBy] = None,
        sort_option: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncPager[Entity]:
        """
        This method returns a list of the entities in the specified entity collection.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection for which the platform will retrieve the entities.

        page : typing.Optional[int]
            A number that identifies the page to retrieve.

            **Default**: `1`.

        page_limit : typing.Optional[int]
            The number of items to return on each page.

            **Default**: `10`.
            **Max**: `50`.

        name : typing.Optional[str]
            Filter entities by name.

        status : typing.Optional[EntitiesListRequestStatus]
            Filter entities by status.

        sort_by : typing.Optional[EntitiesListRequestSortBy]
            The field to sort on. The following options are available:
            - `created_at`: Sorts by the time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the entity was created.
            - `updated_at:` Sorts by the time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the entity collection was updated.
            - `name`: Sorts by the name.

        sort_option : typing.Optional[str]
            The sorting direction. The following options are available:
            - `asc`
            - `desc`

            **Default**: `desc`.

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

        Returns
        -------
        AsyncPager[Entity]
            The entities have been successfully retrieved.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            response = await client.entity_collections.entities.list(
                entity_collection_id="6298d673f1090f1100476d4c",
                page=1,
                page_limit=10,
                name="My entity",
                status="processing",
                sort_by="created_at",
                sort_option="desc",
            )
            async for item in response:
                yield item

            # alternatively, you can paginate page-by-page
            async for page in response.iter_pages():
                yield page


        asyncio.run(main())
        """
        return await self._raw_client.list(
            entity_collection_id,
            page=page,
            page_limit=page_limit,
            name=name,
            status=status,
            sort_by=sort_by,
            sort_option=sort_option,
            request_options=request_options,
        )

    async def create(
        self,
        entity_collection_id: str,
        *,
        name: str,
        asset_ids: typing.Sequence[str],
        description: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method creates an entity within a specified entity collection. Each entity must be associated with at least one asset.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection in which to create the entity.

        name : str
            The name of the entity. Make sure you use a succinct and descriptive name.

        asset_ids : typing.Sequence[str]
            An array of asset IDs to associate with the entity. You must provide at least one value.

        description : typing.Optional[str]
            An optional description of the entity.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Optional metadata for the entity, provided as key-value pairs to store additional context or attributes. Use metadata to categorize or describe the entity for easier management and search. Keys must be of type `string`, and values can be of type `string`, `integer`, `float`, or `boolean`.

            **Example**:
            ```json
            {
              "sport": "soccer",
              "teamId": 42,
              "performanceScore": 8.7,
              "isActive": true
            }
            ```

            <Note title="Note">
              To store complex data types such as objects or arrays, convert them to string values before including them in the metadata.
            </Note>

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

        Returns
        -------
        Entity
            The entity has been successfully created.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.create(
                entity_collection_id="6298d673f1090f1100476d4c",
                name="My entity",
                asset_ids=["6298d673f1090f1100476d4c", "6298d673f1090f1100476d4d"],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            entity_collection_id,
            name=name,
            asset_ids=asset_ids,
            description=description,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    async def create_bulk(
        self,
        entity_collection_id: str,
        *,
        entities: typing.Sequence[EntitiesCreateBulkRequestEntitiesItem],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> BulkCreateEntityResponse:
        """
        This method creates multiple entities within a specified entity collection in a single request. Each entity must be associated with at least one asset. This endpoint is useful for efficiently adding multiple entities, such as a roster of players or a group of characters.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection in which to create the entities.

        entities : typing.Sequence[EntitiesCreateBulkRequestEntitiesItem]

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

        Returns
        -------
        BulkCreateEntityResponse
            The entities have been successfully created.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs
        from twelvelabs.entity_collections.entities import (
            EntitiesCreateBulkRequestEntitiesItem,
        )

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.create_bulk(
                entity_collection_id="6298d673f1090f1100476d4c",
                entities=[
                    EntitiesCreateBulkRequestEntitiesItem(
                        name="My entity",
                        asset_ids=[
                            "6298d673f1090f1100476d4c",
                            "6298d673f1090f1100476d4d",
                        ],
                    )
                ],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_bulk(
            entity_collection_id, entities=entities, request_options=request_options
        )
        return _response.data

    async def retrieve(
        self, entity_collection_id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> Entity:
        """
        This method retrieves details about the specified entity.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection.

        entity_id : str
            The unique identifier of the entity to retrieve.

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

        Returns
        -------
        Entity
            The entity has been successfully retrieved.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.retrieve(
                entity_collection_id="6298d673f1090f1100476d4c",
                entity_id="6298d673f1090f1100476d4c",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.retrieve(entity_collection_id, entity_id, request_options=request_options)
        return _response.data

    async def delete(
        self, entity_collection_id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        This method deletes a specific entity from an entity collection. It permanently removes the entity and its associated data, but does not affect the assets associated with this entity.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection containing the entity to be deleted.

        entity_id : str
            The unique identifier of the entity to delete.

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.delete(
                entity_collection_id="6298d673f1090f1100476d4c",
                entity_id="6298d673f1090f1100476d4c",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete(entity_collection_id, entity_id, request_options=request_options)
        return _response.data

    async def update(
        self,
        entity_collection_id: str,
        entity_id: str,
        *,
        name: typing.Optional[str] = OMIT,
        description: typing.Optional[str] = OMIT,
        metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method updates the specified entity within an entity collection. This operation allows modification of the entity's name, description, or metadata. Note that this endpoint does not affect the assets associated with the entity.

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection containing the entity to be updated.

        entity_id : str
            The unique identifier of the entity to update.

        name : typing.Optional[str]
            The new name for the entity.

        description : typing.Optional[str]
            An updated description for the entity.

        metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
            Updated metadata for the entity. If provided, this completely replaces the existing metadata. Use this to store custom key-value pairs related to the entity.

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

        Returns
        -------
        Entity
            The entity has been successfully updated.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.update(
                entity_collection_id="6298d673f1090f1100476d4c",
                entity_id="6298d673f1090f1100476d4c",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            entity_collection_id,
            entity_id,
            name=name,
            description=description,
            metadata=metadata,
            request_options=request_options,
        )
        return _response.data

    async def create_assets(
        self,
        entity_collection_id: str,
        entity_id: str,
        *,
        asset_ids: typing.Sequence[str],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method adds assets to the specified entity within an entity collection. Assets are used to identify the entity in media content, and adding multiple assets can improve the accuracy of entity recognition in searches.

        When assets are added, the entity may temporarily enter the "processing" state while the platform updates the necessary data. Once processing is complete, the entity status will return to "ready."

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection that contains the entity to which assets will be added.

        entity_id : str
            The unique identifier of the entity within the specified entity collection to which the assets will be added.

        asset_ids : typing.Sequence[str]
            An array of asset IDs to add to the entity.

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

        Returns
        -------
        Entity
            The assets have been successfully added to the entity.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.create_assets(
                entity_collection_id="6298d673f1090f1100476d4c",
                entity_id="6298d673f1090f1100476d4c",
                asset_ids=["6298d673f1090f1100476d4c", "6298d673f1090f1100476d4d"],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_assets(
            entity_collection_id, entity_id, asset_ids=asset_ids, request_options=request_options
        )
        return _response.data

    async def delete_assets(
        self,
        entity_collection_id: str,
        entity_id: str,
        *,
        asset_ids: typing.Sequence[str],
        request_options: typing.Optional[RequestOptions] = None,
    ) -> Entity:
        """
        This method removes from the specified entity. Assets are used to identify the entity in media content, and removing assets may impact the accuracy of entity recognition in searches if too few assets remain.

        When assets are removed, the entity may temporarily enter a "processing" state while the system updates the necessary data. Once processing is complete, the entity status will return to "ready."

        <Note title="Notes">
          - This operation only removes the association between the entity and the specified assets; it does not delete the assets themselves.
          - An entity must always have at least one asset associated with it. You can't remove the last asset from an entity.
        </Note>

        Parameters
        ----------
        entity_collection_id : str
            The unique identifier of the entity collection that contains the entity from which assets will be removed.

        entity_id : str
            The unique identifier of the entity within the specified entity collection from which the assets will be removed.

        asset_ids : typing.Sequence[str]
            An array of asset IDs to remove from the entity.

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

        Returns
        -------
        Entity
            The assets have been successfully removed from the entity.

        Examples
        --------
        import asyncio

        from twelvelabs import AsyncTwelveLabs

        client = AsyncTwelveLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.entity_collections.entities.delete_assets(
                entity_collection_id="6298d673f1090f1100476d4c",
                entity_id="6298d673f1090f1100476d4c",
                asset_ids=["6298d673f1090f1100476d4e", "6298d673f1090f1100476d4f"],
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete_assets(
            entity_collection_id, entity_id, asset_ids=asset_ids, request_options=request_options
        )
        return _response.data
