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

import datetime as dt
import typing

from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .....core.request_options import RequestOptions
from ....commons.types.charge_capture_claim_creation_id import ChargeCaptureClaimCreationId
from ....commons.types.charge_capture_id import ChargeCaptureId
from ....commons.types.charge_capture_post_billed_change_id import ChargeCapturePostBilledChangeId
from ....commons.types.encounter_id import EncounterId
from ....commons.types.page_token import PageToken
from ....commons.types.sort_direction import SortDirection
from .raw_client import AsyncRawV1Client, RawV1Client
from .types.charge_capture import ChargeCapture
from .types.charge_capture_data import ChargeCaptureData
from .types.charge_capture_page import ChargeCapturePage
from .types.charge_capture_post_billed_change import ChargeCapturePostBilledChange
from .types.charge_capture_sort_field import ChargeCaptureSortField
from .types.charge_capture_status import ChargeCaptureStatus

# 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 create(
        self,
        *,
        data: ChargeCaptureData,
        charge_external_id: str,
        patient_external_id: str,
        status: ChargeCaptureStatus,
        ehr_source_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ChargeCapture:
        """
        Parameters
        ----------
        data : ChargeCaptureData
            Charge Capture data contains all the fields needed to create an encounter, but listed as optional. Candid will use this data when attempting to bundle multiple Charge Captures into a single encounter.

        charge_external_id : str
            A client-specified unique ID to associate with this encounter; for example, your internal encounter ID or a Dr. Chrono encounter ID. This field should not contain PHI.

        patient_external_id : str
            The patient ID from the external EMR platform for the patient

        status : ChargeCaptureStatus
            the status of the charge capture

        ehr_source_url : typing.Optional[str]
            External URL reference that links to Charge Capture details within the external system (e.g. the EHR visit page). Send full URL format for the external link (e.g. https://emr_charge_capture_url.com/123).

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

        Returns
        -------
        ChargeCapture

        Examples
        --------
        from candid import CandidApiClient
        from candid.resources.charge_capture.resources.v_1 import (
            ChargeCaptureData,
            ChargeCaptureStatus,
        )

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.charge_capture.v_1.create(
            data=ChargeCaptureData(),
            charge_external_id="charge_external_id",
            patient_external_id="patient_external_id",
            status=ChargeCaptureStatus.PLANNED,
        )
        """
        _response = self._raw_client.create(
            data=data,
            charge_external_id=charge_external_id,
            patient_external_id=patient_external_id,
            status=status,
            ehr_source_url=ehr_source_url,
            request_options=request_options,
        )
        return _response.data

    def delete(
        self, charge_capture_id: ChargeCaptureId, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Parameters
        ----------
        charge_capture_id : ChargeCaptureId

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

        Returns
        -------
        None

        Examples
        --------
        import uuid

        from candid import CandidApiClient

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

    def update(
        self,
        charge_capture_id: ChargeCaptureId,
        *,
        data: typing.Optional[ChargeCaptureData] = OMIT,
        charge_external_id: typing.Optional[str] = OMIT,
        ehr_source_url: typing.Optional[str] = OMIT,
        patient_external_id: typing.Optional[str] = OMIT,
        status: typing.Optional[ChargeCaptureStatus] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ChargeCapture:
        """
        Parameters
        ----------
        charge_capture_id : ChargeCaptureId

        data : typing.Optional[ChargeCaptureData]

        charge_external_id : typing.Optional[str]
            A client-specified unique ID to associate with this encounter;
            for example, your internal encounter ID or a Dr. Chrono encounter ID.
            This field should not contain PHI.

        ehr_source_url : typing.Optional[str]
            External URL reference that links to Charge Capture details within the external system (e.g. the EHR visit page).
            Send full URL format for the external link (e.g. https://emr_charge_capture_url.com/123).

        patient_external_id : typing.Optional[str]
            The patient ID from the external EMR platform for the patient

        status : typing.Optional[ChargeCaptureStatus]
            the status of the charge capture

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

        Returns
        -------
        ChargeCapture

        Examples
        --------
        import uuid

        from candid import CandidApiClient

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.charge_capture.v_1.update(
            charge_capture_id=uuid.UUID(
                "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
            ),
        )
        """
        _response = self._raw_client.update(
            charge_capture_id,
            data=data,
            charge_external_id=charge_external_id,
            ehr_source_url=ehr_source_url,
            patient_external_id=patient_external_id,
            status=status,
            request_options=request_options,
        )
        return _response.data

    def get(
        self, charge_capture_id: ChargeCaptureId, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ChargeCapture:
        """
        Parameters
        ----------
        charge_capture_id : ChargeCaptureId

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

        Returns
        -------
        ChargeCapture

        Examples
        --------
        import uuid

        from candid import CandidApiClient

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

    def get_all(
        self,
        *,
        limit: typing.Optional[int] = None,
        sort: typing.Optional[ChargeCaptureSortField] = None,
        sort_direction: typing.Optional[SortDirection] = None,
        page_token: typing.Optional[PageToken] = None,
        patient_external_id: typing.Optional[str] = None,
        status: typing.Optional[ChargeCaptureStatus] = None,
        charge_external_id: typing.Optional[str] = None,
        date_of_service_min: typing.Optional[dt.date] = None,
        date_of_service_max: typing.Optional[dt.date] = None,
        claim_ids: typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]] = None,
        claim_creation_ids: typing.Optional[
            typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]
        ] = None,
        billing_provider_npis: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        service_facility_name: typing.Optional[str] = None,
        primary_payer_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_npis: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_npis: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        exclude_charges_linked_to_claims: typing.Optional[bool] = None,
        patient_external_id_ranked_sort: typing.Optional[str] = None,
        status_ranked_sort: typing.Optional[ChargeCaptureStatus] = None,
        charge_external_id_ranked_sort: typing.Optional[str] = None,
        date_of_service_min_ranked_sort: typing.Optional[dt.date] = None,
        date_of_service_max_ranked_sort: typing.Optional[dt.date] = None,
        claim_ids_ranked_sort: typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]] = None,
        claim_creation_ids_ranked_sort: typing.Optional[
            typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]
        ] = None,
        billing_provider_npis_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        service_facility_name_ranked_sort: typing.Optional[str] = None,
        primary_payer_ids_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_npis_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_names_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_npis_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_names_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ChargeCapturePage:
        """
        Parameters
        ----------
        limit : typing.Optional[int]
            Maximum number of entities per page, defaults to 100.

        sort : typing.Optional[ChargeCaptureSortField]
            Defaults to created_at

        sort_direction : typing.Optional[SortDirection]
            Sort direction. Defaults to descending order if not provided.

        page_token : typing.Optional[PageToken]

        patient_external_id : typing.Optional[str]
            The patient ID from the external EMR platform for the patient

        status : typing.Optional[ChargeCaptureStatus]
            the status of the charge captures

        charge_external_id : typing.Optional[str]
            A client-specified unique ID to associate with this encounter;
            for example, your internal encounter ID or a Dr. Chrono encounter ID.
            This field should not contain PHI.

        date_of_service_min : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        date_of_service_max : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        claim_ids : typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]]
            A list of claim IDs to filter by. This will return all charge captures that have a resulting claim with one of the IDs in this list.

        claim_creation_ids : typing.Optional[typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]]
            A list of Claim Creation IDs to filter by.

        billing_provider_npis : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of billing provider NPIs to filter by. This will return all charge captures with one of the NPIs in this list.

        service_facility_name : typing.Optional[str]
            A string to filter by. This will return all charge captures with this service facility name.

        primary_payer_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of primary payer IDs to filter by. This will return all charge captures with one of the primary payer IDs in this list.

        rendering_provider_npis : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider NPIs to filter by. This will return all charge captures with one of the NPIs in this list.

        rendering_provider_names : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider names to filter by. This will return all charge captures with one of the names in this list.

        supervising_provider_npis : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider NPIs to filter by. This will return all charge captures with one of the NPIs in this list.

        supervising_provider_names : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider names to filter by. This will return all charge captures with one of the names in this list.

        exclude_charges_linked_to_claims : typing.Optional[bool]
            Whether to exclude charge captures which are part of a claim creation.

        patient_external_id_ranked_sort : typing.Optional[str]
            The patient ID from the external EMR platform for the patient

        status_ranked_sort : typing.Optional[ChargeCaptureStatus]
            The charge capture status to show first

        charge_external_id_ranked_sort : typing.Optional[str]
            A client-specified unique ID to associate with this encounter;
            for example, your internal encounter ID or a Dr. Chrono encounter ID.
            This field should not contain PHI.

        date_of_service_min_ranked_sort : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        date_of_service_max_ranked_sort : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        claim_ids_ranked_sort : typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]]
            A list of claim IDs to show first. This will return all charge captures that have a resulting claim with one of the IDs in this list.

        claim_creation_ids_ranked_sort : typing.Optional[typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]]
            A list of Claim Creation IDs to show first.

        billing_provider_npis_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of billing provider NPIs to show first. This will return all charge captures with one of the NPIs in this list.

        service_facility_name_ranked_sort : typing.Optional[str]
            A string to show first. This will return all charge captures with this service facility name.

        primary_payer_ids_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of primary payer IDs to show first. This will return all charge captures with one of the primary payer IDs in this list.

        rendering_provider_npis_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider NPIs to show first. This will return all charge captures with one of the NPIs in this list.

        rendering_provider_names_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider names to show first. This will return all charge captures with one of the names in this list.

        supervising_provider_npis_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider NPIs to show first. This will return all charge captures with one of the NPIs in this list.

        supervising_provider_names_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider names to show first. This will return all charge captures with one of the names in this list.

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

        Returns
        -------
        ChargeCapturePage

        Examples
        --------
        from candid import CandidApiClient

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.charge_capture.v_1.get_all()
        """
        _response = self._raw_client.get_all(
            limit=limit,
            sort=sort,
            sort_direction=sort_direction,
            page_token=page_token,
            patient_external_id=patient_external_id,
            status=status,
            charge_external_id=charge_external_id,
            date_of_service_min=date_of_service_min,
            date_of_service_max=date_of_service_max,
            claim_ids=claim_ids,
            claim_creation_ids=claim_creation_ids,
            billing_provider_npis=billing_provider_npis,
            service_facility_name=service_facility_name,
            primary_payer_ids=primary_payer_ids,
            rendering_provider_npis=rendering_provider_npis,
            rendering_provider_names=rendering_provider_names,
            supervising_provider_npis=supervising_provider_npis,
            supervising_provider_names=supervising_provider_names,
            exclude_charges_linked_to_claims=exclude_charges_linked_to_claims,
            patient_external_id_ranked_sort=patient_external_id_ranked_sort,
            status_ranked_sort=status_ranked_sort,
            charge_external_id_ranked_sort=charge_external_id_ranked_sort,
            date_of_service_min_ranked_sort=date_of_service_min_ranked_sort,
            date_of_service_max_ranked_sort=date_of_service_max_ranked_sort,
            claim_ids_ranked_sort=claim_ids_ranked_sort,
            claim_creation_ids_ranked_sort=claim_creation_ids_ranked_sort,
            billing_provider_npis_ranked_sort=billing_provider_npis_ranked_sort,
            service_facility_name_ranked_sort=service_facility_name_ranked_sort,
            primary_payer_ids_ranked_sort=primary_payer_ids_ranked_sort,
            rendering_provider_npis_ranked_sort=rendering_provider_npis_ranked_sort,
            rendering_provider_names_ranked_sort=rendering_provider_names_ranked_sort,
            supervising_provider_npis_ranked_sort=supervising_provider_npis_ranked_sort,
            supervising_provider_names_ranked_sort=supervising_provider_names_ranked_sort,
            request_options=request_options,
        )
        return _response.data

    def update_post_billed_changes(
        self,
        *,
        charge_capture_change_ids: typing.Sequence[ChargeCapturePostBilledChangeId],
        resolved: bool,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ChargeCapturePostBilledChange]:
        """
        Parameters
        ----------
        charge_capture_change_ids : typing.Sequence[ChargeCapturePostBilledChangeId]
            A list of UUIDs corresponding to ChargeCapturePostBilledChanges.
            All of the charges sent will be marked as resolved

        resolved : bool
            Whether the change has been resolved. If true, the change will be marked as resolved.
            If false, the change will be marked as unresolved.

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

        Returns
        -------
        typing.List[ChargeCapturePostBilledChange]

        Examples
        --------
        import uuid

        from candid import CandidApiClient

        client = CandidApiClient(
            client_id="YOUR_CLIENT_ID",
            client_secret="YOUR_CLIENT_SECRET",
        )
        client.charge_capture.v_1.update_post_billed_changes(
            charge_capture_change_ids=[
                uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
                uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            ],
            resolved=True,
        )
        """
        _response = self._raw_client.update_post_billed_changes(
            charge_capture_change_ids=charge_capture_change_ids, resolved=resolved, 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 create(
        self,
        *,
        data: ChargeCaptureData,
        charge_external_id: str,
        patient_external_id: str,
        status: ChargeCaptureStatus,
        ehr_source_url: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ChargeCapture:
        """
        Parameters
        ----------
        data : ChargeCaptureData
            Charge Capture data contains all the fields needed to create an encounter, but listed as optional. Candid will use this data when attempting to bundle multiple Charge Captures into a single encounter.

        charge_external_id : str
            A client-specified unique ID to associate with this encounter; for example, your internal encounter ID or a Dr. Chrono encounter ID. This field should not contain PHI.

        patient_external_id : str
            The patient ID from the external EMR platform for the patient

        status : ChargeCaptureStatus
            the status of the charge capture

        ehr_source_url : typing.Optional[str]
            External URL reference that links to Charge Capture details within the external system (e.g. the EHR visit page). Send full URL format for the external link (e.g. https://emr_charge_capture_url.com/123).

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

        Returns
        -------
        ChargeCapture

        Examples
        --------
        import asyncio

        from candid import AsyncCandidApiClient
        from candid.resources.charge_capture.resources.v_1 import (
            ChargeCaptureData,
            ChargeCaptureStatus,
        )

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


        async def main() -> None:
            await client.charge_capture.v_1.create(
                data=ChargeCaptureData(),
                charge_external_id="charge_external_id",
                patient_external_id="patient_external_id",
                status=ChargeCaptureStatus.PLANNED,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            data=data,
            charge_external_id=charge_external_id,
            patient_external_id=patient_external_id,
            status=status,
            ehr_source_url=ehr_source_url,
            request_options=request_options,
        )
        return _response.data

    async def delete(
        self, charge_capture_id: ChargeCaptureId, *, request_options: typing.Optional[RequestOptions] = None
    ) -> None:
        """
        Parameters
        ----------
        charge_capture_id : ChargeCaptureId

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

        Returns
        -------
        None

        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.charge_capture.v_1.delete(
                charge_capture_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            )


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

    async def update(
        self,
        charge_capture_id: ChargeCaptureId,
        *,
        data: typing.Optional[ChargeCaptureData] = OMIT,
        charge_external_id: typing.Optional[str] = OMIT,
        ehr_source_url: typing.Optional[str] = OMIT,
        patient_external_id: typing.Optional[str] = OMIT,
        status: typing.Optional[ChargeCaptureStatus] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ChargeCapture:
        """
        Parameters
        ----------
        charge_capture_id : ChargeCaptureId

        data : typing.Optional[ChargeCaptureData]

        charge_external_id : typing.Optional[str]
            A client-specified unique ID to associate with this encounter;
            for example, your internal encounter ID or a Dr. Chrono encounter ID.
            This field should not contain PHI.

        ehr_source_url : typing.Optional[str]
            External URL reference that links to Charge Capture details within the external system (e.g. the EHR visit page).
            Send full URL format for the external link (e.g. https://emr_charge_capture_url.com/123).

        patient_external_id : typing.Optional[str]
            The patient ID from the external EMR platform for the patient

        status : typing.Optional[ChargeCaptureStatus]
            the status of the charge capture

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

        Returns
        -------
        ChargeCapture

        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.charge_capture.v_1.update(
                charge_capture_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            charge_capture_id,
            data=data,
            charge_external_id=charge_external_id,
            ehr_source_url=ehr_source_url,
            patient_external_id=patient_external_id,
            status=status,
            request_options=request_options,
        )
        return _response.data

    async def get(
        self, charge_capture_id: ChargeCaptureId, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ChargeCapture:
        """
        Parameters
        ----------
        charge_capture_id : ChargeCaptureId

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

        Returns
        -------
        ChargeCapture

        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.charge_capture.v_1.get(
                charge_capture_id=uuid.UUID(
                    "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                ),
            )


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

    async def get_all(
        self,
        *,
        limit: typing.Optional[int] = None,
        sort: typing.Optional[ChargeCaptureSortField] = None,
        sort_direction: typing.Optional[SortDirection] = None,
        page_token: typing.Optional[PageToken] = None,
        patient_external_id: typing.Optional[str] = None,
        status: typing.Optional[ChargeCaptureStatus] = None,
        charge_external_id: typing.Optional[str] = None,
        date_of_service_min: typing.Optional[dt.date] = None,
        date_of_service_max: typing.Optional[dt.date] = None,
        claim_ids: typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]] = None,
        claim_creation_ids: typing.Optional[
            typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]
        ] = None,
        billing_provider_npis: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        service_facility_name: typing.Optional[str] = None,
        primary_payer_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_npis: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_npis: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_names: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        exclude_charges_linked_to_claims: typing.Optional[bool] = None,
        patient_external_id_ranked_sort: typing.Optional[str] = None,
        status_ranked_sort: typing.Optional[ChargeCaptureStatus] = None,
        charge_external_id_ranked_sort: typing.Optional[str] = None,
        date_of_service_min_ranked_sort: typing.Optional[dt.date] = None,
        date_of_service_max_ranked_sort: typing.Optional[dt.date] = None,
        claim_ids_ranked_sort: typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]] = None,
        claim_creation_ids_ranked_sort: typing.Optional[
            typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]
        ] = None,
        billing_provider_npis_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        service_facility_name_ranked_sort: typing.Optional[str] = None,
        primary_payer_ids_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_npis_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        rendering_provider_names_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_npis_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        supervising_provider_names_ranked_sort: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ChargeCapturePage:
        """
        Parameters
        ----------
        limit : typing.Optional[int]
            Maximum number of entities per page, defaults to 100.

        sort : typing.Optional[ChargeCaptureSortField]
            Defaults to created_at

        sort_direction : typing.Optional[SortDirection]
            Sort direction. Defaults to descending order if not provided.

        page_token : typing.Optional[PageToken]

        patient_external_id : typing.Optional[str]
            The patient ID from the external EMR platform for the patient

        status : typing.Optional[ChargeCaptureStatus]
            the status of the charge captures

        charge_external_id : typing.Optional[str]
            A client-specified unique ID to associate with this encounter;
            for example, your internal encounter ID or a Dr. Chrono encounter ID.
            This field should not contain PHI.

        date_of_service_min : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        date_of_service_max : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        claim_ids : typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]]
            A list of claim IDs to filter by. This will return all charge captures that have a resulting claim with one of the IDs in this list.

        claim_creation_ids : typing.Optional[typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]]
            A list of Claim Creation IDs to filter by.

        billing_provider_npis : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of billing provider NPIs to filter by. This will return all charge captures with one of the NPIs in this list.

        service_facility_name : typing.Optional[str]
            A string to filter by. This will return all charge captures with this service facility name.

        primary_payer_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of primary payer IDs to filter by. This will return all charge captures with one of the primary payer IDs in this list.

        rendering_provider_npis : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider NPIs to filter by. This will return all charge captures with one of the NPIs in this list.

        rendering_provider_names : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider names to filter by. This will return all charge captures with one of the names in this list.

        supervising_provider_npis : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider NPIs to filter by. This will return all charge captures with one of the NPIs in this list.

        supervising_provider_names : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider names to filter by. This will return all charge captures with one of the names in this list.

        exclude_charges_linked_to_claims : typing.Optional[bool]
            Whether to exclude charge captures which are part of a claim creation.

        patient_external_id_ranked_sort : typing.Optional[str]
            The patient ID from the external EMR platform for the patient

        status_ranked_sort : typing.Optional[ChargeCaptureStatus]
            The charge capture status to show first

        charge_external_id_ranked_sort : typing.Optional[str]
            A client-specified unique ID to associate with this encounter;
            for example, your internal encounter ID or a Dr. Chrono encounter ID.
            This field should not contain PHI.

        date_of_service_min_ranked_sort : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        date_of_service_max_ranked_sort : typing.Optional[dt.date]
            Date formatted as YYYY-MM-DD; eg: 2019-08-24.
            This date must be the local date in the timezone where the service occurred.

        claim_ids_ranked_sort : typing.Optional[typing.Union[EncounterId, typing.Sequence[EncounterId]]]
            A list of claim IDs to show first. This will return all charge captures that have a resulting claim with one of the IDs in this list.

        claim_creation_ids_ranked_sort : typing.Optional[typing.Union[ChargeCaptureClaimCreationId, typing.Sequence[ChargeCaptureClaimCreationId]]]
            A list of Claim Creation IDs to show first.

        billing_provider_npis_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of billing provider NPIs to show first. This will return all charge captures with one of the NPIs in this list.

        service_facility_name_ranked_sort : typing.Optional[str]
            A string to show first. This will return all charge captures with this service facility name.

        primary_payer_ids_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of primary payer IDs to show first. This will return all charge captures with one of the primary payer IDs in this list.

        rendering_provider_npis_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider NPIs to show first. This will return all charge captures with one of the NPIs in this list.

        rendering_provider_names_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of rendering provider names to show first. This will return all charge captures with one of the names in this list.

        supervising_provider_npis_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider NPIs to show first. This will return all charge captures with one of the NPIs in this list.

        supervising_provider_names_ranked_sort : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            A list of supervising provider names to show first. This will return all charge captures with one of the names in this list.

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

        Returns
        -------
        ChargeCapturePage

        Examples
        --------
        import asyncio

        from candid import AsyncCandidApiClient

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


        async def main() -> None:
            await client.charge_capture.v_1.get_all()


        asyncio.run(main())
        """
        _response = await self._raw_client.get_all(
            limit=limit,
            sort=sort,
            sort_direction=sort_direction,
            page_token=page_token,
            patient_external_id=patient_external_id,
            status=status,
            charge_external_id=charge_external_id,
            date_of_service_min=date_of_service_min,
            date_of_service_max=date_of_service_max,
            claim_ids=claim_ids,
            claim_creation_ids=claim_creation_ids,
            billing_provider_npis=billing_provider_npis,
            service_facility_name=service_facility_name,
            primary_payer_ids=primary_payer_ids,
            rendering_provider_npis=rendering_provider_npis,
            rendering_provider_names=rendering_provider_names,
            supervising_provider_npis=supervising_provider_npis,
            supervising_provider_names=supervising_provider_names,
            exclude_charges_linked_to_claims=exclude_charges_linked_to_claims,
            patient_external_id_ranked_sort=patient_external_id_ranked_sort,
            status_ranked_sort=status_ranked_sort,
            charge_external_id_ranked_sort=charge_external_id_ranked_sort,
            date_of_service_min_ranked_sort=date_of_service_min_ranked_sort,
            date_of_service_max_ranked_sort=date_of_service_max_ranked_sort,
            claim_ids_ranked_sort=claim_ids_ranked_sort,
            claim_creation_ids_ranked_sort=claim_creation_ids_ranked_sort,
            billing_provider_npis_ranked_sort=billing_provider_npis_ranked_sort,
            service_facility_name_ranked_sort=service_facility_name_ranked_sort,
            primary_payer_ids_ranked_sort=primary_payer_ids_ranked_sort,
            rendering_provider_npis_ranked_sort=rendering_provider_npis_ranked_sort,
            rendering_provider_names_ranked_sort=rendering_provider_names_ranked_sort,
            supervising_provider_npis_ranked_sort=supervising_provider_npis_ranked_sort,
            supervising_provider_names_ranked_sort=supervising_provider_names_ranked_sort,
            request_options=request_options,
        )
        return _response.data

    async def update_post_billed_changes(
        self,
        *,
        charge_capture_change_ids: typing.Sequence[ChargeCapturePostBilledChangeId],
        resolved: bool,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ChargeCapturePostBilledChange]:
        """
        Parameters
        ----------
        charge_capture_change_ids : typing.Sequence[ChargeCapturePostBilledChangeId]
            A list of UUIDs corresponding to ChargeCapturePostBilledChanges.
            All of the charges sent will be marked as resolved

        resolved : bool
            Whether the change has been resolved. If true, the change will be marked as resolved.
            If false, the change will be marked as unresolved.

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

        Returns
        -------
        typing.List[ChargeCapturePostBilledChange]

        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.charge_capture.v_1.update_post_billed_changes(
                charge_capture_change_ids=[
                    uuid.UUID(
                        "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                    ),
                    uuid.UUID(
                        "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
                    ),
                ],
                resolved=True,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_post_billed_changes(
            charge_capture_change_ids=charge_capture_change_ids, resolved=resolved, request_options=request_options
        )
        return _response.data
