# 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.user_metadata import UserMetadata
from .raw_client import AsyncRawManageVideosClient, RawManageVideosClient

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


class ManageVideosClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawManageVideosClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawManageVideosClient
        """
        return self._raw_client

    def partial_update_video_information(
        self,
        index_id: str,
        video_id: str,
        *,
        user_metadata: typing.Optional[UserMetadata] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Use this method to update one or more fields of the metadata of a video. Also, you can delete a field by setting it to `null`.

        Parameters
        ----------
        index_id : str
            The unique identifier of the index to which the video has been uploaded.

        video_id : str
            The unique identifier of the video to update.

        user_metadata : typing.Optional[UserMetadata]

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

        Returns
        -------
        None

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

        client = TwelveLabs(
            api_key="YOUR_API_KEY",
        )
        client.manage_videos.partial_update_video_information(
            index_id="6298d673f1090f1100476d4c",
            video_id="6298d673f1090f1100476d4c",
            user_metadata={
                "category": "recentlyAdded",
                "batchNumber": 5,
                "rating": 9.3,
                "needsReview": True,
            },
        )
        """
        _response = self._raw_client.partial_update_video_information(
            index_id, video_id, user_metadata=user_metadata, request_options=request_options
        )
        return _response.data


class AsyncManageVideosClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawManageVideosClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawManageVideosClient
        """
        return self._raw_client

    async def partial_update_video_information(
        self,
        index_id: str,
        video_id: str,
        *,
        user_metadata: typing.Optional[UserMetadata] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Use this method to update one or more fields of the metadata of a video. Also, you can delete a field by setting it to `null`.

        Parameters
        ----------
        index_id : str
            The unique identifier of the index to which the video has been uploaded.

        video_id : str
            The unique identifier of the video to update.

        user_metadata : typing.Optional[UserMetadata]

        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.manage_videos.partial_update_video_information(
                index_id="6298d673f1090f1100476d4c",
                video_id="6298d673f1090f1100476d4c",
                user_metadata={
                    "category": "recentlyAdded",
                    "batchNumber": 5,
                    "rating": 9.3,
                    "needsReview": True,
                },
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.partial_update_video_information(
            index_id, video_id, user_metadata=user_metadata, request_options=request_options
        )
        return _response.data
