# 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 ....commons.types.encounter_id import EncounterId
from .raw_client import AsyncRawV1Client, RawV1Client
from .types.health_care_code_information_get_all_response import HealthCareCodeInformationGetAllResponse
from .types.health_care_code_information_update import HealthCareCodeInformationUpdate

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


class V1Client:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawV1Client(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawV1Client
        """
        return self._raw_client

    def update(
        self,
        encounter_id: EncounterId,
        *,
        request: HealthCareCodeInformationUpdate,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HealthCareCodeInformationGetAllResponse:
        """
        Parameters
        ----------
        encounter_id : EncounterId

        request : HealthCareCodeInformationUpdate

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

        Returns
        -------
        HealthCareCodeInformationGetAllResponse

        Examples
        --------
        import uuid

        from candid import CandidApiClient
        from candid.resources.health_care_code_information.resources.v_1 import (
            HealthCareCodeInformationUpdate,
        )

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.health_care_code_information.v_1.update(
            encounter_id=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
            request=HealthCareCodeInformationUpdate(),
        )
        """
        _response = self._raw_client.update(encounter_id, request=request, request_options=request_options)
        return _response.data

    def get_all_for_encounter(
        self, encounter_id: EncounterId, *, request_options: typing.Optional[RequestOptions] = None
    ) -> HealthCareCodeInformationGetAllResponse:
        """
        Parameters
        ----------
        encounter_id : EncounterId

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

        Returns
        -------
        HealthCareCodeInformationGetAllResponse

        Examples
        --------
        import uuid

        from candid import CandidApiClient

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.health_care_code_information.v_1.get_all_for_encounter(
            encounter_id=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
        )
        """
        _response = self._raw_client.get_all_for_encounter(encounter_id, request_options=request_options)
        return _response.data


class AsyncV1Client:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawV1Client(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawV1Client
        """
        return self._raw_client

    async def update(
        self,
        encounter_id: EncounterId,
        *,
        request: HealthCareCodeInformationUpdate,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HealthCareCodeInformationGetAllResponse:
        """
        Parameters
        ----------
        encounter_id : EncounterId

        request : HealthCareCodeInformationUpdate

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

        Returns
        -------
        HealthCareCodeInformationGetAllResponse

        Examples
        --------
        import asyncio
        import uuid

        from candid import AsyncCandidApiClient
        from candid.resources.health_care_code_information.resources.v_1 import (
            HealthCareCodeInformationUpdate,
        )

        client = AsyncCandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )


        async def main() -> None:
            await client.health_care_code_information.v_1.update(
                encounter_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
                request=HealthCareCodeInformationUpdate(),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(encounter_id, request=request, request_options=request_options)
        return _response.data

    async def get_all_for_encounter(
        self, encounter_id: EncounterId, *, request_options: typing.Optional[RequestOptions] = None
    ) -> HealthCareCodeInformationGetAllResponse:
        """
        Parameters
        ----------
        encounter_id : EncounterId

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

        Returns
        -------
        HealthCareCodeInformationGetAllResponse

        Examples
        --------
        import asyncio
        import uuid

        from candid import AsyncCandidApiClient

        client = AsyncCandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )


        async def main() -> None:
            await client.health_care_code_information.v_1.get_all_for_encounter(
                encounter_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_all_for_encounter(encounter_id, request_options=request_options)
        return _response.data
