# 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 .raw_client import AsyncRawTagsClient, RawTagsClient
from .types.tags_create_response import TagsCreateResponse
from .types.tags_get_response import TagsGetResponse
from .types.tags_list_response import TagsListResponse
from .types.tags_update_response import TagsUpdateResponse

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


class TagsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawTagsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawTagsClient
        """
        return self._raw_client

    def list(
        self,
        organization_id: str,
        project_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsListResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

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

        Returns
        -------
        TagsListResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.tags.list(
            organization_id="organizationId",
            project_id="projectId",
        )
        """
        _response = self._raw_client.list(
            organization_id, project_id, request_options=request_options
        )
        return _response.data

    def create(
        self,
        organization_id: str,
        project_id: str,
        *,
        name: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsCreateResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        name : str
            a string at most 100 character(s) long

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

        Returns
        -------
        TagsCreateResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.tags.create(
            organization_id="organizationId",
            project_id="projectId",
            name="name",
        )
        """
        _response = self._raw_client.create(
            organization_id, project_id, name=name, request_options=request_options
        )
        return _response.data

    def get(
        self,
        organization_id: str,
        project_id: str,
        tag_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsGetResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        tag_id : str

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

        Returns
        -------
        TagsGetResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.tags.get(
            organization_id="organizationId",
            project_id="projectId",
            tag_id="tagId",
        )
        """
        _response = self._raw_client.get(
            organization_id, project_id, tag_id, request_options=request_options
        )
        return _response.data

    def update(
        self,
        organization_id: str,
        project_id: str,
        tag_id: str,
        *,
        name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsUpdateResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        tag_id : str

        name : typing.Optional[str]
            a string at most 100 character(s) long

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

        Returns
        -------
        TagsUpdateResponse
            Success

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.tags.update(
            organization_id="organizationId",
            project_id="projectId",
            tag_id="tagId",
        )
        """
        _response = self._raw_client.update(
            organization_id,
            project_id,
            tag_id,
            name=name,
            request_options=request_options,
        )
        return _response.data

    def delete(
        self,
        organization_id: str,
        project_id: str,
        tag_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        tag_id : str

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

        Returns
        -------
        None

        Examples
        --------
        from mirascope.api._generated import Mirascope

        client = Mirascope()
        client.tags.delete(
            organization_id="organizationId",
            project_id="projectId",
            tag_id="tagId",
        )
        """
        _response = self._raw_client.delete(
            organization_id, project_id, tag_id, request_options=request_options
        )
        return _response.data


class AsyncTagsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawTagsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawTagsClient
        """
        return self._raw_client

    async def list(
        self,
        organization_id: str,
        project_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsListResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

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

        Returns
        -------
        TagsListResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.tags.list(
                organization_id="organizationId",
                project_id="projectId",
            )


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

    async def create(
        self,
        organization_id: str,
        project_id: str,
        *,
        name: str,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsCreateResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        name : str
            a string at most 100 character(s) long

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

        Returns
        -------
        TagsCreateResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.tags.create(
                organization_id="organizationId",
                project_id="projectId",
                name="name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            organization_id, project_id, name=name, request_options=request_options
        )
        return _response.data

    async def get(
        self,
        organization_id: str,
        project_id: str,
        tag_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsGetResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        tag_id : str

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

        Returns
        -------
        TagsGetResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.tags.get(
                organization_id="organizationId",
                project_id="projectId",
                tag_id="tagId",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(
            organization_id, project_id, tag_id, request_options=request_options
        )
        return _response.data

    async def update(
        self,
        organization_id: str,
        project_id: str,
        tag_id: str,
        *,
        name: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TagsUpdateResponse:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        tag_id : str

        name : typing.Optional[str]
            a string at most 100 character(s) long

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

        Returns
        -------
        TagsUpdateResponse
            Success

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.tags.update(
                organization_id="organizationId",
                project_id="projectId",
                tag_id="tagId",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            organization_id,
            project_id,
            tag_id,
            name=name,
            request_options=request_options,
        )
        return _response.data

    async def delete(
        self,
        organization_id: str,
        project_id: str,
        tag_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> None:
        """
        Parameters
        ----------
        organization_id : str

        project_id : str

        tag_id : str

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from mirascope.api._generated import AsyncMirascope

        client = AsyncMirascope()


        async def main() -> None:
            await client.tags.delete(
                organization_id="organizationId",
                project_id="projectId",
                tag_id="tagId",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete(
            organization_id, project_id, tag_id, request_options=request_options
        )
        return _response.data
