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

import typing
from ..core.client_wrapper import SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.client_facing_lab_test import ClientFacingLabTest
from ..core.pydantic_utilities import parse_obj_as
from json.decoder import JSONDecodeError
from ..core.api_error import ApiError
from ..types.lab_test_collection_method import LabTestCollectionMethod
from ..errors.unprocessable_entity_error import UnprocessableEntityError
from ..types.http_validation_error import HttpValidationError
from ..types.get_markers_response import GetMarkersResponse
from ..types.order_set_request import OrderSetRequest
from ..core.jsonable_encoder import jsonable_encoder
from ..types.client_facing_marker import ClientFacingMarker
from ..types.client_facing_lab import ClientFacingLab
from ..types.us_address import UsAddress
from ..types.appointment_availability_slots import AppointmentAvailabilitySlots
from ..types.appointment_booking_request import AppointmentBookingRequest
from ..types.client_facing_appointment import ClientFacingAppointment
from ..types.appointment_provider import AppointmentProvider
from ..types.appointment_reschedule_request import AppointmentRescheduleRequest
from ..types.client_facing_appointment_cancellation_reason import ClientFacingAppointmentCancellationReason
from ..types.allowed_radius import AllowedRadius
from ..types.client_facing_labs import ClientFacingLabs
from ..types.area_info import AreaInfo
from ..types.psc_info import PscInfo
from ..types.lab_results_metadata import LabResultsMetadata
from ..types.lab_results_raw import LabResultsRaw
import datetime as dt
from ..core.datetime_utils import serialize_datetime
from ..types.client_facing_order import ClientFacingOrder
from ..types.patient_details_with_validation import PatientDetailsWithValidation
from ..types.patient_address_with_validation import PatientAddressWithValidation
from ..types.physician_create_request import PhysicianCreateRequest
from ..types.health_insurance_create_request import HealthInsuranceCreateRequest
from ..types.billing import Billing
from ..types.consent import Consent
from ..types.ao_e_answer import AoEAnswer
from ..types.post_order_response import PostOrderResponse
from ..types.order_status import OrderStatus
from .types.lab_tests_get_orders_request_order_key import LabTestsGetOrdersRequestOrderKey
from .types.lab_tests_get_orders_request_order_direction import LabTestsGetOrdersRequestOrderDirection
from ..types.get_orders_response import GetOrdersResponse
from ..core.client_wrapper import AsyncClientWrapper

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


class LabTestsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._client_wrapper = client_wrapper

    def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[ClientFacingLabTest]:
        """
        GET all the lab tests the team has access to.

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

        Returns
        -------
        typing.List[ClientFacingLabTest]
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/lab_tests",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingLabTest],
                    parse_obj_as(
                        type_=typing.List[ClientFacingLabTest],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def create(
        self,
        *,
        name: str,
        method: LabTestCollectionMethod,
        description: str,
        marker_ids: typing.Optional[typing.Sequence[int]] = OMIT,
        provider_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        fasting: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingLabTest:
        """
        Parameters
        ----------
        name : str

        method : LabTestCollectionMethod

        description : str

        marker_ids : typing.Optional[typing.Sequence[int]]

        provider_ids : typing.Optional[typing.Sequence[str]]

        fasting : typing.Optional[bool]

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

        Returns
        -------
        ClientFacingLabTest
            Successful Response

        Examples
        --------
        from vital import LabTestCollectionMethod, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.create(
            name="name",
            method=LabTestCollectionMethod.TESTKIT,
            description="description",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/lab_tests",
            method="POST",
            json={
                "marker_ids": marker_ids,
                "provider_ids": provider_ids,
                "name": name,
                "method": method,
                "description": description,
                "fasting": fasting,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingLabTest,
                    parse_obj_as(
                        type_=ClientFacingLabTest,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_markers(
        self,
        *,
        lab_id: typing.Optional[typing.Union[int, typing.Sequence[int]]] = None,
        name: typing.Optional[str] = None,
        a_la_carte_enabled: typing.Optional[bool] = None,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetMarkersResponse:
        """
        GET all the markers for the given lab.

        Parameters
        ----------
        lab_id : typing.Optional[typing.Union[int, typing.Sequence[int]]]
            The identifier Vital assigned to a lab partner.

        name : typing.Optional[str]
            The name or test code of an individual biomarker or a panel.

        a_la_carte_enabled : typing.Optional[bool]

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetMarkersResponse
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_markers()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/lab_tests/markers",
            method="GET",
            params={
                "lab_id": lab_id,
                "name": name,
                "a_la_carte_enabled": a_la_carte_enabled,
                "page": page,
                "size": size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetMarkersResponse,
                    parse_obj_as(
                        type_=GetMarkersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_markers_for_order_set(
        self,
        *,
        request: OrderSetRequest,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetMarkersResponse:
        """
        Parameters
        ----------
        request : OrderSetRequest

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetMarkersResponse
            Successful Response

        Examples
        --------
        from vital import OrderSetRequest, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_markers_for_order_set(
            request=OrderSetRequest(),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/lab_tests/list_order_set_markers",
            method="POST",
            params={
                "page": page,
                "size": size,
            },
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetMarkersResponse,
                    parse_obj_as(
                        type_=GetMarkersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_markers_for_lab_test(
        self,
        lab_test_id: str,
        *,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetMarkersResponse:
        """
        Parameters
        ----------
        lab_test_id : str

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetMarkersResponse
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_markers_for_lab_test(
            lab_test_id="lab_test_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/lab_tests/{jsonable_encoder(lab_test_id)}/markers",
            method="GET",
            params={
                "page": page,
                "size": size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetMarkersResponse,
                    parse_obj_as(
                        type_=GetMarkersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_markers_by_lab_and_provider_id(
        self, provider_id: str, lab_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingMarker:
        """
        GET a specific marker for the given lab and provider_id

        Parameters
        ----------
        provider_id : str

        lab_id : int

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

        Returns
        -------
        ClientFacingMarker
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_markers_by_lab_and_provider_id(
            provider_id="provider_id",
            lab_id=1,
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/lab_tests/{jsonable_encoder(lab_id)}/markers/{jsonable_encoder(provider_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingMarker,
                    parse_obj_as(
                        type_=ClientFacingMarker,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_labs(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[ClientFacingLab]:
        """
        GET all the labs.

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

        Returns
        -------
        typing.List[ClientFacingLab]
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_labs()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/lab_tests/labs",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingLab],
                    parse_obj_as(
                        type_=typing.List[ClientFacingLab],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_by_id(
        self, lab_test_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingLabTest:
        """
        GET all the lab tests the team has access to.

        Parameters
        ----------
        lab_test_id : str

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

        Returns
        -------
        ClientFacingLabTest
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_by_id(
            lab_test_id="lab_test_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/lab_tests/{jsonable_encoder(lab_test_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingLabTest,
                    parse_obj_as(
                        type_=ClientFacingLabTest,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_phlebotomy_appointment_availability(
        self,
        *,
        request: UsAddress,
        start_date: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppointmentAvailabilitySlots:
        """
        Return the available time slots to book an appointment with a phlebotomist
        for the given address and order.

        Parameters
        ----------
        request : UsAddress

        start_date : typing.Optional[str]
            Start date for appointment availability

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

        Returns
        -------
        AppointmentAvailabilitySlots
            Successful Response

        Examples
        --------
        from vital import UsAddress, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_phlebotomy_appointment_availability(
            request=UsAddress(
                first_line="first_line",
                city="city",
                state="state",
                zip_code="zip_code",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order/phlebotomy/appointment/availability",
            method="POST",
            params={
                "start_date": start_date,
            },
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    AppointmentAvailabilitySlots,
                    parse_obj_as(
                        type_=AppointmentAvailabilitySlots,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def book_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentBookingRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Book an at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentBookingRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import AppointmentBookingRequest, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.book_phlebotomy_appointment(
            order_id="order_id",
            request=AppointmentBookingRequest(
                booking_key="booking_key",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/book",
            method="POST",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def request_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        address: UsAddress,
        provider: AppointmentProvider,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Request an at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        address : UsAddress
            At-home phlebotomy appointment address.

        provider : AppointmentProvider

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import AppointmentProvider, UsAddress, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.request_phlebotomy_appointment(
            order_id="order_id",
            address=UsAddress(
                first_line="first_line",
                city="city",
                state="state",
                zip_code="zip_code",
            ),
            provider=AppointmentProvider.GETLABS,
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/request",
            method="POST",
            json={
                "address": address,
                "provider": provider,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def reschedule_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentRescheduleRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Reschedule a previously booked at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentRescheduleRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import AppointmentRescheduleRequest, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.reschedule_phlebotomy_appointment(
            order_id="order_id",
            request=AppointmentRescheduleRequest(
                booking_key="booking_key",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/reschedule",
            method="PATCH",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def cancel_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        cancellation_reason_id: str,
        notes: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Cancel a previously booked at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        cancellation_reason_id : str

        notes : typing.Optional[str]

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.cancel_phlebotomy_appointment(
            order_id="order_id",
            cancellation_reason_id="cancellation_reason_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/cancel",
            method="PATCH",
            json={
                "cancellation_reason_id": cancellation_reason_id,
                "notes": notes,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_phlebotomy_appointment_cancellation_reason(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ClientFacingAppointmentCancellationReason]:
        """
        Get the list of reasons for cancelling an at-home phlebotomy appointment.

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

        Returns
        -------
        typing.List[ClientFacingAppointmentCancellationReason]
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_phlebotomy_appointment_cancellation_reason()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order/phlebotomy/appointment/cancellation-reasons",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingAppointmentCancellationReason],
                    parse_obj_as(
                        type_=typing.List[ClientFacingAppointmentCancellationReason],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_phlebotomy_appointment(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingAppointment:
        """
        Get the appointment associated with an order.

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_phlebotomy_appointment(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_area_info(
        self,
        *,
        zip_code: str,
        radius: typing.Optional[AllowedRadius] = None,
        lab: typing.Optional[ClientFacingLabs] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AreaInfo:
        """
        GET information about an area with respect to lab-testing.

        Information returned:

        - Whether a given zip code is served by our Phlebotomy network.
        - List of Lab locations in the area.

        Parameters
        ----------
        zip_code : str
            Zip code of the area to check

        radius : typing.Optional[AllowedRadius]
            Radius in which to search in miles

        lab : typing.Optional[ClientFacingLabs]
            Lab to check for PSCs

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

        Returns
        -------
        AreaInfo
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_area_info(
            zip_code="zip_code",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order/area/info",
            method="GET",
            params={
                "zip_code": zip_code,
                "radius": radius,
                "lab": lab,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    AreaInfo,
                    parse_obj_as(
                        type_=AreaInfo,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_psc_info(
        self,
        *,
        zip_code: str,
        lab_id: int,
        radius: typing.Optional[AllowedRadius] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PscInfo:
        """
        Parameters
        ----------
        zip_code : str
            Zip code of the area to check

        lab_id : int
            Lab ID to check for PSCs

        radius : typing.Optional[AllowedRadius]
            Radius in which to search. (meters)

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

        Returns
        -------
        PscInfo
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_psc_info(
            zip_code="zip_code",
            lab_id=1,
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order/psc/info",
            method="GET",
            params={
                "zip_code": zip_code,
                "lab_id": lab_id,
                "radius": radius,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PscInfo,
                    parse_obj_as(
                        type_=PscInfo,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_order_psc_info(
        self,
        order_id: str,
        *,
        radius: typing.Optional[AllowedRadius] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PscInfo:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        radius : typing.Optional[AllowedRadius]
            Radius in which to search in miles

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

        Returns
        -------
        PscInfo
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_order_psc_info(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/info",
            method="GET",
            params={
                "radius": radius,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PscInfo,
                    parse_obj_as(
                        type_=PscInfo,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_result_pdf(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Iterator[bytes]:
        """
        This endpoint returns the lab results for the order.

        Parameters
        ----------
        order_id : str

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

        Yields
        ------
        typing.Iterator[bytes]
            PDF with results

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_result_pdf(
            order_id="string",
        )
        """
        with self._client_wrapper.httpx_client.stream(
            f"v3/order/{jsonable_encoder(order_id)}/result/pdf",
            method="GET",
            request_options=request_options,
        ) as _response:
            try:
                if 200 <= _response.status_code < 300:
                    for _chunk in _response.iter_bytes():
                        yield _chunk
                    return
                _response.read()
                if _response.status_code == 422:
                    raise UnprocessableEntityError(
                        typing.cast(
                            HttpValidationError,
                            parse_obj_as(
                                type_=HttpValidationError,  # type: ignore
                                object_=_response.json(),
                            ),
                        )
                    )
                _response_json = _response.json()
            except JSONDecodeError:
                raise ApiError(status_code=_response.status_code, body=_response.text)
            raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_result_metadata(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LabResultsMetadata:
        """
        Return metadata related to order results, such as lab metadata,
        provider and sample dates.

        Parameters
        ----------
        order_id : str

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

        Returns
        -------
        LabResultsMetadata
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_result_metadata(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/result/metadata",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    LabResultsMetadata,
                    parse_obj_as(
                        type_=LabResultsMetadata,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_result_raw(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LabResultsRaw:
        """
        Return both metadata and raw json test data

        Parameters
        ----------
        order_id : str

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

        Returns
        -------
        LabResultsRaw
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_result_raw(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/result",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    LabResultsRaw,
                    parse_obj_as(
                        type_=LabResultsRaw,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_labels_pdf(
        self,
        order_id: str,
        *,
        collection_date: dt.datetime,
        number_of_labels: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Iterator[bytes]:
        """
        This endpoint returns the printed labels for the order.

        Parameters
        ----------
        order_id : str

        collection_date : dt.datetime
            Collection date

        number_of_labels : typing.Optional[int]
            Number of labels to generate

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

        Yields
        ------
        typing.Iterator[bytes]
            PDF with labels

        Examples
        --------
        import datetime

        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_labels_pdf(
            order_id="string",
            number_of_labels=1,
            collection_date=datetime.datetime.fromisoformat(
                "2024-01-15 09:30:00+00:00",
            ),
        )
        """
        with self._client_wrapper.httpx_client.stream(
            f"v3/order/{jsonable_encoder(order_id)}/labels/pdf",
            method="GET",
            params={
                "number_of_labels": number_of_labels,
                "collection_date": serialize_datetime(collection_date),
            },
            request_options=request_options,
        ) as _response:
            try:
                if 200 <= _response.status_code < 300:
                    for _chunk in _response.iter_bytes():
                        yield _chunk
                    return
                _response.read()
                if _response.status_code == 422:
                    raise UnprocessableEntityError(
                        typing.cast(
                            HttpValidationError,
                            parse_obj_as(
                                type_=HttpValidationError,  # type: ignore
                                object_=_response.json(),
                            ),
                        )
                    )
                _response_json = _response.json()
            except JSONDecodeError:
                raise ApiError(status_code=_response.status_code, body=_response.text)
            raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_psc_appointment_availability(
        self,
        *,
        start_date: typing.Optional[str] = None,
        site_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        zip_code: typing.Optional[str] = None,
        radius: typing.Optional[AllowedRadius] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppointmentAvailabilitySlots:
        """
        Parameters
        ----------
        start_date : typing.Optional[str]
            Start date for appointment availability

        site_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            List of site codes to fetch availability for

        zip_code : typing.Optional[str]
            Zip code of the area to check

        radius : typing.Optional[AllowedRadius]
            Radius in which to search. (meters)

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

        Returns
        -------
        AppointmentAvailabilitySlots
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_psc_appointment_availability()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order/psc/appointment/availability",
            method="POST",
            params={
                "lab": "quest",
                "start_date": start_date,
                "site_codes": site_codes,
                "zip_code": zip_code,
                "radius": radius,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    AppointmentAvailabilitySlots,
                    parse_obj_as(
                        type_=AppointmentAvailabilitySlots,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def book_psc_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentBookingRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentBookingRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import AppointmentBookingRequest, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.book_psc_appointment(
            order_id="order_id",
            request=AppointmentBookingRequest(
                booking_key="booking_key",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment/book",
            method="POST",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def reschedule_psc_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentRescheduleRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentRescheduleRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import AppointmentRescheduleRequest, Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.reschedule_psc_appointment(
            order_id="order_id",
            request=AppointmentRescheduleRequest(
                booking_key="booking_key",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment/reschedule",
            method="PATCH",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def cancel_psc_appointment(
        self,
        order_id: str,
        *,
        cancellation_reason_id: str,
        note: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        cancellation_reason_id : str

        note : typing.Optional[str]

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.cancel_psc_appointment(
            order_id="order_id",
            cancellation_reason_id="cancellationReasonId",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment/cancel",
            method="PATCH",
            json={
                "cancellationReasonId": cancellation_reason_id,
                "note": note,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_psc_appointment_cancellation_reason(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ClientFacingAppointmentCancellationReason]:
        """
        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[ClientFacingAppointmentCancellationReason]
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_psc_appointment_cancellation_reason()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order/psc/appointment/cancellation-reasons",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingAppointmentCancellationReason],
                    parse_obj_as(
                        type_=typing.List[ClientFacingAppointmentCancellationReason],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_psc_appointment(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingAppointment:
        """
        Get the appointment associated with an order.

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_psc_appointment(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_order_requistion_pdf(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.Iterator[bytes]:
        """
        GET requisition pdf for an order

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Yields
        ------
        typing.Iterator[bytes]
            PDF with requisition form

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_order_requistion_pdf(
            order_id="string",
        )
        """
        with self._client_wrapper.httpx_client.stream(
            f"v3/order/{jsonable_encoder(order_id)}/requisition/pdf",
            method="GET",
            request_options=request_options,
        ) as _response:
            try:
                if 200 <= _response.status_code < 300:
                    for _chunk in _response.iter_bytes():
                        yield _chunk
                    return
                _response.read()
                if _response.status_code == 422:
                    raise UnprocessableEntityError(
                        typing.cast(
                            HttpValidationError,
                            parse_obj_as(
                                type_=HttpValidationError,  # type: ignore
                                object_=_response.json(),
                            ),
                        )
                    )
                _response_json = _response.json()
            except JSONDecodeError:
                raise ApiError(status_code=_response.status_code, body=_response.text)
            raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_order(self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ClientFacingOrder:
        """
        GET individual order by ID.

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        ClientFacingOrder
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_order(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingOrder,
                    parse_obj_as(
                        type_=ClientFacingOrder,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def create_order(
        self,
        *,
        user_id: str,
        patient_details: PatientDetailsWithValidation,
        patient_address: PatientAddressWithValidation,
        lab_test_id: typing.Optional[str] = OMIT,
        order_set: typing.Optional[OrderSetRequest] = OMIT,
        collection_method: typing.Optional[LabTestCollectionMethod] = OMIT,
        physician: typing.Optional[PhysicianCreateRequest] = OMIT,
        health_insurance: typing.Optional[HealthInsuranceCreateRequest] = OMIT,
        priority: typing.Optional[bool] = OMIT,
        billing_type: typing.Optional[Billing] = OMIT,
        icd_codes: typing.Optional[typing.Sequence[str]] = OMIT,
        consents: typing.Optional[typing.Sequence[Consent]] = OMIT,
        activate_by: typing.Optional[str] = OMIT,
        aoe_answers: typing.Optional[typing.Sequence[AoEAnswer]] = OMIT,
        passthrough: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PostOrderResponse:
        """
        POST create new order

        Parameters
        ----------
        user_id : str

        patient_details : PatientDetailsWithValidation

        patient_address : PatientAddressWithValidation

        lab_test_id : typing.Optional[str]

        order_set : typing.Optional[OrderSetRequest]

        collection_method : typing.Optional[LabTestCollectionMethod]

        physician : typing.Optional[PhysicianCreateRequest]

        health_insurance : typing.Optional[HealthInsuranceCreateRequest]

        priority : typing.Optional[bool]
            Defines whether order is priority or not. For some labs, this refers to a STAT order.

        billing_type : typing.Optional[Billing]

        icd_codes : typing.Optional[typing.Sequence[str]]

        consents : typing.Optional[typing.Sequence[Consent]]

        activate_by : typing.Optional[str]
            Schedule an Order to be processed in a future date.

        aoe_answers : typing.Optional[typing.Sequence[AoEAnswer]]

        passthrough : typing.Optional[str]

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

        Returns
        -------
        PostOrderResponse
            Successful Response

        Examples
        --------
        import datetime

        from vital import (
            Gender,
            PatientAddressWithValidation,
            PatientDetailsWithValidation,
            Vital,
        )

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.create_order(
            user_id="user_id",
            patient_details=PatientDetailsWithValidation(
                first_name="first_name",
                last_name="last_name",
                dob=datetime.datetime.fromisoformat(
                    "2024-01-15 09:30:00+00:00",
                ),
                gender=Gender.FEMALE,
                phone_number="phone_number",
                email="email",
            ),
            patient_address=PatientAddressWithValidation(
                first_line="first_line",
                city="city",
                state="state",
                zip="zip",
                country="country",
            ),
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/order",
            method="POST",
            json={
                "user_id": user_id,
                "lab_test_id": lab_test_id,
                "order_set": order_set,
                "collection_method": collection_method,
                "physician": physician,
                "health_insurance": health_insurance,
                "priority": priority,
                "billing_type": billing_type,
                "icd_codes": icd_codes,
                "consents": consents,
                "activate_by": activate_by,
                "aoe_answers": aoe_answers,
                "passthrough": passthrough,
                "patient_details": patient_details,
                "patient_address": patient_address,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PostOrderResponse,
                    parse_obj_as(
                        type_=PostOrderResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def cancel_order(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> PostOrderResponse:
        """
        POST cancel order

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        PostOrderResponse
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.cancel_order(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/cancel",
            method="POST",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PostOrderResponse,
                    parse_obj_as(
                        type_=PostOrderResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def simulate_order_process(
        self,
        order_id: str,
        *,
        final_status: typing.Optional[OrderStatus] = None,
        delay: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Get available test kits.

        Parameters
        ----------
        order_id : str

        final_status : typing.Optional[OrderStatus]

        delay : typing.Optional[int]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.simulate_order_process(
            order_id="order_id",
        )
        """
        _response = self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/test",
            method="POST",
            params={
                "final_status": final_status,
                "delay": delay,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.Optional[typing.Any],
                    parse_obj_as(
                        type_=typing.Optional[typing.Any],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    def get_orders(
        self,
        *,
        search_input: typing.Optional[str] = None,
        start_date: typing.Optional[dt.datetime] = None,
        end_date: typing.Optional[dt.datetime] = None,
        updated_start_date: typing.Optional[dt.datetime] = None,
        updated_end_date: typing.Optional[dt.datetime] = None,
        order_key: typing.Optional[LabTestsGetOrdersRequestOrderKey] = None,
        order_direction: typing.Optional[LabTestsGetOrdersRequestOrderDirection] = None,
        user_id: typing.Optional[str] = None,
        patient_name: typing.Optional[str] = None,
        shipping_recipient_name: typing.Optional[str] = None,
        order_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetOrdersResponse:
        """
        GET many orders with filters.

        Parameters
        ----------
        search_input : typing.Optional[str]
            Search by order id, user id, patient name, shipping dob, or shipping recipient name.

        start_date : typing.Optional[dt.datetime]
            Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00

        end_date : typing.Optional[dt.datetime]
            Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 23:59:59

        updated_start_date : typing.Optional[dt.datetime]
            Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00

        updated_end_date : typing.Optional[dt.datetime]
            Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00

        order_key : typing.Optional[LabTestsGetOrdersRequestOrderKey]

        order_direction : typing.Optional[LabTestsGetOrdersRequestOrderDirection]

        user_id : typing.Optional[str]
            Filter by user ID.

        patient_name : typing.Optional[str]
            Filter by patient name.

        shipping_recipient_name : typing.Optional[str]
            Filter by shipping recipient name.

        order_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter by order ids.

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetOrdersResponse
            Successful Response

        Examples
        --------
        from vital import Vital

        client = Vital(
            api_key="YOUR_API_KEY",
        )
        client.lab_tests.get_orders()
        """
        _response = self._client_wrapper.httpx_client.request(
            "v3/orders",
            method="GET",
            params={
                "search_input": search_input,
                "start_date": serialize_datetime(start_date) if start_date is not None else None,
                "end_date": serialize_datetime(end_date) if end_date is not None else None,
                "updated_start_date": serialize_datetime(updated_start_date)
                if updated_start_date is not None
                else None,
                "updated_end_date": serialize_datetime(updated_end_date) if updated_end_date is not None else None,
                "order_key": order_key,
                "order_direction": order_direction,
                "user_id": user_id,
                "patient_name": patient_name,
                "shipping_recipient_name": shipping_recipient_name,
                "order_ids": order_ids,
                "page": page,
                "size": size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetOrdersResponse,
                    parse_obj_as(
                        type_=GetOrdersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)


class AsyncLabTestsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._client_wrapper = client_wrapper

    async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[ClientFacingLabTest]:
        """
        GET all the lab tests the team has access to.

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

        Returns
        -------
        typing.List[ClientFacingLabTest]
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/lab_tests",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingLabTest],
                    parse_obj_as(
                        type_=typing.List[ClientFacingLabTest],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def create(
        self,
        *,
        name: str,
        method: LabTestCollectionMethod,
        description: str,
        marker_ids: typing.Optional[typing.Sequence[int]] = OMIT,
        provider_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        fasting: typing.Optional[bool] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingLabTest:
        """
        Parameters
        ----------
        name : str

        method : LabTestCollectionMethod

        description : str

        marker_ids : typing.Optional[typing.Sequence[int]]

        provider_ids : typing.Optional[typing.Sequence[str]]

        fasting : typing.Optional[bool]

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

        Returns
        -------
        ClientFacingLabTest
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital, LabTestCollectionMethod

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.create(
                name="name",
                method=LabTestCollectionMethod.TESTKIT,
                description="description",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/lab_tests",
            method="POST",
            json={
                "marker_ids": marker_ids,
                "provider_ids": provider_ids,
                "name": name,
                "method": method,
                "description": description,
                "fasting": fasting,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingLabTest,
                    parse_obj_as(
                        type_=ClientFacingLabTest,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_markers(
        self,
        *,
        lab_id: typing.Optional[typing.Union[int, typing.Sequence[int]]] = None,
        name: typing.Optional[str] = None,
        a_la_carte_enabled: typing.Optional[bool] = None,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetMarkersResponse:
        """
        GET all the markers for the given lab.

        Parameters
        ----------
        lab_id : typing.Optional[typing.Union[int, typing.Sequence[int]]]
            The identifier Vital assigned to a lab partner.

        name : typing.Optional[str]
            The name or test code of an individual biomarker or a panel.

        a_la_carte_enabled : typing.Optional[bool]

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetMarkersResponse
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_markers()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/lab_tests/markers",
            method="GET",
            params={
                "lab_id": lab_id,
                "name": name,
                "a_la_carte_enabled": a_la_carte_enabled,
                "page": page,
                "size": size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetMarkersResponse,
                    parse_obj_as(
                        type_=GetMarkersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_markers_for_order_set(
        self,
        *,
        request: OrderSetRequest,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetMarkersResponse:
        """
        Parameters
        ----------
        request : OrderSetRequest

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetMarkersResponse
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital, OrderSetRequest

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_markers_for_order_set(
                request=OrderSetRequest(),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/lab_tests/list_order_set_markers",
            method="POST",
            params={
                "page": page,
                "size": size,
            },
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetMarkersResponse,
                    parse_obj_as(
                        type_=GetMarkersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_markers_for_lab_test(
        self,
        lab_test_id: str,
        *,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetMarkersResponse:
        """
        Parameters
        ----------
        lab_test_id : str

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetMarkersResponse
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_markers_for_lab_test(
                lab_test_id="lab_test_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/lab_tests/{jsonable_encoder(lab_test_id)}/markers",
            method="GET",
            params={
                "page": page,
                "size": size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetMarkersResponse,
                    parse_obj_as(
                        type_=GetMarkersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_markers_by_lab_and_provider_id(
        self, provider_id: str, lab_id: int, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingMarker:
        """
        GET a specific marker for the given lab and provider_id

        Parameters
        ----------
        provider_id : str

        lab_id : int

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

        Returns
        -------
        ClientFacingMarker
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_markers_by_lab_and_provider_id(
                provider_id="provider_id",
                lab_id=1,
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/lab_tests/{jsonable_encoder(lab_id)}/markers/{jsonable_encoder(provider_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingMarker,
                    parse_obj_as(
                        type_=ClientFacingMarker,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_labs(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ClientFacingLab]:
        """
        GET all the labs.

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

        Returns
        -------
        typing.List[ClientFacingLab]
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_labs()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/lab_tests/labs",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingLab],
                    parse_obj_as(
                        type_=typing.List[ClientFacingLab],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_by_id(
        self, lab_test_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingLabTest:
        """
        GET all the lab tests the team has access to.

        Parameters
        ----------
        lab_test_id : str

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

        Returns
        -------
        ClientFacingLabTest
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_by_id(
                lab_test_id="lab_test_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/lab_tests/{jsonable_encoder(lab_test_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingLabTest,
                    parse_obj_as(
                        type_=ClientFacingLabTest,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_phlebotomy_appointment_availability(
        self,
        *,
        request: UsAddress,
        start_date: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppointmentAvailabilitySlots:
        """
        Return the available time slots to book an appointment with a phlebotomist
        for the given address and order.

        Parameters
        ----------
        request : UsAddress

        start_date : typing.Optional[str]
            Start date for appointment availability

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

        Returns
        -------
        AppointmentAvailabilitySlots
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital, UsAddress

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_phlebotomy_appointment_availability(
                request=UsAddress(
                    first_line="first_line",
                    city="city",
                    state="state",
                    zip_code="zip_code",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order/phlebotomy/appointment/availability",
            method="POST",
            params={
                "start_date": start_date,
            },
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    AppointmentAvailabilitySlots,
                    parse_obj_as(
                        type_=AppointmentAvailabilitySlots,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def book_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentBookingRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Book an at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentBookingRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AppointmentBookingRequest, AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.book_phlebotomy_appointment(
                order_id="order_id",
                request=AppointmentBookingRequest(
                    booking_key="booking_key",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/book",
            method="POST",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def request_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        address: UsAddress,
        provider: AppointmentProvider,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Request an at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        address : UsAddress
            At-home phlebotomy appointment address.

        provider : AppointmentProvider

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AppointmentProvider, AsyncVital, UsAddress

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.request_phlebotomy_appointment(
                order_id="order_id",
                address=UsAddress(
                    first_line="first_line",
                    city="city",
                    state="state",
                    zip_code="zip_code",
                ),
                provider=AppointmentProvider.GETLABS,
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/request",
            method="POST",
            json={
                "address": address,
                "provider": provider,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def reschedule_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentRescheduleRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Reschedule a previously booked at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentRescheduleRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AppointmentRescheduleRequest, AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.reschedule_phlebotomy_appointment(
                order_id="order_id",
                request=AppointmentRescheduleRequest(
                    booking_key="booking_key",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/reschedule",
            method="PATCH",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def cancel_phlebotomy_appointment(
        self,
        order_id: str,
        *,
        cancellation_reason_id: str,
        notes: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Cancel a previously booked at-home phlebotomy appointment.

        Parameters
        ----------
        order_id : str
            Your Order ID.

        cancellation_reason_id : str

        notes : typing.Optional[str]

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.cancel_phlebotomy_appointment(
                order_id="order_id",
                cancellation_reason_id="cancellation_reason_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment/cancel",
            method="PATCH",
            json={
                "cancellation_reason_id": cancellation_reason_id,
                "notes": notes,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_phlebotomy_appointment_cancellation_reason(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ClientFacingAppointmentCancellationReason]:
        """
        Get the list of reasons for cancelling an at-home phlebotomy appointment.

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

        Returns
        -------
        typing.List[ClientFacingAppointmentCancellationReason]
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_phlebotomy_appointment_cancellation_reason()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order/phlebotomy/appointment/cancellation-reasons",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingAppointmentCancellationReason],
                    parse_obj_as(
                        type_=typing.List[ClientFacingAppointmentCancellationReason],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_phlebotomy_appointment(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingAppointment:
        """
        Get the appointment associated with an order.

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_phlebotomy_appointment(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/phlebotomy/appointment",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_area_info(
        self,
        *,
        zip_code: str,
        radius: typing.Optional[AllowedRadius] = None,
        lab: typing.Optional[ClientFacingLabs] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AreaInfo:
        """
        GET information about an area with respect to lab-testing.

        Information returned:

        - Whether a given zip code is served by our Phlebotomy network.
        - List of Lab locations in the area.

        Parameters
        ----------
        zip_code : str
            Zip code of the area to check

        radius : typing.Optional[AllowedRadius]
            Radius in which to search in miles

        lab : typing.Optional[ClientFacingLabs]
            Lab to check for PSCs

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

        Returns
        -------
        AreaInfo
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_area_info(
                zip_code="zip_code",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order/area/info",
            method="GET",
            params={
                "zip_code": zip_code,
                "radius": radius,
                "lab": lab,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    AreaInfo,
                    parse_obj_as(
                        type_=AreaInfo,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_psc_info(
        self,
        *,
        zip_code: str,
        lab_id: int,
        radius: typing.Optional[AllowedRadius] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PscInfo:
        """
        Parameters
        ----------
        zip_code : str
            Zip code of the area to check

        lab_id : int
            Lab ID to check for PSCs

        radius : typing.Optional[AllowedRadius]
            Radius in which to search. (meters)

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

        Returns
        -------
        PscInfo
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_psc_info(
                zip_code="zip_code",
                lab_id=1,
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order/psc/info",
            method="GET",
            params={
                "zip_code": zip_code,
                "lab_id": lab_id,
                "radius": radius,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PscInfo,
                    parse_obj_as(
                        type_=PscInfo,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_order_psc_info(
        self,
        order_id: str,
        *,
        radius: typing.Optional[AllowedRadius] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PscInfo:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        radius : typing.Optional[AllowedRadius]
            Radius in which to search in miles

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

        Returns
        -------
        PscInfo
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_order_psc_info(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/info",
            method="GET",
            params={
                "radius": radius,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PscInfo,
                    parse_obj_as(
                        type_=PscInfo,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_result_pdf(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.AsyncIterator[bytes]:
        """
        This endpoint returns the lab results for the order.

        Parameters
        ----------
        order_id : str

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

        Yields
        ------
        typing.AsyncIterator[bytes]
            PDF with results

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_result_pdf(
                order_id="string",
            )


        asyncio.run(main())
        """
        async with self._client_wrapper.httpx_client.stream(
            f"v3/order/{jsonable_encoder(order_id)}/result/pdf",
            method="GET",
            request_options=request_options,
        ) as _response:
            try:
                if 200 <= _response.status_code < 300:
                    async for _chunk in _response.aiter_bytes():
                        yield _chunk
                    return
                await _response.aread()
                if _response.status_code == 422:
                    raise UnprocessableEntityError(
                        typing.cast(
                            HttpValidationError,
                            parse_obj_as(
                                type_=HttpValidationError,  # type: ignore
                                object_=_response.json(),
                            ),
                        )
                    )
                _response_json = _response.json()
            except JSONDecodeError:
                raise ApiError(status_code=_response.status_code, body=_response.text)
            raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_result_metadata(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LabResultsMetadata:
        """
        Return metadata related to order results, such as lab metadata,
        provider and sample dates.

        Parameters
        ----------
        order_id : str

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

        Returns
        -------
        LabResultsMetadata
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_result_metadata(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/result/metadata",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    LabResultsMetadata,
                    parse_obj_as(
                        type_=LabResultsMetadata,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_result_raw(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> LabResultsRaw:
        """
        Return both metadata and raw json test data

        Parameters
        ----------
        order_id : str

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

        Returns
        -------
        LabResultsRaw
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_result_raw(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/result",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    LabResultsRaw,
                    parse_obj_as(
                        type_=LabResultsRaw,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_labels_pdf(
        self,
        order_id: str,
        *,
        collection_date: dt.datetime,
        number_of_labels: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.AsyncIterator[bytes]:
        """
        This endpoint returns the printed labels for the order.

        Parameters
        ----------
        order_id : str

        collection_date : dt.datetime
            Collection date

        number_of_labels : typing.Optional[int]
            Number of labels to generate

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

        Yields
        ------
        typing.AsyncIterator[bytes]
            PDF with labels

        Examples
        --------
        import asyncio
        import datetime

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_labels_pdf(
                order_id="string",
                number_of_labels=1,
                collection_date=datetime.datetime.fromisoformat(
                    "2024-01-15 09:30:00+00:00",
                ),
            )


        asyncio.run(main())
        """
        async with self._client_wrapper.httpx_client.stream(
            f"v3/order/{jsonable_encoder(order_id)}/labels/pdf",
            method="GET",
            params={
                "number_of_labels": number_of_labels,
                "collection_date": serialize_datetime(collection_date),
            },
            request_options=request_options,
        ) as _response:
            try:
                if 200 <= _response.status_code < 300:
                    async for _chunk in _response.aiter_bytes():
                        yield _chunk
                    return
                await _response.aread()
                if _response.status_code == 422:
                    raise UnprocessableEntityError(
                        typing.cast(
                            HttpValidationError,
                            parse_obj_as(
                                type_=HttpValidationError,  # type: ignore
                                object_=_response.json(),
                            ),
                        )
                    )
                _response_json = _response.json()
            except JSONDecodeError:
                raise ApiError(status_code=_response.status_code, body=_response.text)
            raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_psc_appointment_availability(
        self,
        *,
        start_date: typing.Optional[str] = None,
        site_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        zip_code: typing.Optional[str] = None,
        radius: typing.Optional[AllowedRadius] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppointmentAvailabilitySlots:
        """
        Parameters
        ----------
        start_date : typing.Optional[str]
            Start date for appointment availability

        site_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            List of site codes to fetch availability for

        zip_code : typing.Optional[str]
            Zip code of the area to check

        radius : typing.Optional[AllowedRadius]
            Radius in which to search. (meters)

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

        Returns
        -------
        AppointmentAvailabilitySlots
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_psc_appointment_availability()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order/psc/appointment/availability",
            method="POST",
            params={
                "lab": "quest",
                "start_date": start_date,
                "site_codes": site_codes,
                "zip_code": zip_code,
                "radius": radius,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    AppointmentAvailabilitySlots,
                    parse_obj_as(
                        type_=AppointmentAvailabilitySlots,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def book_psc_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentBookingRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentBookingRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AppointmentBookingRequest, AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.book_psc_appointment(
                order_id="order_id",
                request=AppointmentBookingRequest(
                    booking_key="booking_key",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment/book",
            method="POST",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def reschedule_psc_appointment(
        self,
        order_id: str,
        *,
        request: AppointmentRescheduleRequest,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        request : AppointmentRescheduleRequest

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AppointmentRescheduleRequest, AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.reschedule_psc_appointment(
                order_id="order_id",
                request=AppointmentRescheduleRequest(
                    booking_key="booking_key",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment/reschedule",
            method="PATCH",
            json=request,
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def cancel_psc_appointment(
        self,
        order_id: str,
        *,
        cancellation_reason_id: str,
        note: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ClientFacingAppointment:
        """
        Parameters
        ----------
        order_id : str
            Your Order ID.

        cancellation_reason_id : str

        note : typing.Optional[str]

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.cancel_psc_appointment(
                order_id="order_id",
                cancellation_reason_id="cancellationReasonId",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment/cancel",
            method="PATCH",
            json={
                "cancellationReasonId": cancellation_reason_id,
                "note": note,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_psc_appointment_cancellation_reason(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.List[ClientFacingAppointmentCancellationReason]:
        """
        Parameters
        ----------
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[ClientFacingAppointmentCancellationReason]
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_psc_appointment_cancellation_reason()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order/psc/appointment/cancellation-reasons",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.List[ClientFacingAppointmentCancellationReason],
                    parse_obj_as(
                        type_=typing.List[ClientFacingAppointmentCancellationReason],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_psc_appointment(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingAppointment:
        """
        Get the appointment associated with an order.

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        ClientFacingAppointment
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_psc_appointment(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/psc/appointment",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingAppointment,
                    parse_obj_as(
                        type_=ClientFacingAppointment,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_order_requistion_pdf(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> typing.AsyncIterator[bytes]:
        """
        GET requisition pdf for an order

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Yields
        ------
        typing.AsyncIterator[bytes]
            PDF with requisition form

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_order_requistion_pdf(
                order_id="string",
            )


        asyncio.run(main())
        """
        async with self._client_wrapper.httpx_client.stream(
            f"v3/order/{jsonable_encoder(order_id)}/requisition/pdf",
            method="GET",
            request_options=request_options,
        ) as _response:
            try:
                if 200 <= _response.status_code < 300:
                    async for _chunk in _response.aiter_bytes():
                        yield _chunk
                    return
                await _response.aread()
                if _response.status_code == 422:
                    raise UnprocessableEntityError(
                        typing.cast(
                            HttpValidationError,
                            parse_obj_as(
                                type_=HttpValidationError,  # type: ignore
                                object_=_response.json(),
                            ),
                        )
                    )
                _response_json = _response.json()
            except JSONDecodeError:
                raise ApiError(status_code=_response.status_code, body=_response.text)
            raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_order(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> ClientFacingOrder:
        """
        GET individual order by ID.

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        ClientFacingOrder
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_order(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}",
            method="GET",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    ClientFacingOrder,
                    parse_obj_as(
                        type_=ClientFacingOrder,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def create_order(
        self,
        *,
        user_id: str,
        patient_details: PatientDetailsWithValidation,
        patient_address: PatientAddressWithValidation,
        lab_test_id: typing.Optional[str] = OMIT,
        order_set: typing.Optional[OrderSetRequest] = OMIT,
        collection_method: typing.Optional[LabTestCollectionMethod] = OMIT,
        physician: typing.Optional[PhysicianCreateRequest] = OMIT,
        health_insurance: typing.Optional[HealthInsuranceCreateRequest] = OMIT,
        priority: typing.Optional[bool] = OMIT,
        billing_type: typing.Optional[Billing] = OMIT,
        icd_codes: typing.Optional[typing.Sequence[str]] = OMIT,
        consents: typing.Optional[typing.Sequence[Consent]] = OMIT,
        activate_by: typing.Optional[str] = OMIT,
        aoe_answers: typing.Optional[typing.Sequence[AoEAnswer]] = OMIT,
        passthrough: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> PostOrderResponse:
        """
        POST create new order

        Parameters
        ----------
        user_id : str

        patient_details : PatientDetailsWithValidation

        patient_address : PatientAddressWithValidation

        lab_test_id : typing.Optional[str]

        order_set : typing.Optional[OrderSetRequest]

        collection_method : typing.Optional[LabTestCollectionMethod]

        physician : typing.Optional[PhysicianCreateRequest]

        health_insurance : typing.Optional[HealthInsuranceCreateRequest]

        priority : typing.Optional[bool]
            Defines whether order is priority or not. For some labs, this refers to a STAT order.

        billing_type : typing.Optional[Billing]

        icd_codes : typing.Optional[typing.Sequence[str]]

        consents : typing.Optional[typing.Sequence[Consent]]

        activate_by : typing.Optional[str]
            Schedule an Order to be processed in a future date.

        aoe_answers : typing.Optional[typing.Sequence[AoEAnswer]]

        passthrough : typing.Optional[str]

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

        Returns
        -------
        PostOrderResponse
            Successful Response

        Examples
        --------
        import asyncio
        import datetime

        from vital import (
            AsyncVital,
            Gender,
            PatientAddressWithValidation,
            PatientDetailsWithValidation,
        )

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.create_order(
                user_id="user_id",
                patient_details=PatientDetailsWithValidation(
                    first_name="first_name",
                    last_name="last_name",
                    dob=datetime.datetime.fromisoformat(
                        "2024-01-15 09:30:00+00:00",
                    ),
                    gender=Gender.FEMALE,
                    phone_number="phone_number",
                    email="email",
                ),
                patient_address=PatientAddressWithValidation(
                    first_line="first_line",
                    city="city",
                    state="state",
                    zip="zip",
                    country="country",
                ),
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/order",
            method="POST",
            json={
                "user_id": user_id,
                "lab_test_id": lab_test_id,
                "order_set": order_set,
                "collection_method": collection_method,
                "physician": physician,
                "health_insurance": health_insurance,
                "priority": priority,
                "billing_type": billing_type,
                "icd_codes": icd_codes,
                "consents": consents,
                "activate_by": activate_by,
                "aoe_answers": aoe_answers,
                "passthrough": passthrough,
                "patient_details": patient_details,
                "patient_address": patient_address,
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PostOrderResponse,
                    parse_obj_as(
                        type_=PostOrderResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def cancel_order(
        self, order_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> PostOrderResponse:
        """
        POST cancel order

        Parameters
        ----------
        order_id : str
            Your Order ID.

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

        Returns
        -------
        PostOrderResponse
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.cancel_order(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/cancel",
            method="POST",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    PostOrderResponse,
                    parse_obj_as(
                        type_=PostOrderResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def simulate_order_process(
        self,
        order_id: str,
        *,
        final_status: typing.Optional[OrderStatus] = None,
        delay: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Get available test kits.

        Parameters
        ----------
        order_id : str

        final_status : typing.Optional[OrderStatus]

        delay : typing.Optional[int]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.simulate_order_process(
                order_id="order_id",
            )


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            f"v3/order/{jsonable_encoder(order_id)}/test",
            method="POST",
            params={
                "final_status": final_status,
                "delay": delay,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    typing.Optional[typing.Any],
                    parse_obj_as(
                        type_=typing.Optional[typing.Any],  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)

    async def get_orders(
        self,
        *,
        search_input: typing.Optional[str] = None,
        start_date: typing.Optional[dt.datetime] = None,
        end_date: typing.Optional[dt.datetime] = None,
        updated_start_date: typing.Optional[dt.datetime] = None,
        updated_end_date: typing.Optional[dt.datetime] = None,
        order_key: typing.Optional[LabTestsGetOrdersRequestOrderKey] = None,
        order_direction: typing.Optional[LabTestsGetOrdersRequestOrderDirection] = None,
        user_id: typing.Optional[str] = None,
        patient_name: typing.Optional[str] = None,
        shipping_recipient_name: typing.Optional[str] = None,
        order_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        page: typing.Optional[int] = None,
        size: typing.Optional[int] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GetOrdersResponse:
        """
        GET many orders with filters.

        Parameters
        ----------
        search_input : typing.Optional[str]
            Search by order id, user id, patient name, shipping dob, or shipping recipient name.

        start_date : typing.Optional[dt.datetime]
            Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00

        end_date : typing.Optional[dt.datetime]
            Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 23:59:59

        updated_start_date : typing.Optional[dt.datetime]
            Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00

        updated_end_date : typing.Optional[dt.datetime]
            Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00

        order_key : typing.Optional[LabTestsGetOrdersRequestOrderKey]

        order_direction : typing.Optional[LabTestsGetOrdersRequestOrderDirection]

        user_id : typing.Optional[str]
            Filter by user ID.

        patient_name : typing.Optional[str]
            Filter by patient name.

        shipping_recipient_name : typing.Optional[str]
            Filter by shipping recipient name.

        order_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter by order ids.

        page : typing.Optional[int]

        size : typing.Optional[int]

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

        Returns
        -------
        GetOrdersResponse
            Successful Response

        Examples
        --------
        import asyncio

        from vital import AsyncVital

        client = AsyncVital(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.lab_tests.get_orders()


        asyncio.run(main())
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v3/orders",
            method="GET",
            params={
                "search_input": search_input,
                "start_date": serialize_datetime(start_date) if start_date is not None else None,
                "end_date": serialize_datetime(end_date) if end_date is not None else None,
                "updated_start_date": serialize_datetime(updated_start_date)
                if updated_start_date is not None
                else None,
                "updated_end_date": serialize_datetime(updated_end_date) if updated_end_date is not None else None,
                "order_key": order_key,
                "order_direction": order_direction,
                "user_id": user_id,
                "patient_name": patient_name,
                "shipping_recipient_name": shipping_recipient_name,
                "order_ids": order_ids,
                "page": page,
                "size": size,
            },
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                return typing.cast(
                    GetOrdersResponse,
                    parse_obj_as(
                        type_=GetOrdersResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
            if _response.status_code == 422:
                raise UnprocessableEntityError(
                    typing.cast(
                        HttpValidationError,
                        parse_obj_as(
                            type_=HttpValidationError,  # type: ignore
                            object_=_response.json(),
                        ),
                    )
                )
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, body=_response.text)
        raise ApiError(status_code=_response.status_code, body=_response_json)
