diff --git a/.fern/metadata.json b/.fern/metadata.json index d3cb91c8..fc3099e0 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.35.1", + "cliVersion": "4.66.0", "generatorName": "fernapi/fern-python-sdk", - "generatorVersion": "4.46.6", + "generatorVersion": "4.60.1", "generatorConfig": { "client_class_name": "Vital", "inline_request_params": false, @@ -10,5 +10,6 @@ "use_pydantic_field_aliases": true } }, - "sdkVersion": "2.1.569" + "originGitCommit": "6347981d44f9d73cff1e67ebed52cf9d3f0927c8", + "sdkVersion": "3.0.0" } \ No newline at end of file diff --git a/.fernignore b/.fernignore index 43ca0d22..07281cd7 100644 --- a/.fernignore +++ b/.fernignore @@ -1,3 +1,4 @@ # Specify files that shouldn't be modified by Fern README.md +changelog.md diff --git a/changelog.md b/changelog.md new file mode 100644 index 00000000..a6ef4102 --- /dev/null +++ b/changelog.md @@ -0,0 +1,42 @@ +## 3.0.0 - 2026-04-10 +* Several breaking changes have been made in this release: +* The `INSULIN_INJECTION` enum value has been removed from `IntervalTimeseriesExprTimeseries`. Callers using `.visit(insulin_injection=...)` must remove that argument. +* The `LinkBulkExportRequestTeamId`, `LinkBulkImportRequestTeamId`, `LinkBulkPauseRequestTeamId`, `LinkBulkTriggerHistoricalPullRequestTeamId`, and `LinkListBulkOpsRequestTeamId` types have been removed from `vital.link`. +* `AppointmentPscLabs` has changed from a `Literal["quest"]` type alias to a `StrEnum` class — code using it as a plain string type annotation may need updating. +* New in this release: HTTP requests now support structured logging (debug and error) with automatic redaction of sensitive headers; `BaseHttpResponse` exposes a new `status_code` property; and `AppointmentPscLabs` now includes the `SONORA_QUEST` value. +* **Breaking changes:** +* The `file` parameter of `parser_create_job` (on both `LabReportClient` and `AsyncLabReportClient`) has changed from `core.File` to `typing.List[core.File]`. Callers must now wrap a single file in a list: `file=[my_file]`. +* The following types have been removed from the top-level `vital` package: `LinkBulkExportRequestTeamId`, `LinkBulkImportRequestTeamId`, `LinkBulkPauseRequestTeamId`, `LinkBulkTriggerHistoricalPullRequestTeamId`, and `LinkListBulkOpsRequestTeamId`. +**New features:** +* Three new resource submodules are now available: `vital.compendium`, `vital.lab_account`, and `vital.order_transaction`. +* Over 40 new public types have been added, including `CanonicalCandidate`, `ClientFacingLabAccount`, `ClientFacingOrderTransaction`, `InsulinInjectionTimeseriesExpr`, `OrderSummary`, `SearchCompendiumResponse`, `UsState`, `UserAddress`, and more. +* Client wrappers now accept an optional `logging` parameter for structured request/response logging (`LogConfig` or `Logger`). +* The `LabTestsClient` (sync and async) has been expanded with several new parameters and types: +* `get_psc_appointment_availability` now accepts a required `lab` parameter (`AppointmentPscLabs`) and a new optional `allow_stale` flag for cached availability data. +* `book_psc_appointment` now supports optional `idempotency_key` and `idempotency_error` parameters for idempotent PSC appointment booking (currently in closed beta). +* `create_lab_test` accepts new optional `lab_account_id` and `lab_slug` (`Labs`) parameters. +* `get_markers` accepts a new optional `lab_slug` parameter to filter markers by lab slug. +* `get_orders` accepts a new optional `order_transaction_id` parameter for filtering. +* `request_phlebotomy_appointment` accepts a new optional `appointment_notes` parameter. +* `create_order` accepts a new optional `clinical_notes` parameter. +* New types `AppointmentPscLabs` and `Labs` are now available for use with these methods. +* The `get_psc_appointment_availability` method now requires a `lab` parameter (of type `AppointmentPscLabs`) that was previously hardcoded to `"quest"`. Callers must now explicitly pass the desired lab value. Additionally, many lab test and appointment methods have new optional parameters: `lab_account_id`, `lab_slug`, `order_transaction_id`, `appointment_notes`, `allow_stale`, `clinical_notes`, and idempotency support (`idempotency_key`, `idempotency_error`) for PSC appointment booking. +* The `team_id` parameter has been removed from `link.list_bulk_ops()`, `link.bulk_import()`, `link.bulk_trigger_historical_pull()`, `link.bulk_export()`, and `link.bulk_pause()` — callers using this keyword argument must remove it. The associated enum types (`LinkBulkExportRequestTeamId`, `LinkBulkImportRequestTeamId`, `LinkBulkPauseRequestTeamId`, `LinkBulkTriggerHistoricalPullRequestTeamId`, `LinkListBulkOpsRequestTeamId`) have also been removed. +* `link.connect_manual_provider()` now accepts three new optional parameters: `vital_ios_sdk_version`, `vital_android_sdk_version`, and `granted_permissions`, enabling mobile SDK version reporting and explicit permission grants. +* The SDK introduces several breaking changes alongside new features. +**Breaking changes:** +* The `address` parameter type in user creation/update methods (`UserClient`, `RawUserClient`) has changed from `Address` to `UserAddress`. Update all imports and usages accordingly (e.g., replace `from vital import Address` with `from vital import UserAddress`). +* `ParsingJob.job_id` has been removed. Use `ParsingJob.id` to identify parsing jobs. +* `Jpeg.content` and `Png.content` now use `bytes` instead of `str`. +**New features:** +* Three new top-level clients are now available on `Vital` and `AsyncVital`: `compendium`, `lab_account`, and `order_transaction`. +* A new optional `logging` parameter is available on `Vital` and `AsyncVital` constructors, accepting a `LogConfig` dict or a `Logger` instance for configurable SDK-level logging. +* `ClientFacingOrder` now exposes `last_event`, `clinical_notes`, `origin`, and `order_transaction` fields. +* `ClientFacingInsulinInjectionSample` gains optional `delivery_mode`, `delivery_form`, and `bolus_purpose` fields. +* `OrderStatus` includes new enum values for corrected results and lab-processing-blocked states. +* The SDK now includes two new client namespaces: `compendium` (with `search` and `convert` methods for lab test discovery and cross-lab conversion) and `lab_account` (with `get_team_lab_accounts` for managing team lab accounts). A new structured logging module (`ILogger`, `ConsoleLogger`, `LogConfig`, `Logger`, `create_logger`) is also available via `vital.core`. +* The SDK now includes a new `order_transaction` client namespace with three methods: `get_transaction()`, `get_transaction_result()`, and `get_transaction_result_pdf()`. These methods provide access to order transaction details, raw lab results, and streamable PDF lab result reports respectively. Both synchronous and asynchronous variants are available. +* The SDK now exposes many new types and enum values. New types include lab account management (`ClientFacingLabAccount`, `GetTeamLabAccountsResponse`, `LabAccountDelegatedFlow`, `LabAccountStatus`), order transactions (`ClientFacingOrderTransaction`, `ClientFacingOrderInTransaction`, `GetOrderTransactionResponse`, `OrderTransactionStatus`, `OrderOrigin`, `OrderStatusDetail`, `OrderSummary`), compendium search (`SearchCompendiumResponse`, `CompendiumSearchLabs`, `ConvertCompendiumResponse`, `SearchMode`, `CanonicalCandidate`, `PerLabCandidate`, `RelatedCandidate`), insulin injection details (`ClientFacingInsulinInjectionSampleBolusPurpose`, `ClientFacingInsulinInjectionSampleDeliveryForm`, `ClientFacingInsulinInjectionSampleDeliveryMode`), and sleep analytics (`AwakeningsValueMacroExpr`, `DerivedReadinessColumnExpr`). Several existing models have gained new optional fields, and new enum values have been added to `AppointmentProvider` (`SONORA_QUEST`) and source-type enums (`INSULIN_PUMP`). +* The SDK now includes new types and fields to support insulin injection timeseries, lab account management, order transactions, lab report parsing job webhook events, and compendium search/conversion. New optional fields `recovery_readiness_score` (on `ClientFacingSleep`), `status_detail` (on `ClientFacingOrderEvent`), and `order_transaction` (on `LabResultsRaw`) are also available. Several enums have been expanded with new values including `SONORA_QUEST`, `CRL`, `SAMSUNG_HEALTH`, `INSULIN_PUMP`, `CORRECTED`, `LAB_PROCESSING_BLOCKED`, and `DERIVED_READINESS`. +* The SDK now includes several new types and capabilities: `OrderStatusDetail`, `OrderTransactionStatus`, and `OrderSummary` for richer order lifecycle tracking; `SearchCompendiumResponse`, `PerLabCandidate`, `RelatedCandidate`, and `ProviderIdConversionResponse` for compendium search and provider ID conversion; and `UserAddress` with `UsState` enum for US address handling. New providers `TANDEM_SOURCE` and `SAMSUNG_HEALTH` have been added to the `Providers` enum, `TANDEM_SOURCE` to `PasswordProviders`, and `APERO`/`PVERIFY` to `PayorCodeExternalProvider`. Address models (`PatientAddress`, `PatientAddressCompatible`, `PatientAddressWithValidation`, `UsAddress`) now include an optional `access_notes` field, and query expression union types have been expanded with `AwakeningsValueMacroExpr`, `DerivedReadinessColumnExpr`, and `InsulinInjectionTimeseriesExpr`. + diff --git a/poetry.lock b/poetry.lock index ea0fda47..fdfe7802 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2026.1.4" +version = "2026.2.25" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c"}, - {file = "certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120"}, + {file = "certifi-2026.2.25-py3-none-any.whl", hash = "sha256:027692e4402ad994f1c42e52a4997a9763c646b73e4096e4d5d6db8af1d6f0fa"}, + {file = "certifi-2026.2.25.tar.gz", hash = "sha256:e887ab5cee78ea814d3472169153c2d12cd43b14bd03329a39a9c6e2e80bfba7"}, ] [[package]] @@ -236,13 +236,13 @@ files = [ [[package]] name = "packaging" -version = "25.0" +version = "26.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, - {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, + {file = "packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529"}, + {file = "packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4"}, ] [[package]] @@ -517,58 +517,58 @@ files = [ [[package]] name = "tomli" -version = "2.4.0" +version = "2.4.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" files = [ - {file = "tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867"}, - {file = "tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9"}, - {file = "tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95"}, - {file = "tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76"}, - {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d"}, - {file = "tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576"}, - {file = "tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a"}, - {file = "tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa"}, - {file = "tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614"}, - {file = "tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1"}, - {file = "tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8"}, - {file = "tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a"}, - {file = "tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1"}, - {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b"}, - {file = "tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51"}, - {file = "tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729"}, - {file = "tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da"}, - {file = "tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3"}, - {file = "tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0"}, - {file = "tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e"}, - {file = "tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4"}, - {file = "tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e"}, - {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c"}, - {file = "tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f"}, - {file = "tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86"}, - {file = "tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87"}, - {file = "tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132"}, - {file = "tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6"}, - {file = "tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc"}, - {file = "tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66"}, - {file = "tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d"}, - {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702"}, - {file = "tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8"}, - {file = "tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776"}, - {file = "tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475"}, - {file = "tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2"}, - {file = "tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9"}, - {file = "tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0"}, - {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df"}, - {file = "tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d"}, - {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f"}, - {file = "tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b"}, - {file = "tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087"}, - {file = "tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd"}, - {file = "tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4"}, - {file = "tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a"}, - {file = "tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c"}, + {file = "tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30"}, + {file = "tomli-2.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a"}, + {file = "tomli-2.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076"}, + {file = "tomli-2.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9"}, + {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c"}, + {file = "tomli-2.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc"}, + {file = "tomli-2.4.1-cp311-cp311-win32.whl", hash = "sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049"}, + {file = "tomli-2.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e"}, + {file = "tomli-2.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece"}, + {file = "tomli-2.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a"}, + {file = "tomli-2.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085"}, + {file = "tomli-2.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9"}, + {file = "tomli-2.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5"}, + {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585"}, + {file = "tomli-2.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1"}, + {file = "tomli-2.4.1-cp312-cp312-win32.whl", hash = "sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917"}, + {file = "tomli-2.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9"}, + {file = "tomli-2.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257"}, + {file = "tomli-2.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54"}, + {file = "tomli-2.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a"}, + {file = "tomli-2.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897"}, + {file = "tomli-2.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f"}, + {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d"}, + {file = "tomli-2.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5"}, + {file = "tomli-2.4.1-cp313-cp313-win32.whl", hash = "sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd"}, + {file = "tomli-2.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36"}, + {file = "tomli-2.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd"}, + {file = "tomli-2.4.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf"}, + {file = "tomli-2.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac"}, + {file = "tomli-2.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662"}, + {file = "tomli-2.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853"}, + {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15"}, + {file = "tomli-2.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba"}, + {file = "tomli-2.4.1-cp314-cp314-win32.whl", hash = "sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6"}, + {file = "tomli-2.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7"}, + {file = "tomli-2.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232"}, + {file = "tomli-2.4.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4"}, + {file = "tomli-2.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c"}, + {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d"}, + {file = "tomli-2.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41"}, + {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c"}, + {file = "tomli-2.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f"}, + {file = "tomli-2.4.1-cp314-cp314t-win32.whl", hash = "sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8"}, + {file = "tomli-2.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26"}, + {file = "tomli-2.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396"}, + {file = "tomli-2.4.1-py3-none-any.whl", hash = "sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe"}, + {file = "tomli-2.4.1.tar.gz", hash = "sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index c0e22abf..795b03a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "vital" -version = "2.1.569" +version = "3.0.0" description = "" readme = "README.md" authors = [] @@ -19,6 +19,9 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", diff --git a/reference.md b/reference.md deleted file mode 100644 index 5cd24c71..00000000 --- a/reference.md +++ /dev/null @@ -1,17552 +0,0 @@ -# Reference -## Link -
client.link.list_bulk_ops(...) -> AsyncHttpResponse[BulkOpsResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital -from vital.link import LinkListBulkOpsRequestTeamId - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.list_bulk_ops( - next_cursor="next_cursor", - page_size=1, - team_id=LinkListBulkOpsRequestTeamId.INFER_FROM_CONTEXT, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` - -
-
- -
-
- -**page_size:** `typing.Optional[int]` - -
-
- -
-
- -**team_id:** `typing.Optional[LinkListBulkOpsRequestTeamId]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.bulk_import(...) -> AsyncHttpResponse[BulkImportConnectionsResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ConnectionRecipe, OAuthProviders, Vital -from vital.link import LinkBulkImportRequestTeamId - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.bulk_import( - team_id=LinkBulkImportRequestTeamId.INFER_FROM_CONTEXT, - provider=OAuthProviders.OURA, - connections=[ - ConnectionRecipe( - user_id="user_id", - access_token="access_token", - refresh_token="refresh_token", - provider_id="provider_id", - expires_at=1, - ) - ], -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**provider:** `OAuthProviders` - -
-
- -
-
- -**connections:** `typing.Sequence[ConnectionRecipe]` - -
-
- -
-
- -**team_id:** `typing.Optional[LinkBulkImportRequestTeamId]` - -
-
- -
-
- -**wait_for_completion:** `typing.Optional[bool]` - - -Whether or not the endpoint should wait for the Bulk Op to complete before responding. - -When `wait_for_completion` is enabled, the endpoint may respond 200 OK if the Bulk Op takes less than 20 seconds to complete. - -Otherwise, the endpoint always responds with 202 Created once the submitted data have been enqueued successfully. You can use -the [List Bulk Ops](https://docs.tryvital.io/api-reference/link/list-bulk-ops) endpoint to inspect the progress of the Bulk Op. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.bulk_trigger_historical_pull(...) -> AsyncHttpResponse[typing.Any] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import OAuthProviders, Vital -from vital.link import LinkBulkTriggerHistoricalPullRequestTeamId - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.bulk_trigger_historical_pull( - team_id=LinkBulkTriggerHistoricalPullRequestTeamId.INFER_FROM_CONTEXT, - user_ids=["user_ids"], - provider=OAuthProviders.OURA, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_ids:** `typing.Sequence[str]` - -
-
- -
-
- -**provider:** `OAuthProviders` - -
-
- -
-
- -**team_id:** `typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId]` - -
-
- -
-
- -**wait_for_completion:** `typing.Optional[bool]` - - -Whether or not the endpoint should wait for the Bulk Op to complete before responding. - -When `wait_for_completion` is enabled, the endpoint may respond 200 OK if the Bulk Op takes less than 20 seconds to complete. - -Otherwise, the endpoint always responds with 202 Created once the submitted data have been enqueued successfully. You can use -the [List Bulk Ops](https://docs.tryvital.io/api-reference/link/list-bulk-ops) endpoint to inspect the progress of the Bulk Op. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.bulk_export(...) -> AsyncHttpResponse[BulkExportConnectionsResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import OAuthProviders, Vital -from vital.link import LinkBulkExportRequestTeamId - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.bulk_export( - team_id=LinkBulkExportRequestTeamId.INFER_FROM_CONTEXT, - provider=OAuthProviders.OURA, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**provider:** `OAuthProviders` - -
-
- -
-
- -**team_id:** `typing.Optional[LinkBulkExportRequestTeamId]` - -
-
- -
-
- -**user_ids:** `typing.Optional[typing.Sequence[str]]` - -
-
- -
-
- -**next_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.bulk_pause(...) -> AsyncHttpResponse[typing.Any] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import OAuthProviders, Vital -from vital.link import LinkBulkPauseRequestTeamId - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.bulk_pause( - team_id=LinkBulkPauseRequestTeamId.INFER_FROM_CONTEXT, - user_ids=["user_ids"], - provider=OAuthProviders.OURA, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_ids:** `typing.Sequence[str]` - -
-
- -
-
- -**provider:** `OAuthProviders` - -
-
- -
-
- -**team_id:** `typing.Optional[LinkBulkPauseRequestTeamId]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.token(...) -> AsyncHttpResponse[LinkTokenExchangeResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Endpoint to generate a user link token, to be used throughout the vital -link process. The vital link token is a one time use token, that -expires after 10 minutes. If you would like vital-link widget to launch -with a specific provider, pass in a provider in the body. If you would -like to redirect to a custom url after successful or error connection, -pass in your own custom redirect_url parameter. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.token( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` — User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api. - -
-
- -
-
- -**provider:** `typing.Optional[Providers]` - -
-
- -
-
- -**redirect_url:** `typing.Optional[str]` - -
-
- -
-
- -**filter_on_providers:** `typing.Optional[typing.Sequence[Providers]]` - -An allowlist of providers dictating what Vital Link Widget should show to the end user. -If unspecified, all linkable providers are shown. - -This has no effect on programmatic Vital Link API usage. - -
-
- -
-
- -**on_error:** `typing.Optional[typing.Literal["redirect"]]` - -By default, Vital Link Widget input forms for password and email providers have in-built error handling. - -Specifying `on_error=redirect` disables this Vital Link Widget UI behaviour — it would -instead redirect to your `redirect_url`, with Link Error parameters injected. - -This has no effect on OAuth providers — they always redirect to your `redirect_url`. This also has -no effect on programmatic Vital Link API usage. - -
-
- -
-
- -**on_close:** `typing.Optional[typing.Literal["redirect"]]` - -By default, Vital Link Widget closes the window or tab when the user taps the Close button. - -Specifying `on_close=redirect` would change the Close button behaviour to redirect to your `redirect_url` -with the `user_cancelled` error specified. - -This has no effect on programmatic Vital Link API usage. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.is_token_valid(...) -> AsyncHttpResponse[typing.Dict[str, typing.Any]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.is_token_valid( - token="token", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**token:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.code_create(...) -> AsyncHttpResponse[VitalTokenCreatedResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Generate a token to invite a user of Vital mobile app to your team -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -import datetime - -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.code_create( - user_id="user_id", - expires_at=datetime.datetime.fromisoformat( - "2024-01-15 09:30:00+00:00", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**expires_at:** `typing.Optional[dt.datetime]` — When the link code should expire. Defaults to server time plus 1 hour. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.start_connect(...) -> AsyncHttpResponse[typing.Dict[str, typing.Any]] -
-
- -#### 📝 Description - -
-
- -
-
- -REQUEST_SOURCE: VITAL-LINK -Start link token process -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Providers, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.start_connect( - link_token="link_token", - provider=Providers.OURA, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**link_token:** `str` - -
-
- -
-
- -**provider:** `Providers` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.token_state(...) -> AsyncHttpResponse[typing.Dict[str, typing.Any]] -
-
- -#### 📝 Description - -
-
- -
-
- -REQUEST_SOURCE: VITAL-LINK -Check link token state - can be hit continuously used as heartbeat -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.token_state( - vital_link_token="x-vital-link-token", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.email_auth(...) -> AsyncHttpResponse[typing.Any] -
-
- -#### 📝 Description - -
-
- -
-
- -Deprecated. Use `POST /v2/link/provider/email/{provider}` instead. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import AuthType, Providers, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.email_auth( - vital_link_token="x-vital-link-token", - email="email", - provider=Providers.OURA, - auth_type=AuthType.PASSWORD, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**email:** `str` - -
-
- -
-
- -**provider:** `Providers` - -
-
- -
-
- -**auth_type:** `AuthType` - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**region:** `typing.Optional[Region]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.password_auth(...) -> AsyncHttpResponse[typing.Any] -
-
- -#### 📝 Description - -
-
- -
-
- -Deprecated. Use `POST /v2/link/provider/password/{provider}` instead. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import AuthType, Providers, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.password_auth( - vital_link_token="x-vital-link-token", - username="username", - password="password", - provider=Providers.OURA, - auth_type=AuthType.PASSWORD, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**username:** `str` - -
-
- -
-
- -**password:** `str` - -
-
- -
-
- -**provider:** `Providers` - -
-
- -
-
- -**auth_type:** `AuthType` - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.generate_oauth_link(...) -> AsyncHttpResponse[Source] -
-
- -#### 📝 Description - -
-
- -
-
- -This endpoint generates an OAuth link for oauth provider -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import OAuthProviders, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.generate_oauth_link( - oauth_provider=OAuthProviders.OURA, - vital_link_token="x-vital-link-token", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**oauth_provider:** `OAuthProviders` - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.connect_password_provider(...) -> AsyncHttpResponse[ProviderLinkResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -This connects auth providers that are password based. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import PasswordProviders, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.connect_password_provider( - provider=PasswordProviders.WHOOP, - vital_link_token="x-vital-link-token", - username="username", - password="password", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**provider:** `PasswordProviders` - -
-
- -
-
- -**username:** `str` — Username for provider - -
-
- -
-
- -**password:** `str` — Password for provider - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**region:** `typing.Optional[Region]` — Provider region to authenticate against. Only applicable to specific providers. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.complete_password_provider_mfa(...) -> AsyncHttpResponse[ProviderLinkResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -This connects auth providers that are password based. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import PasswordProviders, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.complete_password_provider_mfa( - provider=PasswordProviders.WHOOP, - vital_link_token="x-vital-link-token", - mfa_code="mfa_code", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**provider:** `PasswordProviders` - -
-
- -
-
- -**mfa_code:** `str` - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.connect_email_auth_provider(...) -> AsyncHttpResponse[typing.Any] -
-
- -#### 📝 Description - -
-
- -
-
- -This connects auth providers that are email based. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.connect_email_auth_provider( - vital_link_token="x-vital-link-token", - email="email", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**email:** `str` - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**email_provider_auth_link_provider:** `typing.Optional[Providers]` - -
-
- -
-
- -**region:** `typing.Optional[Region]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.get_all_providers(...) -> AsyncHttpResponse[typing.List[SourceLink]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET List of all available providers given the generated link token. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.get_all_providers( - vital_link_token="x-vital-link-token", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.connect_manual_provider(...) -> AsyncHttpResponse[typing.Dict[str, bool]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ManualProviders, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.connect_manual_provider( - provider=ManualProviders.BEURER_BLE, - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**provider:** `ManualProviders` - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**provider_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.link.connect_demo_provider(...) -> AsyncHttpResponse[DemoConnectionStatus] -
-
- -#### 📝 Description - -
-
- -
-
- -POST Connect the given Vital user to a demo provider. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import DemoProviders, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.link.connect_demo_provider( - user_id="user_id", - provider=DemoProviders.APPLE_HEALTH_KIT, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` — Vital user ID - -
-
- -
-
- -**provider:** `DemoProviders` — Demo provider. For more information, please check out our docs (https://docs.tryvital.io/wearables/providers/test_data) - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Electrocardiogram -
client.electrocardiogram.get(...) -> AsyncHttpResponse[ClientFacingElectrocardiogramResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get electrocardiogram summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.electrocardiogram.get( - user_id="user_id", - start_date="start_date", - end_date="end_date", - provider="provider", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` - -
-
- -
-
- -**end_date:** `typing.Optional[str]` - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## SleepCycle -
client.sleep_cycle.get(...) -> AsyncHttpResponse[ClientSleepCycleResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get sleep cycle for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.sleep_cycle.get( - user_id="user_id", - start_date="start_date", - end_date="end_date", - provider="provider", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` - -
-
- -
-
- -**end_date:** `typing.Optional[str]` - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Profile -
client.profile.get(...) -> AsyncHttpResponse[ClientFacingProfile] -
-
- -#### 📝 Description - -
-
- -
-
- -Get profile for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.profile.get( - user_id="user_id", - provider="provider", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.profile.get_raw(...) -> AsyncHttpResponse[RawProfile] -
-
- -#### 📝 Description - -
-
- -
-
- -Get raw profile for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.profile.get_raw( - user_id="user_id", - provider="provider", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Devices -
client.devices.get_raw(...) -> AsyncHttpResponse[RawDevices] -
-
- -#### 📝 Description - -
-
- -
-
- -Get Devices for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.devices.get_raw( - user_id="user_id", - provider="provider", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Activity -
client.activity.get(...) -> AsyncHttpResponse[ClientActivityResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get activity summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.activity.get( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.activity.get_raw(...) -> AsyncHttpResponse[RawActivity] -
-
- -#### 📝 Description - -
-
- -
-
- -Get raw activity summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.activity.get_raw( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Workouts -
client.workouts.get(...) -> AsyncHttpResponse[ClientWorkoutResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get workout summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.workouts.get( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workouts.get_raw(...) -> AsyncHttpResponse[RawWorkout] -
-
- -#### 📝 Description - -
-
- -
-
- -Get raw workout summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.workouts.get_raw( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.workouts.get_by_workout_id(...) -> AsyncHttpResponse[ClientFacingStream] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.workouts.get_by_workout_id( - workout_id="workout_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**workout_id:** `str` — The Vital ID for the workout - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Sleep -
client.sleep.get(...) -> AsyncHttpResponse[ClientSleepResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get sleep summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.sleep.get( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sleep.get_raw(...) -> AsyncHttpResponse[RawSleep] -
-
- -#### 📝 Description - -
-
- -
-
- -Get raw sleep summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.sleep.get_raw( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.sleep.get_stream_by_sleep_id(...) -> AsyncHttpResponse[ClientFacingSleepStream] -
-
- -#### 📝 Description - -
-
- -
-
- -Get Sleep stream for a user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.sleep.get_stream_by_sleep_id( - sleep_id="sleep_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**sleep_id:** `str` — The Vital Sleep ID - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Body -
client.body.get(...) -> AsyncHttpResponse[ClientBodyResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get Body summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.body.get( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.body.get_raw(...) -> AsyncHttpResponse[RawBody] -
-
- -#### 📝 Description - -
-
- -
-
- -Get raw Body summary for user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.body.get_raw( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Meal -
client.meal.get(...) -> AsyncHttpResponse[ClientFacingMealResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Get user's meals -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.meal.get( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## MenstrualCycle -
client.menstrual_cycle.get(...) -> AsyncHttpResponse[MenstrualCycleResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.menstrual_cycle.get( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Vitals -
client.vitals.workout_swimming_stroke_grouped(...) -> AsyncHttpResponse[GroupedWorkoutSwimmingStrokeResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.workout_swimming_stroke_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.workout_distance_grouped(...) -> AsyncHttpResponse[GroupedWorkoutDistanceResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.workout_distance_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.heart_rate_recovery_one_minute_grouped(...) -> AsyncHttpResponse[GroupedHeartRateRecoveryOneMinuteResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.heart_rate_recovery_one_minute_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.waist_circumference_grouped(...) -> AsyncHttpResponse[GroupedWaistCircumferenceResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.waist_circumference_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.lean_body_mass_grouped(...) -> AsyncHttpResponse[GroupedLeanBodyMassResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.lean_body_mass_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_mass_index_grouped(...) -> AsyncHttpResponse[GroupedBodyMassIndexResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_mass_index_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.basal_body_temperature_grouped(...) -> AsyncHttpResponse[GroupedBasalBodyTemperatureResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.basal_body_temperature_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.handwashing_grouped(...) -> AsyncHttpResponse[GroupedHandwashingResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.handwashing_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.daylight_exposure_grouped(...) -> AsyncHttpResponse[GroupedDaylightExposureResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.daylight_exposure_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.uv_exposure_grouped(...) -> AsyncHttpResponse[GroupedUvExposureResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.uv_exposure_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.fall_grouped(...) -> AsyncHttpResponse[GroupedFallResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.fall_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.inhaler_usage_grouped(...) -> AsyncHttpResponse[GroupedInhalerUsageResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.inhaler_usage_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.peak_expiratory_flow_rate_grouped(...) -> AsyncHttpResponse[GroupedPeakExpiratoryFlowRateResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.peak_expiratory_flow_rate_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.forced_vital_capacity_grouped(...) -> AsyncHttpResponse[GroupedForcedVitalCapacityResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.forced_vital_capacity_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.forced_expiratory_volume_1_grouped(...) -> AsyncHttpResponse[GroupedForcedExpiratoryVolume1Response] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.forced_expiratory_volume_1_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.wheelchair_push_grouped(...) -> AsyncHttpResponse[GroupedWheelchairPushResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.wheelchair_push_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.sleep_breathing_disturbance_grouped(...) -> AsyncHttpResponse[GroupedSleepBreathingDisturbanceResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.sleep_breathing_disturbance_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.sleep_apnea_alert_grouped(...) -> AsyncHttpResponse[GroupedSleepApneaAlertResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.sleep_apnea_alert_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.stand_duration_grouped(...) -> AsyncHttpResponse[GroupedStandDurationResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.stand_duration_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.stand_hour_grouped(...) -> AsyncHttpResponse[GroupedStandHourResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.stand_hour_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.heart_rate_alert_grouped(...) -> AsyncHttpResponse[GroupedHeartRateAlertResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.heart_rate_alert_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.afib_burden_grouped(...) -> AsyncHttpResponse[GroupedAFibBurdenResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.afib_burden_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.workout_duration_grouped(...) -> AsyncHttpResponse[GroupedWorkoutDurationResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.workout_duration_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.vo_2_max_grouped(...) -> AsyncHttpResponse[GroupedVo2MaxResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.vo_2_max_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.stress_level_grouped(...) -> AsyncHttpResponse[GroupedStressLevelResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.stress_level_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.mindfulness_minutes_grouped(...) -> AsyncHttpResponse[GroupedMindfulnessMinutesResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.mindfulness_minutes_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.caffeine_grouped(...) -> AsyncHttpResponse[GroupedCaffeineResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.caffeine_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.water_grouped(...) -> AsyncHttpResponse[GroupedWaterResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.water_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.steps_grouped(...) -> AsyncHttpResponse[GroupedStepsResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.steps_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.floors_climbed_grouped(...) -> AsyncHttpResponse[GroupedFloorsClimbedResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.floors_climbed_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.distance_grouped(...) -> AsyncHttpResponse[GroupedDistanceResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.distance_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.calories_basal_grouped(...) -> AsyncHttpResponse[GroupedCaloriesBasalResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.calories_basal_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.calories_active_grouped(...) -> AsyncHttpResponse[GroupedCaloriesActiveResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.calories_active_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.respiratory_rate_grouped(...) -> AsyncHttpResponse[GroupedRespiratoryRateResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.respiratory_rate_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.note_grouped(...) -> AsyncHttpResponse[GroupedNoteResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.note_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.insulin_injection_grouped(...) -> AsyncHttpResponse[GroupedInsulinInjectionResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.insulin_injection_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.ige_grouped(...) -> AsyncHttpResponse[GroupedIgeResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.ige_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.igg_grouped(...) -> AsyncHttpResponse[GroupedIggResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.igg_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.hypnogram_grouped(...) -> AsyncHttpResponse[GroupedHypnogramResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.hypnogram_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.hrv_grouped(...) -> AsyncHttpResponse[GroupedHrvResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.hrv_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.heartrate_grouped(...) -> AsyncHttpResponse[GroupedHeartRateResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.heartrate_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.glucose_grouped(...) -> AsyncHttpResponse[GroupedGlucoseResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.glucose_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.cholesterol_grouped(...) -> AsyncHttpResponse[GroupedCholesterolResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.cholesterol_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.carbohydrates_grouped(...) -> AsyncHttpResponse[GroupedCarbohydratesResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.carbohydrates_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_temperature_delta_grouped(...) -> AsyncHttpResponse[GroupedBodyTemperatureDeltaResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_temperature_delta_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_temperature_grouped(...) -> AsyncHttpResponse[GroupedBodyTemperatureResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_temperature_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_weight_grouped(...) -> AsyncHttpResponse[GroupedBodyWeightResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_weight_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_fat_grouped(...) -> AsyncHttpResponse[GroupedBodyFatResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_fat_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.blood_oxygen_grouped(...) -> AsyncHttpResponse[GroupedBloodOxygenResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.blood_oxygen_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.electrocardiogram_voltage_grouped(...) -> AsyncHttpResponse[GroupedElectrocardiogramVoltageResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.electrocardiogram_voltage_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.blood_pressure_grouped(...) -> AsyncHttpResponse[GroupedBloodPressureResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.blood_pressure_grouped( - user_id="user_id", - cursor="cursor", - next_cursor="next_cursor", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.vo_2_max(...) -> AsyncHttpResponse[typing.List[ClientFacingVo2MaxTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.vo_2_max( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.stress_level(...) -> AsyncHttpResponse[typing.List[ClientFacingStressLevelTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.stress_level( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.mindfulness_minutes(...) -> AsyncHttpResponse[typing.List[ClientFacingMindfulnessMinutesTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.mindfulness_minutes( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.caffeine(...) -> AsyncHttpResponse[typing.List[ClientFacingCaffeineTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.caffeine( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.water(...) -> AsyncHttpResponse[typing.List[ClientFacingWaterTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.water( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.steps(...) -> AsyncHttpResponse[typing.List[ClientFacingStepsTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.steps( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.floors_climbed(...) -> AsyncHttpResponse[typing.List[ClientFacingFloorsClimbedTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.floors_climbed( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.distance(...) -> AsyncHttpResponse[typing.List[ClientFacingDistanceTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.distance( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.calories_basal(...) -> AsyncHttpResponse[typing.List[ClientFacingCaloriesBasalTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.calories_basal( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.calories_active(...) -> AsyncHttpResponse[typing.List[ClientFacingCaloriesActiveTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.calories_active( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.respiratory_rate(...) -> AsyncHttpResponse[typing.List[ClientFacingRespiratoryRateTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.respiratory_rate( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.ige(...) -> AsyncHttpResponse[typing.List[ClientFacingIgeTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.ige( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.igg(...) -> AsyncHttpResponse[typing.List[ClientFacingIggTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.igg( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.hypnogram(...) -> AsyncHttpResponse[typing.List[ClientFacingHypnogramTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.hypnogram( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.hrv(...) -> AsyncHttpResponse[typing.List[ClientFacingHrvTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.hrv( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.heartrate(...) -> AsyncHttpResponse[typing.List[ClientFacingHeartRateTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.heartrate( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.glucose(...) -> AsyncHttpResponse[typing.List[ClientFacingGlucoseTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.glucose( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.cholesterol_triglycerides(...) -> AsyncHttpResponse[typing.List[ClientFacingCholesterolTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.cholesterol_triglycerides( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.cholesterol_total(...) -> AsyncHttpResponse[typing.List[ClientFacingCholesterolTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.cholesterol_total( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.cholesterol_ldl(...) -> AsyncHttpResponse[typing.List[ClientFacingCholesterolTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.cholesterol_ldl( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.cholesterol_hdl(...) -> AsyncHttpResponse[typing.List[ClientFacingCholesterolTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.cholesterol_hdl( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.cholesterol(...) -> AsyncHttpResponse[typing.List[ClientFacingCholesterolTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.cholesterol( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_weight(...) -> AsyncHttpResponse[typing.List[ClientFacingBodyWeightTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_weight( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.body_fat(...) -> AsyncHttpResponse[typing.List[ClientFacingBodyFatTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.body_fat( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.blood_oxygen(...) -> AsyncHttpResponse[typing.List[ClientFacingBloodOxygenTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.blood_oxygen( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.electrocardiogram_voltage(...) -> AsyncHttpResponse[typing.List[ClientFacingElectrocardiogramVoltageTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.electrocardiogram_voltage( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.vitals.blood_pressure(...) -> AsyncHttpResponse[typing.List[ClientFacingBloodPressureTimeseries]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.vitals.blood_pressure( - user_id="user_id", - provider="provider", - start_date="start_date", - end_date="end_date", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**start_date:** `str` — 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 - -
-
- -
-
- -**provider:** `typing.Optional[str]` — Provider oura/strava etc - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — 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 - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## User -
client.user.get_all(...) -> AsyncHttpResponse[PaginatedUsersResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -GET All users for team. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_all( - offset=1, - limit=1, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**offset:** `typing.Optional[int]` - -
-
- -
-
- -**limit:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.create(...) -> AsyncHttpResponse[ClientFacingUserKey] -
-
- -#### 📝 Description - -
-
- -
-
- -POST Create a Vital user given a client_user_id and returns the user_id. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.create( - client_user_id="client_user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**client_user_id:** `str` — A unique ID representing the end user. Typically this will be a user ID from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. - -
-
- -
-
- -**fallback_time_zone:** `typing.Optional[str]` - - - Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`). - Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points). - - -
-
- -
-
- -**fallback_birth_date:** `typing.Optional[str]` — Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. - -
-
- -
-
- -**ingestion_start:** `typing.Optional[str]` — Starting bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). - -
-
- -
-
- -**ingestion_end:** `typing.Optional[str]` — Ending bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_team_metrics() -> AsyncHttpResponse[MetricsResult] -
-
- -#### 📝 Description - -
-
- -
-
- -GET metrics for team. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_team_metrics() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_connected_providers(...) -> AsyncHttpResponse[typing.Dict[str, typing.List[ClientFacingProviderWithStatus]]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET Users connected providers -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_connected_providers( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_latest_user_info(...) -> AsyncHttpResponse[UserInfo] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_latest_user_info( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.create_insurance(...) -> AsyncHttpResponse[ClientFacingInsurance] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - Address, - Gender, - ResponsibleRelationship, - Vital, - VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.create_insurance( - user_id="user_id", - payor_code="payor_code", - member_id="member_id", - relationship=ResponsibleRelationship.SELF, - insured=VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails( - first_name="first_name", - last_name="last_name", - gender=Gender.FEMALE, - address=Address( - first_line="first_line", - country="country", - zip="zip", - city="city", - state="state", - ), - dob="dob", - email="email", - phone_number="phone_number", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**payor_code:** `str` - -
-
- -
-
- -**member_id:** `str` - -
-
- -
-
- -**relationship:** `ResponsibleRelationship` - -
-
- -
-
- -**insured:** `VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails` - -
-
- -
-
- -**group_id:** `typing.Optional[str]` - -
-
- -
-
- -**guarantor:** `typing.Optional[GuarantorDetails]` - -
-
- -
-
- -**is_primary:** `typing.Optional[bool]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_latest_insurance(...) -> AsyncHttpResponse[ClientFacingInsurance] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_latest_insurance( - user_id="user_id", - is_primary=True, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**is_primary:** `typing.Optional[bool]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.upsert_user_info(...) -> AsyncHttpResponse[UserInfo] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Address, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.upsert_user_info( - user_id="user_id", - first_name="first_name", - last_name="last_name", - email="email", - phone_number="phone_number", - gender="gender", - dob="dob", - address=Address( - first_line="first_line", - country="country", - zip="zip", - city="city", - state="state", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**first_name:** `str` - -
-
- -
-
- -**last_name:** `str` - -
-
- -
-
- -**email:** `str` - -
-
- -
-
- -**phone_number:** `str` - -
-
- -
-
- -**gender:** `str` - -
-
- -
-
- -**dob:** `str` - -
-
- -
-
- -**address:** `Address` - -
-
- -
-
- -**medical_proxy:** `typing.Optional[GuarantorDetails]` - -
-
- -
-
- -**race:** `typing.Optional[Race]` - -
-
- -
-
- -**ethnicity:** `typing.Optional[Ethnicity]` - -
-
- -
-
- -**sexual_orientation:** `typing.Optional[SexualOrientation]` - -
-
- -
-
- -**gender_identity:** `typing.Optional[GenderIdentity]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_by_client_user_id(...) -> AsyncHttpResponse[ClientFacingUser] -
-
- -#### 📝 Description - -
-
- -
-
- -GET user_id from client_user_id. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_by_client_user_id( - client_user_id="client_user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**client_user_id:** `str` — A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.deregister_provider(...) -> AsyncHttpResponse[UserSuccessResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Providers, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.deregister_provider( - user_id="user_id", - provider=Providers.OURA, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**provider:** `Providers` — Provider slug. e.g., `oura`, `fitbit`, `garmin`. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get(...) -> AsyncHttpResponse[ClientFacingUser] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.delete(...) -> AsyncHttpResponse[UserSuccessResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.delete( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.patch(...) -> AsyncHttpResponse[None] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.patch( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**fallback_time_zone:** `typing.Optional[str]` - - - Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`). - Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points). - - -
-
- -
-
- -**fallback_birth_date:** `typing.Optional[str]` — Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. - -
-
- -
-
- -**ingestion_start:** `typing.Optional[str]` — Starting bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). - -
-
- -
-
- -**ingestion_end:** `typing.Optional[str]` — Ending bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). - -
-
- -
-
- -**client_user_id:** `typing.Optional[str]` — A unique ID representing the end user. Typically this will be a user ID from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.undo_delete(...) -> AsyncHttpResponse[UserSuccessResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.undo_delete( - user_id="user_id", - client_user_id="client_user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `typing.Optional[str]` — User ID to undo deletion. Mutually exclusive with `client_user_id`. - -
-
- -
-
- -**client_user_id:** `typing.Optional[str]` — Client User ID to undo deletion. Mutually exclusive with `user_id`. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.refresh(...) -> AsyncHttpResponse[UserRefreshSuccessResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Trigger a manual refresh for a specific user -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.refresh( - user_id="user_id", - timeout=1.1, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**timeout:** `typing.Optional[float]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_devices(...) -> AsyncHttpResponse[typing.List[ClientFacingDevice]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_devices( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_device(...) -> AsyncHttpResponse[ClientFacingDevice] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_device( - user_id="user_id", - device_id="device_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**device_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.get_user_sign_in_token(...) -> AsyncHttpResponse[UserSignInTokenResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.get_user_sign_in_token( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.user.create_portal_url(...) -> AsyncHttpResponse[CreateUserPortalUrlResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital -from vital.user import CreateUserPortalUrlBodyContext - -client = Vital( - api_key="YOUR_API_KEY", -) -client.user.create_portal_url( - user_id="user_id", - context=CreateUserPortalUrlBodyContext.LAUNCH, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**context:** `CreateUserPortalUrlBodyContext` - -`launch`: Generates a short-lived (minutes) portal URL that is intended for launching a user from your -authenticated web context directly into the Junction User Portal. This URL is not suitable for asynchronous -communications due to its verbosity as well as short-lived nature. - -`communications`: Generates a long-lived (weeks) but shortened portal URL that is suitable for Emails, SMS -messages and other communication channels. Users may be asked to verify their identity with Email and SMS -authentication, e.g., when they open a short link on a new device. â„šī¸ This enum is non-exhaustive. - -
-
- -
-
- -**order_id:** `typing.Optional[str]` — If specified, the generated URL will deeplink to the specified Order. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Team -
client.team.get_link_config(...) -> AsyncHttpResponse[typing.Dict[str, typing.Any]] -
-
- -#### 📝 Description - -
-
- -
-
- -Post teams. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.get_link_config( - vital_link_token="x-vital-link-token", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**vital_link_token:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.team.get(...) -> AsyncHttpResponse[ClientFacingTeam] -
-
- -#### 📝 Description - -
-
- -
-
- -Get team. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.get( - team_id="team_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**team_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.team.get_user_by_id(...) -> AsyncHttpResponse[typing.List[ClientFacingUser]] -
-
- -#### 📝 Description - -
-
- -
-
- -Search team users by user_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.get_user_by_id( - query_id="query_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**query_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.team.get_svix_url() -> AsyncHttpResponse[typing.Dict[str, typing.Any]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.get_svix_url() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.team.get_source_priorities(...) -> AsyncHttpResponse[typing.List[typing.Dict[str, typing.Any]]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET source priorities. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import PriorityResource, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.get_source_priorities( - data_type=PriorityResource.WORKOUTS, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**data_type:** `typing.Optional[PriorityResource]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.team.update_source_priorities() -> AsyncHttpResponse[typing.List[typing.Dict[str, typing.Any]]] -
-
- -#### 📝 Description - -
-
- -
-
- -Patch source priorities. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.update_source_priorities() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.team.get_physicians(...) -> AsyncHttpResponse[typing.List[ClientFacingPhysician]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.team.get_physicians( - team_id="team_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**team_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Providers -
client.providers.get_all(...) -> AsyncHttpResponse[typing.List[ClientFacingProviderDetailed]] -
-
- -#### 📝 Description - -
-
- -
-
- -Get Provider list -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.providers.get_all( - source_type="source_type", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**source_type:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Introspect -
client.introspect.get_user_resources(...) -> AsyncHttpResponse[UserResourcesResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Providers, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.introspect.get_user_resources( - user_id="user_id", - provider=Providers.OURA, - user_limit=1, - cursor="cursor", - next_cursor="next_cursor", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `typing.Optional[str]` — Filter by user ID. - -
-
- -
-
- -**provider:** `typing.Optional[Providers]` - -
-
- -
-
- -**user_limit:** `typing.Optional[int]` - -
-
- -
-
- -**cursor:** `typing.Optional[str]` - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.introspect.get_user_historical_pulls(...) -> AsyncHttpResponse[UserHistoricalPullsResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Providers, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.introspect.get_user_historical_pulls( - user_id="user_id", - provider=Providers.OURA, - user_limit=1, - cursor="cursor", - next_cursor="next_cursor", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `typing.Optional[str]` — Filter by user ID. - -
-
- -
-
- -**provider:** `typing.Optional[Providers]` - -
-
- -
-
- -**user_limit:** `typing.Optional[int]` - -
-
- -
-
- -**cursor:** `typing.Optional[str]` - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` — The cursor for fetching the next page, or `null` to fetch the first page. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## LabTests -
client.lab_tests.get(...) -> AsyncHttpResponse[typing.List[ClientFacingLabTest]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET all the lab tests the team has access to. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - LabTestCollectionMethod, - LabTestGenerationMethodFilter, - LabTestStatus, - Vital, -) -from vital.lab_tests import ( - LabTestsGetRequestOrderDirection, - LabTestsGetRequestOrderKey, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get( - generation_method=LabTestGenerationMethodFilter.AUTO, - lab_slug="lab_slug", - collection_method=LabTestCollectionMethod.TESTKIT, - status=LabTestStatus.ACTIVE, - name="name", - order_key=LabTestsGetRequestOrderKey.PRICE, - order_direction=LabTestsGetRequestOrderDirection.ASC, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**generation_method:** `typing.Optional[LabTestGenerationMethodFilter]` — Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned. - -
-
- -
-
- -**lab_slug:** `typing.Optional[str]` — Filter by the slug of the lab for these lab tests. - -
-
- -
-
- -**collection_method:** `typing.Optional[LabTestCollectionMethod]` — Filter by the collection method for these lab tests. - -
-
- -
-
- -**status:** `typing.Optional[LabTestStatus]` — Filter by the status of these lab tests. - -
-
- -
-
- -**marker_ids:** `typing.Optional[typing.Union[int, typing.Sequence[int]]]` — Filter to only include lab tests containing these marker IDs. - -
-
- -
-
- -**provider_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter to only include lab tests containing these provider IDs. - -
-
- -
-
- -**name:** `typing.Optional[str]` — Filter by the name of the lab test (a case-insensitive substring search). - -
-
- -
-
- -**order_key:** `typing.Optional[LabTestsGetRequestOrderKey]` - -
-
- -
-
- -**order_direction:** `typing.Optional[LabTestsGetRequestOrderDirection]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.create(...) -> AsyncHttpResponse[ClientFacingLabTest] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import LabTestCollectionMethod, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.create( - name="name", - method=LabTestCollectionMethod.TESTKIT, - description="description", -) - -``` -
-
-
-
- -#### âš™ī¸ 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. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_by_id(...) -> AsyncHttpResponse[ClientFacingLabTest] -
-
- -#### 📝 Description - -
-
- -
-
- -GET all the lab tests the team has access to. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_by_id( - lab_test_id="lab_test_id", - lab_account_id="lab_account_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**lab_test_id:** `str` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` — The lab account ID. This lab account is used to determine the availability of markers and lab tests. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.update_lab_test(...) -> AsyncHttpResponse[ClientFacingLabTest] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.update_lab_test( - lab_test_id="lab_test_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**lab_test_id:** `str` - -
-
- -
-
- -**name:** `typing.Optional[str]` - -
-
- -
-
- -**active:** `typing.Optional[bool]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_markers(...) -> AsyncHttpResponse[GetMarkersResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -GET all the markers for the given lab. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_markers( - name="name", - a_la_carte_enabled=True, - lab_account_id="lab_account_id", - page=1, - size=1, -) - -``` -
-
-
-
- -#### âš™ī¸ 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]` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` — The lab account ID. This lab account is used to determine the availability of markers and lab tests. - -
-
- -
-
- -**page:** `typing.Optional[int]` - -
-
- -
-
- -**size:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_markers_for_order_set(...) -> AsyncHttpResponse[GetMarkersResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import OrderSetRequest, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_markers_for_order_set( - page=1, - size=1, - request=OrderSetRequest(), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request:** `OrderSetRequest` - -
-
- -
-
- -**page:** `typing.Optional[int]` - -
-
- -
-
- -**size:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_markers_for_lab_test(...) -> AsyncHttpResponse[GetMarkersResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", - lab_account_id="lab_account_id", - page=1, - size=1, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**lab_test_id:** `str` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` — The lab account ID. This lab account is used to determine the availability of markers and lab tests. - -
-
- -
-
- -**page:** `typing.Optional[int]` - -
-
- -
-
- -**size:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_markers_by_lab_and_provider_id(...) -> AsyncHttpResponse[ClientFacingMarker] -
-
- -#### 📝 Description - -
-
- -
-
- -GET a specific marker for the given lab and provider_id -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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, - lab_account_id="lab_account_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**provider_id:** `str` - -
-
- -
-
- -**lab_id:** `int` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` — The lab account ID. This lab account is used to determine the availability of markers and lab tests. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_labs() -> AsyncHttpResponse[typing.List[ClientFacingLab]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET all the labs. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_labs() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_paginated(...) -> AsyncHttpResponse[LabTestResourcesResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -GET lab tests the team has access to as a paginated list. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - LabTestCollectionMethod, - LabTestGenerationMethodFilter, - LabTestStatus, - Vital, -) -from vital.lab_tests import ( - LabTestsGetPaginatedRequestOrderDirection, - LabTestsGetPaginatedRequestOrderKey, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_paginated( - lab_test_limit=1, - next_cursor="next_cursor", - generation_method=LabTestGenerationMethodFilter.AUTO, - lab_slug="lab_slug", - collection_method=LabTestCollectionMethod.TESTKIT, - status=LabTestStatus.ACTIVE, - name="name", - order_key=LabTestsGetPaginatedRequestOrderKey.PRICE, - order_direction=LabTestsGetPaginatedRequestOrderDirection.ASC, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**lab_test_limit:** `typing.Optional[int]` - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` - -
-
- -
-
- -**generation_method:** `typing.Optional[LabTestGenerationMethodFilter]` — Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned. - -
-
- -
-
- -**lab_slug:** `typing.Optional[str]` — Filter by the slug of the lab for these lab tests. - -
-
- -
-
- -**collection_method:** `typing.Optional[LabTestCollectionMethod]` — Filter by the collection method for these lab tests. - -
-
- -
-
- -**status:** `typing.Optional[LabTestStatus]` — Filter by the status of these lab tests. - -
-
- -
-
- -**marker_ids:** `typing.Optional[typing.Union[int, typing.Sequence[int]]]` — Filter to only include lab tests containing these marker IDs. - -
-
- -
-
- -**provider_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Filter to only include lab tests containing these provider IDs. - -
-
- -
-
- -**name:** `typing.Optional[str]` — Filter by the name of the lab test (a case-insensitive substring search). - -
-
- -
-
- -**order_key:** `typing.Optional[LabTestsGetPaginatedRequestOrderKey]` - -
-
- -
-
- -**order_direction:** `typing.Optional[LabTestsGetPaginatedRequestOrderDirection]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_lab_test_collection_instruction_pdf(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_lab_test_collection_instruction_pdf( - lab_test_id="lab_test_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**lab_test_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_orders(...) -> AsyncHttpResponse[GetOrdersResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -GET many orders with filters. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -import datetime - -from vital import Interpretation, Vital -from vital.lab_tests import ( - LabTestsGetOrdersRequestOrderDirection, - LabTestsGetOrdersRequestOrderKey, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_orders( - search_input="search_input", - start_date=datetime.datetime.fromisoformat( - "2024-01-15 09:30:00+00:00", - ), - end_date=datetime.datetime.fromisoformat( - "2024-01-15 09:30:00+00:00", - ), - updated_start_date=datetime.datetime.fromisoformat( - "2024-01-15 09:30:00+00:00", - ), - updated_end_date=datetime.datetime.fromisoformat( - "2024-01-15 09:30:00+00:00", - ), - order_key=LabTestsGetOrdersRequestOrderKey.CREATED_AT, - order_direction=LabTestsGetOrdersRequestOrderDirection.ASC, - is_critical=True, - interpretation=Interpretation.NORMAL, - user_id="user_id", - patient_name="patient_name", - shipping_recipient_name="shipping_recipient_name", - page=1, - size=1, -) - -``` -
-
-
-
- -#### âš™ī¸ 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 - -
-
- -
-
- -**status:** `typing.Optional[ - typing.Union[OrderLowLevelStatus, typing.Sequence[OrderLowLevelStatus]] -]` — Filter by low level status. - -
-
- -
-
- -**order_key:** `typing.Optional[LabTestsGetOrdersRequestOrderKey]` — Order key to sort by. - -
-
- -
-
- -**order_direction:** `typing.Optional[LabTestsGetOrdersRequestOrderDirection]` — Order direction to sort by. - -
-
- -
-
- -**order_type:** `typing.Optional[ - typing.Union[ - LabTestCollectionMethod, typing.Sequence[LabTestCollectionMethod] - ] -]` — Filter by method used to perform the lab test. - -
-
- -
-
- -**is_critical:** `typing.Optional[bool]` — Filter by critical order status. - -
-
- -
-
- -**interpretation:** `typing.Optional[Interpretation]` — Filter by result interpretation of the lab test. - -
-
- -
-
- -**order_activation_types:** `typing.Optional[ - typing.Union[OrderActivationType, typing.Sequence[OrderActivationType]] -]` — Filter by activation type. - -
-
- -
-
- -**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. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_phlebotomy_appointment_availability(...) -> AsyncHttpResponse[AppointmentAvailabilitySlots] -
-
- -#### 📝 Description - -
-
- -
-
- -Return the available time slots to book an appointment with a phlebotomist -for the given address and order. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import UsAddress, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_phlebotomy_appointment_availability( - start_date="start_date", - request=UsAddress( - first_line="first_line", - city="city", - state="state", - zip_code="zip_code", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request:** `UsAddress` - -
-
- -
-
- -**start_date:** `typing.Optional[str]` — Start date for appointment availability - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.book_phlebotomy_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 📝 Description - -
-
- -
-
- -Book an at-home phlebotomy appointment. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request:** `AppointmentBookingRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.request_phlebotomy_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 📝 Description - -
-
- -
-
- -Request an at-home phlebotomy appointment. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**address:** `UsAddress` — At-home phlebotomy appointment address. - -
-
- -
-
- -**provider:** `AppointmentProvider` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.reschedule_phlebotomy_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 📝 Description - -
-
- -
-
- -Reschedule a previously booked at-home phlebotomy appointment. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request:** `AppointmentRescheduleRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.cancel_phlebotomy_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 📝 Description - -
-
- -
-
- -Cancel a previously booked at-home phlebotomy appointment. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**cancellation_reason_id:** `str` - -
-
- -
-
- -**notes:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_phlebotomy_appointment_cancellation_reason() -> AsyncHttpResponse[typing.List[ClientFacingAppointmentCancellationReason]] -
-
- -#### 📝 Description - -
-
- -
-
- -Get the list of reasons for cancelling an at-home phlebotomy appointment. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_phlebotomy_appointment_cancellation_reason() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_phlebotomy_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 📝 Description - -
-
- -
-
- -Get the appointment associated with an order. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_phlebotomy_appointment( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_area_info(...) -> AsyncHttpResponse[AreaInfo] -
-
- -#### 📝 Description - -
-
- -
-
- -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. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import AllowedRadius, ClientFacingLabs, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_area_info( - zip_code="zip_code", - radius=AllowedRadius.TEN, - lab=ClientFacingLabs.QUEST, - lab_account_id="lab_account_id", -) - -``` -
-
-
-
- -#### âš™ī¸ 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 - -
-
- -
-
- -**labs:** `typing.Optional[ - typing.Union[ClientFacingLabs, typing.Sequence[ClientFacingLabs]] -]` — List of labs to check for PSCs - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` — Lab Account ID to use for availability checks - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_psc_info(...) -> AsyncHttpResponse[PscInfo] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import AllowedRadius, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_psc_info( - zip_code="zip_code", - lab_id=1, - radius=AllowedRadius.TEN, - lab_account_id="lab_account_id", -) - -``` -
-
-
-
- -#### âš™ī¸ 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 in miles. Note that we limit to 30 PSCs. - -
-
- -
-
- -**capabilities:** `typing.Optional[ - typing.Union[LabLocationCapability, typing.Sequence[LabLocationCapability]] -]` — Filter for only locations with certain capabilities - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` — Lab Account ID to use for availability checks - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_order_psc_info(...) -> AsyncHttpResponse[PscInfo] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import AllowedRadius, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_order_psc_info( - order_id="order_id", - radius=AllowedRadius.TEN, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**radius:** `typing.Optional[AllowedRadius]` — Radius in which to search in miles - -
-
- -
-
- -**capabilities:** `typing.Optional[ - typing.Union[LabLocationCapability, typing.Sequence[LabLocationCapability]] -]` — Filter for only locations with certain capabilities - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_result_pdf(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] -
-
- -#### 📝 Description - -
-
- -
-
- -This endpoint returns the lab results for the order. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_result_pdf( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_result_metadata(...) -> AsyncHttpResponse[LabResultsMetadata] -
-
- -#### 📝 Description - -
-
- -
-
- -Return metadata related to order results, such as lab metadata, -provider and sample dates. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_result_metadata( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_result_raw(...) -> AsyncHttpResponse[LabResultsRaw] -
-
- -#### 📝 Description - -
-
- -
-
- -Return both metadata and raw json test data -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_result_raw( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_labels_pdf(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] -
-
- -#### 📝 Description - -
-
- -
-
- -This endpoint returns the printed labels for the order. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -import datetime - -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_labels_pdf( - order_id="order_id", - collection_date=datetime.datetime.fromisoformat( - "2024-01-15 09:30:00+00:00", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ 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. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_psc_appointment_availability(...) -> AsyncHttpResponse[AppointmentAvailabilitySlots] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import AllowedRadius, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_psc_appointment_availability( - start_date="start_date", - zip_code="zip_code", - radius=AllowedRadius.TEN, -) - -``` -
-
-
-
- -#### âš™ī¸ 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. - -
-
-
-
- - -
-
-
- -
client.lab_tests.book_psc_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request:** `AppointmentBookingRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.reschedule_psc_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request:** `AppointmentRescheduleRequest` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.cancel_psc_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -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", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**cancellation_reason_id:** `str` - -
-
- -
-
- -**note:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_psc_appointment_cancellation_reason() -> AsyncHttpResponse[typing.List[ClientFacingAppointmentCancellationReason]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_psc_appointment_cancellation_reason() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_psc_appointment(...) -> AsyncHttpResponse[ClientFacingAppointment] -
-
- -#### 📝 Description - -
-
- -
-
- -Get the appointment associated with an order. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_psc_appointment( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_order_collection_instruction_pdf(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET collection instructions for an order -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_order_collection_instruction_pdf( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_order_requistion_pdf(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET requisition pdf for an order -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_order_requistion_pdf( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_order_abn_pdf(...) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] -
-
- -#### 📝 Description - -
-
- -
-
- -GET ABN pdf for an order -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_order_abn_pdf( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. - -
-
-
-
- - -
-
-
- -
client.lab_tests.get_order(...) -> AsyncHttpResponse[ClientFacingOrder] -
-
- -#### 📝 Description - -
-
- -
-
- -GET individual order by ID. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.get_order( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.create_order(...) -> AsyncHttpResponse[PostOrderResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - Gender, - PatientAddressWithValidation, - PatientDetailsWithValidation, - Vital, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.create_order( - idempotency_key="X-Idempotency-Key", - user_id="user_id", - patient_details=PatientDetailsWithValidation( - first_name="first_name", - last_name="last_name", - dob="dob", - gender=Gender.FEMALE, - phone_number="phone_number", - email="email", - ), - patient_address=PatientAddressWithValidation( - first_line="first_line", - city="city", - state="state", - zip="zip", - country="country", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**patient_details:** `PatientDetailsWithValidation` - -
-
- -
-
- -**patient_address:** `PatientAddressWithValidation` - -
-
- -
-
- -**idempotency_key:** `typing.Optional[str]` - -
-
- -
-
- -**idempotency_error:** `typing.Optional[typing.Literal["no-cache"]]` - -
-
- -
-
- -**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]` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` - -
-
- -
-
- -**creator_member_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.import_order(...) -> AsyncHttpResponse[PostOrderResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - Billing, - Gender, - LabTestCollectionMethod, - OrderSetRequest, - PatientAddress, - PatientDetailsWithValidation, - Vital, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.import_order( - user_id="user_id", - billing_type=Billing.CLIENT_BILL, - order_set=OrderSetRequest(), - collection_method=LabTestCollectionMethod.TESTKIT, - patient_details=PatientDetailsWithValidation( - first_name="first_name", - last_name="last_name", - dob="dob", - gender=Gender.FEMALE, - phone_number="phone_number", - email="email", - ), - patient_address=PatientAddress( - receiver_name="receiver_name", - first_line="first_line", - city="city", - state="state", - zip="zip", - country="country", - ), - sample_id="sample_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**billing_type:** `Billing` - -
-
- -
-
- -**order_set:** `OrderSetRequest` - -
-
- -
-
- -**collection_method:** `LabTestCollectionMethod` - -
-
- -
-
- -**patient_details:** `PatientDetailsWithValidation` - -
-
- -
-
- -**patient_address:** `PatientAddress` - -
-
- -
-
- -**sample_id:** `str` - -
-
- -
-
- -**physician:** `typing.Optional[PhysicianCreateRequest]` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.cancel_order(...) -> AsyncHttpResponse[PostOrderResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -POST cancel order -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.cancel_order( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.simulate_order_process(...) -> AsyncHttpResponse[typing.Any] -
-
- -#### 📝 Description - -
-
- -
-
- -Get available test kits. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import OrderStatus, SimulationFlags, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.simulate_order_process( - order_id="order_id", - final_status=OrderStatus.RECEIVED_WALK_IN_TEST_ORDERED, - delay=1, - request=SimulationFlags(), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` - -
-
- -
-
- -**final_status:** `typing.Optional[OrderStatus]` - -
-
- -
-
- -**delay:** `typing.Optional[int]` - -
-
- -
-
- -**request:** `typing.Optional[SimulationFlags]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.update_on_site_collection_order_draw_completed(...) -> AsyncHttpResponse[PostOrderResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -PATCH update on site collection order when draw is completed -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.update_on_site_collection_order_draw_completed( - order_id="order_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_id:** `str` — Your Order ID. - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_tests.validate_icd_codes(...) -> AsyncHttpResponse[ValidateIcdCodesResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_tests.validate_icd_codes( - codes=["codes"], -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**codes:** `typing.Sequence[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Testkit -
client.testkit.register(...) -> AsyncHttpResponse[PostOrderResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - Gender, - PatientAddressWithValidation, - PatientDetailsWithValidation, - Vital, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.testkit.register( - sample_id="sample_id", - patient_details=PatientDetailsWithValidation( - first_name="first_name", - last_name="last_name", - dob="dob", - gender=Gender.FEMALE, - phone_number="phone_number", - email="email", - ), - patient_address=PatientAddressWithValidation( - first_line="first_line", - city="city", - state="state", - zip="zip", - country="country", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**sample_id:** `str` - -
-
- -
-
- -**patient_details:** `PatientDetailsWithValidation` - -
-
- -
-
- -**patient_address:** `PatientAddressWithValidation` - -
-
- -
-
- -**user_id:** `typing.Optional[str]` — The user ID of the patient. - -
-
- -
-
- -**physician:** `typing.Optional[PhysicianCreateRequestBase]` - -
-
- -
-
- -**health_insurance:** `typing.Optional[HealthInsuranceCreateRequest]` - -
-
- -
-
- -**consents:** `typing.Optional[typing.Sequence[Consent]]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.testkit.create_order(...) -> AsyncHttpResponse[PostOrderResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Creates an order for an unregistered testkit -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ShippingAddressWithValidation, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.testkit.create_order( - user_id="user_id", - lab_test_id="lab_test_id", - shipping_details=ShippingAddressWithValidation( - receiver_name="receiver_name", - first_line="first_line", - city="city", - state="state", - zip="zip", - country="country", - phone_number="phone_number", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**lab_test_id:** `str` - -
-
- -
-
- -**shipping_details:** `ShippingAddressWithValidation` - -
-
- -
-
- -**passthrough:** `typing.Optional[str]` - -
-
- -
-
- -**lab_account_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Order -
client.order.resend_events(...) -> AsyncHttpResponse[ResendWebhookResponse] -
-
- -#### 📝 Description - -
-
- -
-
- -Replay a webhook for a given set of orders -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.order.resend_events() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**order_ids:** `typing.Optional[typing.Sequence[str]]` - -
-
- -
-
- -**start_at:** `typing.Optional[dt.datetime]` - -
-
- -
-
- -**end_at:** `typing.Optional[dt.datetime]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Insurance -
client.insurance.search_get_payor_info(...) -> AsyncHttpResponse[typing.List[ClientFacingPayorSearchResponse]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import PayorCodeExternalProvider, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.insurance.search_get_payor_info( - insurance_name="insurance_name", - provider=PayorCodeExternalProvider.CHANGE_HEALTHCARE, - provider_payor_id="provider_payor_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**insurance_name:** `typing.Optional[str]` - -
-
- -
-
- -**provider:** `typing.Optional[PayorCodeExternalProvider]` - -
-
- -
-
- -**provider_payor_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.insurance.search_payor_info(...) -> AsyncHttpResponse[typing.List[ClientFacingPayorSearchResponseDeprecated]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.insurance.search_payor_info() - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**insurance_name:** `typing.Optional[str]` - -
-
- -
-
- -**provider:** `typing.Optional[PayorCodeExternalProvider]` - -
-
- -
-
- -**provider_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.insurance.search_diagnosis(...) -> AsyncHttpResponse[typing.List[ClientFacingDiagnosisInformation]] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.insurance.search_diagnosis( - diagnosis_query="diagnosis_query", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**diagnosis_query:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Payor -
client.payor.create_payor(...) -> AsyncHttpResponse[ClientFacingPayor] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Address, Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.payor.create_payor( - name="name", - address=Address( - first_line="first_line", - country="country", - zip="zip", - city="city", - state="state", - ), -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**name:** `str` - -
-
- -
-
- -**address:** `Address` - -
-
- -
-
- -**provider:** `typing.Optional[PayorCodeExternalProvider]` - -
-
- -
-
- -**provider_payor_id:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## LabReport -
client.lab_report.parser_create_job(...) -> AsyncHttpResponse[ParsingJob] -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a parse job, uploads the file to provider, persists the job row, -and starts the ParseLabReport. Returns a generated job_id. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_report.parser_create_job( - user_id="user_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**file:** `from __future__ import annotations - -core.File` — See core.File for more documentation - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**needs_human_review:** `typing.Optional[bool]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.lab_report.parser_get_job(...) -> AsyncHttpResponse[ParsingJob] -
-
- -#### 📝 Description - -
-
- -
-
- -Retrieves the parse job status and stored result if completed. - -Returns: - ParseLabResultJobResponse with job status and parsed data (if complete) -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.lab_report.parser_get_job( - job_id="job_id", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**job_id:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Aggregate -
client.aggregate.query_one(...) -> AsyncHttpResponse[AggregationResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import ( - AggregateExpr, - AggregateExprFunc, - Period, - PeriodUnit, - Query, - RelativeTimeframe, - SleepColumnExpr, - SleepColumnExprSleep, - Vital, -) - -client = Vital( - api_key="YOUR_API_KEY", -) -client.aggregate.query_one( - user_id="user_id", - timeframe=RelativeTimeframe( - anchor="anchor", - past=Period( - unit=PeriodUnit.MINUTE, - ), - ), - queries=[ - Query( - select=[ - AggregateExpr( - arg=SleepColumnExpr( - sleep=SleepColumnExprSleep.ID, - ), - func=AggregateExprFunc.MEAN, - ) - ], - ) - ], -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**timeframe:** `QueryBatchTimeframe` - -
-
- -
-
- -**queries:** `typing.Sequence[Query]` - -
-
- -
-
- -**config:** `typing.Optional[QueryConfig]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.aggregate.get_result_table_for_continuous_query(...) -> AsyncHttpResponse[AggregationResult] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.aggregate.get_result_table_for_continuous_query( - user_id="user_id", - query_id_or_slug="query_id_or_slug", -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**query_id_or_slug:** `str` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.aggregate.get_task_history_for_continuous_query(...) -> AsyncHttpResponse[ContinuousQueryTaskHistoryResponse] -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from vital import Vital - -client = Vital( - api_key="YOUR_API_KEY", -) -client.aggregate.get_task_history_for_continuous_query( - user_id="user_id", - query_id_or_slug="query_id_or_slug", - next_cursor="next_cursor", - limit=1, -) - -``` -
-
-
-
- -#### âš™ī¸ Parameters - -
-
- -
-
- -**user_id:** `str` - -
-
- -
-
- -**query_id_or_slug:** `str` - -
-
- -
-
- -**next_cursor:** `typing.Optional[str]` - -
-
- -
-
- -**limit:** `typing.Optional[int]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/src/vital/__init__.py b/src/vital/__init__.py index ef6f3ba1..0109c018 100644 --- a/src/vital/__init__.py +++ b/src/vital/__init__.py @@ -37,6 +37,7 @@ AuthType, Availability, AwakeAtValueMacroExpr, + AwakeningsValueMacroExpr, BasalBodyTemperatureEntry, Billing, BiomarkerResult, @@ -51,6 +52,7 @@ BulkOpStatus, BulkOpType, BulkOpsResponse, + CanonicalCandidate, CervicalMucusEntry, CervicalMucusEntryQuality, ChronotypeValueMacroExpr, @@ -218,10 +220,16 @@ ClientFacingInsulinInjectionChangedEventType, ClientFacingInsulinInjectionHistoricalPullCompleted, ClientFacingInsulinInjectionSample, + ClientFacingInsulinInjectionSampleBolusPurpose, + ClientFacingInsulinInjectionSampleDeliveryForm, + ClientFacingInsulinInjectionSampleDeliveryMode, ClientFacingInsulinInjectionSampleType, ClientFacingInsurance, ClientFacingLab, + ClientFacingLabAccount, ClientFacingLabLocation, + ClientFacingLabReportParsingJobCreatedEvent, + ClientFacingLabReportParsingJobUpdatedEvent, ClientFacingLabTest, ClientFacingLabs, ClientFacingLeanBodyMassChanged, @@ -261,6 +269,8 @@ ClientFacingOrderDetails_Testkit, ClientFacingOrderDetails_WalkInTest, ClientFacingOrderEvent, + ClientFacingOrderInTransaction, + ClientFacingOrderTransaction, ClientFacingPatientDetailsCompatible, ClientFacingPayor, ClientFacingPayorCodeSource, @@ -397,6 +407,7 @@ ClientWorkoutResponse, ClinicalInformation, CompanyDetails, + CompendiumSearchLabs, ConnectedSourceClientFacing, ConnectionRecipe, Consent, @@ -407,6 +418,7 @@ ContinuousQueryTaskStatus, ContraceptiveEntry, ContraceptiveEntryType, + ConvertCompendiumResponse, CreateUserPortalUrlResponse, DatePartExpr, DatePartExprArg, @@ -417,6 +429,8 @@ DelegatedFlowType, DemoConnectionStatus, DemoProviders, + DerivedReadinessColumnExpr, + DerivedReadinessColumnExprDerivedReadiness, DetectedDeviationEntry, DetectedDeviationEntryDeviation, DeviceV2InDb, @@ -436,7 +450,9 @@ Gender, GenderIdentity, GetMarkersResponse, + GetOrderTransactionResponse, GetOrdersResponse, + GetTeamLabAccountsResponse, GroupKeyColumnExpr, GroupKeyColumnExprGroupKey, GroupedAFibBurden, @@ -560,12 +576,16 @@ IcdExcludesWarning, IndexColumnExpr, IndexColumnExprIndex, + InsulinInjectionTimeseriesExpr, + InsulinInjectionTimeseriesExprField, IntermenstrualBleedingEntry, Interpretation, IntervalTimeseriesExpr, IntervalTimeseriesExprField, IntervalTimeseriesExprTimeseries, Jpeg, + LabAccountDelegatedFlow, + LabAccountStatus, LabLocationCapability, LabLocationMetadata, LabReportResult, @@ -603,15 +623,20 @@ OAuthProviders, OrderActivationType, OrderLowLevelStatus, + OrderOrigin, OrderSetRequest, OrderStatus, + OrderStatusDetail, + OrderSummary, OrderTopLevelStatus, + OrderTransactionStatus, OvulationTestEntry, OvulationTestEntryTestResult, PaginatedUsersResponse, ParentBiomarkerData, ParsedLabReportData, ParsingJob, + ParsingJobFailureReason, ParsingJobStatus, PasswordProviders, PatientAddress, @@ -619,6 +644,7 @@ PatientAddressWithValidation, PatientDetailsWithValidation, PayorCodeExternalProvider, + PerLabCandidate, PerformingLaboratory, Period, PeriodUnit, @@ -637,6 +663,7 @@ ProviderConnectionCreated, ProviderConnectionError, ProviderConnectionErrorErrorType, + ProviderIdConversionResponse, ProviderLinkResponse, ProviderLinkResponseErrorType, ProviderLinkResponseState, @@ -661,11 +688,13 @@ RawSleep, RawWorkout, Region, + RelatedCandidate, RelativeTimeframe, ResendWebhookResponse, ResourceAvailability, ResponsibleRelationship, ResultMetadata, + ResultMetadataGender, ResultType, SampleData, SampleDataDateCollected, @@ -673,6 +702,8 @@ SampleDataDateReported, ScopeRequirementsGrants, ScopeRequirementsStr, + SearchCompendiumResponse, + SearchMode, Select, Sex, SexualActivityEntry, @@ -708,6 +739,8 @@ TraceElements, UnrecognizedValueMacroExpr, UsAddress, + UsState, + UserAddress, UserHistoricalPullsResponse, UserInfo, UserRefreshErrorResponse, @@ -735,16 +768,19 @@ activity, aggregate, body, + compendium, devices, electrocardiogram, insurance, introspect, + lab_account, lab_report, lab_tests, link, meal, menstrual_cycle, order, + order_transaction, payor, profile, providers, @@ -767,13 +803,6 @@ LabTestsGetRequestOrderDirection, LabTestsGetRequestOrderKey, ) - from .link import ( - LinkBulkExportRequestTeamId, - LinkBulkImportRequestTeamId, - LinkBulkPauseRequestTeamId, - LinkBulkTriggerHistoricalPullRequestTeamId, - LinkListBulkOpsRequestTeamId, - ) from .user import CreateUserPortalUrlBodyContext from .version import __version__ _dynamic_imports: typing.Dict[str, str] = { @@ -808,6 +837,7 @@ "AuthType": ".types", "Availability": ".types", "AwakeAtValueMacroExpr": ".types", + "AwakeningsValueMacroExpr": ".types", "BadRequestError": ".errors", "BasalBodyTemperatureEntry": ".types", "Billing": ".types", @@ -823,6 +853,7 @@ "BulkOpStatus": ".types", "BulkOpType": ".types", "BulkOpsResponse": ".types", + "CanonicalCandidate": ".types", "CervicalMucusEntry": ".types", "CervicalMucusEntryQuality": ".types", "ChronotypeValueMacroExpr": ".types", @@ -990,10 +1021,16 @@ "ClientFacingInsulinInjectionChangedEventType": ".types", "ClientFacingInsulinInjectionHistoricalPullCompleted": ".types", "ClientFacingInsulinInjectionSample": ".types", + "ClientFacingInsulinInjectionSampleBolusPurpose": ".types", + "ClientFacingInsulinInjectionSampleDeliveryForm": ".types", + "ClientFacingInsulinInjectionSampleDeliveryMode": ".types", "ClientFacingInsulinInjectionSampleType": ".types", "ClientFacingInsurance": ".types", "ClientFacingLab": ".types", + "ClientFacingLabAccount": ".types", "ClientFacingLabLocation": ".types", + "ClientFacingLabReportParsingJobCreatedEvent": ".types", + "ClientFacingLabReportParsingJobUpdatedEvent": ".types", "ClientFacingLabTest": ".types", "ClientFacingLabs": ".types", "ClientFacingLeanBodyMassChanged": ".types", @@ -1033,6 +1070,8 @@ "ClientFacingOrderDetails_Testkit": ".types", "ClientFacingOrderDetails_WalkInTest": ".types", "ClientFacingOrderEvent": ".types", + "ClientFacingOrderInTransaction": ".types", + "ClientFacingOrderTransaction": ".types", "ClientFacingPatientDetailsCompatible": ".types", "ClientFacingPayor": ".types", "ClientFacingPayorCodeSource": ".types", @@ -1169,6 +1208,7 @@ "ClientWorkoutResponse": ".types", "ClinicalInformation": ".types", "CompanyDetails": ".types", + "CompendiumSearchLabs": ".types", "ConnectedSourceClientFacing": ".types", "ConnectionRecipe": ".types", "Consent": ".types", @@ -1179,6 +1219,7 @@ "ContinuousQueryTaskStatus": ".types", "ContraceptiveEntry": ".types", "ContraceptiveEntryType": ".types", + "ConvertCompendiumResponse": ".types", "CreateUserPortalUrlBodyContext": ".user", "CreateUserPortalUrlResponse": ".types", "DatePartExpr": ".types", @@ -1190,6 +1231,8 @@ "DelegatedFlowType": ".types", "DemoConnectionStatus": ".types", "DemoProviders": ".types", + "DerivedReadinessColumnExpr": ".types", + "DerivedReadinessColumnExprDerivedReadiness": ".types", "DetectedDeviationEntry": ".types", "DetectedDeviationEntryDeviation": ".types", "DeviceV2InDb": ".types", @@ -1209,7 +1252,9 @@ "Gender": ".types", "GenderIdentity": ".types", "GetMarkersResponse": ".types", + "GetOrderTransactionResponse": ".types", "GetOrdersResponse": ".types", + "GetTeamLabAccountsResponse": ".types", "GroupKeyColumnExpr": ".types", "GroupKeyColumnExprGroupKey": ".types", "GroupedAFibBurden": ".types", @@ -1333,12 +1378,16 @@ "IcdExcludesWarning": ".types", "IndexColumnExpr": ".types", "IndexColumnExprIndex": ".types", + "InsulinInjectionTimeseriesExpr": ".types", + "InsulinInjectionTimeseriesExprField": ".types", "IntermenstrualBleedingEntry": ".types", "Interpretation": ".types", "IntervalTimeseriesExpr": ".types", "IntervalTimeseriesExprField": ".types", "IntervalTimeseriesExprTimeseries": ".types", "Jpeg": ".types", + "LabAccountDelegatedFlow": ".types", + "LabAccountStatus": ".types", "LabLocationCapability": ".types", "LabLocationMetadata": ".types", "LabReportResult": ".types", @@ -1360,11 +1409,6 @@ "Labs": ".types", "LastAttempt": ".types", "LibreConfig": ".types", - "LinkBulkExportRequestTeamId": ".link", - "LinkBulkImportRequestTeamId": ".link", - "LinkBulkPauseRequestTeamId": ".link", - "LinkBulkTriggerHistoricalPullRequestTeamId": ".link", - "LinkListBulkOpsRequestTeamId": ".link", "LinkTokenExchangeResponse": ".types", "LngLat": ".types", "LoincMatch": ".types", @@ -1388,15 +1432,20 @@ "OAuthProviders": ".types", "OrderActivationType": ".types", "OrderLowLevelStatus": ".types", + "OrderOrigin": ".types", "OrderSetRequest": ".types", "OrderStatus": ".types", + "OrderStatusDetail": ".types", + "OrderSummary": ".types", "OrderTopLevelStatus": ".types", + "OrderTransactionStatus": ".types", "OvulationTestEntry": ".types", "OvulationTestEntryTestResult": ".types", "PaginatedUsersResponse": ".types", "ParentBiomarkerData": ".types", "ParsedLabReportData": ".types", "ParsingJob": ".types", + "ParsingJobFailureReason": ".types", "ParsingJobStatus": ".types", "PasswordProviders": ".types", "PatientAddress": ".types", @@ -1404,6 +1453,7 @@ "PatientAddressWithValidation": ".types", "PatientDetailsWithValidation": ".types", "PayorCodeExternalProvider": ".types", + "PerLabCandidate": ".types", "PerformingLaboratory": ".types", "Period": ".types", "PeriodUnit": ".types", @@ -1422,6 +1472,7 @@ "ProviderConnectionCreated": ".types", "ProviderConnectionError": ".types", "ProviderConnectionErrorErrorType": ".types", + "ProviderIdConversionResponse": ".types", "ProviderLinkResponse": ".types", "ProviderLinkResponseErrorType": ".types", "ProviderLinkResponseState": ".types", @@ -1447,11 +1498,13 @@ "RawSleep": ".types", "RawWorkout": ".types", "Region": ".types", + "RelatedCandidate": ".types", "RelativeTimeframe": ".types", "ResendWebhookResponse": ".types", "ResourceAvailability": ".types", "ResponsibleRelationship": ".types", "ResultMetadata": ".types", + "ResultMetadataGender": ".types", "ResultType": ".types", "SampleData": ".types", "SampleDataDateCollected": ".types", @@ -1459,6 +1512,8 @@ "SampleDataDateReported": ".types", "ScopeRequirementsGrants": ".types", "ScopeRequirementsStr": ".types", + "SearchCompendiumResponse": ".types", + "SearchMode": ".types", "Select": ".types", "Sex": ".types", "SexualActivityEntry": ".types", @@ -1495,6 +1550,8 @@ "UnprocessableEntityError": ".errors", "UnrecognizedValueMacroExpr": ".types", "UsAddress": ".types", + "UsState": ".types", + "UserAddress": ".types", "UserHistoricalPullsResponse": ".types", "UserInfo": ".types", "UserRefreshErrorResponse": ".types", @@ -1522,16 +1579,19 @@ "activity": ".activity", "aggregate": ".aggregate", "body": ".body", + "compendium": ".compendium", "devices": ".devices", "electrocardiogram": ".electrocardiogram", "insurance": ".insurance", "introspect": ".introspect", + "lab_account": ".lab_account", "lab_report": ".lab_report", "lab_tests": ".lab_tests", "link": ".link", "meal": ".meal", "menstrual_cycle": ".menstrual_cycle", "order": ".order", + "order_transaction": ".order_transaction", "payor": ".payor", "profile": ".profile", "providers": ".providers", @@ -1598,6 +1658,7 @@ def __dir__(): "AuthType", "Availability", "AwakeAtValueMacroExpr", + "AwakeningsValueMacroExpr", "BadRequestError", "BasalBodyTemperatureEntry", "Billing", @@ -1613,6 +1674,7 @@ def __dir__(): "BulkOpStatus", "BulkOpType", "BulkOpsResponse", + "CanonicalCandidate", "CervicalMucusEntry", "CervicalMucusEntryQuality", "ChronotypeValueMacroExpr", @@ -1780,10 +1842,16 @@ def __dir__(): "ClientFacingInsulinInjectionChangedEventType", "ClientFacingInsulinInjectionHistoricalPullCompleted", "ClientFacingInsulinInjectionSample", + "ClientFacingInsulinInjectionSampleBolusPurpose", + "ClientFacingInsulinInjectionSampleDeliveryForm", + "ClientFacingInsulinInjectionSampleDeliveryMode", "ClientFacingInsulinInjectionSampleType", "ClientFacingInsurance", "ClientFacingLab", + "ClientFacingLabAccount", "ClientFacingLabLocation", + "ClientFacingLabReportParsingJobCreatedEvent", + "ClientFacingLabReportParsingJobUpdatedEvent", "ClientFacingLabTest", "ClientFacingLabs", "ClientFacingLeanBodyMassChanged", @@ -1823,6 +1891,8 @@ def __dir__(): "ClientFacingOrderDetails_Testkit", "ClientFacingOrderDetails_WalkInTest", "ClientFacingOrderEvent", + "ClientFacingOrderInTransaction", + "ClientFacingOrderTransaction", "ClientFacingPatientDetailsCompatible", "ClientFacingPayor", "ClientFacingPayorCodeSource", @@ -1959,6 +2029,7 @@ def __dir__(): "ClientWorkoutResponse", "ClinicalInformation", "CompanyDetails", + "CompendiumSearchLabs", "ConnectedSourceClientFacing", "ConnectionRecipe", "Consent", @@ -1969,6 +2040,7 @@ def __dir__(): "ContinuousQueryTaskStatus", "ContraceptiveEntry", "ContraceptiveEntryType", + "ConvertCompendiumResponse", "CreateUserPortalUrlBodyContext", "CreateUserPortalUrlResponse", "DatePartExpr", @@ -1980,6 +2052,8 @@ def __dir__(): "DelegatedFlowType", "DemoConnectionStatus", "DemoProviders", + "DerivedReadinessColumnExpr", + "DerivedReadinessColumnExprDerivedReadiness", "DetectedDeviationEntry", "DetectedDeviationEntryDeviation", "DeviceV2InDb", @@ -1999,7 +2073,9 @@ def __dir__(): "Gender", "GenderIdentity", "GetMarkersResponse", + "GetOrderTransactionResponse", "GetOrdersResponse", + "GetTeamLabAccountsResponse", "GroupKeyColumnExpr", "GroupKeyColumnExprGroupKey", "GroupedAFibBurden", @@ -2123,12 +2199,16 @@ def __dir__(): "IcdExcludesWarning", "IndexColumnExpr", "IndexColumnExprIndex", + "InsulinInjectionTimeseriesExpr", + "InsulinInjectionTimeseriesExprField", "IntermenstrualBleedingEntry", "Interpretation", "IntervalTimeseriesExpr", "IntervalTimeseriesExprField", "IntervalTimeseriesExprTimeseries", "Jpeg", + "LabAccountDelegatedFlow", + "LabAccountStatus", "LabLocationCapability", "LabLocationMetadata", "LabReportResult", @@ -2150,11 +2230,6 @@ def __dir__(): "Labs", "LastAttempt", "LibreConfig", - "LinkBulkExportRequestTeamId", - "LinkBulkImportRequestTeamId", - "LinkBulkPauseRequestTeamId", - "LinkBulkTriggerHistoricalPullRequestTeamId", - "LinkListBulkOpsRequestTeamId", "LinkTokenExchangeResponse", "LngLat", "LoincMatch", @@ -2178,15 +2253,20 @@ def __dir__(): "OAuthProviders", "OrderActivationType", "OrderLowLevelStatus", + "OrderOrigin", "OrderSetRequest", "OrderStatus", + "OrderStatusDetail", + "OrderSummary", "OrderTopLevelStatus", + "OrderTransactionStatus", "OvulationTestEntry", "OvulationTestEntryTestResult", "PaginatedUsersResponse", "ParentBiomarkerData", "ParsedLabReportData", "ParsingJob", + "ParsingJobFailureReason", "ParsingJobStatus", "PasswordProviders", "PatientAddress", @@ -2194,6 +2274,7 @@ def __dir__(): "PatientAddressWithValidation", "PatientDetailsWithValidation", "PayorCodeExternalProvider", + "PerLabCandidate", "PerformingLaboratory", "Period", "PeriodUnit", @@ -2212,6 +2293,7 @@ def __dir__(): "ProviderConnectionCreated", "ProviderConnectionError", "ProviderConnectionErrorErrorType", + "ProviderIdConversionResponse", "ProviderLinkResponse", "ProviderLinkResponseErrorType", "ProviderLinkResponseState", @@ -2237,11 +2319,13 @@ def __dir__(): "RawSleep", "RawWorkout", "Region", + "RelatedCandidate", "RelativeTimeframe", "ResendWebhookResponse", "ResourceAvailability", "ResponsibleRelationship", "ResultMetadata", + "ResultMetadataGender", "ResultType", "SampleData", "SampleDataDateCollected", @@ -2249,6 +2333,8 @@ def __dir__(): "SampleDataDateReported", "ScopeRequirementsGrants", "ScopeRequirementsStr", + "SearchCompendiumResponse", + "SearchMode", "Select", "Sex", "SexualActivityEntry", @@ -2285,6 +2371,8 @@ def __dir__(): "UnprocessableEntityError", "UnrecognizedValueMacroExpr", "UsAddress", + "UsState", + "UserAddress", "UserHistoricalPullsResponse", "UserInfo", "UserRefreshErrorResponse", @@ -2312,16 +2400,19 @@ def __dir__(): "activity", "aggregate", "body", + "compendium", "devices", "electrocardiogram", "insurance", "introspect", + "lab_account", "lab_report", "lab_tests", "link", "meal", "menstrual_cycle", "order", + "order_transaction", "payor", "profile", "providers", diff --git a/src/vital/client.py b/src/vital/client.py index 1cc40c42..05f0a0c6 100644 --- a/src/vital/client.py +++ b/src/vital/client.py @@ -6,22 +6,26 @@ import httpx from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .core.logging import LogConfig, Logger from .environment import VitalEnvironment if typing.TYPE_CHECKING: from .activity.client import ActivityClient, AsyncActivityClient from .aggregate.client import AggregateClient, AsyncAggregateClient from .body.client import AsyncBodyClient, BodyClient + from .compendium.client import AsyncCompendiumClient, CompendiumClient from .devices.client import AsyncDevicesClient, DevicesClient from .electrocardiogram.client import AsyncElectrocardiogramClient, ElectrocardiogramClient from .insurance.client import AsyncInsuranceClient, InsuranceClient from .introspect.client import AsyncIntrospectClient, IntrospectClient + from .lab_account.client import AsyncLabAccountClient, LabAccountClient from .lab_report.client import AsyncLabReportClient, LabReportClient from .lab_tests.client import AsyncLabTestsClient, LabTestsClient from .link.client import AsyncLinkClient, LinkClient from .meal.client import AsyncMealClient, MealClient from .menstrual_cycle.client import AsyncMenstrualCycleClient, MenstrualCycleClient from .order.client import AsyncOrderClient, OrderClient + from .order_transaction.client import AsyncOrderTransactionClient, OrderTransactionClient from .payor.client import AsyncPayorClient, PayorClient from .profile.client import AsyncProfileClient, ProfileClient from .providers.client import AsyncProvidersClient, ProvidersClient @@ -65,6 +69,9 @@ class Vital: httpx_client : typing.Optional[httpx.Client] The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + logging : typing.Optional[typing.Union[LogConfig, Logger]] + Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance. + Examples -------- from vital import Vital @@ -84,6 +91,7 @@ def __init__( timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.Client] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): _defaulted_timeout = ( timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read @@ -98,6 +106,7 @@ def __init__( if follow_redirects is not None else httpx.Client(timeout=_defaulted_timeout), timeout=_defaulted_timeout, + logging=logging, ) self._link: typing.Optional[LinkClient] = None self._electrocardiogram: typing.Optional[ElectrocardiogramClient] = None @@ -116,6 +125,9 @@ def __init__( self._providers: typing.Optional[ProvidersClient] = None self._introspect: typing.Optional[IntrospectClient] = None self._lab_tests: typing.Optional[LabTestsClient] = None + self._compendium: typing.Optional[CompendiumClient] = None + self._lab_account: typing.Optional[LabAccountClient] = None + self._order_transaction: typing.Optional[OrderTransactionClient] = None self._testkit: typing.Optional[TestkitClient] = None self._order: typing.Optional[OrderClient] = None self._insurance: typing.Optional[InsuranceClient] = None @@ -259,6 +271,30 @@ def lab_tests(self): self._lab_tests = LabTestsClient(client_wrapper=self._client_wrapper) return self._lab_tests + @property + def compendium(self): + if self._compendium is None: + from .compendium.client import CompendiumClient # noqa: E402 + + self._compendium = CompendiumClient(client_wrapper=self._client_wrapper) + return self._compendium + + @property + def lab_account(self): + if self._lab_account is None: + from .lab_account.client import LabAccountClient # noqa: E402 + + self._lab_account = LabAccountClient(client_wrapper=self._client_wrapper) + return self._lab_account + + @property + def order_transaction(self): + if self._order_transaction is None: + from .order_transaction.client import OrderTransactionClient # noqa: E402 + + self._order_transaction = OrderTransactionClient(client_wrapper=self._client_wrapper) + return self._order_transaction + @property def testkit(self): if self._testkit is None: @@ -339,6 +375,9 @@ class AsyncVital: httpx_client : typing.Optional[httpx.AsyncClient] The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + logging : typing.Optional[typing.Union[LogConfig, Logger]] + Configure logging for the SDK. Accepts a LogConfig dict with 'level' (debug/info/warn/error), 'logger' (custom logger implementation), and 'silent' (boolean, defaults to True) fields. You can also pass a pre-configured Logger instance. + Examples -------- from vital import AsyncVital @@ -358,6 +397,7 @@ def __init__( timeout: typing.Optional[float] = None, follow_redirects: typing.Optional[bool] = True, httpx_client: typing.Optional[httpx.AsyncClient] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): _defaulted_timeout = ( timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read @@ -372,6 +412,7 @@ def __init__( if follow_redirects is not None else httpx.AsyncClient(timeout=_defaulted_timeout), timeout=_defaulted_timeout, + logging=logging, ) self._link: typing.Optional[AsyncLinkClient] = None self._electrocardiogram: typing.Optional[AsyncElectrocardiogramClient] = None @@ -390,6 +431,9 @@ def __init__( self._providers: typing.Optional[AsyncProvidersClient] = None self._introspect: typing.Optional[AsyncIntrospectClient] = None self._lab_tests: typing.Optional[AsyncLabTestsClient] = None + self._compendium: typing.Optional[AsyncCompendiumClient] = None + self._lab_account: typing.Optional[AsyncLabAccountClient] = None + self._order_transaction: typing.Optional[AsyncOrderTransactionClient] = None self._testkit: typing.Optional[AsyncTestkitClient] = None self._order: typing.Optional[AsyncOrderClient] = None self._insurance: typing.Optional[AsyncInsuranceClient] = None @@ -533,6 +577,30 @@ def lab_tests(self): self._lab_tests = AsyncLabTestsClient(client_wrapper=self._client_wrapper) return self._lab_tests + @property + def compendium(self): + if self._compendium is None: + from .compendium.client import AsyncCompendiumClient # noqa: E402 + + self._compendium = AsyncCompendiumClient(client_wrapper=self._client_wrapper) + return self._compendium + + @property + def lab_account(self): + if self._lab_account is None: + from .lab_account.client import AsyncLabAccountClient # noqa: E402 + + self._lab_account = AsyncLabAccountClient(client_wrapper=self._client_wrapper) + return self._lab_account + + @property + def order_transaction(self): + if self._order_transaction is None: + from .order_transaction.client import AsyncOrderTransactionClient # noqa: E402 + + self._order_transaction = AsyncOrderTransactionClient(client_wrapper=self._client_wrapper) + return self._order_transaction + @property def testkit(self): if self._testkit is None: diff --git a/src/vital/compendium/__init__.py b/src/vital/compendium/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/vital/compendium/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/vital/compendium/client.py b/src/vital/compendium/client.py new file mode 100644 index 00000000..6f6a61dc --- /dev/null +++ b/src/vital/compendium/client.py @@ -0,0 +1,278 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.compendium_search_labs import CompendiumSearchLabs +from ..types.convert_compendium_response import ConvertCompendiumResponse +from ..types.search_compendium_response import SearchCompendiumResponse +from ..types.search_mode import SearchMode +from .raw_client import AsyncRawCompendiumClient, RawCompendiumClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class CompendiumClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawCompendiumClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawCompendiumClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawCompendiumClient + """ + return self._raw_client + + def search( + self, + *, + mode: SearchMode, + query: typing.Optional[str] = OMIT, + cpt_codes: typing.Optional[typing.Sequence[str]] = OMIT, + loinc_set_hash: typing.Optional[str] = OMIT, + labs: typing.Optional[typing.Sequence[CompendiumSearchLabs]] = OMIT, + include_related: typing.Optional[bool] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SearchCompendiumResponse: + """ + Parameters + ---------- + mode : SearchMode + + query : typing.Optional[str] + + cpt_codes : typing.Optional[typing.Sequence[str]] + + loinc_set_hash : typing.Optional[str] + + labs : typing.Optional[typing.Sequence[CompendiumSearchLabs]] + + include_related : typing.Optional[bool] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SearchCompendiumResponse + Successful Response + + Examples + -------- + from vital import SearchMode, Vital + + client = Vital( + api_key="YOUR_API_KEY", + ) + client.compendium.search( + mode=SearchMode.CANONICAL, + ) + """ + _response = self._raw_client.search( + mode=mode, + query=query, + cpt_codes=cpt_codes, + loinc_set_hash=loinc_set_hash, + labs=labs, + include_related=include_related, + limit=limit, + request_options=request_options, + ) + return _response.data + + def convert( + self, + *, + target_lab: CompendiumSearchLabs, + lab_test_id: typing.Optional[str] = OMIT, + provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ConvertCompendiumResponse: + """ + Parameters + ---------- + target_lab : CompendiumSearchLabs + + lab_test_id : typing.Optional[str] + + provider_ids : typing.Optional[typing.Sequence[str]] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ConvertCompendiumResponse + Successful Response + + Examples + -------- + from vital import CompendiumSearchLabs, Vital + + client = Vital( + api_key="YOUR_API_KEY", + ) + client.compendium.convert( + target_lab=CompendiumSearchLabs.LABCORP, + ) + """ + _response = self._raw_client.convert( + target_lab=target_lab, + lab_test_id=lab_test_id, + provider_ids=provider_ids, + limit=limit, + request_options=request_options, + ) + return _response.data + + +class AsyncCompendiumClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawCompendiumClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawCompendiumClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawCompendiumClient + """ + return self._raw_client + + async def search( + self, + *, + mode: SearchMode, + query: typing.Optional[str] = OMIT, + cpt_codes: typing.Optional[typing.Sequence[str]] = OMIT, + loinc_set_hash: typing.Optional[str] = OMIT, + labs: typing.Optional[typing.Sequence[CompendiumSearchLabs]] = OMIT, + include_related: typing.Optional[bool] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> SearchCompendiumResponse: + """ + Parameters + ---------- + mode : SearchMode + + query : typing.Optional[str] + + cpt_codes : typing.Optional[typing.Sequence[str]] + + loinc_set_hash : typing.Optional[str] + + labs : typing.Optional[typing.Sequence[CompendiumSearchLabs]] + + include_related : typing.Optional[bool] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + SearchCompendiumResponse + Successful Response + + Examples + -------- + import asyncio + + from vital import AsyncVital, SearchMode + + client = AsyncVital( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.compendium.search( + mode=SearchMode.CANONICAL, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.search( + mode=mode, + query=query, + cpt_codes=cpt_codes, + loinc_set_hash=loinc_set_hash, + labs=labs, + include_related=include_related, + limit=limit, + request_options=request_options, + ) + return _response.data + + async def convert( + self, + *, + target_lab: CompendiumSearchLabs, + lab_test_id: typing.Optional[str] = OMIT, + provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ConvertCompendiumResponse: + """ + Parameters + ---------- + target_lab : CompendiumSearchLabs + + lab_test_id : typing.Optional[str] + + provider_ids : typing.Optional[typing.Sequence[str]] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ConvertCompendiumResponse + Successful Response + + Examples + -------- + import asyncio + + from vital import AsyncVital, CompendiumSearchLabs + + client = AsyncVital( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.compendium.convert( + target_lab=CompendiumSearchLabs.LABCORP, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.convert( + target_lab=target_lab, + lab_test_id=lab_test_id, + provider_ids=provider_ids, + limit=limit, + request_options=request_options, + ) + return _response.data diff --git a/src/vital/compendium/raw_client.py b/src/vital/compendium/raw_client.py new file mode 100644 index 00000000..3c5caa3f --- /dev/null +++ b/src/vital/compendium/raw_client.py @@ -0,0 +1,329 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.unprocessable_entity_error import UnprocessableEntityError +from ..types.compendium_search_labs import CompendiumSearchLabs +from ..types.convert_compendium_response import ConvertCompendiumResponse +from ..types.http_validation_error import HttpValidationError +from ..types.search_compendium_response import SearchCompendiumResponse +from ..types.search_mode import SearchMode + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawCompendiumClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def search( + self, + *, + mode: SearchMode, + query: typing.Optional[str] = OMIT, + cpt_codes: typing.Optional[typing.Sequence[str]] = OMIT, + loinc_set_hash: typing.Optional[str] = OMIT, + labs: typing.Optional[typing.Sequence[CompendiumSearchLabs]] = OMIT, + include_related: typing.Optional[bool] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[SearchCompendiumResponse]: + """ + Parameters + ---------- + mode : SearchMode + + query : typing.Optional[str] + + cpt_codes : typing.Optional[typing.Sequence[str]] + + loinc_set_hash : typing.Optional[str] + + labs : typing.Optional[typing.Sequence[CompendiumSearchLabs]] + + include_related : typing.Optional[bool] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[SearchCompendiumResponse] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + "v3/compendium/search", + method="POST", + json={ + "mode": mode, + "query": query, + "cpt_codes": cpt_codes, + "loinc_set_hash": loinc_set_hash, + "labs": labs, + "include_related": include_related, + "limit": limit, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SearchCompendiumResponse, + parse_obj_as( + type_=SearchCompendiumResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def convert( + self, + *, + target_lab: CompendiumSearchLabs, + lab_test_id: typing.Optional[str] = OMIT, + provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[ConvertCompendiumResponse]: + """ + Parameters + ---------- + target_lab : CompendiumSearchLabs + + lab_test_id : typing.Optional[str] + + provider_ids : typing.Optional[typing.Sequence[str]] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ConvertCompendiumResponse] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + "v3/compendium/convert", + method="POST", + json={ + "lab_test_id": lab_test_id, + "provider_ids": provider_ids, + "target_lab": target_lab, + "limit": limit, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ConvertCompendiumResponse, + parse_obj_as( + type_=ConvertCompendiumResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawCompendiumClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def search( + self, + *, + mode: SearchMode, + query: typing.Optional[str] = OMIT, + cpt_codes: typing.Optional[typing.Sequence[str]] = OMIT, + loinc_set_hash: typing.Optional[str] = OMIT, + labs: typing.Optional[typing.Sequence[CompendiumSearchLabs]] = OMIT, + include_related: typing.Optional[bool] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[SearchCompendiumResponse]: + """ + Parameters + ---------- + mode : SearchMode + + query : typing.Optional[str] + + cpt_codes : typing.Optional[typing.Sequence[str]] + + loinc_set_hash : typing.Optional[str] + + labs : typing.Optional[typing.Sequence[CompendiumSearchLabs]] + + include_related : typing.Optional[bool] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[SearchCompendiumResponse] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + "v3/compendium/search", + method="POST", + json={ + "mode": mode, + "query": query, + "cpt_codes": cpt_codes, + "loinc_set_hash": loinc_set_hash, + "labs": labs, + "include_related": include_related, + "limit": limit, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + SearchCompendiumResponse, + parse_obj_as( + type_=SearchCompendiumResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def convert( + self, + *, + target_lab: CompendiumSearchLabs, + lab_test_id: typing.Optional[str] = OMIT, + provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, + limit: typing.Optional[int] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[ConvertCompendiumResponse]: + """ + Parameters + ---------- + target_lab : CompendiumSearchLabs + + lab_test_id : typing.Optional[str] + + provider_ids : typing.Optional[typing.Sequence[str]] + + limit : typing.Optional[int] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ConvertCompendiumResponse] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + "v3/compendium/convert", + method="POST", + json={ + "lab_test_id": lab_test_id, + "provider_ids": provider_ids, + "target_lab": target_lab, + "limit": limit, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ConvertCompendiumResponse, + parse_obj_as( + type_=ConvertCompendiumResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/vital/core/__init__.py b/src/vital/core/__init__.py index 9a33e233..75b240ce 100644 --- a/src/vital/core/__init__.py +++ b/src/vital/core/__init__.py @@ -13,6 +13,7 @@ from .http_client import AsyncHttpClient, HttpClient from .http_response import AsyncHttpResponse, HttpResponse from .jsonable_encoder import jsonable_encoder + from .logging import ConsoleLogger, ILogger, LogConfig, LogLevel, Logger, create_logger from .pydantic_utilities import ( IS_PYDANTIC_V2, UniversalBaseModel, @@ -32,17 +33,23 @@ "AsyncHttpClient": ".http_client", "AsyncHttpResponse": ".http_response", "BaseClientWrapper": ".client_wrapper", + "ConsoleLogger": ".logging", "FieldMetadata": ".serialization", "File": ".file", "HttpClient": ".http_client", "HttpResponse": ".http_response", + "ILogger": ".logging", "IS_PYDANTIC_V2": ".pydantic_utilities", + "LogConfig": ".logging", + "LogLevel": ".logging", + "Logger": ".logging", "RequestOptions": ".request_options", "SyncClientWrapper": ".client_wrapper", "UniversalBaseModel": ".pydantic_utilities", "UniversalRootModel": ".pydantic_utilities", "convert_and_respect_annotation_metadata": ".serialization", "convert_file_dict_to_httpx_tuples": ".file", + "create_logger": ".logging", "encode_query": ".query_encoder", "jsonable_encoder": ".jsonable_encoder", "parse_obj_as": ".pydantic_utilities", @@ -82,17 +89,23 @@ def __dir__(): "AsyncHttpClient", "AsyncHttpResponse", "BaseClientWrapper", + "ConsoleLogger", "FieldMetadata", "File", "HttpClient", "HttpResponse", + "ILogger", "IS_PYDANTIC_V2", + "LogConfig", + "LogLevel", + "Logger", "RequestOptions", "SyncClientWrapper", "UniversalBaseModel", "UniversalRootModel", "convert_and_respect_annotation_metadata", "convert_file_dict_to_httpx_tuples", + "create_logger", "encode_query", "jsonable_encoder", "parse_obj_as", diff --git a/src/vital/core/client_wrapper.py b/src/vital/core/client_wrapper.py index 69aaa0ad..811663ef 100644 --- a/src/vital/core/client_wrapper.py +++ b/src/vital/core/client_wrapper.py @@ -4,6 +4,7 @@ import httpx from .http_client import AsyncHttpClient, HttpClient +from .logging import LogConfig, Logger class BaseClientWrapper: @@ -14,18 +15,24 @@ def __init__( headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self.api_key = api_key self._headers = headers self._base_url = base_url self._timeout = timeout + self._logging = logging def get_headers(self) -> typing.Dict[str, str]: + import platform + headers: typing.Dict[str, str] = { - "User-Agent": "vital/2.1.569", + "User-Agent": "vital/3.0.0", "X-Fern-Language": "Python", + "X-Fern-Runtime": f"python/{platform.python_version()}", + "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "vital", - "X-Fern-SDK-Version": "2.1.569", + "X-Fern-SDK-Version": "3.0.0", **(self.get_custom_headers() or {}), } headers["x-vital-api-key"] = self.api_key @@ -49,14 +56,16 @@ def __init__( headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, httpx_client: httpx.Client, ): - super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout) + super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout, logging=logging) self.httpx_client = HttpClient( httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout, base_url=self.get_base_url, + logging_config=self._logging, ) @@ -68,10 +77,11 @@ def __init__( headers: typing.Optional[typing.Dict[str, str]] = None, base_url: str, timeout: typing.Optional[float] = None, + logging: typing.Optional[typing.Union[LogConfig, Logger]] = None, async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, httpx_client: httpx.AsyncClient, ): - super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout) + super().__init__(api_key=api_key, headers=headers, base_url=base_url, timeout=timeout, logging=logging) self._async_token = async_token self.httpx_client = AsyncHttpClient( httpx_client=httpx_client, @@ -79,6 +89,7 @@ def __init__( base_timeout=self.get_timeout, base_url=self.get_base_url, async_base_headers=self.async_get_headers, + logging_config=self._logging, ) async def async_get_headers(self) -> typing.Dict[str, str]: diff --git a/src/vital/core/http_client.py b/src/vital/core/http_client.py index 7c6c936f..ee937589 100644 --- a/src/vital/core/http_client.py +++ b/src/vital/core/http_client.py @@ -12,6 +12,7 @@ from .file import File, convert_file_dict_to_httpx_tuples from .force_multipart import FORCE_MULTIPART from .jsonable_encoder import jsonable_encoder +from .logging import LogConfig, Logger, create_logger from .query_encoder import encode_query from .remove_none_from_dict import remove_none_from_dict as remove_none_from_dict from .request_options import RequestOptions @@ -122,6 +123,32 @@ def _should_retry(response: httpx.Response) -> bool: return response.status_code >= 500 or response.status_code in retryable_400s +_SENSITIVE_HEADERS = frozenset( + { + "authorization", + "www-authenticate", + "x-api-key", + "api-key", + "apikey", + "x-api-token", + "x-auth-token", + "auth-token", + "cookie", + "set-cookie", + "proxy-authorization", + "proxy-authenticate", + "x-csrf-token", + "x-xsrf-token", + "x-session-token", + "x-access-token", + } +) + + +def _redact_headers(headers: typing.Dict[str, str]) -> typing.Dict[str, str]: + return {k: ("[REDACTED]" if k.lower() in _SENSITIVE_HEADERS else v) for k, v in headers.items()} + + def _build_url(base_url: str, path: typing.Optional[str]) -> str: """ Build a full URL by joining a base URL with a path. @@ -238,11 +265,13 @@ def __init__( base_timeout: typing.Callable[[], typing.Optional[float]], base_headers: typing.Callable[[], typing.Dict[str, str]], base_url: typing.Optional[typing.Callable[[], str]] = None, + logging_config: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self.base_url = base_url self.base_timeout = base_timeout self.base_headers = base_headers self.httpx_client = httpx_client + self.logger = create_logger(logging_config) def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: base_url = maybe_base_url @@ -315,18 +344,30 @@ def request( ) ) + _request_url = _build_url(base_url, path) + _request_headers = jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ) + + if self.logger.is_debug(): + self.logger.debug( + "Making HTTP request", + method=method, + url=_request_url, + headers=_redact_headers(_request_headers), + has_body=json_body is not None or data_body is not None, + ) + response = self.httpx_client.request( method=method, - url=_build_url(base_url, path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), + url=_request_url, + headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, @@ -353,6 +394,24 @@ def request( omit=omit, ) + if self.logger.is_debug(): + if 200 <= response.status_code < 400: + self.logger.debug( + "HTTP request succeeded", + method=method, + url=_request_url, + status_code=response.status_code, + ) + + if self.logger.is_error(): + if response.status_code >= 400: + self.logger.error( + "HTTP request failed with error status", + method=method, + url=_request_url, + status_code=response.status_code, + ) + return response @contextmanager @@ -418,18 +477,29 @@ def stream( ) ) + _request_url = _build_url(base_url, path) + _request_headers = jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ) + + if self.logger.is_debug(): + self.logger.debug( + "Making streaming HTTP request", + method=method, + url=_request_url, + headers=_redact_headers(_request_headers), + ) + with self.httpx_client.stream( method=method, - url=_build_url(base_url, path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), + url=_request_url, + headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, @@ -449,12 +519,14 @@ def __init__( base_headers: typing.Callable[[], typing.Dict[str, str]], base_url: typing.Optional[typing.Callable[[], str]] = None, async_base_headers: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Dict[str, str]]]] = None, + logging_config: typing.Optional[typing.Union[LogConfig, Logger]] = None, ): self.base_url = base_url self.base_timeout = base_timeout self.base_headers = base_headers self.async_base_headers = async_base_headers self.httpx_client = httpx_client + self.logger = create_logger(logging_config) async def _get_headers(self) -> typing.Dict[str, str]: if self.async_base_headers is not None: @@ -535,19 +607,30 @@ async def request( ) ) - # Add the input to each of these and do None-safety checks + _request_url = _build_url(base_url, path) + _request_headers = jsonable_encoder( + remove_none_from_dict( + { + **_headers, + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ) + + if self.logger.is_debug(): + self.logger.debug( + "Making HTTP request", + method=method, + url=_request_url, + headers=_redact_headers(_request_headers), + has_body=json_body is not None or data_body is not None, + ) + response = await self.httpx_client.request( method=method, - url=_build_url(base_url, path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **_headers, - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), + url=_request_url, + headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, @@ -573,6 +656,25 @@ async def request( retries=retries + 1, omit=omit, ) + + if self.logger.is_debug(): + if 200 <= response.status_code < 400: + self.logger.debug( + "HTTP request succeeded", + method=method, + url=_request_url, + status_code=response.status_code, + ) + + if self.logger.is_error(): + if response.status_code >= 400: + self.logger.error( + "HTTP request failed with error status", + method=method, + url=_request_url, + status_code=response.status_code, + ) + return response @asynccontextmanager @@ -641,18 +743,29 @@ async def stream( ) ) + _request_url = _build_url(base_url, path) + _request_headers = jsonable_encoder( + remove_none_from_dict( + { + **_headers, + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ) + + if self.logger.is_debug(): + self.logger.debug( + "Making streaming HTTP request", + method=method, + url=_request_url, + headers=_redact_headers(_request_headers), + ) + async with self.httpx_client.stream( method=method, - url=_build_url(base_url, path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **_headers, - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), + url=_request_url, + headers=_request_headers, params=_encoded_params if _encoded_params else None, json=json_body, data=data_body, diff --git a/src/vital/core/http_response.py b/src/vital/core/http_response.py index 2479747e..00bb1096 100644 --- a/src/vital/core/http_response.py +++ b/src/vital/core/http_response.py @@ -9,7 +9,7 @@ class BaseHttpResponse: - """Minimalist HTTP response wrapper that exposes response headers.""" + """Minimalist HTTP response wrapper that exposes response headers and status code.""" _response: httpx.Response @@ -20,6 +20,10 @@ def __init__(self, response: httpx.Response): def headers(self) -> Dict[str, str]: return dict(self._response.headers) + @property + def status_code(self) -> int: + return self._response.status_code + class HttpResponse(Generic[T], BaseHttpResponse): """HTTP response wrapper that exposes response headers and data.""" diff --git a/src/vital/core/jsonable_encoder.py b/src/vital/core/jsonable_encoder.py index afee3662..f8beaeaf 100644 --- a/src/vital/core/jsonable_encoder.py +++ b/src/vital/core/jsonable_encoder.py @@ -30,6 +30,10 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: custom_encoder = custom_encoder or {} + # Generated SDKs use Ellipsis (`...`) as the sentinel value for "OMIT". + # OMIT values should be excluded from serialized payloads. + if obj is Ellipsis: + return None if custom_encoder: if type(obj) in custom_encoder: return custom_encoder[type(obj)](obj) @@ -70,6 +74,8 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any] allowed_keys = set(obj.keys()) for key, value in obj.items(): if key in allowed_keys: + if value is Ellipsis: + continue encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) encoded_dict[encoded_key] = encoded_value @@ -77,6 +83,8 @@ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any] if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): encoded_list = [] for item in obj: + if item is Ellipsis: + continue encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) return encoded_list diff --git a/src/vital/core/logging.py b/src/vital/core/logging.py new file mode 100644 index 00000000..e5e57245 --- /dev/null +++ b/src/vital/core/logging.py @@ -0,0 +1,107 @@ +# This file was auto-generated by Fern from our API Definition. + +import logging +import typing + +LogLevel = typing.Literal["debug", "info", "warn", "error"] + +_LOG_LEVEL_MAP: typing.Dict[LogLevel, int] = { + "debug": 1, + "info": 2, + "warn": 3, + "error": 4, +} + + +class ILogger(typing.Protocol): + def debug(self, message: str, **kwargs: typing.Any) -> None: ... + def info(self, message: str, **kwargs: typing.Any) -> None: ... + def warn(self, message: str, **kwargs: typing.Any) -> None: ... + def error(self, message: str, **kwargs: typing.Any) -> None: ... + + +class ConsoleLogger: + _logger: logging.Logger + + def __init__(self) -> None: + self._logger = logging.getLogger("fern") + if not self._logger.handlers: + handler = logging.StreamHandler() + handler.setFormatter(logging.Formatter("%(levelname)s - %(message)s")) + self._logger.addHandler(handler) + self._logger.setLevel(logging.DEBUG) + + def debug(self, message: str, **kwargs: typing.Any) -> None: + self._logger.debug(message, extra=kwargs) + + def info(self, message: str, **kwargs: typing.Any) -> None: + self._logger.info(message, extra=kwargs) + + def warn(self, message: str, **kwargs: typing.Any) -> None: + self._logger.warning(message, extra=kwargs) + + def error(self, message: str, **kwargs: typing.Any) -> None: + self._logger.error(message, extra=kwargs) + + +class LogConfig(typing.TypedDict, total=False): + level: LogLevel + logger: ILogger + silent: bool + + +class Logger: + _level: int + _logger: ILogger + _silent: bool + + def __init__(self, *, level: LogLevel, logger: ILogger, silent: bool) -> None: + self._level = _LOG_LEVEL_MAP[level] + self._logger = logger + self._silent = silent + + def _should_log(self, level: LogLevel) -> bool: + return not self._silent and self._level <= _LOG_LEVEL_MAP[level] + + def is_debug(self) -> bool: + return self._should_log("debug") + + def is_info(self) -> bool: + return self._should_log("info") + + def is_warn(self) -> bool: + return self._should_log("warn") + + def is_error(self) -> bool: + return self._should_log("error") + + def debug(self, message: str, **kwargs: typing.Any) -> None: + if self.is_debug(): + self._logger.debug(message, **kwargs) + + def info(self, message: str, **kwargs: typing.Any) -> None: + if self.is_info(): + self._logger.info(message, **kwargs) + + def warn(self, message: str, **kwargs: typing.Any) -> None: + if self.is_warn(): + self._logger.warn(message, **kwargs) + + def error(self, message: str, **kwargs: typing.Any) -> None: + if self.is_error(): + self._logger.error(message, **kwargs) + + +_default_logger: Logger = Logger(level="info", logger=ConsoleLogger(), silent=True) + + +def create_logger(config: typing.Optional[typing.Union[LogConfig, Logger]] = None) -> Logger: + if config is None: + return _default_logger + if isinstance(config, Logger): + return config + return Logger( + level=config.get("level", "info"), + logger=config.get("logger", ConsoleLogger()), + silent=config.get("silent", True), + ) diff --git a/src/vital/core/pydantic_utilities.py b/src/vital/core/pydantic_utilities.py index 1da6f10a..e3a97226 100644 --- a/src/vital/core/pydantic_utilities.py +++ b/src/vital/core/pydantic_utilities.py @@ -2,22 +2,49 @@ # nopycln: file import datetime as dt +import inspect +import json +import logging from collections import defaultdict -from typing import Any, Callable, Dict, List, Mapping, Tuple, Type, TypeVar, Union, cast +from dataclasses import asdict +from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, TypeVar, Union, cast import pydantic +import typing_extensions + +_logger = logging.getLogger(__name__) + +if TYPE_CHECKING: + from .http_sse._models import ServerSentEvent IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") if IS_PYDANTIC_V2: - from pydantic.v1.datetime_parse import parse_date as parse_date - from pydantic.v1.datetime_parse import parse_datetime as parse_datetime - from pydantic.v1.fields import ModelField as ModelField - from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] - from pydantic.v1.typing import get_args as get_args - from pydantic.v1.typing import get_origin as get_origin - from pydantic.v1.typing import is_literal_type as is_literal_type - from pydantic.v1.typing import is_union as is_union + import warnings + + _datetime_adapter = pydantic.TypeAdapter(dt.datetime) # type: ignore[attr-defined] + _date_adapter = pydantic.TypeAdapter(dt.date) # type: ignore[attr-defined] + + def parse_datetime(value: Any) -> dt.datetime: # type: ignore[misc] + if isinstance(value, dt.datetime): + return value + return _datetime_adapter.validate_python(value) + + def parse_date(value: Any) -> dt.date: # type: ignore[misc] + if isinstance(value, dt.datetime): + return value.date() + if isinstance(value, dt.date): + return value + return _date_adapter.validate_python(value) + + with warnings.catch_warnings(): + warnings.simplefilter("ignore", UserWarning) + from pydantic.v1.fields import ModelField as ModelField + from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] + from pydantic.v1.typing import get_args as get_args + from pydantic.v1.typing import get_origin as get_origin + from pydantic.v1.typing import is_literal_type as is_literal_type + from pydantic.v1.typing import is_union as is_union else: from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] @@ -35,6 +62,169 @@ Model = TypeVar("Model", bound=pydantic.BaseModel) +def _get_discriminator_and_variants(type_: Type[Any]) -> Tuple[Optional[str], Optional[List[Type[Any]]]]: + """ + Extract the discriminator field name and union variants from a discriminated union type. + Supports Annotated[Union[...], Field(discriminator=...)] patterns. + Returns (discriminator, variants) or (None, None) if not a discriminated union. + """ + origin = typing_extensions.get_origin(type_) + + if origin is typing_extensions.Annotated: + args = typing_extensions.get_args(type_) + if len(args) >= 2: + inner_type = args[0] + # Check annotations for discriminator + discriminator = None + for annotation in args[1:]: + if hasattr(annotation, "discriminator"): + discriminator = getattr(annotation, "discriminator", None) + break + + if discriminator: + inner_origin = typing_extensions.get_origin(inner_type) + if inner_origin is Union: + variants = list(typing_extensions.get_args(inner_type)) + return discriminator, variants + return None, None + + +def _get_field_annotation(model: Type[Any], field_name: str) -> Optional[Type[Any]]: + """Get the type annotation of a field from a Pydantic model.""" + if IS_PYDANTIC_V2: + fields = getattr(model, "model_fields", {}) + field_info = fields.get(field_name) + if field_info: + return cast(Optional[Type[Any]], field_info.annotation) + else: + fields = getattr(model, "__fields__", {}) + field_info = fields.get(field_name) + if field_info: + return cast(Optional[Type[Any]], field_info.outer_type_) + return None + + +def _find_variant_by_discriminator( + variants: List[Type[Any]], + discriminator: str, + discriminator_value: Any, +) -> Optional[Type[Any]]: + """Find the union variant that matches the discriminator value.""" + for variant in variants: + if not (inspect.isclass(variant) and issubclass(variant, pydantic.BaseModel)): + continue + + disc_annotation = _get_field_annotation(variant, discriminator) + if disc_annotation and is_literal_type(disc_annotation): + literal_args = get_args(disc_annotation) + if literal_args and literal_args[0] == discriminator_value: + return variant + return None + + +def _is_string_type(type_: Type[Any]) -> bool: + """Check if a type is str or Optional[str].""" + if type_ is str: + return True + + origin = typing_extensions.get_origin(type_) + if origin is Union: + args = typing_extensions.get_args(type_) + # Optional[str] = Union[str, None] + non_none_args = [a for a in args if a is not type(None)] + if len(non_none_args) == 1 and non_none_args[0] is str: + return True + + return False + + +def parse_sse_obj(sse: "ServerSentEvent", type_: Type[T]) -> T: + """ + Parse a ServerSentEvent into the appropriate type. + + Handles two scenarios based on where the discriminator field is located: + + 1. Data-level discrimination: The discriminator (e.g., 'type') is inside the 'data' payload. + The union describes the data content, not the SSE envelope. + -> Returns: json.loads(data) parsed into the type + + 2. Event-level discrimination: The discriminator (e.g., 'event') is at the SSE event level. + The union describes the full SSE event structure. + -> Returns: SSE envelope with 'data' field JSON-parsed only if the variant expects non-string + + Args: + sse: The ServerSentEvent object to parse + type_: The target discriminated union type + + Returns: + The parsed object of type T + + Note: + This function is only available in SDK contexts where http_sse module exists. + """ + sse_event = asdict(sse) + discriminator, variants = _get_discriminator_and_variants(type_) + + if discriminator is None or variants is None: + # Not a discriminated union - parse the data field as JSON + data_value = sse_event.get("data") + if isinstance(data_value, str) and data_value: + try: + parsed_data = json.loads(data_value) + return parse_obj_as(type_, parsed_data) + except json.JSONDecodeError as e: + _logger.warning( + "Failed to parse SSE data field as JSON: %s, data: %s", + e, + data_value[:100] if len(data_value) > 100 else data_value, + ) + return parse_obj_as(type_, sse_event) + + data_value = sse_event.get("data") + + # Check if discriminator is at the top level (event-level discrimination) + if discriminator in sse_event: + # Case 2: Event-level discrimination + # Find the matching variant to check if 'data' field needs JSON parsing + disc_value = sse_event.get(discriminator) + matching_variant = _find_variant_by_discriminator(variants, discriminator, disc_value) + + if matching_variant is not None: + # Check what type the variant expects for 'data' + data_type = _get_field_annotation(matching_variant, "data") + if data_type is not None and not _is_string_type(data_type): + # Variant expects non-string data - parse JSON + if isinstance(data_value, str) and data_value: + try: + parsed_data = json.loads(data_value) + new_object = dict(sse_event) + new_object["data"] = parsed_data + return parse_obj_as(type_, new_object) + except json.JSONDecodeError as e: + _logger.warning( + "Failed to parse SSE data field as JSON for event-level discrimination: %s, data: %s", + e, + data_value[:100] if len(data_value) > 100 else data_value, + ) + # Either no matching variant, data is string type, or JSON parse failed + return parse_obj_as(type_, sse_event) + + else: + # Case 1: Data-level discrimination + # The discriminator is inside the data payload - extract and parse data only + if isinstance(data_value, str) and data_value: + try: + parsed_data = json.loads(data_value) + return parse_obj_as(type_, parsed_data) + except json.JSONDecodeError as e: + _logger.warning( + "Failed to parse SSE data field as JSON for data-level discrimination: %s, data: %s", + e, + data_value[:100] if len(data_value) > 100 else data_value, + ) + return parse_obj_as(type_, sse_event) + + def parse_obj_as(type_: Type[T], object_: Any) -> T: if IS_PYDANTIC_V2: adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] diff --git a/src/vital/lab_account/__init__.py b/src/vital/lab_account/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/vital/lab_account/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/vital/lab_account/client.py b/src/vital/lab_account/client.py new file mode 100644 index 00000000..a6c9ed4b --- /dev/null +++ b/src/vital/lab_account/client.py @@ -0,0 +1,127 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.get_team_lab_accounts_response import GetTeamLabAccountsResponse +from ..types.lab_account_status import LabAccountStatus +from .raw_client import AsyncRawLabAccountClient, RawLabAccountClient + + +class LabAccountClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawLabAccountClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawLabAccountClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawLabAccountClient + """ + return self._raw_client + + def get_team_lab_accounts( + self, + *, + lab_account_id: typing.Optional[str] = None, + status: typing.Optional[LabAccountStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetTeamLabAccountsResponse: + """ + Parameters + ---------- + lab_account_id : typing.Optional[str] + + status : typing.Optional[LabAccountStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTeamLabAccountsResponse + Successful Response + + Examples + -------- + from vital import LabAccountStatus, Vital + + client = Vital( + api_key="YOUR_API_KEY", + ) + client.lab_account.get_team_lab_accounts( + lab_account_id="lab_account_id", + status=LabAccountStatus.ACTIVE, + ) + """ + _response = self._raw_client.get_team_lab_accounts( + lab_account_id=lab_account_id, status=status, request_options=request_options + ) + return _response.data + + +class AsyncLabAccountClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawLabAccountClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawLabAccountClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawLabAccountClient + """ + return self._raw_client + + async def get_team_lab_accounts( + self, + *, + lab_account_id: typing.Optional[str] = None, + status: typing.Optional[LabAccountStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> GetTeamLabAccountsResponse: + """ + Parameters + ---------- + lab_account_id : typing.Optional[str] + + status : typing.Optional[LabAccountStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetTeamLabAccountsResponse + Successful Response + + Examples + -------- + import asyncio + + from vital import AsyncVital, LabAccountStatus + + client = AsyncVital( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.lab_account.get_team_lab_accounts( + lab_account_id="lab_account_id", + status=LabAccountStatus.ACTIVE, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_team_lab_accounts( + lab_account_id=lab_account_id, status=status, request_options=request_options + ) + return _response.data diff --git a/src/vital/lab_account/raw_client.py b/src/vital/lab_account/raw_client.py new file mode 100644 index 00000000..69b37787 --- /dev/null +++ b/src/vital/lab_account/raw_client.py @@ -0,0 +1,138 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.unprocessable_entity_error import UnprocessableEntityError +from ..types.get_team_lab_accounts_response import GetTeamLabAccountsResponse +from ..types.http_validation_error import HttpValidationError +from ..types.lab_account_status import LabAccountStatus + + +class RawLabAccountClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_team_lab_accounts( + self, + *, + lab_account_id: typing.Optional[str] = None, + status: typing.Optional[LabAccountStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[GetTeamLabAccountsResponse]: + """ + Parameters + ---------- + lab_account_id : typing.Optional[str] + + status : typing.Optional[LabAccountStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetTeamLabAccountsResponse] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + "v3/lab_test/lab_account", + method="GET", + params={ + "lab_account_id": lab_account_id, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTeamLabAccountsResponse, + parse_obj_as( + type_=GetTeamLabAccountsResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + +class AsyncRawLabAccountClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_team_lab_accounts( + self, + *, + lab_account_id: typing.Optional[str] = None, + status: typing.Optional[LabAccountStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[GetTeamLabAccountsResponse]: + """ + Parameters + ---------- + lab_account_id : typing.Optional[str] + + status : typing.Optional[LabAccountStatus] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetTeamLabAccountsResponse] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + "v3/lab_test/lab_account", + method="GET", + params={ + "lab_account_id": lab_account_id, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetTeamLabAccountsResponse, + parse_obj_as( + type_=GetTeamLabAccountsResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/src/vital/lab_report/client.py b/src/vital/lab_report/client.py index ad8cfcca..12ea4b5f 100644 --- a/src/vital/lab_report/client.py +++ b/src/vital/lab_report/client.py @@ -30,18 +30,18 @@ def with_raw_response(self) -> RawLabReportClient: def parser_create_job( self, *, - file: core.File, + file: typing.List[core.File], user_id: str, needs_human_review: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ParsingJob: """ - Creates a parse job, uploads the file to provider, persists the job row, + Creates a parse job, uploads the file(s) to provider, persists the job row, and starts the ParseLabReport. Returns a generated job_id. Parameters ---------- - file : core.File + file : typing.List[core.File] See core.File for more documentation user_id : str @@ -124,18 +124,18 @@ def with_raw_response(self) -> AsyncRawLabReportClient: async def parser_create_job( self, *, - file: core.File, + file: typing.List[core.File], user_id: str, needs_human_review: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ParsingJob: """ - Creates a parse job, uploads the file to provider, persists the job row, + Creates a parse job, uploads the file(s) to provider, persists the job row, and starts the ParseLabReport. Returns a generated job_id. Parameters ---------- - file : core.File + file : typing.List[core.File] See core.File for more documentation user_id : str diff --git a/src/vital/lab_report/raw_client.py b/src/vital/lab_report/raw_client.py index 14c7133c..bc2d6999 100644 --- a/src/vital/lab_report/raw_client.py +++ b/src/vital/lab_report/raw_client.py @@ -25,18 +25,18 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def parser_create_job( self, *, - file: core.File, + file: typing.List[core.File], user_id: str, needs_human_review: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ParsingJob]: """ - Creates a parse job, uploads the file to provider, persists the job row, + Creates a parse job, uploads the file(s) to provider, persists the job row, and starts the ParseLabReport. Returns a generated job_id. Parameters ---------- - file : core.File + file : typing.List[core.File] See core.File for more documentation user_id : str @@ -151,18 +151,18 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def parser_create_job( self, *, - file: core.File, + file: typing.List[core.File], user_id: str, needs_human_review: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ParsingJob]: """ - Creates a parse job, uploads the file to provider, persists the job row, + Creates a parse job, uploads the file(s) to provider, persists the job row, and starts the ParseLabReport. Returns a generated job_id. Parameters ---------- - file : core.File + file : typing.List[core.File] See core.File for more documentation user_id : str diff --git a/src/vital/lab_tests/client.py b/src/vital/lab_tests/client.py index d38166ea..3389fe00 100644 --- a/src/vital/lab_tests/client.py +++ b/src/vital/lab_tests/client.py @@ -10,6 +10,7 @@ from ..types.appointment_availability_slots import AppointmentAvailabilitySlots from ..types.appointment_booking_request import AppointmentBookingRequest from ..types.appointment_provider import AppointmentProvider +from ..types.appointment_psc_labs import AppointmentPscLabs from ..types.appointment_reschedule_request import AppointmentRescheduleRequest from ..types.area_info import AreaInfo from ..types.billing import Billing @@ -32,6 +33,7 @@ from ..types.lab_test_generation_method_filter import LabTestGenerationMethodFilter from ..types.lab_test_resources_response import LabTestResourcesResponse from ..types.lab_test_status import LabTestStatus +from ..types.labs import Labs from ..types.order_activation_type import OrderActivationType from ..types.order_low_level_status import OrderLowLevelStatus from ..types.order_set_request import OrderSetRequest @@ -173,6 +175,8 @@ def create( marker_ids: typing.Optional[typing.Sequence[int]] = OMIT, provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, fasting: typing.Optional[bool] = OMIT, + lab_account_id: typing.Optional[str] = OMIT, + lab_slug: typing.Optional[Labs] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ClientFacingLabTest: """ @@ -190,6 +194,10 @@ def create( fasting : typing.Optional[bool] + lab_account_id : typing.Optional[str] + + lab_slug : typing.Optional[Labs] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -218,6 +226,8 @@ def create( marker_ids=marker_ids, provider_ids=provider_ids, fasting=fasting, + lab_account_id=lab_account_id, + lab_slug=lab_slug, request_options=request_options, ) return _response.data @@ -309,6 +319,7 @@ def get_markers( self, *, lab_id: typing.Optional[typing.Union[int, typing.Sequence[int]]] = None, + lab_slug: typing.Optional[str] = None, name: typing.Optional[str] = None, a_la_carte_enabled: typing.Optional[bool] = None, lab_account_id: typing.Optional[str] = None, @@ -317,13 +328,16 @@ def get_markers( request_options: typing.Optional[RequestOptions] = None, ) -> GetMarkersResponse: """ - GET all the markers for the given lab. + List active and orderable markers for a given Lab. Note that reflex markers are not included. Parameters ---------- lab_id : typing.Optional[typing.Union[int, typing.Sequence[int]]] The identifier Vital assigned to a lab partner. + lab_slug : typing.Optional[str] + The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. + name : typing.Optional[str] The name or test code of an individual biomarker or a panel. @@ -352,6 +366,7 @@ def get_markers( api_key="YOUR_API_KEY", ) client.lab_tests.get_markers( + lab_slug="lab_slug", name="name", a_la_carte_enabled=True, lab_account_id="lab_account_id", @@ -361,6 +376,7 @@ def get_markers( """ _response = self._raw_client.get_markers( lab_id=lab_id, + lab_slug=lab_slug, name=name, a_la_carte_enabled=a_la_carte_enabled, lab_account_id=lab_account_id, @@ -423,6 +439,8 @@ def get_markers_for_lab_test( request_options: typing.Optional[RequestOptions] = None, ) -> GetMarkersResponse: """ + List all markers for a given Lab Test, as well as any associated reflex markers. + Parameters ---------- lab_test_id : str @@ -690,6 +708,7 @@ def get_orders( patient_name: typing.Optional[str] = None, shipping_recipient_name: typing.Optional[str] = None, order_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order_transaction_id: typing.Optional[str] = None, page: typing.Optional[int] = None, size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -747,6 +766,9 @@ def get_orders( order_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by order ids. + order_transaction_id : typing.Optional[str] + Filter by order transaction ID + page : typing.Optional[int] size : typing.Optional[int] @@ -793,6 +815,7 @@ def get_orders( user_id="user_id", patient_name="patient_name", shipping_recipient_name="shipping_recipient_name", + order_transaction_id="order_transaction_id", page=1, size=1, ) @@ -814,6 +837,7 @@ def get_orders( patient_name=patient_name, shipping_recipient_name=shipping_recipient_name, order_ids=order_ids, + order_transaction_id=order_transaction_id, page=page, size=size, request_options=request_options, @@ -918,6 +942,7 @@ def request_phlebotomy_appointment( *, address: UsAddress, provider: AppointmentProvider, + appointment_notes: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ClientFacingAppointment: """ @@ -933,6 +958,8 @@ def request_phlebotomy_appointment( provider : AppointmentProvider + appointment_notes : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -960,7 +987,11 @@ def request_phlebotomy_appointment( ) """ _response = self._raw_client.request_phlebotomy_appointment( - order_id, address=address, provider=provider, request_options=request_options + order_id, + address=address, + provider=provider, + appointment_notes=appointment_notes, + request_options=request_options, ) return _response.data @@ -1442,15 +1473,20 @@ def get_labels_pdf( def get_psc_appointment_availability( self, *, + lab: AppointmentPscLabs, 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, + allow_stale: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AppointmentAvailabilitySlots: """ Parameters ---------- + lab : AppointmentPscLabs + Lab to check for availability + start_date : typing.Optional[str] Start date for appointment availability @@ -1461,7 +1497,10 @@ def get_psc_appointment_availability( Zip code of the area to check radius : typing.Optional[AllowedRadius] - Radius in which to search. (meters) + Radius in which to search in miles + + allow_stale : typing.Optional[bool] + If true, allows cached availability data to be returned. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1473,22 +1512,26 @@ def get_psc_appointment_availability( Examples -------- - from vital import AllowedRadius, Vital + from vital import AllowedRadius, AppointmentPscLabs, Vital client = Vital( api_key="YOUR_API_KEY", ) client.lab_tests.get_psc_appointment_availability( + lab=AppointmentPscLabs.QUEST, start_date="start_date", zip_code="zip_code", radius=AllowedRadius.TEN, + allow_stale=True, ) """ _response = self._raw_client.get_psc_appointment_availability( + lab=lab, start_date=start_date, site_codes=site_codes, zip_code=zip_code, radius=radius, + allow_stale=allow_stale, request_options=request_options, ) return _response.data @@ -1498,6 +1541,8 @@ def book_psc_appointment( order_id: str, *, request: AppointmentBookingRequest, + idempotency_key: typing.Optional[str] = None, + idempotency_error: typing.Optional[typing.Literal["no-cache"]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ClientFacingAppointment: """ @@ -1508,6 +1553,12 @@ def book_psc_appointment( request : AppointmentBookingRequest + idempotency_key : typing.Optional[str] + [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. + + idempotency_error : typing.Optional[typing.Literal["no-cache"]] + If `no-cache`, applies idempotency only to successful outcomes. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1530,7 +1581,13 @@ def book_psc_appointment( ), ) """ - _response = self._raw_client.book_psc_appointment(order_id, request=request, request_options=request_options) + _response = self._raw_client.book_psc_appointment( + order_id, + request=request, + idempotency_key=idempotency_key, + idempotency_error=idempotency_error, + request_options=request_options, + ) return _response.data def reschedule_psc_appointment( @@ -1827,6 +1884,7 @@ def create_order( activate_by: typing.Optional[str] = OMIT, aoe_answers: typing.Optional[typing.Sequence[AoEAnswer]] = OMIT, passthrough: typing.Optional[str] = OMIT, + clinical_notes: typing.Optional[str] = OMIT, lab_account_id: typing.Optional[str] = OMIT, creator_member_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -1870,6 +1928,8 @@ def create_order( passthrough : typing.Optional[str] + clinical_notes : typing.Optional[str] + lab_account_id : typing.Optional[str] creator_member_id : typing.Optional[str] @@ -1895,7 +1955,6 @@ def create_order( api_key="YOUR_API_KEY", ) client.lab_tests.create_order( - idempotency_key="X-Idempotency-Key", user_id="user_id", patient_details=PatientDetailsWithValidation( first_name="first_name", @@ -1932,6 +1991,7 @@ def create_order( activate_by=activate_by, aoe_answers=aoe_answers, passthrough=passthrough, + clinical_notes=clinical_notes, lab_account_id=lab_account_id, creator_member_id=creator_member_id, request_options=request_options, @@ -2306,6 +2366,8 @@ async def create( marker_ids: typing.Optional[typing.Sequence[int]] = OMIT, provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, fasting: typing.Optional[bool] = OMIT, + lab_account_id: typing.Optional[str] = OMIT, + lab_slug: typing.Optional[Labs] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ClientFacingLabTest: """ @@ -2323,6 +2385,10 @@ async def create( fasting : typing.Optional[bool] + lab_account_id : typing.Optional[str] + + lab_slug : typing.Optional[Labs] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2359,6 +2425,8 @@ async def main() -> None: marker_ids=marker_ids, provider_ids=provider_ids, fasting=fasting, + lab_account_id=lab_account_id, + lab_slug=lab_slug, request_options=request_options, ) return _response.data @@ -2466,6 +2534,7 @@ async def get_markers( self, *, lab_id: typing.Optional[typing.Union[int, typing.Sequence[int]]] = None, + lab_slug: typing.Optional[str] = None, name: typing.Optional[str] = None, a_la_carte_enabled: typing.Optional[bool] = None, lab_account_id: typing.Optional[str] = None, @@ -2474,13 +2543,16 @@ async def get_markers( request_options: typing.Optional[RequestOptions] = None, ) -> GetMarkersResponse: """ - GET all the markers for the given lab. + List active and orderable markers for a given Lab. Note that reflex markers are not included. Parameters ---------- lab_id : typing.Optional[typing.Union[int, typing.Sequence[int]]] The identifier Vital assigned to a lab partner. + lab_slug : typing.Optional[str] + The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. + name : typing.Optional[str] The name or test code of an individual biomarker or a panel. @@ -2514,6 +2586,7 @@ async def get_markers( async def main() -> None: await client.lab_tests.get_markers( + lab_slug="lab_slug", name="name", a_la_carte_enabled=True, lab_account_id="lab_account_id", @@ -2526,6 +2599,7 @@ async def main() -> None: """ _response = await self._raw_client.get_markers( lab_id=lab_id, + lab_slug=lab_slug, name=name, a_la_carte_enabled=a_la_carte_enabled, lab_account_id=lab_account_id, @@ -2596,6 +2670,8 @@ async def get_markers_for_lab_test( request_options: typing.Optional[RequestOptions] = None, ) -> GetMarkersResponse: """ + List all markers for a given Lab Test, as well as any associated reflex markers. + Parameters ---------- lab_test_id : str @@ -2906,6 +2982,7 @@ async def get_orders( patient_name: typing.Optional[str] = None, shipping_recipient_name: typing.Optional[str] = None, order_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order_transaction_id: typing.Optional[str] = None, page: typing.Optional[int] = None, size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -2963,6 +3040,9 @@ async def get_orders( order_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by order ids. + order_transaction_id : typing.Optional[str] + Filter by order transaction ID + page : typing.Optional[int] size : typing.Optional[int] @@ -3013,6 +3093,7 @@ async def main() -> None: user_id="user_id", patient_name="patient_name", shipping_recipient_name="shipping_recipient_name", + order_transaction_id="order_transaction_id", page=1, size=1, ) @@ -3037,6 +3118,7 @@ async def main() -> None: patient_name=patient_name, shipping_recipient_name=shipping_recipient_name, order_ids=order_ids, + order_transaction_id=order_transaction_id, page=page, size=size, request_options=request_options, @@ -3157,6 +3239,7 @@ async def request_phlebotomy_appointment( *, address: UsAddress, provider: AppointmentProvider, + appointment_notes: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> ClientFacingAppointment: """ @@ -3172,6 +3255,8 @@ async def request_phlebotomy_appointment( provider : AppointmentProvider + appointment_notes : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3207,7 +3292,11 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.request_phlebotomy_appointment( - order_id, address=address, provider=provider, request_options=request_options + order_id, + address=address, + provider=provider, + appointment_notes=appointment_notes, + request_options=request_options, ) return _response.data @@ -3780,15 +3869,20 @@ async def main() -> None: async def get_psc_appointment_availability( self, *, + lab: AppointmentPscLabs, 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, + allow_stale: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AppointmentAvailabilitySlots: """ Parameters ---------- + lab : AppointmentPscLabs + Lab to check for availability + start_date : typing.Optional[str] Start date for appointment availability @@ -3799,7 +3893,10 @@ async def get_psc_appointment_availability( Zip code of the area to check radius : typing.Optional[AllowedRadius] - Radius in which to search. (meters) + Radius in which to search in miles + + allow_stale : typing.Optional[bool] + If true, allows cached availability data to be returned. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3813,7 +3910,7 @@ async def get_psc_appointment_availability( -------- import asyncio - from vital import AllowedRadius, AsyncVital + from vital import AllowedRadius, AppointmentPscLabs, AsyncVital client = AsyncVital( api_key="YOUR_API_KEY", @@ -3822,19 +3919,23 @@ async def get_psc_appointment_availability( async def main() -> None: await client.lab_tests.get_psc_appointment_availability( + lab=AppointmentPscLabs.QUEST, start_date="start_date", zip_code="zip_code", radius=AllowedRadius.TEN, + allow_stale=True, ) asyncio.run(main()) """ _response = await self._raw_client.get_psc_appointment_availability( + lab=lab, start_date=start_date, site_codes=site_codes, zip_code=zip_code, radius=radius, + allow_stale=allow_stale, request_options=request_options, ) return _response.data @@ -3844,6 +3945,8 @@ async def book_psc_appointment( order_id: str, *, request: AppointmentBookingRequest, + idempotency_key: typing.Optional[str] = None, + idempotency_error: typing.Optional[typing.Literal["no-cache"]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> ClientFacingAppointment: """ @@ -3854,6 +3957,12 @@ async def book_psc_appointment( request : AppointmentBookingRequest + idempotency_key : typing.Optional[str] + [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. + + idempotency_error : typing.Optional[typing.Literal["no-cache"]] + If `no-cache`, applies idempotency only to successful outcomes. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3885,7 +3994,11 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.book_psc_appointment( - order_id, request=request, request_options=request_options + order_id, + request=request, + idempotency_key=idempotency_key, + idempotency_error=idempotency_error, + request_options=request_options, ) return _response.data @@ -4254,6 +4367,7 @@ async def create_order( activate_by: typing.Optional[str] = OMIT, aoe_answers: typing.Optional[typing.Sequence[AoEAnswer]] = OMIT, passthrough: typing.Optional[str] = OMIT, + clinical_notes: typing.Optional[str] = OMIT, lab_account_id: typing.Optional[str] = OMIT, creator_member_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -4297,6 +4411,8 @@ async def create_order( passthrough : typing.Optional[str] + clinical_notes : typing.Optional[str] + lab_account_id : typing.Optional[str] creator_member_id : typing.Optional[str] @@ -4327,7 +4443,6 @@ async def create_order( async def main() -> None: await client.lab_tests.create_order( - idempotency_key="X-Idempotency-Key", user_id="user_id", patient_details=PatientDetailsWithValidation( first_name="first_name", @@ -4367,6 +4482,7 @@ async def main() -> None: activate_by=activate_by, aoe_answers=aoe_answers, passthrough=passthrough, + clinical_notes=clinical_notes, lab_account_id=lab_account_id, creator_member_id=creator_member_id, request_options=request_options, diff --git a/src/vital/lab_tests/raw_client.py b/src/vital/lab_tests/raw_client.py index 7290b578..46d774f0 100644 --- a/src/vital/lab_tests/raw_client.py +++ b/src/vital/lab_tests/raw_client.py @@ -19,6 +19,7 @@ from ..types.appointment_availability_slots import AppointmentAvailabilitySlots from ..types.appointment_booking_request import AppointmentBookingRequest from ..types.appointment_provider import AppointmentProvider +from ..types.appointment_psc_labs import AppointmentPscLabs from ..types.appointment_reschedule_request import AppointmentRescheduleRequest from ..types.area_info import AreaInfo from ..types.billing import Billing @@ -42,6 +43,7 @@ from ..types.lab_test_generation_method_filter import LabTestGenerationMethodFilter from ..types.lab_test_resources_response import LabTestResourcesResponse from ..types.lab_test_status import LabTestStatus +from ..types.labs import Labs from ..types.not_found_error_body import NotFoundErrorBody from ..types.order_activation_type import OrderActivationType from ..types.order_low_level_status import OrderLowLevelStatus @@ -174,6 +176,8 @@ def create( marker_ids: typing.Optional[typing.Sequence[int]] = OMIT, provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, fasting: typing.Optional[bool] = OMIT, + lab_account_id: typing.Optional[str] = OMIT, + lab_slug: typing.Optional[Labs] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ClientFacingLabTest]: """ @@ -191,6 +195,10 @@ def create( fasting : typing.Optional[bool] + lab_account_id : typing.Optional[str] + + lab_slug : typing.Optional[Labs] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -209,6 +217,8 @@ def create( "method": method, "description": description, "fasting": fasting, + "lab_account_id": lab_account_id, + "lab_slug": lab_slug, }, headers={ "content-type": "application/json", @@ -369,6 +379,7 @@ def get_markers( self, *, lab_id: typing.Optional[typing.Union[int, typing.Sequence[int]]] = None, + lab_slug: typing.Optional[str] = None, name: typing.Optional[str] = None, a_la_carte_enabled: typing.Optional[bool] = None, lab_account_id: typing.Optional[str] = None, @@ -377,13 +388,16 @@ def get_markers( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetMarkersResponse]: """ - GET all the markers for the given lab. + List active and orderable markers for a given Lab. Note that reflex markers are not included. Parameters ---------- lab_id : typing.Optional[typing.Union[int, typing.Sequence[int]]] The identifier Vital assigned to a lab partner. + lab_slug : typing.Optional[str] + The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. + name : typing.Optional[str] The name or test code of an individual biomarker or a panel. @@ -409,6 +423,7 @@ def get_markers( method="GET", params={ "lab_id": lab_id, + "lab_slug": lab_slug, "name": name, "a_la_carte_enabled": a_la_carte_enabled, "lab_account_id": lab_account_id, @@ -518,6 +533,8 @@ def get_markers_for_lab_test( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetMarkersResponse]: """ + List all markers for a given Lab Test, as well as any associated reflex markers. + Parameters ---------- lab_test_id : str @@ -847,6 +864,7 @@ def get_orders( patient_name: typing.Optional[str] = None, shipping_recipient_name: typing.Optional[str] = None, order_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order_transaction_id: typing.Optional[str] = None, page: typing.Optional[int] = None, size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -904,6 +922,9 @@ def get_orders( order_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by order ids. + order_transaction_id : typing.Optional[str] + Filter by order transaction ID + page : typing.Optional[int] size : typing.Optional[int] @@ -938,6 +959,7 @@ def get_orders( "patient_name": patient_name, "shipping_recipient_name": shipping_recipient_name, "order_ids": order_ids, + "order_transaction_id": order_transaction_id, "page": page, "size": size, }, @@ -1101,6 +1123,7 @@ def request_phlebotomy_appointment( *, address: UsAddress, provider: AppointmentProvider, + appointment_notes: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ClientFacingAppointment]: """ @@ -1116,6 +1139,8 @@ def request_phlebotomy_appointment( provider : AppointmentProvider + appointment_notes : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1130,6 +1155,7 @@ def request_phlebotomy_appointment( json={ "address": address, "provider": provider, + "appointment_notes": appointment_notes, }, headers={ "content-type": "application/json", @@ -1821,15 +1847,20 @@ def _stream() -> HttpResponse[typing.Iterator[bytes]]: def get_psc_appointment_availability( self, *, + lab: AppointmentPscLabs, 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, + allow_stale: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[AppointmentAvailabilitySlots]: """ Parameters ---------- + lab : AppointmentPscLabs + Lab to check for availability + start_date : typing.Optional[str] Start date for appointment availability @@ -1840,7 +1871,10 @@ def get_psc_appointment_availability( Zip code of the area to check radius : typing.Optional[AllowedRadius] - Radius in which to search. (meters) + Radius in which to search in miles + + allow_stale : typing.Optional[bool] + If true, allows cached availability data to be returned. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1854,11 +1888,12 @@ def get_psc_appointment_availability( "v3/order/psc/appointment/availability", method="POST", params={ - "lab": "quest", + "lab": lab, "start_date": start_date, "site_codes": site_codes, "zip_code": zip_code, "radius": radius, + "allow_stale": allow_stale, }, request_options=request_options, ) @@ -1904,6 +1939,8 @@ def book_psc_appointment( order_id: str, *, request: AppointmentBookingRequest, + idempotency_key: typing.Optional[str] = None, + idempotency_error: typing.Optional[typing.Literal["no-cache"]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[ClientFacingAppointment]: """ @@ -1914,6 +1951,12 @@ def book_psc_appointment( request : AppointmentBookingRequest + idempotency_key : typing.Optional[str] + [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. + + idempotency_error : typing.Optional[typing.Literal["no-cache"]] + If `no-cache`, applies idempotency only to successful outcomes. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1928,6 +1971,8 @@ def book_psc_appointment( json=request, headers={ "content-type": "application/json", + "x-idempotency-key": str(idempotency_key) if idempotency_key is not None else None, + "x-idempotency-error": str(idempotency_error) if idempotency_error is not None else None, }, request_options=request_options, omit=OMIT, @@ -2398,6 +2443,7 @@ def create_order( activate_by: typing.Optional[str] = OMIT, aoe_answers: typing.Optional[typing.Sequence[AoEAnswer]] = OMIT, passthrough: typing.Optional[str] = OMIT, + clinical_notes: typing.Optional[str] = OMIT, lab_account_id: typing.Optional[str] = OMIT, creator_member_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -2441,6 +2487,8 @@ def create_order( passthrough : typing.Optional[str] + clinical_notes : typing.Optional[str] + lab_account_id : typing.Optional[str] creator_member_id : typing.Optional[str] @@ -2470,6 +2518,7 @@ def create_order( "activate_by": activate_by, "aoe_answers": aoe_answers, "passthrough": passthrough, + "clinical_notes": clinical_notes, "lab_account_id": lab_account_id, "creator_member_id": creator_member_id, "patient_details": patient_details, @@ -2932,6 +2981,8 @@ async def create( marker_ids: typing.Optional[typing.Sequence[int]] = OMIT, provider_ids: typing.Optional[typing.Sequence[str]] = OMIT, fasting: typing.Optional[bool] = OMIT, + lab_account_id: typing.Optional[str] = OMIT, + lab_slug: typing.Optional[Labs] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ClientFacingLabTest]: """ @@ -2949,6 +3000,10 @@ async def create( fasting : typing.Optional[bool] + lab_account_id : typing.Optional[str] + + lab_slug : typing.Optional[Labs] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2967,6 +3022,8 @@ async def create( "method": method, "description": description, "fasting": fasting, + "lab_account_id": lab_account_id, + "lab_slug": lab_slug, }, headers={ "content-type": "application/json", @@ -3127,6 +3184,7 @@ async def get_markers( self, *, lab_id: typing.Optional[typing.Union[int, typing.Sequence[int]]] = None, + lab_slug: typing.Optional[str] = None, name: typing.Optional[str] = None, a_la_carte_enabled: typing.Optional[bool] = None, lab_account_id: typing.Optional[str] = None, @@ -3135,13 +3193,16 @@ async def get_markers( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetMarkersResponse]: """ - GET all the markers for the given lab. + List active and orderable markers for a given Lab. Note that reflex markers are not included. Parameters ---------- lab_id : typing.Optional[typing.Union[int, typing.Sequence[int]]] The identifier Vital assigned to a lab partner. + lab_slug : typing.Optional[str] + The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. + name : typing.Optional[str] The name or test code of an individual biomarker or a panel. @@ -3167,6 +3228,7 @@ async def get_markers( method="GET", params={ "lab_id": lab_id, + "lab_slug": lab_slug, "name": name, "a_la_carte_enabled": a_la_carte_enabled, "lab_account_id": lab_account_id, @@ -3276,6 +3338,8 @@ async def get_markers_for_lab_test( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetMarkersResponse]: """ + List all markers for a given Lab Test, as well as any associated reflex markers. + Parameters ---------- lab_test_id : str @@ -3606,6 +3670,7 @@ async def get_orders( patient_name: typing.Optional[str] = None, shipping_recipient_name: typing.Optional[str] = None, order_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None, + order_transaction_id: typing.Optional[str] = None, page: typing.Optional[int] = None, size: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, @@ -3663,6 +3728,9 @@ async def get_orders( order_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]] Filter by order ids. + order_transaction_id : typing.Optional[str] + Filter by order transaction ID + page : typing.Optional[int] size : typing.Optional[int] @@ -3697,6 +3765,7 @@ async def get_orders( "patient_name": patient_name, "shipping_recipient_name": shipping_recipient_name, "order_ids": order_ids, + "order_transaction_id": order_transaction_id, "page": page, "size": size, }, @@ -3860,6 +3929,7 @@ async def request_phlebotomy_appointment( *, address: UsAddress, provider: AppointmentProvider, + appointment_notes: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ClientFacingAppointment]: """ @@ -3875,6 +3945,8 @@ async def request_phlebotomy_appointment( provider : AppointmentProvider + appointment_notes : typing.Optional[str] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -3889,6 +3961,7 @@ async def request_phlebotomy_appointment( json={ "address": address, "provider": provider, + "appointment_notes": appointment_notes, }, headers={ "content-type": "application/json", @@ -4582,15 +4655,20 @@ async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: async def get_psc_appointment_availability( self, *, + lab: AppointmentPscLabs, 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, + allow_stale: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[AppointmentAvailabilitySlots]: """ Parameters ---------- + lab : AppointmentPscLabs + Lab to check for availability + start_date : typing.Optional[str] Start date for appointment availability @@ -4601,7 +4679,10 @@ async def get_psc_appointment_availability( Zip code of the area to check radius : typing.Optional[AllowedRadius] - Radius in which to search. (meters) + Radius in which to search in miles + + allow_stale : typing.Optional[bool] + If true, allows cached availability data to be returned. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4615,11 +4696,12 @@ async def get_psc_appointment_availability( "v3/order/psc/appointment/availability", method="POST", params={ - "lab": "quest", + "lab": lab, "start_date": start_date, "site_codes": site_codes, "zip_code": zip_code, "radius": radius, + "allow_stale": allow_stale, }, request_options=request_options, ) @@ -4665,6 +4747,8 @@ async def book_psc_appointment( order_id: str, *, request: AppointmentBookingRequest, + idempotency_key: typing.Optional[str] = None, + idempotency_error: typing.Optional[typing.Literal["no-cache"]] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[ClientFacingAppointment]: """ @@ -4675,6 +4759,12 @@ async def book_psc_appointment( request : AppointmentBookingRequest + idempotency_key : typing.Optional[str] + [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. + + idempotency_error : typing.Optional[typing.Literal["no-cache"]] + If `no-cache`, applies idempotency only to successful outcomes. + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -4689,6 +4779,8 @@ async def book_psc_appointment( json=request, headers={ "content-type": "application/json", + "x-idempotency-key": str(idempotency_key) if idempotency_key is not None else None, + "x-idempotency-error": str(idempotency_error) if idempotency_error is not None else None, }, request_options=request_options, omit=OMIT, @@ -5162,6 +5254,7 @@ async def create_order( activate_by: typing.Optional[str] = OMIT, aoe_answers: typing.Optional[typing.Sequence[AoEAnswer]] = OMIT, passthrough: typing.Optional[str] = OMIT, + clinical_notes: typing.Optional[str] = OMIT, lab_account_id: typing.Optional[str] = OMIT, creator_member_id: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -5205,6 +5298,8 @@ async def create_order( passthrough : typing.Optional[str] + clinical_notes : typing.Optional[str] + lab_account_id : typing.Optional[str] creator_member_id : typing.Optional[str] @@ -5234,6 +5329,7 @@ async def create_order( "activate_by": activate_by, "aoe_answers": aoe_answers, "passthrough": passthrough, + "clinical_notes": clinical_notes, "lab_account_id": lab_account_id, "creator_member_id": creator_member_id, "patient_details": patient_details, diff --git a/src/vital/link/__init__.py b/src/vital/link/__init__.py index 660b3659..5cde0202 100644 --- a/src/vital/link/__init__.py +++ b/src/vital/link/__init__.py @@ -2,51 +2,3 @@ # isort: skip_file -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import ( - LinkBulkExportRequestTeamId, - LinkBulkImportRequestTeamId, - LinkBulkPauseRequestTeamId, - LinkBulkTriggerHistoricalPullRequestTeamId, - LinkListBulkOpsRequestTeamId, - ) -_dynamic_imports: typing.Dict[str, str] = { - "LinkBulkExportRequestTeamId": ".types", - "LinkBulkImportRequestTeamId": ".types", - "LinkBulkPauseRequestTeamId": ".types", - "LinkBulkTriggerHistoricalPullRequestTeamId": ".types", - "LinkListBulkOpsRequestTeamId": ".types", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "LinkBulkExportRequestTeamId", - "LinkBulkImportRequestTeamId", - "LinkBulkPauseRequestTeamId", - "LinkBulkTriggerHistoricalPullRequestTeamId", - "LinkListBulkOpsRequestTeamId", -] diff --git a/src/vital/link/client.py b/src/vital/link/client.py index b7bda2a9..33c793ed 100644 --- a/src/vital/link/client.py +++ b/src/vital/link/client.py @@ -23,11 +23,6 @@ from ..types.source_link import SourceLink from ..types.vital_token_created_response import VitalTokenCreatedResponse from .raw_client import AsyncRawLinkClient, RawLinkClient -from .types.link_bulk_export_request_team_id import LinkBulkExportRequestTeamId -from .types.link_bulk_import_request_team_id import LinkBulkImportRequestTeamId -from .types.link_bulk_pause_request_team_id import LinkBulkPauseRequestTeamId -from .types.link_bulk_trigger_historical_pull_request_team_id import LinkBulkTriggerHistoricalPullRequestTeamId -from .types.link_list_bulk_ops_request_team_id import LinkListBulkOpsRequestTeamId # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -53,7 +48,6 @@ def list_bulk_ops( *, next_cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, - team_id: typing.Optional[LinkListBulkOpsRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> BulkOpsResponse: """ @@ -63,8 +57,6 @@ def list_bulk_ops( page_size : typing.Optional[int] - team_id : typing.Optional[LinkListBulkOpsRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -76,7 +68,6 @@ def list_bulk_ops( Examples -------- from vital import Vital - from vital.link import LinkListBulkOpsRequestTeamId client = Vital( api_key="YOUR_API_KEY", @@ -84,11 +75,10 @@ def list_bulk_ops( client.link.list_bulk_ops( next_cursor="next_cursor", page_size=1, - team_id=LinkListBulkOpsRequestTeamId.INFER_FROM_CONTEXT, ) """ _response = self._raw_client.list_bulk_ops( - next_cursor=next_cursor, page_size=page_size, team_id=team_id, request_options=request_options + next_cursor=next_cursor, page_size=page_size, request_options=request_options ) return _response.data @@ -97,7 +87,6 @@ def bulk_import( *, provider: OAuthProviders, connections: typing.Sequence[ConnectionRecipe], - team_id: typing.Optional[LinkBulkImportRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> BulkImportConnectionsResponse: @@ -108,8 +97,6 @@ def bulk_import( connections : typing.Sequence[ConnectionRecipe] - team_id : typing.Optional[LinkBulkImportRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -130,13 +117,11 @@ def bulk_import( Examples -------- from vital import ConnectionRecipe, OAuthProviders, Vital - from vital.link import LinkBulkImportRequestTeamId client = Vital( api_key="YOUR_API_KEY", ) client.link.bulk_import( - team_id=LinkBulkImportRequestTeamId.INFER_FROM_CONTEXT, provider=OAuthProviders.OURA, connections=[ ConnectionRecipe( @@ -152,7 +137,6 @@ def bulk_import( _response = self._raw_client.bulk_import( provider=provider, connections=connections, - team_id=team_id, wait_for_completion=wait_for_completion, request_options=request_options, ) @@ -163,7 +147,6 @@ def bulk_trigger_historical_pull( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: @@ -174,8 +157,6 @@ def bulk_trigger_historical_pull( provider : OAuthProviders - team_id : typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -196,13 +177,11 @@ def bulk_trigger_historical_pull( Examples -------- from vital import OAuthProviders, Vital - from vital.link import LinkBulkTriggerHistoricalPullRequestTeamId client = Vital( api_key="YOUR_API_KEY", ) client.link.bulk_trigger_historical_pull( - team_id=LinkBulkTriggerHistoricalPullRequestTeamId.INFER_FROM_CONTEXT, user_ids=["user_ids"], provider=OAuthProviders.OURA, ) @@ -210,7 +189,6 @@ def bulk_trigger_historical_pull( _response = self._raw_client.bulk_trigger_historical_pull( user_ids=user_ids, provider=provider, - team_id=team_id, wait_for_completion=wait_for_completion, request_options=request_options, ) @@ -220,7 +198,6 @@ def bulk_export( self, *, provider: OAuthProviders, - team_id: typing.Optional[LinkBulkExportRequestTeamId] = None, user_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_token: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -230,8 +207,6 @@ def bulk_export( ---------- provider : OAuthProviders - team_id : typing.Optional[LinkBulkExportRequestTeamId] - user_ids : typing.Optional[typing.Sequence[str]] next_token : typing.Optional[str] @@ -247,22 +222,16 @@ def bulk_export( Examples -------- from vital import OAuthProviders, Vital - from vital.link import LinkBulkExportRequestTeamId client = Vital( api_key="YOUR_API_KEY", ) client.link.bulk_export( - team_id=LinkBulkExportRequestTeamId.INFER_FROM_CONTEXT, provider=OAuthProviders.OURA, ) """ _response = self._raw_client.bulk_export( - provider=provider, - team_id=team_id, - user_ids=user_ids, - next_token=next_token, - request_options=request_options, + provider=provider, user_ids=user_ids, next_token=next_token, request_options=request_options ) return _response.data @@ -271,7 +240,6 @@ def bulk_pause( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkPauseRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -281,8 +249,6 @@ def bulk_pause( provider : OAuthProviders - team_id : typing.Optional[LinkBulkPauseRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -294,20 +260,16 @@ def bulk_pause( Examples -------- from vital import OAuthProviders, Vital - from vital.link import LinkBulkPauseRequestTeamId client = Vital( api_key="YOUR_API_KEY", ) client.link.bulk_pause( - team_id=LinkBulkPauseRequestTeamId.INFER_FROM_CONTEXT, user_ids=["user_ids"], provider=OAuthProviders.OURA, ) """ - _response = self._raw_client.bulk_pause( - user_ids=user_ids, provider=provider, team_id=team_id, request_options=request_options - ) + _response = self._raw_client.bulk_pause(user_ids=user_ids, provider=provider, request_options=request_options) return _response.data def token( @@ -531,9 +493,7 @@ def token_state( client = Vital( api_key="YOUR_API_KEY", ) - client.link.token_state( - vital_link_token="x-vital-link-token", - ) + client.link.token_state() """ _response = self._raw_client.token_state(vital_link_token=vital_link_token, request_options=request_options) return _response.data @@ -579,7 +539,6 @@ def email_auth( api_key="YOUR_API_KEY", ) client.link.email_auth( - vital_link_token="x-vital-link-token", email="email", provider=Providers.OURA, auth_type=AuthType.PASSWORD, @@ -636,7 +595,6 @@ def password_auth( api_key="YOUR_API_KEY", ) client.link.password_auth( - vital_link_token="x-vital-link-token", username="username", password="password", provider=Providers.OURA, @@ -686,7 +644,6 @@ def generate_oauth_link( ) client.link.generate_oauth_link( oauth_provider=OAuthProviders.OURA, - vital_link_token="x-vital-link-token", ) """ _response = self._raw_client.generate_oauth_link( @@ -739,7 +696,6 @@ def connect_password_provider( ) client.link.connect_password_provider( provider=PasswordProviders.WHOOP, - vital_link_token="x-vital-link-token", username="username", password="password", ) @@ -790,7 +746,6 @@ def complete_password_provider_mfa( ) client.link.complete_password_provider_mfa( provider=PasswordProviders.WHOOP, - vital_link_token="x-vital-link-token", mfa_code="mfa_code", ) """ @@ -837,7 +792,6 @@ def connect_email_auth_provider( api_key="YOUR_API_KEY", ) client.link.connect_email_auth_provider( - vital_link_token="x-vital-link-token", email="email", ) """ @@ -875,9 +829,7 @@ def get_all_providers( client = Vital( api_key="YOUR_API_KEY", ) - client.link.get_all_providers( - vital_link_token="x-vital-link-token", - ) + client.link.get_all_providers() """ _response = self._raw_client.get_all_providers( vital_link_token=vital_link_token, request_options=request_options @@ -889,7 +841,10 @@ def connect_manual_provider( provider: ManualProviders, *, user_id: str, + vital_ios_sdk_version: typing.Optional[str] = None, + vital_android_sdk_version: typing.Optional[str] = None, provider_id: typing.Optional[str] = OMIT, + granted_permissions: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, bool]: """ @@ -899,8 +854,14 @@ def connect_manual_provider( user_id : str + vital_ios_sdk_version : typing.Optional[str] + + vital_android_sdk_version : typing.Optional[str] + provider_id : typing.Optional[str] + granted_permissions : typing.Optional[typing.Sequence[str]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -922,7 +883,13 @@ def connect_manual_provider( ) """ _response = self._raw_client.connect_manual_provider( - provider, user_id=user_id, provider_id=provider_id, request_options=request_options + provider, + user_id=user_id, + vital_ios_sdk_version=vital_ios_sdk_version, + vital_android_sdk_version=vital_android_sdk_version, + provider_id=provider_id, + granted_permissions=granted_permissions, + request_options=request_options, ) return _response.data @@ -986,7 +953,6 @@ async def list_bulk_ops( *, next_cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, - team_id: typing.Optional[LinkListBulkOpsRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> BulkOpsResponse: """ @@ -996,8 +962,6 @@ async def list_bulk_ops( page_size : typing.Optional[int] - team_id : typing.Optional[LinkListBulkOpsRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1011,7 +975,6 @@ async def list_bulk_ops( import asyncio from vital import AsyncVital - from vital.link import LinkListBulkOpsRequestTeamId client = AsyncVital( api_key="YOUR_API_KEY", @@ -1022,14 +985,13 @@ async def main() -> None: await client.link.list_bulk_ops( next_cursor="next_cursor", page_size=1, - team_id=LinkListBulkOpsRequestTeamId.INFER_FROM_CONTEXT, ) asyncio.run(main()) """ _response = await self._raw_client.list_bulk_ops( - next_cursor=next_cursor, page_size=page_size, team_id=team_id, request_options=request_options + next_cursor=next_cursor, page_size=page_size, request_options=request_options ) return _response.data @@ -1038,7 +1000,6 @@ async def bulk_import( *, provider: OAuthProviders, connections: typing.Sequence[ConnectionRecipe], - team_id: typing.Optional[LinkBulkImportRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> BulkImportConnectionsResponse: @@ -1049,8 +1010,6 @@ async def bulk_import( connections : typing.Sequence[ConnectionRecipe] - team_id : typing.Optional[LinkBulkImportRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -1073,7 +1032,6 @@ async def bulk_import( import asyncio from vital import AsyncVital, ConnectionRecipe, OAuthProviders - from vital.link import LinkBulkImportRequestTeamId client = AsyncVital( api_key="YOUR_API_KEY", @@ -1082,7 +1040,6 @@ async def bulk_import( async def main() -> None: await client.link.bulk_import( - team_id=LinkBulkImportRequestTeamId.INFER_FROM_CONTEXT, provider=OAuthProviders.OURA, connections=[ ConnectionRecipe( @@ -1101,7 +1058,6 @@ async def main() -> None: _response = await self._raw_client.bulk_import( provider=provider, connections=connections, - team_id=team_id, wait_for_completion=wait_for_completion, request_options=request_options, ) @@ -1112,7 +1068,6 @@ async def bulk_trigger_historical_pull( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: @@ -1123,8 +1078,6 @@ async def bulk_trigger_historical_pull( provider : OAuthProviders - team_id : typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -1147,7 +1100,6 @@ async def bulk_trigger_historical_pull( import asyncio from vital import AsyncVital, OAuthProviders - from vital.link import LinkBulkTriggerHistoricalPullRequestTeamId client = AsyncVital( api_key="YOUR_API_KEY", @@ -1156,7 +1108,6 @@ async def bulk_trigger_historical_pull( async def main() -> None: await client.link.bulk_trigger_historical_pull( - team_id=LinkBulkTriggerHistoricalPullRequestTeamId.INFER_FROM_CONTEXT, user_ids=["user_ids"], provider=OAuthProviders.OURA, ) @@ -1167,7 +1118,6 @@ async def main() -> None: _response = await self._raw_client.bulk_trigger_historical_pull( user_ids=user_ids, provider=provider, - team_id=team_id, wait_for_completion=wait_for_completion, request_options=request_options, ) @@ -1177,7 +1127,6 @@ async def bulk_export( self, *, provider: OAuthProviders, - team_id: typing.Optional[LinkBulkExportRequestTeamId] = None, user_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_token: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -1187,8 +1136,6 @@ async def bulk_export( ---------- provider : OAuthProviders - team_id : typing.Optional[LinkBulkExportRequestTeamId] - user_ids : typing.Optional[typing.Sequence[str]] next_token : typing.Optional[str] @@ -1206,7 +1153,6 @@ async def bulk_export( import asyncio from vital import AsyncVital, OAuthProviders - from vital.link import LinkBulkExportRequestTeamId client = AsyncVital( api_key="YOUR_API_KEY", @@ -1215,7 +1161,6 @@ async def bulk_export( async def main() -> None: await client.link.bulk_export( - team_id=LinkBulkExportRequestTeamId.INFER_FROM_CONTEXT, provider=OAuthProviders.OURA, ) @@ -1223,11 +1168,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.bulk_export( - provider=provider, - team_id=team_id, - user_ids=user_ids, - next_token=next_token, - request_options=request_options, + provider=provider, user_ids=user_ids, next_token=next_token, request_options=request_options ) return _response.data @@ -1236,7 +1177,6 @@ async def bulk_pause( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkPauseRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -1246,8 +1186,6 @@ async def bulk_pause( provider : OAuthProviders - team_id : typing.Optional[LinkBulkPauseRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1261,7 +1199,6 @@ async def bulk_pause( import asyncio from vital import AsyncVital, OAuthProviders - from vital.link import LinkBulkPauseRequestTeamId client = AsyncVital( api_key="YOUR_API_KEY", @@ -1270,7 +1207,6 @@ async def bulk_pause( async def main() -> None: await client.link.bulk_pause( - team_id=LinkBulkPauseRequestTeamId.INFER_FROM_CONTEXT, user_ids=["user_ids"], provider=OAuthProviders.OURA, ) @@ -1279,7 +1215,7 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.bulk_pause( - user_ids=user_ids, provider=provider, team_id=team_id, request_options=request_options + user_ids=user_ids, provider=provider, request_options=request_options ) return _response.data @@ -1540,9 +1476,7 @@ async def token_state( async def main() -> None: - await client.link.token_state( - vital_link_token="x-vital-link-token", - ) + await client.link.token_state() asyncio.run(main()) @@ -1598,7 +1532,6 @@ async def email_auth( async def main() -> None: await client.link.email_auth( - vital_link_token="x-vital-link-token", email="email", provider=Providers.OURA, auth_type=AuthType.PASSWORD, @@ -1663,7 +1596,6 @@ async def password_auth( async def main() -> None: await client.link.password_auth( - vital_link_token="x-vital-link-token", username="username", password="password", provider=Providers.OURA, @@ -1721,7 +1653,6 @@ async def generate_oauth_link( async def main() -> None: await client.link.generate_oauth_link( oauth_provider=OAuthProviders.OURA, - vital_link_token="x-vital-link-token", ) @@ -1782,7 +1713,6 @@ async def connect_password_provider( async def main() -> None: await client.link.connect_password_provider( provider=PasswordProviders.WHOOP, - vital_link_token="x-vital-link-token", username="username", password="password", ) @@ -1841,7 +1771,6 @@ async def complete_password_provider_mfa( async def main() -> None: await client.link.complete_password_provider_mfa( provider=PasswordProviders.WHOOP, - vital_link_token="x-vital-link-token", mfa_code="mfa_code", ) @@ -1896,7 +1825,6 @@ async def connect_email_auth_provider( async def main() -> None: await client.link.connect_email_auth_provider( - vital_link_token="x-vital-link-token", email="email", ) @@ -1942,9 +1870,7 @@ async def get_all_providers( async def main() -> None: - await client.link.get_all_providers( - vital_link_token="x-vital-link-token", - ) + await client.link.get_all_providers() asyncio.run(main()) @@ -1959,7 +1885,10 @@ async def connect_manual_provider( provider: ManualProviders, *, user_id: str, + vital_ios_sdk_version: typing.Optional[str] = None, + vital_android_sdk_version: typing.Optional[str] = None, provider_id: typing.Optional[str] = OMIT, + granted_permissions: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Dict[str, bool]: """ @@ -1969,8 +1898,14 @@ async def connect_manual_provider( user_id : str + vital_ios_sdk_version : typing.Optional[str] + + vital_android_sdk_version : typing.Optional[str] + provider_id : typing.Optional[str] + granted_permissions : typing.Optional[typing.Sequence[str]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2000,7 +1935,13 @@ async def main() -> None: asyncio.run(main()) """ _response = await self._raw_client.connect_manual_provider( - provider, user_id=user_id, provider_id=provider_id, request_options=request_options + provider, + user_id=user_id, + vital_ios_sdk_version=vital_ios_sdk_version, + vital_android_sdk_version=vital_android_sdk_version, + provider_id=provider_id, + granted_permissions=granted_permissions, + request_options=request_options, ) return _response.data diff --git a/src/vital/link/raw_client.py b/src/vital/link/raw_client.py index b52e1519..dfd408e2 100644 --- a/src/vital/link/raw_client.py +++ b/src/vital/link/raw_client.py @@ -30,11 +30,6 @@ from ..types.source import Source from ..types.source_link import SourceLink from ..types.vital_token_created_response import VitalTokenCreatedResponse -from .types.link_bulk_export_request_team_id import LinkBulkExportRequestTeamId -from .types.link_bulk_import_request_team_id import LinkBulkImportRequestTeamId -from .types.link_bulk_pause_request_team_id import LinkBulkPauseRequestTeamId -from .types.link_bulk_trigger_historical_pull_request_team_id import LinkBulkTriggerHistoricalPullRequestTeamId -from .types.link_list_bulk_ops_request_team_id import LinkListBulkOpsRequestTeamId # this is used as the default value for optional parameters OMIT = typing.cast(typing.Any, ...) @@ -49,7 +44,6 @@ def list_bulk_ops( *, next_cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, - team_id: typing.Optional[LinkListBulkOpsRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[BulkOpsResponse]: """ @@ -59,8 +53,6 @@ def list_bulk_ops( page_size : typing.Optional[int] - team_id : typing.Optional[LinkListBulkOpsRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -75,7 +67,6 @@ def list_bulk_ops( params={ "next_cursor": next_cursor, "page_size": page_size, - "team_id": team_id, }, request_options=request_options, ) @@ -110,7 +101,6 @@ def bulk_import( *, provider: OAuthProviders, connections: typing.Sequence[ConnectionRecipe], - team_id: typing.Optional[LinkBulkImportRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[BulkImportConnectionsResponse]: @@ -121,8 +111,6 @@ def bulk_import( connections : typing.Sequence[ConnectionRecipe] - team_id : typing.Optional[LinkBulkImportRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -143,9 +131,6 @@ def bulk_import( _response = self._client_wrapper.httpx_client.request( "v2/link/bulk_import", method="POST", - params={ - "team_id": team_id, - }, json={ "provider": provider, "connections": connections, @@ -188,7 +173,6 @@ def bulk_trigger_historical_pull( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: @@ -199,8 +183,6 @@ def bulk_trigger_historical_pull( provider : OAuthProviders - team_id : typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -221,9 +203,6 @@ def bulk_trigger_historical_pull( _response = self._client_wrapper.httpx_client.request( "v2/link/bulk_trigger_historical_pull", method="POST", - params={ - "team_id": team_id, - }, json={ "user_ids": user_ids, "provider": provider, @@ -267,7 +246,6 @@ def bulk_export( self, *, provider: OAuthProviders, - team_id: typing.Optional[LinkBulkExportRequestTeamId] = None, user_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_token: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -277,8 +255,6 @@ def bulk_export( ---------- provider : OAuthProviders - team_id : typing.Optional[LinkBulkExportRequestTeamId] - user_ids : typing.Optional[typing.Sequence[str]] next_token : typing.Optional[str] @@ -294,9 +270,6 @@ def bulk_export( _response = self._client_wrapper.httpx_client.request( "v2/link/bulk_export", method="POST", - params={ - "team_id": team_id, - }, json={ "user_ids": user_ids, "provider": provider, @@ -339,7 +312,6 @@ def bulk_pause( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkPauseRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Any]: """ @@ -349,8 +321,6 @@ def bulk_pause( provider : OAuthProviders - team_id : typing.Optional[LinkBulkPauseRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -362,9 +332,6 @@ def bulk_pause( _response = self._client_wrapper.httpx_client.request( "v2/link/bulk_pause", method="POST", - params={ - "team_id": team_id, - }, json={ "user_ids": user_ids, "provider": provider, @@ -1217,7 +1184,10 @@ def connect_manual_provider( provider: ManualProviders, *, user_id: str, + vital_ios_sdk_version: typing.Optional[str] = None, + vital_android_sdk_version: typing.Optional[str] = None, provider_id: typing.Optional[str] = OMIT, + granted_permissions: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[typing.Dict[str, bool]]: """ @@ -1227,8 +1197,14 @@ def connect_manual_provider( user_id : str + vital_ios_sdk_version : typing.Optional[str] + + vital_android_sdk_version : typing.Optional[str] + provider_id : typing.Optional[str] + granted_permissions : typing.Optional[typing.Sequence[str]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1243,9 +1219,14 @@ def connect_manual_provider( json={ "user_id": user_id, "provider_id": provider_id, + "granted_permissions": granted_permissions, }, headers={ "content-type": "application/json", + "x-vital-ios-sdk-version": str(vital_ios_sdk_version) if vital_ios_sdk_version is not None else None, + "x-vital-android-sdk-version": str(vital_android_sdk_version) + if vital_android_sdk_version is not None + else None, }, request_options=request_options, omit=OMIT, @@ -1347,7 +1328,6 @@ async def list_bulk_ops( *, next_cursor: typing.Optional[str] = None, page_size: typing.Optional[int] = None, - team_id: typing.Optional[LinkListBulkOpsRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[BulkOpsResponse]: """ @@ -1357,8 +1337,6 @@ async def list_bulk_ops( page_size : typing.Optional[int] - team_id : typing.Optional[LinkListBulkOpsRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1373,7 +1351,6 @@ async def list_bulk_ops( params={ "next_cursor": next_cursor, "page_size": page_size, - "team_id": team_id, }, request_options=request_options, ) @@ -1408,7 +1385,6 @@ async def bulk_import( *, provider: OAuthProviders, connections: typing.Sequence[ConnectionRecipe], - team_id: typing.Optional[LinkBulkImportRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[BulkImportConnectionsResponse]: @@ -1419,8 +1395,6 @@ async def bulk_import( connections : typing.Sequence[ConnectionRecipe] - team_id : typing.Optional[LinkBulkImportRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -1441,9 +1415,6 @@ async def bulk_import( _response = await self._client_wrapper.httpx_client.request( "v2/link/bulk_import", method="POST", - params={ - "team_id": team_id, - }, json={ "provider": provider, "connections": connections, @@ -1486,7 +1457,6 @@ async def bulk_trigger_historical_pull( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] = None, wait_for_completion: typing.Optional[bool] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: @@ -1497,8 +1467,6 @@ async def bulk_trigger_historical_pull( provider : OAuthProviders - team_id : typing.Optional[LinkBulkTriggerHistoricalPullRequestTeamId] - wait_for_completion : typing.Optional[bool] Whether or not the endpoint should wait for the Bulk Op to complete before responding. @@ -1519,9 +1487,6 @@ async def bulk_trigger_historical_pull( _response = await self._client_wrapper.httpx_client.request( "v2/link/bulk_trigger_historical_pull", method="POST", - params={ - "team_id": team_id, - }, json={ "user_ids": user_ids, "provider": provider, @@ -1565,7 +1530,6 @@ async def bulk_export( self, *, provider: OAuthProviders, - team_id: typing.Optional[LinkBulkExportRequestTeamId] = None, user_ids: typing.Optional[typing.Sequence[str]] = OMIT, next_token: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, @@ -1575,8 +1539,6 @@ async def bulk_export( ---------- provider : OAuthProviders - team_id : typing.Optional[LinkBulkExportRequestTeamId] - user_ids : typing.Optional[typing.Sequence[str]] next_token : typing.Optional[str] @@ -1592,9 +1554,6 @@ async def bulk_export( _response = await self._client_wrapper.httpx_client.request( "v2/link/bulk_export", method="POST", - params={ - "team_id": team_id, - }, json={ "user_ids": user_ids, "provider": provider, @@ -1637,7 +1596,6 @@ async def bulk_pause( *, user_ids: typing.Sequence[str], provider: OAuthProviders, - team_id: typing.Optional[LinkBulkPauseRequestTeamId] = None, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Any]: """ @@ -1647,8 +1605,6 @@ async def bulk_pause( provider : OAuthProviders - team_id : typing.Optional[LinkBulkPauseRequestTeamId] - request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1660,9 +1616,6 @@ async def bulk_pause( _response = await self._client_wrapper.httpx_client.request( "v2/link/bulk_pause", method="POST", - params={ - "team_id": team_id, - }, json={ "user_ids": user_ids, "provider": provider, @@ -2515,7 +2468,10 @@ async def connect_manual_provider( provider: ManualProviders, *, user_id: str, + vital_ios_sdk_version: typing.Optional[str] = None, + vital_android_sdk_version: typing.Optional[str] = None, provider_id: typing.Optional[str] = OMIT, + granted_permissions: typing.Optional[typing.Sequence[str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[typing.Dict[str, bool]]: """ @@ -2525,8 +2481,14 @@ async def connect_manual_provider( user_id : str + vital_ios_sdk_version : typing.Optional[str] + + vital_android_sdk_version : typing.Optional[str] + provider_id : typing.Optional[str] + granted_permissions : typing.Optional[typing.Sequence[str]] + request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -2541,9 +2503,14 @@ async def connect_manual_provider( json={ "user_id": user_id, "provider_id": provider_id, + "granted_permissions": granted_permissions, }, headers={ "content-type": "application/json", + "x-vital-ios-sdk-version": str(vital_ios_sdk_version) if vital_ios_sdk_version is not None else None, + "x-vital-android-sdk-version": str(vital_android_sdk_version) + if vital_android_sdk_version is not None + else None, }, request_options=request_options, omit=OMIT, diff --git a/src/vital/link/types/__init__.py b/src/vital/link/types/__init__.py deleted file mode 100644 index 122cb0e2..00000000 --- a/src/vital/link/types/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .link_bulk_export_request_team_id import LinkBulkExportRequestTeamId - from .link_bulk_import_request_team_id import LinkBulkImportRequestTeamId - from .link_bulk_pause_request_team_id import LinkBulkPauseRequestTeamId - from .link_bulk_trigger_historical_pull_request_team_id import LinkBulkTriggerHistoricalPullRequestTeamId - from .link_list_bulk_ops_request_team_id import LinkListBulkOpsRequestTeamId -_dynamic_imports: typing.Dict[str, str] = { - "LinkBulkExportRequestTeamId": ".link_bulk_export_request_team_id", - "LinkBulkImportRequestTeamId": ".link_bulk_import_request_team_id", - "LinkBulkPauseRequestTeamId": ".link_bulk_pause_request_team_id", - "LinkBulkTriggerHistoricalPullRequestTeamId": ".link_bulk_trigger_historical_pull_request_team_id", - "LinkListBulkOpsRequestTeamId": ".link_list_bulk_ops_request_team_id", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "LinkBulkExportRequestTeamId", - "LinkBulkImportRequestTeamId", - "LinkBulkPauseRequestTeamId", - "LinkBulkTriggerHistoricalPullRequestTeamId", - "LinkListBulkOpsRequestTeamId", -] diff --git a/src/vital/link/types/link_bulk_export_request_team_id.py b/src/vital/link/types/link_bulk_export_request_team_id.py deleted file mode 100644 index f807c42e..00000000 --- a/src/vital/link/types/link_bulk_export_request_team_id.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core import enum - -T_Result = typing.TypeVar("T_Result") - - -class LinkBulkExportRequestTeamId(enum.StrEnum): - INFER_FROM_CONTEXT = "infer_from_context" - _UNKNOWN = "__LINKBULKEXPORTREQUESTTEAMID_UNKNOWN__" - """ - This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. - """ - - @classmethod - def _missing_(cls, value: typing.Any) -> "LinkBulkExportRequestTeamId": - unknown = cls._UNKNOWN - unknown._value_ = value - return unknown - - def visit( - self, infer_from_context: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result] - ) -> T_Result: - if self is LinkBulkExportRequestTeamId.INFER_FROM_CONTEXT: - return infer_from_context() - return _unknown_member(self._value_) diff --git a/src/vital/link/types/link_bulk_import_request_team_id.py b/src/vital/link/types/link_bulk_import_request_team_id.py deleted file mode 100644 index fea958d7..00000000 --- a/src/vital/link/types/link_bulk_import_request_team_id.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core import enum - -T_Result = typing.TypeVar("T_Result") - - -class LinkBulkImportRequestTeamId(enum.StrEnum): - INFER_FROM_CONTEXT = "infer_from_context" - _UNKNOWN = "__LINKBULKIMPORTREQUESTTEAMID_UNKNOWN__" - """ - This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. - """ - - @classmethod - def _missing_(cls, value: typing.Any) -> "LinkBulkImportRequestTeamId": - unknown = cls._UNKNOWN - unknown._value_ = value - return unknown - - def visit( - self, infer_from_context: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result] - ) -> T_Result: - if self is LinkBulkImportRequestTeamId.INFER_FROM_CONTEXT: - return infer_from_context() - return _unknown_member(self._value_) diff --git a/src/vital/link/types/link_bulk_pause_request_team_id.py b/src/vital/link/types/link_bulk_pause_request_team_id.py deleted file mode 100644 index abddb01c..00000000 --- a/src/vital/link/types/link_bulk_pause_request_team_id.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core import enum - -T_Result = typing.TypeVar("T_Result") - - -class LinkBulkPauseRequestTeamId(enum.StrEnum): - INFER_FROM_CONTEXT = "infer_from_context" - _UNKNOWN = "__LINKBULKPAUSEREQUESTTEAMID_UNKNOWN__" - """ - This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. - """ - - @classmethod - def _missing_(cls, value: typing.Any) -> "LinkBulkPauseRequestTeamId": - unknown = cls._UNKNOWN - unknown._value_ = value - return unknown - - def visit( - self, infer_from_context: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result] - ) -> T_Result: - if self is LinkBulkPauseRequestTeamId.INFER_FROM_CONTEXT: - return infer_from_context() - return _unknown_member(self._value_) diff --git a/src/vital/link/types/link_bulk_trigger_historical_pull_request_team_id.py b/src/vital/link/types/link_bulk_trigger_historical_pull_request_team_id.py deleted file mode 100644 index bc51022e..00000000 --- a/src/vital/link/types/link_bulk_trigger_historical_pull_request_team_id.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core import enum - -T_Result = typing.TypeVar("T_Result") - - -class LinkBulkTriggerHistoricalPullRequestTeamId(enum.StrEnum): - INFER_FROM_CONTEXT = "infer_from_context" - _UNKNOWN = "__LINKBULKTRIGGERHISTORICALPULLREQUESTTEAMID_UNKNOWN__" - """ - This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. - """ - - @classmethod - def _missing_(cls, value: typing.Any) -> "LinkBulkTriggerHistoricalPullRequestTeamId": - unknown = cls._UNKNOWN - unknown._value_ = value - return unknown - - def visit( - self, infer_from_context: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result] - ) -> T_Result: - if self is LinkBulkTriggerHistoricalPullRequestTeamId.INFER_FROM_CONTEXT: - return infer_from_context() - return _unknown_member(self._value_) diff --git a/src/vital/link/types/link_list_bulk_ops_request_team_id.py b/src/vital/link/types/link_list_bulk_ops_request_team_id.py deleted file mode 100644 index fdf105c8..00000000 --- a/src/vital/link/types/link_list_bulk_ops_request_team_id.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core import enum - -T_Result = typing.TypeVar("T_Result") - - -class LinkListBulkOpsRequestTeamId(enum.StrEnum): - INFER_FROM_CONTEXT = "infer_from_context" - _UNKNOWN = "__LINKLISTBULKOPSREQUESTTEAMID_UNKNOWN__" - """ - This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. - """ - - @classmethod - def _missing_(cls, value: typing.Any) -> "LinkListBulkOpsRequestTeamId": - unknown = cls._UNKNOWN - unknown._value_ = value - return unknown - - def visit( - self, infer_from_context: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result] - ) -> T_Result: - if self is LinkListBulkOpsRequestTeamId.INFER_FROM_CONTEXT: - return infer_from_context() - return _unknown_member(self._value_) diff --git a/src/vital/order_transaction/__init__.py b/src/vital/order_transaction/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/vital/order_transaction/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/vital/order_transaction/client.py b/src/vital/order_transaction/client.py new file mode 100644 index 00000000..c01a8c55 --- /dev/null +++ b/src/vital/order_transaction/client.py @@ -0,0 +1,246 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.request_options import RequestOptions +from ..types.get_order_transaction_response import GetOrderTransactionResponse +from ..types.lab_results_raw import LabResultsRaw +from .raw_client import AsyncRawOrderTransactionClient, RawOrderTransactionClient + + +class OrderTransactionClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawOrderTransactionClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawOrderTransactionClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawOrderTransactionClient + """ + return self._raw_client + + def get_transaction( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetOrderTransactionResponse: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetOrderTransactionResponse + Successful Response + + Examples + -------- + from vital import Vital + + client = Vital( + api_key="YOUR_API_KEY", + ) + client.order_transaction.get_transaction( + transaction_id="transaction_id", + ) + """ + _response = self._raw_client.get_transaction(transaction_id, request_options=request_options) + return _response.data + + def get_transaction_result( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> LabResultsRaw: + """ + Parameters + ---------- + transaction_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.order_transaction.get_transaction_result( + transaction_id="transaction_id", + ) + """ + _response = self._raw_client.get_transaction_result(transaction_id, request_options=request_options) + return _response.data + + def get_transaction_result_pdf( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Iterator[bytes]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. + + Returns + ------- + typing.Iterator[bytes] + PDF with results + + Examples + -------- + from vital import Vital + + client = Vital( + api_key="YOUR_API_KEY", + ) + client.order_transaction.get_transaction_result_pdf( + transaction_id="transaction_id", + ) + """ + with self._raw_client.get_transaction_result_pdf(transaction_id, request_options=request_options) as r: + yield from r.data + + +class AsyncOrderTransactionClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawOrderTransactionClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawOrderTransactionClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawOrderTransactionClient + """ + return self._raw_client + + async def get_transaction( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> GetOrderTransactionResponse: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + GetOrderTransactionResponse + Successful Response + + Examples + -------- + import asyncio + + from vital import AsyncVital + + client = AsyncVital( + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.order_transaction.get_transaction( + transaction_id="transaction_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_transaction(transaction_id, request_options=request_options) + return _response.data + + async def get_transaction_result( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> LabResultsRaw: + """ + Parameters + ---------- + transaction_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.order_transaction.get_transaction_result( + transaction_id="transaction_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.get_transaction_result(transaction_id, request_options=request_options) + return _response.data + + async def get_transaction_result_pdf( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[bytes]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. + + Returns + ------- + 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.order_transaction.get_transaction_result_pdf( + transaction_id="transaction_id", + ) + + + asyncio.run(main()) + """ + async with self._raw_client.get_transaction_result_pdf(transaction_id, request_options=request_options) as r: + async for _chunk in r.data: + yield _chunk diff --git a/src/vital/order_transaction/raw_client.py b/src/vital/order_transaction/raw_client.py new file mode 100644 index 00000000..60a99f67 --- /dev/null +++ b/src/vital/order_transaction/raw_client.py @@ -0,0 +1,317 @@ +# This file was auto-generated by Fern from our API Definition. + +import contextlib +import typing +from json.decoder import JSONDecodeError + +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ..core.http_response import AsyncHttpResponse, HttpResponse +from ..core.jsonable_encoder import jsonable_encoder +from ..core.pydantic_utilities import parse_obj_as +from ..core.request_options import RequestOptions +from ..errors.unprocessable_entity_error import UnprocessableEntityError +from ..types.get_order_transaction_response import GetOrderTransactionResponse +from ..types.http_validation_error import HttpValidationError +from ..types.lab_results_raw import LabResultsRaw + + +class RawOrderTransactionClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_transaction( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[GetOrderTransactionResponse]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[GetOrderTransactionResponse] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + f"v3/order_transaction/{jsonable_encoder(transaction_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetOrderTransactionResponse, + parse_obj_as( + type_=GetOrderTransactionResponse, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def get_transaction_result( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[LabResultsRaw]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[LabResultsRaw] + Successful Response + """ + _response = self._client_wrapper.httpx_client.request( + f"v3/order_transaction/{jsonable_encoder(transaction_id)}/result", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + LabResultsRaw, + parse_obj_as( + type_=LabResultsRaw, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + @contextlib.contextmanager + def get_transaction_result_pdf( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.Iterator[HttpResponse[typing.Iterator[bytes]]]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. + + Returns + ------- + typing.Iterator[HttpResponse[typing.Iterator[bytes]]] + PDF with results + """ + with self._client_wrapper.httpx_client.stream( + f"v3/order_transaction/{jsonable_encoder(transaction_id)}/result/pdf", + method="GET", + request_options=request_options, + ) as _response: + + def _stream() -> HttpResponse[typing.Iterator[bytes]]: + try: + if 200 <= _response.status_code < 300: + _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None + return HttpResponse( + response=_response, data=(_chunk for _chunk in _response.iter_bytes(chunk_size=_chunk_size)) + ) + _response.read() + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + yield _stream() + + +class AsyncRawOrderTransactionClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_transaction( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[GetOrderTransactionResponse]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[GetOrderTransactionResponse] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + f"v3/order_transaction/{jsonable_encoder(transaction_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + GetOrderTransactionResponse, + parse_obj_as( + type_=GetOrderTransactionResponse, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def get_transaction_result( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[LabResultsRaw]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[LabResultsRaw] + Successful Response + """ + _response = await self._client_wrapper.httpx_client.request( + f"v3/order_transaction/{jsonable_encoder(transaction_id)}/result", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + LabResultsRaw, + parse_obj_as( + type_=LabResultsRaw, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + @contextlib.asynccontextmanager + async def get_transaction_result_pdf( + self, transaction_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]: + """ + Parameters + ---------- + transaction_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response. + + Returns + ------- + typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]] + PDF with results + """ + async with self._client_wrapper.httpx_client.stream( + f"v3/order_transaction/{jsonable_encoder(transaction_id)}/result/pdf", + method="GET", + request_options=request_options, + ) as _response: + + async def _stream() -> AsyncHttpResponse[typing.AsyncIterator[bytes]]: + try: + if 200 <= _response.status_code < 300: + _chunk_size = request_options.get("chunk_size", None) if request_options is not None else None + return AsyncHttpResponse( + response=_response, + data=(_chunk async for _chunk in _response.aiter_bytes(chunk_size=_chunk_size)), + ) + await _response.aread() + if _response.status_code == 422: + raise UnprocessableEntityError( + headers=dict(_response.headers), + body=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, headers=dict(_response.headers), body=_response.text + ) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + yield await _stream() diff --git a/src/vital/team/client.py b/src/vital/team/client.py index 9c2463d3..5c4a4c8c 100644 --- a/src/vital/team/client.py +++ b/src/vital/team/client.py @@ -51,9 +51,7 @@ def get_link_config( client = Vital( api_key="YOUR_API_KEY", ) - client.team.get_link_config( - vital_link_token="x-vital-link-token", - ) + client.team.get_link_config() """ _response = self._raw_client.get_link_config(vital_link_token=vital_link_token, request_options=request_options) return _response.data @@ -283,9 +281,7 @@ async def get_link_config( async def main() -> None: - await client.team.get_link_config( - vital_link_token="x-vital-link-token", - ) + await client.team.get_link_config() asyncio.run(main()) diff --git a/src/vital/types/__init__.py b/src/vital/types/__init__.py index 8d0999f6..e0e59bd1 100644 --- a/src/vital/types/__init__.py +++ b/src/vital/types/__init__.py @@ -36,6 +36,7 @@ from .auth_type import AuthType from .availability import Availability from .awake_at_value_macro_expr import AwakeAtValueMacroExpr + from .awakenings_value_macro_expr import AwakeningsValueMacroExpr from .basal_body_temperature_entry import BasalBodyTemperatureEntry from .billing import Billing from .biomarker_result import BiomarkerResult @@ -50,6 +51,7 @@ from .bulk_op_status import BulkOpStatus from .bulk_op_type import BulkOpType from .bulk_ops_response import BulkOpsResponse + from .canonical_candidate import CanonicalCandidate from .cervical_mucus_entry import CervicalMucusEntry from .cervical_mucus_entry_quality import CervicalMucusEntryQuality from .chronotype_value_macro_expr import ChronotypeValueMacroExpr @@ -255,10 +257,16 @@ ClientFacingInsulinInjectionHistoricalPullCompleted, ) from .client_facing_insulin_injection_sample import ClientFacingInsulinInjectionSample + from .client_facing_insulin_injection_sample_bolus_purpose import ClientFacingInsulinInjectionSampleBolusPurpose + from .client_facing_insulin_injection_sample_delivery_form import ClientFacingInsulinInjectionSampleDeliveryForm + from .client_facing_insulin_injection_sample_delivery_mode import ClientFacingInsulinInjectionSampleDeliveryMode from .client_facing_insulin_injection_sample_type import ClientFacingInsulinInjectionSampleType from .client_facing_insurance import ClientFacingInsurance from .client_facing_lab import ClientFacingLab + from .client_facing_lab_account import ClientFacingLabAccount from .client_facing_lab_location import ClientFacingLabLocation + from .client_facing_lab_report_parsing_job_created_event import ClientFacingLabReportParsingJobCreatedEvent + from .client_facing_lab_report_parsing_job_updated_event import ClientFacingLabReportParsingJobUpdatedEvent from .client_facing_lab_test import ClientFacingLabTest from .client_facing_labs import ClientFacingLabs from .client_facing_lean_body_mass_changed import ClientFacingLeanBodyMassChanged @@ -304,6 +312,8 @@ ClientFacingOrderDetails_WalkInTest, ) from .client_facing_order_event import ClientFacingOrderEvent + from .client_facing_order_in_transaction import ClientFacingOrderInTransaction + from .client_facing_order_transaction import ClientFacingOrderTransaction from .client_facing_patient_details_compatible import ClientFacingPatientDetailsCompatible from .client_facing_payor import ClientFacingPayor from .client_facing_payor_code_source import ClientFacingPayorCodeSource @@ -464,6 +474,7 @@ from .client_workout_response import ClientWorkoutResponse from .clinical_information import ClinicalInformation from .company_details import CompanyDetails + from .compendium_search_labs import CompendiumSearchLabs from .connected_source_client_facing import ConnectedSourceClientFacing from .connection_recipe import ConnectionRecipe from .consent import Consent @@ -474,6 +485,7 @@ from .continuous_query_task_status import ContinuousQueryTaskStatus from .contraceptive_entry import ContraceptiveEntry from .contraceptive_entry_type import ContraceptiveEntryType + from .convert_compendium_response import ConvertCompendiumResponse from .create_user_portal_url_response import CreateUserPortalUrlResponse from .date_part_expr import DatePartExpr from .date_part_expr_arg import DatePartExprArg @@ -484,6 +496,8 @@ from .delegated_flow_type import DelegatedFlowType from .demo_connection_status import DemoConnectionStatus from .demo_providers import DemoProviders + from .derived_readiness_column_expr import DerivedReadinessColumnExpr + from .derived_readiness_column_expr_derived_readiness import DerivedReadinessColumnExprDerivedReadiness from .detected_deviation_entry import DetectedDeviationEntry from .detected_deviation_entry_deviation import DetectedDeviationEntryDeviation from .device_v_2_in_db import DeviceV2InDb @@ -503,7 +517,9 @@ from .gender import Gender from .gender_identity import GenderIdentity from .get_markers_response import GetMarkersResponse + from .get_order_transaction_response import GetOrderTransactionResponse from .get_orders_response import GetOrdersResponse + from .get_team_lab_accounts_response import GetTeamLabAccountsResponse from .group_key_column_expr import GroupKeyColumnExpr from .group_key_column_expr_group_key import GroupKeyColumnExprGroupKey from .grouped_a_fib_burden import GroupedAFibBurden @@ -629,12 +645,16 @@ from .icd_excludes_warning import IcdExcludesWarning from .index_column_expr import IndexColumnExpr from .index_column_expr_index import IndexColumnExprIndex + from .insulin_injection_timeseries_expr import InsulinInjectionTimeseriesExpr + from .insulin_injection_timeseries_expr_field import InsulinInjectionTimeseriesExprField from .intermenstrual_bleeding_entry import IntermenstrualBleedingEntry from .interpretation import Interpretation from .interval_timeseries_expr import IntervalTimeseriesExpr from .interval_timeseries_expr_field import IntervalTimeseriesExprField from .interval_timeseries_expr_timeseries import IntervalTimeseriesExprTimeseries from .jpeg import Jpeg + from .lab_account_delegated_flow import LabAccountDelegatedFlow + from .lab_account_status import LabAccountStatus from .lab_location_capability import LabLocationCapability from .lab_location_metadata import LabLocationMetadata from .lab_report_result import LabReportResult @@ -672,15 +692,20 @@ from .o_auth_providers import OAuthProviders from .order_activation_type import OrderActivationType from .order_low_level_status import OrderLowLevelStatus + from .order_origin import OrderOrigin from .order_set_request import OrderSetRequest from .order_status import OrderStatus + from .order_status_detail import OrderStatusDetail + from .order_summary import OrderSummary from .order_top_level_status import OrderTopLevelStatus + from .order_transaction_status import OrderTransactionStatus from .ovulation_test_entry import OvulationTestEntry from .ovulation_test_entry_test_result import OvulationTestEntryTestResult from .paginated_users_response import PaginatedUsersResponse from .parent_biomarker_data import ParentBiomarkerData from .parsed_lab_report_data import ParsedLabReportData from .parsing_job import ParsingJob + from .parsing_job_failure_reason import ParsingJobFailureReason from .parsing_job_status import ParsingJobStatus from .password_providers import PasswordProviders from .patient_address import PatientAddress @@ -688,6 +713,7 @@ from .patient_address_with_validation import PatientAddressWithValidation from .patient_details_with_validation import PatientDetailsWithValidation from .payor_code_external_provider import PayorCodeExternalProvider + from .per_lab_candidate import PerLabCandidate from .performing_laboratory import PerformingLaboratory from .period import Period from .period_unit import PeriodUnit @@ -706,6 +732,7 @@ from .provider_connection_created import ProviderConnectionCreated from .provider_connection_error import ProviderConnectionError from .provider_connection_error_error_type import ProviderConnectionErrorErrorType + from .provider_id_conversion_response import ProviderIdConversionResponse from .provider_link_response import ProviderLinkResponse from .provider_link_response_error_type import ProviderLinkResponseErrorType from .provider_link_response_state import ProviderLinkResponseState @@ -730,11 +757,13 @@ from .raw_sleep import RawSleep from .raw_workout import RawWorkout from .region import Region + from .related_candidate import RelatedCandidate from .relative_timeframe import RelativeTimeframe from .resend_webhook_response import ResendWebhookResponse from .resource_availability import ResourceAvailability from .responsible_relationship import ResponsibleRelationship from .result_metadata import ResultMetadata + from .result_metadata_gender import ResultMetadataGender from .result_type import ResultType from .sample_data import SampleData from .sample_data_date_collected import SampleDataDateCollected @@ -742,6 +771,8 @@ from .sample_data_date_reported import SampleDataDateReported from .scope_requirements_grants import ScopeRequirementsGrants from .scope_requirements_str import ScopeRequirementsStr + from .search_compendium_response import SearchCompendiumResponse + from .search_mode import SearchMode from .select import Select from .sex import Sex from .sexual_activity_entry import SexualActivityEntry @@ -777,6 +808,8 @@ from .trace_elements import TraceElements from .unrecognized_value_macro_expr import UnrecognizedValueMacroExpr from .us_address import UsAddress + from .us_state import UsState + from .user_address import UserAddress from .user_historical_pulls_response import UserHistoricalPullsResponse from .user_info import UserInfo from .user_refresh_error_response import UserRefreshErrorResponse @@ -833,6 +866,7 @@ "AuthType": ".auth_type", "Availability": ".availability", "AwakeAtValueMacroExpr": ".awake_at_value_macro_expr", + "AwakeningsValueMacroExpr": ".awakenings_value_macro_expr", "BasalBodyTemperatureEntry": ".basal_body_temperature_entry", "Billing": ".billing", "BiomarkerResult": ".biomarker_result", @@ -847,6 +881,7 @@ "BulkOpStatus": ".bulk_op_status", "BulkOpType": ".bulk_op_type", "BulkOpsResponse": ".bulk_ops_response", + "CanonicalCandidate": ".canonical_candidate", "CervicalMucusEntry": ".cervical_mucus_entry", "CervicalMucusEntryQuality": ".cervical_mucus_entry_quality", "ChronotypeValueMacroExpr": ".chronotype_value_macro_expr", @@ -1014,10 +1049,16 @@ "ClientFacingInsulinInjectionChangedEventType": ".client_facing_insulin_injection_changed_event_type", "ClientFacingInsulinInjectionHistoricalPullCompleted": ".client_facing_insulin_injection_historical_pull_completed", "ClientFacingInsulinInjectionSample": ".client_facing_insulin_injection_sample", + "ClientFacingInsulinInjectionSampleBolusPurpose": ".client_facing_insulin_injection_sample_bolus_purpose", + "ClientFacingInsulinInjectionSampleDeliveryForm": ".client_facing_insulin_injection_sample_delivery_form", + "ClientFacingInsulinInjectionSampleDeliveryMode": ".client_facing_insulin_injection_sample_delivery_mode", "ClientFacingInsulinInjectionSampleType": ".client_facing_insulin_injection_sample_type", "ClientFacingInsurance": ".client_facing_insurance", "ClientFacingLab": ".client_facing_lab", + "ClientFacingLabAccount": ".client_facing_lab_account", "ClientFacingLabLocation": ".client_facing_lab_location", + "ClientFacingLabReportParsingJobCreatedEvent": ".client_facing_lab_report_parsing_job_created_event", + "ClientFacingLabReportParsingJobUpdatedEvent": ".client_facing_lab_report_parsing_job_updated_event", "ClientFacingLabTest": ".client_facing_lab_test", "ClientFacingLabs": ".client_facing_labs", "ClientFacingLeanBodyMassChanged": ".client_facing_lean_body_mass_changed", @@ -1057,6 +1098,8 @@ "ClientFacingOrderDetails_Testkit": ".client_facing_order_details", "ClientFacingOrderDetails_WalkInTest": ".client_facing_order_details", "ClientFacingOrderEvent": ".client_facing_order_event", + "ClientFacingOrderInTransaction": ".client_facing_order_in_transaction", + "ClientFacingOrderTransaction": ".client_facing_order_transaction", "ClientFacingPatientDetailsCompatible": ".client_facing_patient_details_compatible", "ClientFacingPayor": ".client_facing_payor", "ClientFacingPayorCodeSource": ".client_facing_payor_code_source", @@ -1193,6 +1236,7 @@ "ClientWorkoutResponse": ".client_workout_response", "ClinicalInformation": ".clinical_information", "CompanyDetails": ".company_details", + "CompendiumSearchLabs": ".compendium_search_labs", "ConnectedSourceClientFacing": ".connected_source_client_facing", "ConnectionRecipe": ".connection_recipe", "Consent": ".consent", @@ -1203,6 +1247,7 @@ "ContinuousQueryTaskStatus": ".continuous_query_task_status", "ContraceptiveEntry": ".contraceptive_entry", "ContraceptiveEntryType": ".contraceptive_entry_type", + "ConvertCompendiumResponse": ".convert_compendium_response", "CreateUserPortalUrlResponse": ".create_user_portal_url_response", "DatePartExpr": ".date_part_expr", "DatePartExprArg": ".date_part_expr_arg", @@ -1213,6 +1258,8 @@ "DelegatedFlowType": ".delegated_flow_type", "DemoConnectionStatus": ".demo_connection_status", "DemoProviders": ".demo_providers", + "DerivedReadinessColumnExpr": ".derived_readiness_column_expr", + "DerivedReadinessColumnExprDerivedReadiness": ".derived_readiness_column_expr_derived_readiness", "DetectedDeviationEntry": ".detected_deviation_entry", "DetectedDeviationEntryDeviation": ".detected_deviation_entry_deviation", "DeviceV2InDb": ".device_v_2_in_db", @@ -1232,7 +1279,9 @@ "Gender": ".gender", "GenderIdentity": ".gender_identity", "GetMarkersResponse": ".get_markers_response", + "GetOrderTransactionResponse": ".get_order_transaction_response", "GetOrdersResponse": ".get_orders_response", + "GetTeamLabAccountsResponse": ".get_team_lab_accounts_response", "GroupKeyColumnExpr": ".group_key_column_expr", "GroupKeyColumnExprGroupKey": ".group_key_column_expr_group_key", "GroupedAFibBurden": ".grouped_a_fib_burden", @@ -1356,12 +1405,16 @@ "IcdExcludesWarning": ".icd_excludes_warning", "IndexColumnExpr": ".index_column_expr", "IndexColumnExprIndex": ".index_column_expr_index", + "InsulinInjectionTimeseriesExpr": ".insulin_injection_timeseries_expr", + "InsulinInjectionTimeseriesExprField": ".insulin_injection_timeseries_expr_field", "IntermenstrualBleedingEntry": ".intermenstrual_bleeding_entry", "Interpretation": ".interpretation", "IntervalTimeseriesExpr": ".interval_timeseries_expr", "IntervalTimeseriesExprField": ".interval_timeseries_expr_field", "IntervalTimeseriesExprTimeseries": ".interval_timeseries_expr_timeseries", "Jpeg": ".jpeg", + "LabAccountDelegatedFlow": ".lab_account_delegated_flow", + "LabAccountStatus": ".lab_account_status", "LabLocationCapability": ".lab_location_capability", "LabLocationMetadata": ".lab_location_metadata", "LabReportResult": ".lab_report_result", @@ -1399,15 +1452,20 @@ "OAuthProviders": ".o_auth_providers", "OrderActivationType": ".order_activation_type", "OrderLowLevelStatus": ".order_low_level_status", + "OrderOrigin": ".order_origin", "OrderSetRequest": ".order_set_request", "OrderStatus": ".order_status", + "OrderStatusDetail": ".order_status_detail", + "OrderSummary": ".order_summary", "OrderTopLevelStatus": ".order_top_level_status", + "OrderTransactionStatus": ".order_transaction_status", "OvulationTestEntry": ".ovulation_test_entry", "OvulationTestEntryTestResult": ".ovulation_test_entry_test_result", "PaginatedUsersResponse": ".paginated_users_response", "ParentBiomarkerData": ".parent_biomarker_data", "ParsedLabReportData": ".parsed_lab_report_data", "ParsingJob": ".parsing_job", + "ParsingJobFailureReason": ".parsing_job_failure_reason", "ParsingJobStatus": ".parsing_job_status", "PasswordProviders": ".password_providers", "PatientAddress": ".patient_address", @@ -1415,6 +1473,7 @@ "PatientAddressWithValidation": ".patient_address_with_validation", "PatientDetailsWithValidation": ".patient_details_with_validation", "PayorCodeExternalProvider": ".payor_code_external_provider", + "PerLabCandidate": ".per_lab_candidate", "PerformingLaboratory": ".performing_laboratory", "Period": ".period", "PeriodUnit": ".period_unit", @@ -1433,6 +1492,7 @@ "ProviderConnectionCreated": ".provider_connection_created", "ProviderConnectionError": ".provider_connection_error", "ProviderConnectionErrorErrorType": ".provider_connection_error_error_type", + "ProviderIdConversionResponse": ".provider_id_conversion_response", "ProviderLinkResponse": ".provider_link_response", "ProviderLinkResponseErrorType": ".provider_link_response_error_type", "ProviderLinkResponseState": ".provider_link_response_state", @@ -1457,11 +1517,13 @@ "RawSleep": ".raw_sleep", "RawWorkout": ".raw_workout", "Region": ".region", + "RelatedCandidate": ".related_candidate", "RelativeTimeframe": ".relative_timeframe", "ResendWebhookResponse": ".resend_webhook_response", "ResourceAvailability": ".resource_availability", "ResponsibleRelationship": ".responsible_relationship", "ResultMetadata": ".result_metadata", + "ResultMetadataGender": ".result_metadata_gender", "ResultType": ".result_type", "SampleData": ".sample_data", "SampleDataDateCollected": ".sample_data_date_collected", @@ -1469,6 +1531,8 @@ "SampleDataDateReported": ".sample_data_date_reported", "ScopeRequirementsGrants": ".scope_requirements_grants", "ScopeRequirementsStr": ".scope_requirements_str", + "SearchCompendiumResponse": ".search_compendium_response", + "SearchMode": ".search_mode", "Select": ".select", "Sex": ".sex", "SexualActivityEntry": ".sexual_activity_entry", @@ -1504,6 +1568,8 @@ "TraceElements": ".trace_elements", "UnrecognizedValueMacroExpr": ".unrecognized_value_macro_expr", "UsAddress": ".us_address", + "UsState": ".us_state", + "UserAddress": ".user_address", "UserHistoricalPullsResponse": ".user_historical_pulls_response", "UserInfo": ".user_info", "UserRefreshErrorResponse": ".user_refresh_error_response", @@ -1580,6 +1646,7 @@ def __dir__(): "AuthType", "Availability", "AwakeAtValueMacroExpr", + "AwakeningsValueMacroExpr", "BasalBodyTemperatureEntry", "Billing", "BiomarkerResult", @@ -1594,6 +1661,7 @@ def __dir__(): "BulkOpStatus", "BulkOpType", "BulkOpsResponse", + "CanonicalCandidate", "CervicalMucusEntry", "CervicalMucusEntryQuality", "ChronotypeValueMacroExpr", @@ -1761,10 +1829,16 @@ def __dir__(): "ClientFacingInsulinInjectionChangedEventType", "ClientFacingInsulinInjectionHistoricalPullCompleted", "ClientFacingInsulinInjectionSample", + "ClientFacingInsulinInjectionSampleBolusPurpose", + "ClientFacingInsulinInjectionSampleDeliveryForm", + "ClientFacingInsulinInjectionSampleDeliveryMode", "ClientFacingInsulinInjectionSampleType", "ClientFacingInsurance", "ClientFacingLab", + "ClientFacingLabAccount", "ClientFacingLabLocation", + "ClientFacingLabReportParsingJobCreatedEvent", + "ClientFacingLabReportParsingJobUpdatedEvent", "ClientFacingLabTest", "ClientFacingLabs", "ClientFacingLeanBodyMassChanged", @@ -1804,6 +1878,8 @@ def __dir__(): "ClientFacingOrderDetails_Testkit", "ClientFacingOrderDetails_WalkInTest", "ClientFacingOrderEvent", + "ClientFacingOrderInTransaction", + "ClientFacingOrderTransaction", "ClientFacingPatientDetailsCompatible", "ClientFacingPayor", "ClientFacingPayorCodeSource", @@ -1940,6 +2016,7 @@ def __dir__(): "ClientWorkoutResponse", "ClinicalInformation", "CompanyDetails", + "CompendiumSearchLabs", "ConnectedSourceClientFacing", "ConnectionRecipe", "Consent", @@ -1950,6 +2027,7 @@ def __dir__(): "ContinuousQueryTaskStatus", "ContraceptiveEntry", "ContraceptiveEntryType", + "ConvertCompendiumResponse", "CreateUserPortalUrlResponse", "DatePartExpr", "DatePartExprArg", @@ -1960,6 +2038,8 @@ def __dir__(): "DelegatedFlowType", "DemoConnectionStatus", "DemoProviders", + "DerivedReadinessColumnExpr", + "DerivedReadinessColumnExprDerivedReadiness", "DetectedDeviationEntry", "DetectedDeviationEntryDeviation", "DeviceV2InDb", @@ -1979,7 +2059,9 @@ def __dir__(): "Gender", "GenderIdentity", "GetMarkersResponse", + "GetOrderTransactionResponse", "GetOrdersResponse", + "GetTeamLabAccountsResponse", "GroupKeyColumnExpr", "GroupKeyColumnExprGroupKey", "GroupedAFibBurden", @@ -2103,12 +2185,16 @@ def __dir__(): "IcdExcludesWarning", "IndexColumnExpr", "IndexColumnExprIndex", + "InsulinInjectionTimeseriesExpr", + "InsulinInjectionTimeseriesExprField", "IntermenstrualBleedingEntry", "Interpretation", "IntervalTimeseriesExpr", "IntervalTimeseriesExprField", "IntervalTimeseriesExprTimeseries", "Jpeg", + "LabAccountDelegatedFlow", + "LabAccountStatus", "LabLocationCapability", "LabLocationMetadata", "LabReportResult", @@ -2146,15 +2232,20 @@ def __dir__(): "OAuthProviders", "OrderActivationType", "OrderLowLevelStatus", + "OrderOrigin", "OrderSetRequest", "OrderStatus", + "OrderStatusDetail", + "OrderSummary", "OrderTopLevelStatus", + "OrderTransactionStatus", "OvulationTestEntry", "OvulationTestEntryTestResult", "PaginatedUsersResponse", "ParentBiomarkerData", "ParsedLabReportData", "ParsingJob", + "ParsingJobFailureReason", "ParsingJobStatus", "PasswordProviders", "PatientAddress", @@ -2162,6 +2253,7 @@ def __dir__(): "PatientAddressWithValidation", "PatientDetailsWithValidation", "PayorCodeExternalProvider", + "PerLabCandidate", "PerformingLaboratory", "Period", "PeriodUnit", @@ -2180,6 +2272,7 @@ def __dir__(): "ProviderConnectionCreated", "ProviderConnectionError", "ProviderConnectionErrorErrorType", + "ProviderIdConversionResponse", "ProviderLinkResponse", "ProviderLinkResponseErrorType", "ProviderLinkResponseState", @@ -2204,11 +2297,13 @@ def __dir__(): "RawSleep", "RawWorkout", "Region", + "RelatedCandidate", "RelativeTimeframe", "ResendWebhookResponse", "ResourceAvailability", "ResponsibleRelationship", "ResultMetadata", + "ResultMetadataGender", "ResultType", "SampleData", "SampleDataDateCollected", @@ -2216,6 +2311,8 @@ def __dir__(): "SampleDataDateReported", "ScopeRequirementsGrants", "ScopeRequirementsStr", + "SearchCompendiumResponse", + "SearchMode", "Select", "Sex", "SexualActivityEntry", @@ -2251,6 +2348,8 @@ def __dir__(): "TraceElements", "UnrecognizedValueMacroExpr", "UsAddress", + "UsState", + "UserAddress", "UserHistoricalPullsResponse", "UserInfo", "UserRefreshErrorResponse", diff --git a/src/vital/types/address.py b/src/vital/types/address.py index f09c9fd1..8f571196 100644 --- a/src/vital/types/address.py +++ b/src/vital/types/address.py @@ -13,6 +13,7 @@ class Address(UniversalBaseModel): zip: str city: str state: str + access_notes: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/aggregate_expr_arg.py b/src/vital/types/aggregate_expr_arg.py index fe861faa..c2aa1b3b 100644 --- a/src/vital/types/aggregate_expr_arg.py +++ b/src/vital/types/aggregate_expr_arg.py @@ -5,11 +5,14 @@ from .activity_column_expr import ActivityColumnExpr from .asleep_at_value_macro_expr import AsleepAtValueMacroExpr from .awake_at_value_macro_expr import AwakeAtValueMacroExpr +from .awakenings_value_macro_expr import AwakeningsValueMacroExpr from .blood_pressure_timeseries_expr import BloodPressureTimeseriesExpr from .body_column_expr import BodyColumnExpr from .chronotype_value_macro_expr import ChronotypeValueMacroExpr +from .derived_readiness_column_expr import DerivedReadinessColumnExpr from .discrete_timeseries_expr import DiscreteTimeseriesExpr from .index_column_expr import IndexColumnExpr +from .insulin_injection_timeseries_expr import InsulinInjectionTimeseriesExpr from .interval_timeseries_expr import IntervalTimeseriesExpr from .meal_column_expr import MealColumnExpr from .note_timeseries_expr import NoteTimeseriesExpr @@ -23,6 +26,7 @@ AggregateExprArg = typing.Union[ SleepColumnExpr, + DerivedReadinessColumnExpr, ActivityColumnExpr, WorkoutColumnExpr, BodyColumnExpr, @@ -32,9 +36,11 @@ ChronotypeValueMacroExpr, AsleepAtValueMacroExpr, AwakeAtValueMacroExpr, + AwakeningsValueMacroExpr, UnrecognizedValueMacroExpr, DiscreteTimeseriesExpr, IntervalTimeseriesExpr, + InsulinInjectionTimeseriesExpr, BloodPressureTimeseriesExpr, TemperatureTimeseriesExpr, WorkoutDurationTimeseriesExpr, diff --git a/src/vital/types/appointment_booking_request.py b/src/vital/types/appointment_booking_request.py index 69ca27d6..87c60a6f 100644 --- a/src/vital/types/appointment_booking_request.py +++ b/src/vital/types/appointment_booking_request.py @@ -8,6 +8,21 @@ class AppointmentBookingRequest(UniversalBaseModel): booking_key: str + appointment_notes: typing.Optional[str] = None + async_confirmation: typing.Optional[bool] = pydantic.Field(default=None) + """ + If true, the endpoint attempts to confirm the booking within the `sync_confirmation_timeout_millisecond` window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure. + """ + + sync_confirmation_timeout_millisecond: typing.Optional[int] = pydantic.Field(default=None) + """ + Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when `async_confirmation` is true. Defaults to 2500ms. Range: 1000-10000ms. + """ + + async_confirmation_timeout_millisecond: typing.Optional[int] = pydantic.Field(default=None) + """ + Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when `async_confirmation` is true. Defaults to 15 minutes. Range: 60000-172800000ms. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/appointment_provider.py b/src/vital/types/appointment_provider.py index 6c6f69db..9da97b17 100644 --- a/src/vital/types/appointment_provider.py +++ b/src/vital/types/appointment_provider.py @@ -15,6 +15,7 @@ class AppointmentProvider(enum.StrEnum): GETLABS = "getlabs" PHLEBFINDERS = "phlebfinders" QUEST = "quest" + SONORA_QUEST = "sonora_quest" _UNKNOWN = "__APPOINTMENTPROVIDER_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -31,6 +32,7 @@ def visit( getlabs: typing.Callable[[], T_Result], phlebfinders: typing.Callable[[], T_Result], quest: typing.Callable[[], T_Result], + sonora_quest: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is AppointmentProvider.GETLABS: @@ -39,4 +41,6 @@ def visit( return phlebfinders() if self is AppointmentProvider.QUEST: return quest() + if self is AppointmentProvider.SONORA_QUEST: + return sonora_quest() return _unknown_member(self._value_) diff --git a/src/vital/types/appointment_psc_labs.py b/src/vital/types/appointment_psc_labs.py index 8c87f8c6..0ba25548 100644 --- a/src/vital/types/appointment_psc_labs.py +++ b/src/vital/types/appointment_psc_labs.py @@ -2,4 +2,37 @@ import typing -AppointmentPscLabs = typing.Literal["quest"] +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class AppointmentPscLabs(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + QUEST = "quest" + SONORA_QUEST = "sonora_quest" + _UNKNOWN = "__APPOINTMENTPSCLABS_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "AppointmentPscLabs": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + quest: typing.Callable[[], T_Result], + sonora_quest: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is AppointmentPscLabs.QUEST: + return quest() + if self is AppointmentPscLabs.SONORA_QUEST: + return sonora_quest() + return _unknown_member(self._value_) diff --git a/src/vital/types/appointment_reschedule_request.py b/src/vital/types/appointment_reschedule_request.py index 153b8056..3a040852 100644 --- a/src/vital/types/appointment_reschedule_request.py +++ b/src/vital/types/appointment_reschedule_request.py @@ -8,6 +8,7 @@ class AppointmentRescheduleRequest(UniversalBaseModel): booking_key: str + appointment_notes: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/awakenings_value_macro_expr.py b/src/vital/types/awakenings_value_macro_expr.py new file mode 100644 index 00000000..32511501 --- /dev/null +++ b/src/vital/types/awakenings_value_macro_expr.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class AwakeningsValueMacroExpr(UniversalBaseModel): + value_macro: typing.Literal["awakenings"] = "awakenings" + version: typing.Optional[typing.Literal["automatic"]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/canonical_candidate.py b/src/vital/types/canonical_candidate.py new file mode 100644 index 00000000..2188f500 --- /dev/null +++ b/src/vital/types/canonical_candidate.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class CanonicalCandidate(UniversalBaseModel): + loinc_set_hash: str + display_name: str + aliases: typing.Optional[typing.List[str]] = None + loinc_codes: typing.Optional[typing.List[str]] = None + provider_ids: typing.Optional[typing.List[str]] = None + loinc_components: typing.Optional[typing.List[str]] = None + loinc_groups: typing.Optional[typing.List[str]] = None + cpt_codes: typing.Optional[typing.List[str]] = None + popularity_score: float + confidence: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/client_facing_activity.py b/src/vital/types/client_facing_activity.py index 8cd1f3ff..7b58159e 100644 --- a/src/vital/types/client_facing_activity.py +++ b/src/vital/types/client_facing_activity.py @@ -91,7 +91,7 @@ class ClientFacingActivity(UniversalBaseModel): Heart rate daily summary. """ - wheelchair_use: typing.Optional[bool] = None + wheelchair_use: typing.Optional[typing.Literal[True]] = None wheelchair_push: typing.Optional[int] = None created_at: dt.datetime updated_at: dt.datetime diff --git a/src/vital/types/client_facing_appointment.py b/src/vital/types/client_facing_appointment.py index 4066725e..15d3efb7 100644 --- a/src/vital/types/client_facing_appointment.py +++ b/src/vital/types/client_facing_appointment.py @@ -18,6 +18,7 @@ class ClientFacingAppointment(UniversalBaseModel): id: str user_id: str order_id: str + order_transaction_id: typing.Optional[str] = None address: UsAddress location: LngLat start_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) @@ -37,6 +38,7 @@ class ClientFacingAppointment(UniversalBaseModel): provider_id: str external_id: typing.Optional[str] = None can_reschedule: bool + appointment_notes: typing.Optional[str] = None event_status: AppointmentEventStatus event_data: typing.Optional[typing.Dict[str, typing.Any]] = None events: typing.List[ClientFacingAppointmentEvent] diff --git a/src/vital/types/client_facing_device_source_type.py b/src/vital/types/client_facing_device_source_type.py index 6075b5ea..e33cdb69 100644 --- a/src/vital/types/client_facing_device_source_type.py +++ b/src/vital/types/client_facing_device_source_type.py @@ -21,6 +21,7 @@ class ClientFacingDeviceSourceType(enum.StrEnum): CUFF = "cuff" MANUAL_SCAN = "manual_scan" AUTOMATIC = "automatic" + INSULIN_PUMP = "insulin_pump" SCALE = "scale" CHEST_STRAP = "chest_strap" RING = "ring" @@ -49,6 +50,7 @@ def visit( cuff: typing.Callable[[], T_Result], manual_scan: typing.Callable[[], T_Result], automatic: typing.Callable[[], T_Result], + insulin_pump: typing.Callable[[], T_Result], scale: typing.Callable[[], T_Result], chest_strap: typing.Callable[[], T_Result], ring: typing.Callable[[], T_Result], @@ -75,6 +77,8 @@ def visit( return manual_scan() if self is ClientFacingDeviceSourceType.AUTOMATIC: return automatic() + if self is ClientFacingDeviceSourceType.INSULIN_PUMP: + return insulin_pump() if self is ClientFacingDeviceSourceType.SCALE: return scale() if self is ClientFacingDeviceSourceType.CHEST_STRAP: diff --git a/src/vital/types/client_facing_electrocardiogram_source_type.py b/src/vital/types/client_facing_electrocardiogram_source_type.py index 3a8fc150..aaf68e61 100644 --- a/src/vital/types/client_facing_electrocardiogram_source_type.py +++ b/src/vital/types/client_facing_electrocardiogram_source_type.py @@ -21,6 +21,7 @@ class ClientFacingElectrocardiogramSourceType(enum.StrEnum): CUFF = "cuff" MANUAL_SCAN = "manual_scan" AUTOMATIC = "automatic" + INSULIN_PUMP = "insulin_pump" SCALE = "scale" CHEST_STRAP = "chest_strap" RING = "ring" @@ -49,6 +50,7 @@ def visit( cuff: typing.Callable[[], T_Result], manual_scan: typing.Callable[[], T_Result], automatic: typing.Callable[[], T_Result], + insulin_pump: typing.Callable[[], T_Result], scale: typing.Callable[[], T_Result], chest_strap: typing.Callable[[], T_Result], ring: typing.Callable[[], T_Result], @@ -75,6 +77,8 @@ def visit( return manual_scan() if self is ClientFacingElectrocardiogramSourceType.AUTOMATIC: return automatic() + if self is ClientFacingElectrocardiogramSourceType.INSULIN_PUMP: + return insulin_pump() if self is ClientFacingElectrocardiogramSourceType.SCALE: return scale() if self is ClientFacingElectrocardiogramSourceType.CHEST_STRAP: diff --git a/src/vital/types/client_facing_insulin_injection_sample.py b/src/vital/types/client_facing_insulin_injection_sample.py index 6fde544a..d9c3d611 100644 --- a/src/vital/types/client_facing_insulin_injection_sample.py +++ b/src/vital/types/client_facing_insulin_injection_sample.py @@ -5,6 +5,9 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .client_facing_insulin_injection_sample_bolus_purpose import ClientFacingInsulinInjectionSampleBolusPurpose +from .client_facing_insulin_injection_sample_delivery_form import ClientFacingInsulinInjectionSampleDeliveryForm +from .client_facing_insulin_injection_sample_delivery_mode import ClientFacingInsulinInjectionSampleDeliveryMode from .client_facing_insulin_injection_sample_type import ClientFacingInsulinInjectionSampleType @@ -21,7 +24,7 @@ class ClientFacingInsulinInjectionSample(UniversalBaseModel): type: ClientFacingInsulinInjectionSampleType = pydantic.Field() """ - The type of insulin injection. â„šī¸ This enum is non-exhaustive. + The insulin formulation type. â„šī¸ This enum is non-exhaustive. """ unit: typing.Literal["unit"] = "unit" @@ -45,6 +48,21 @@ class ClientFacingInsulinInjectionSample(UniversalBaseModel): The recorded value for the interval. """ + delivery_mode: typing.Optional[ClientFacingInsulinInjectionSampleDeliveryMode] = pydantic.Field(default=None) + """ + How the insulin was delivered. â„šī¸ This enum is non-exhaustive. + """ + + delivery_form: typing.Optional[ClientFacingInsulinInjectionSampleDeliveryForm] = pydantic.Field(default=None) + """ + For bolus deliveries, whether the dose was standard or extended. â„šī¸ This enum is non-exhaustive. + """ + + bolus_purpose: typing.Optional[ClientFacingInsulinInjectionSampleBolusPurpose] = pydantic.Field(default=None) + """ + For bolus deliveries, what the bolus was intended for. â„šī¸ This enum is non-exhaustive. + """ + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vital/types/client_facing_insulin_injection_sample_bolus_purpose.py b/src/vital/types/client_facing_insulin_injection_sample_bolus_purpose.py new file mode 100644 index 00000000..689b711b --- /dev/null +++ b/src/vital/types/client_facing_insulin_injection_sample_bolus_purpose.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class ClientFacingInsulinInjectionSampleBolusPurpose(enum.StrEnum): + MEAL = "meal" + CORRECTION = "correction" + MIXED = "mixed" + UNKNOWN = "unknown" + _UNKNOWN = "__CLIENTFACINGINSULININJECTIONSAMPLEBOLUSPURPOSE_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "ClientFacingInsulinInjectionSampleBolusPurpose": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + meal: typing.Callable[[], T_Result], + correction: typing.Callable[[], T_Result], + mixed: typing.Callable[[], T_Result], + unknown: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is ClientFacingInsulinInjectionSampleBolusPurpose.MEAL: + return meal() + if self is ClientFacingInsulinInjectionSampleBolusPurpose.CORRECTION: + return correction() + if self is ClientFacingInsulinInjectionSampleBolusPurpose.MIXED: + return mixed() + if self is ClientFacingInsulinInjectionSampleBolusPurpose.UNKNOWN: + return unknown() + return _unknown_member(self._value_) diff --git a/src/vital/types/client_facing_insulin_injection_sample_delivery_form.py b/src/vital/types/client_facing_insulin_injection_sample_delivery_form.py new file mode 100644 index 00000000..8de4b7c5 --- /dev/null +++ b/src/vital/types/client_facing_insulin_injection_sample_delivery_form.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class ClientFacingInsulinInjectionSampleDeliveryForm(enum.StrEnum): + STANDARD = "standard" + EXTENDED = "extended" + _UNKNOWN = "__CLIENTFACINGINSULININJECTIONSAMPLEDELIVERYFORM_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "ClientFacingInsulinInjectionSampleDeliveryForm": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + standard: typing.Callable[[], T_Result], + extended: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is ClientFacingInsulinInjectionSampleDeliveryForm.STANDARD: + return standard() + if self is ClientFacingInsulinInjectionSampleDeliveryForm.EXTENDED: + return extended() + return _unknown_member(self._value_) diff --git a/src/vital/types/client_facing_insulin_injection_sample_delivery_mode.py b/src/vital/types/client_facing_insulin_injection_sample_delivery_mode.py new file mode 100644 index 00000000..9160632a --- /dev/null +++ b/src/vital/types/client_facing_insulin_injection_sample_delivery_mode.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class ClientFacingInsulinInjectionSampleDeliveryMode(enum.StrEnum): + BASAL = "basal" + BOLUS = "bolus" + _UNKNOWN = "__CLIENTFACINGINSULININJECTIONSAMPLEDELIVERYMODE_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "ClientFacingInsulinInjectionSampleDeliveryMode": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + basal: typing.Callable[[], T_Result], + bolus: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is ClientFacingInsulinInjectionSampleDeliveryMode.BASAL: + return basal() + if self is ClientFacingInsulinInjectionSampleDeliveryMode.BOLUS: + return bolus() + return _unknown_member(self._value_) diff --git a/src/vital/types/client_facing_insulin_injection_sample_type.py b/src/vital/types/client_facing_insulin_injection_sample_type.py index 3a486c49..a7b46c06 100644 --- a/src/vital/types/client_facing_insulin_injection_sample_type.py +++ b/src/vital/types/client_facing_insulin_injection_sample_type.py @@ -9,7 +9,7 @@ class ClientFacingInsulinInjectionSampleType(enum.StrEnum): """ - The type of insulin injection. â„šī¸ This enum is non-exhaustive. + The insulin formulation type. â„šī¸ This enum is non-exhaustive. """ RAPID_ACTING = "rapid_acting" diff --git a/src/vital/types/client_facing_lab_account.py b/src/vital/types/client_facing_lab_account.py new file mode 100644 index 00000000..58bbc527 --- /dev/null +++ b/src/vital/types/client_facing_lab_account.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .lab_account_delegated_flow import LabAccountDelegatedFlow +from .lab_account_status import LabAccountStatus +from .labs import Labs +from .us_state import UsState + + +class ClientFacingLabAccount(UniversalBaseModel): + id: str + lab: Labs + org_id: typing.Optional[str] = None + status: LabAccountStatus + delegated_flow: LabAccountDelegatedFlow + provider_account_id: str + account_name: typing.Optional[str] = None + default_clinical_notes: typing.Optional[str] = None + business_units: typing.Optional[typing.List[str]] = None + allowed_billing: typing.Dict[str, typing.List[UsState]] + team_id_allowlist: typing.List[str] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/client_facing_lab_report_parsing_job_created_event.py b/src/vital/types/client_facing_lab_report_parsing_job_created_event.py new file mode 100644 index 00000000..9dd5be9d --- /dev/null +++ b/src/vital/types/client_facing_lab_report_parsing_job_created_event.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .parsing_job import ParsingJob + + +class ClientFacingLabReportParsingJobCreatedEvent(UniversalBaseModel): + event_type: typing.Literal["lab_report.parsing_job.created"] = "lab_report.parsing_job.created" + user_id: str + client_user_id: str + team_id: str + data: ParsingJob + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/client_facing_lab_report_parsing_job_updated_event.py b/src/vital/types/client_facing_lab_report_parsing_job_updated_event.py new file mode 100644 index 00000000..e176a4ec --- /dev/null +++ b/src/vital/types/client_facing_lab_report_parsing_job_updated_event.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .parsing_job import ParsingJob + + +class ClientFacingLabReportParsingJobUpdatedEvent(UniversalBaseModel): + event_type: typing.Literal["lab_report.parsing_job.updated"] = "lab_report.parsing_job.updated" + user_id: str + client_user_id: str + team_id: str + data: ParsingJob + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/client_facing_labs.py b/src/vital/types/client_facing_labs.py index c27d6dde..01424dc3 100644 --- a/src/vital/types/client_facing_labs.py +++ b/src/vital/types/client_facing_labs.py @@ -15,6 +15,7 @@ class ClientFacingLabs(enum.StrEnum): QUEST = "quest" LABCORP = "labcorp" BIOREFERENCE = "bioreference" + SONORA_QUEST = "sonora_quest" _UNKNOWN = "__CLIENTFACINGLABS_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -31,6 +32,7 @@ def visit( quest: typing.Callable[[], T_Result], labcorp: typing.Callable[[], T_Result], bioreference: typing.Callable[[], T_Result], + sonora_quest: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is ClientFacingLabs.QUEST: @@ -39,4 +41,6 @@ def visit( return labcorp() if self is ClientFacingLabs.BIOREFERENCE: return bioreference() + if self is ClientFacingLabs.SONORA_QUEST: + return sonora_quest() return _unknown_member(self._value_) diff --git a/src/vital/types/client_facing_menstrual_cycle_source_type.py b/src/vital/types/client_facing_menstrual_cycle_source_type.py index 373ce9a9..e18ad595 100644 --- a/src/vital/types/client_facing_menstrual_cycle_source_type.py +++ b/src/vital/types/client_facing_menstrual_cycle_source_type.py @@ -21,6 +21,7 @@ class ClientFacingMenstrualCycleSourceType(enum.StrEnum): CUFF = "cuff" MANUAL_SCAN = "manual_scan" AUTOMATIC = "automatic" + INSULIN_PUMP = "insulin_pump" SCALE = "scale" CHEST_STRAP = "chest_strap" RING = "ring" @@ -49,6 +50,7 @@ def visit( cuff: typing.Callable[[], T_Result], manual_scan: typing.Callable[[], T_Result], automatic: typing.Callable[[], T_Result], + insulin_pump: typing.Callable[[], T_Result], scale: typing.Callable[[], T_Result], chest_strap: typing.Callable[[], T_Result], ring: typing.Callable[[], T_Result], @@ -75,6 +77,8 @@ def visit( return manual_scan() if self is ClientFacingMenstrualCycleSourceType.AUTOMATIC: return automatic() + if self is ClientFacingMenstrualCycleSourceType.INSULIN_PUMP: + return insulin_pump() if self is ClientFacingMenstrualCycleSourceType.SCALE: return scale() if self is ClientFacingMenstrualCycleSourceType.CHEST_STRAP: diff --git a/src/vital/types/client_facing_order.py b/src/vital/types/client_facing_order.py index 0b099e08..1156752b 100644 --- a/src/vital/types/client_facing_order.py +++ b/src/vital/types/client_facing_order.py @@ -9,9 +9,11 @@ from .client_facing_lab_test import ClientFacingLabTest from .client_facing_order_details import ClientFacingOrderDetails from .client_facing_order_event import ClientFacingOrderEvent +from .client_facing_order_transaction import ClientFacingOrderTransaction from .client_facing_patient_details_compatible import ClientFacingPatientDetailsCompatible from .client_facing_physician import ClientFacingPhysician from .interpretation import Interpretation +from .order_origin import OrderOrigin from .order_top_level_status import OrderTopLevelStatus from .patient_address_compatible import PatientAddressCompatible from .shipping_address import ShippingAddress @@ -59,6 +61,7 @@ class ClientFacingOrder(UniversalBaseModel): Notes associated with the order """ + clinical_notes: typing.Optional[str] = None created_at: dt.datetime = pydantic.Field() """ When your order was created @@ -70,7 +73,16 @@ class ClientFacingOrder(UniversalBaseModel): """ events: typing.List[ClientFacingOrderEvent] - status: typing.Optional[OrderTopLevelStatus] = None + status: typing.Optional[OrderTopLevelStatus] = pydantic.Field(default=None) + """ + The top-level status of the latest event for this order. This field is deprecated. Please use `last_event` instead. + """ + + last_event: ClientFacingOrderEvent = pydantic.Field() + """ + The latest event in the order's lifecycle. + """ + physician: typing.Optional[ClientFacingPhysician] = None health_insurance_id: typing.Optional[str] = pydantic.Field(default=None) """ @@ -125,6 +137,9 @@ class ClientFacingOrder(UniversalBaseModel): The latest date by which the order result is expected to be available. """ + origin: typing.Optional[OrderOrigin] = None + order_transaction: typing.Optional[ClientFacingOrderTransaction] = None + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vital/types/client_facing_order_event.py b/src/vital/types/client_facing_order_event.py index 3ce2e310..21bd85ff 100644 --- a/src/vital/types/client_facing_order_event.py +++ b/src/vital/types/client_facing_order_event.py @@ -6,12 +6,14 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .order_status import OrderStatus +from .order_status_detail import OrderStatusDetail class ClientFacingOrderEvent(UniversalBaseModel): id: int created_at: dt.datetime status: OrderStatus + status_detail: typing.Optional[OrderStatusDetail] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/client_facing_order_in_transaction.py b/src/vital/types/client_facing_order_in_transaction.py new file mode 100644 index 00000000..7e3692aa --- /dev/null +++ b/src/vital/types/client_facing_order_in_transaction.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .order_low_level_status import OrderLowLevelStatus +from .order_origin import OrderOrigin + + +class ClientFacingOrderInTransaction(UniversalBaseModel): + """ + Minimal order info for embedding in order_transaction payload. + """ + + id: str + low_level_status: typing.Optional[OrderLowLevelStatus] = None + low_level_status_created_at: typing.Optional[dt.datetime] = None + origin: typing.Optional[OrderOrigin] = None + parent_id: typing.Optional[str] = None + created_at: dt.datetime + updated_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/client_facing_order_transaction.py b/src/vital/types/client_facing_order_transaction.py new file mode 100644 index 00000000..9d014ddc --- /dev/null +++ b/src/vital/types/client_facing_order_transaction.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .client_facing_order_in_transaction import ClientFacingOrderInTransaction +from .order_transaction_status import OrderTransactionStatus + + +class ClientFacingOrderTransaction(UniversalBaseModel): + """ + Order transaction info. + """ + + id: str + status: OrderTransactionStatus + orders: typing.List[ClientFacingOrderInTransaction] + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/client_facing_profile.py b/src/vital/types/client_facing_profile.py index 1122b2cc..e807108a 100644 --- a/src/vital/types/client_facing_profile.py +++ b/src/vital/types/client_facing_profile.py @@ -19,7 +19,7 @@ class ClientFacingProfile(UniversalBaseModel): height: typing.Optional[int] = None birth_date: typing.Optional[str] = None - wheelchair_use: typing.Optional[bool] = None + wheelchair_use: typing.Optional[typing.Literal[True]] = None gender: typing.Optional[Gender] = None sex: typing.Optional[Sex] = None source: ClientFacingSource diff --git a/src/vital/types/client_facing_sleep.py b/src/vital/types/client_facing_sleep.py index ea806c54..f5201496 100644 --- a/src/vital/types/client_facing_sleep.py +++ b/src/vital/types/client_facing_sleep.py @@ -87,6 +87,11 @@ class ClientFacingSleep(UniversalBaseModel): A value between 1 and 100 representing how well the user slept. Currently only available for Withings, Oura, Whoop and Garmin::scalar """ + recovery_readiness_score: typing.Optional[int] = pydantic.Field(default=None) + """ + A value between 0 and 100 representing the provider's recovery/readiness proxy. Currently sourced from Oura readiness score, Whoop recovery score, and Ultrahuman recovery::scalar + """ + hr_lowest: typing.Optional[int] = pydantic.Field(default=None) """ The lowest heart rate (5 minutes sliding average) registered during the sleep period::beats per minute diff --git a/src/vital/types/client_facing_sleep_cycle_source_type.py b/src/vital/types/client_facing_sleep_cycle_source_type.py index 90e266f9..5f5a3060 100644 --- a/src/vital/types/client_facing_sleep_cycle_source_type.py +++ b/src/vital/types/client_facing_sleep_cycle_source_type.py @@ -21,6 +21,7 @@ class ClientFacingSleepCycleSourceType(enum.StrEnum): CUFF = "cuff" MANUAL_SCAN = "manual_scan" AUTOMATIC = "automatic" + INSULIN_PUMP = "insulin_pump" SCALE = "scale" CHEST_STRAP = "chest_strap" RING = "ring" @@ -49,6 +50,7 @@ def visit( cuff: typing.Callable[[], T_Result], manual_scan: typing.Callable[[], T_Result], automatic: typing.Callable[[], T_Result], + insulin_pump: typing.Callable[[], T_Result], scale: typing.Callable[[], T_Result], chest_strap: typing.Callable[[], T_Result], ring: typing.Callable[[], T_Result], @@ -75,6 +77,8 @@ def visit( return manual_scan() if self is ClientFacingSleepCycleSourceType.AUTOMATIC: return automatic() + if self is ClientFacingSleepCycleSourceType.INSULIN_PUMP: + return insulin_pump() if self is ClientFacingSleepCycleSourceType.SCALE: return scale() if self is ClientFacingSleepCycleSourceType.CHEST_STRAP: diff --git a/src/vital/types/client_facing_workout.py b/src/vital/types/client_facing_workout.py index 64981c39..7e44fb93 100644 --- a/src/vital/types/client_facing_workout.py +++ b/src/vital/types/client_facing_workout.py @@ -4,7 +4,9 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata from .client_facing_source import ClientFacingSource from .client_facing_sport import ClientFacingSport from .client_facing_workout_map import ClientFacingWorkoutMap @@ -127,11 +129,11 @@ class ClientFacingWorkout(UniversalBaseModel): Number of steps accumulated during this workout::count """ - map_: typing.Optional[ClientFacingWorkoutMap] = pydantic.Field(alias="map", default=None) - """ - Map of the workout - """ - + map_: typing_extensions.Annotated[ + typing.Optional[ClientFacingWorkoutMap], + FieldMetadata(alias="map"), + pydantic.Field(alias="map", description="Map of the workout"), + ] = None provider_id: str = pydantic.Field() """ Provider ID given for that specific workout diff --git a/src/vital/types/compendium_search_labs.py b/src/vital/types/compendium_search_labs.py new file mode 100644 index 00000000..f3605cfd --- /dev/null +++ b/src/vital/types/compendium_search_labs.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class CompendiumSearchLabs(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + LABCORP = "labcorp" + QUEST = "quest" + BIOREFERENCE = "bioreference" + SONORA_QUEST = "sonora_quest" + _UNKNOWN = "__COMPENDIUMSEARCHLABS_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "CompendiumSearchLabs": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + labcorp: typing.Callable[[], T_Result], + quest: typing.Callable[[], T_Result], + bioreference: typing.Callable[[], T_Result], + sonora_quest: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is CompendiumSearchLabs.LABCORP: + return labcorp() + if self is CompendiumSearchLabs.QUEST: + return quest() + if self is CompendiumSearchLabs.BIOREFERENCE: + return bioreference() + if self is CompendiumSearchLabs.SONORA_QUEST: + return sonora_quest() + return _unknown_member(self._value_) diff --git a/src/vital/types/consent.py b/src/vital/types/consent.py index bbc03973..9168a56f 100644 --- a/src/vital/types/consent.py +++ b/src/vital/types/consent.py @@ -4,14 +4,20 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata from .consent_type import ConsentType class Consent(UniversalBaseModel): - consent_type: ConsentType = pydantic.Field(alias="consentType") + consent_type: typing_extensions.Annotated[ + ConsentType, FieldMetadata(alias="consentType"), pydantic.Field(alias="consentType") + ] version: typing.Optional[str] = None - time_of_consent: typing.Optional[dt.datetime] = pydantic.Field(alias="timeOfConsent", default=None) + time_of_consent: typing_extensions.Annotated[ + typing.Optional[dt.datetime], FieldMetadata(alias="timeOfConsent"), pydantic.Field(alias="timeOfConsent") + ] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/convert_compendium_response.py b/src/vital/types/convert_compendium_response.py new file mode 100644 index 00000000..56aba79c --- /dev/null +++ b/src/vital/types/convert_compendium_response.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .provider_id_conversion_response import ProviderIdConversionResponse + + +class ConvertCompendiumResponse(UniversalBaseModel): + source_lab_test_id: typing.Optional[str] = None + source_lab_id: typing.Optional[int] = None + target_lab_id: int + target_lab_slug: str + source_provider_ids: typing.Optional[typing.List[str]] = None + converted_provider_ids: typing.Optional[typing.List[str]] = None + unresolved_provider_ids: typing.Optional[typing.List[str]] = None + by_source_provider_id: typing.Optional[typing.Dict[str, ProviderIdConversionResponse]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/derived_readiness_column_expr.py b/src/vital/types/derived_readiness_column_expr.py new file mode 100644 index 00000000..c11c11e5 --- /dev/null +++ b/src/vital/types/derived_readiness_column_expr.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .derived_readiness_column_expr_derived_readiness import DerivedReadinessColumnExprDerivedReadiness + + +class DerivedReadinessColumnExpr(UniversalBaseModel): + derived_readiness: DerivedReadinessColumnExprDerivedReadiness = pydantic.Field() + """ + â„šī¸ This enum is non-exhaustive. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/derived_readiness_column_expr_derived_readiness.py b/src/vital/types/derived_readiness_column_expr_derived_readiness.py new file mode 100644 index 00000000..44988504 --- /dev/null +++ b/src/vital/types/derived_readiness_column_expr_derived_readiness.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class DerivedReadinessColumnExprDerivedReadiness(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + DATE = "date" + CHRONOTYPE = "chronotype" + SLEEP_SCORE = "sleep_score" + RECOVERY_SCORE = "recovery_score" + RECOVERY_ZONE = "recovery_zone" + STRESS_SCORE = "stress_score" + STRAIN_SCORE = "strain_score" + STRAIN_ZONE = "strain_zone" + _UNKNOWN = "__DERIVEDREADINESSCOLUMNEXPRDERIVEDREADINESS_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "DerivedReadinessColumnExprDerivedReadiness": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + date: typing.Callable[[], T_Result], + chronotype: typing.Callable[[], T_Result], + sleep_score: typing.Callable[[], T_Result], + recovery_score: typing.Callable[[], T_Result], + recovery_zone: typing.Callable[[], T_Result], + stress_score: typing.Callable[[], T_Result], + strain_score: typing.Callable[[], T_Result], + strain_zone: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is DerivedReadinessColumnExprDerivedReadiness.DATE: + return date() + if self is DerivedReadinessColumnExprDerivedReadiness.CHRONOTYPE: + return chronotype() + if self is DerivedReadinessColumnExprDerivedReadiness.SLEEP_SCORE: + return sleep_score() + if self is DerivedReadinessColumnExprDerivedReadiness.RECOVERY_SCORE: + return recovery_score() + if self is DerivedReadinessColumnExprDerivedReadiness.RECOVERY_ZONE: + return recovery_zone() + if self is DerivedReadinessColumnExprDerivedReadiness.STRESS_SCORE: + return stress_score() + if self is DerivedReadinessColumnExprDerivedReadiness.STRAIN_SCORE: + return strain_score() + if self is DerivedReadinessColumnExprDerivedReadiness.STRAIN_ZONE: + return strain_zone() + return _unknown_member(self._value_) diff --git a/src/vital/types/fats.py b/src/vital/types/fats.py index 8851f004..9c388bd8 100644 --- a/src/vital/types/fats.py +++ b/src/vital/types/fats.py @@ -3,7 +3,9 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata class Fats(UniversalBaseModel): @@ -22,16 +24,16 @@ class Fats(UniversalBaseModel): Amount of polyunsaturated fats in grams (g) """ - omega_3: typing.Optional[float] = pydantic.Field(alias="omega3", default=None) - """ - Amount of Omega-3 fatty acids in grams (g) - """ - - omega_6: typing.Optional[float] = pydantic.Field(alias="omega6", default=None) - """ - Amount of Omega-6 fatty acids in grams (g) - """ - + omega_3: typing_extensions.Annotated[ + typing.Optional[float], + FieldMetadata(alias="omega3"), + pydantic.Field(alias="omega3", description="Amount of Omega-3 fatty acids in grams (g)"), + ] = None + omega_6: typing_extensions.Annotated[ + typing.Optional[float], + FieldMetadata(alias="omega6"), + pydantic.Field(alias="omega6", description="Amount of Omega-6 fatty acids in grams (g)"), + ] = None total: typing.Optional[float] = pydantic.Field(default=None) """ Total amount of fats in grams (g) diff --git a/src/vital/types/get_order_transaction_response.py b/src/vital/types/get_order_transaction_response.py new file mode 100644 index 00000000..1c8ea77e --- /dev/null +++ b/src/vital/types/get_order_transaction_response.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .order_summary import OrderSummary +from .order_transaction_status import OrderTransactionStatus + + +class GetOrderTransactionResponse(UniversalBaseModel): + id: str + team_id: str + status: OrderTransactionStatus + orders: typing.Optional[typing.List[OrderSummary]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/get_team_lab_accounts_response.py b/src/vital/types/get_team_lab_accounts_response.py new file mode 100644 index 00000000..d821884f --- /dev/null +++ b/src/vital/types/get_team_lab_accounts_response.py @@ -0,0 +1,20 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .client_facing_lab_account import ClientFacingLabAccount + + +class GetTeamLabAccountsResponse(UniversalBaseModel): + data: typing.Optional[typing.List[ClientFacingLabAccount]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/historical_pull_completed.py b/src/vital/types/historical_pull_completed.py index ab747348..f2578cc5 100644 --- a/src/vital/types/historical_pull_completed.py +++ b/src/vital/types/historical_pull_completed.py @@ -11,7 +11,7 @@ class HistoricalPullCompleted(UniversalBaseModel): user_id: str start_date: dt.datetime end_date: dt.datetime - is_final: bool + is_final: typing.Literal[True] = True provider: str if IS_PYDANTIC_V2: diff --git a/src/vital/types/index_column_expr_index.py b/src/vital/types/index_column_expr_index.py index c2d38904..388fe7d2 100644 --- a/src/vital/types/index_column_expr_index.py +++ b/src/vital/types/index_column_expr_index.py @@ -13,6 +13,7 @@ class IndexColumnExprIndex(enum.StrEnum): """ SLEEP = "sleep" + DERIVED_READINESS = "derived_readiness" ACTIVITY = "activity" WORKOUT = "workout" BODY = "body" @@ -33,6 +34,7 @@ def _missing_(cls, value: typing.Any) -> "IndexColumnExprIndex": def visit( self, sleep: typing.Callable[[], T_Result], + derived_readiness: typing.Callable[[], T_Result], activity: typing.Callable[[], T_Result], workout: typing.Callable[[], T_Result], body: typing.Callable[[], T_Result], @@ -43,6 +45,8 @@ def visit( ) -> T_Result: if self is IndexColumnExprIndex.SLEEP: return sleep() + if self is IndexColumnExprIndex.DERIVED_READINESS: + return derived_readiness() if self is IndexColumnExprIndex.ACTIVITY: return activity() if self is IndexColumnExprIndex.WORKOUT: diff --git a/src/vital/types/insulin_injection_timeseries_expr.py b/src/vital/types/insulin_injection_timeseries_expr.py new file mode 100644 index 00000000..2b4f156f --- /dev/null +++ b/src/vital/types/insulin_injection_timeseries_expr.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .insulin_injection_timeseries_expr_field import InsulinInjectionTimeseriesExprField + + +class InsulinInjectionTimeseriesExpr(UniversalBaseModel): + timeseries: typing.Literal["insulin_injection"] = "insulin_injection" + field: InsulinInjectionTimeseriesExprField = pydantic.Field() + """ + â„šī¸ This enum is non-exhaustive. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/insulin_injection_timeseries_expr_field.py b/src/vital/types/insulin_injection_timeseries_expr_field.py new file mode 100644 index 00000000..1506c17d --- /dev/null +++ b/src/vital/types/insulin_injection_timeseries_expr_field.py @@ -0,0 +1,78 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class InsulinInjectionTimeseriesExprField(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + SOURCE_PROVIDER = "source_provider" + SOURCE_TYPE = "source_type" + SOURCE_APP_ID = "source_app_id" + SOURCE_WORKOUT_ID = "source_workout_id" + SOURCE_SPORT = "source_sport" + TIMEZONE_OFFSET = "timezone_offset" + TYPE = "type" + DURATION = "duration" + VALUE = "value" + DELIVERY_MODE = "delivery_mode" + DELIVERY_FORM = "delivery_form" + BOLUS_PURPOSE = "bolus_purpose" + _UNKNOWN = "__INSULININJECTIONTIMESERIESEXPRFIELD_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "InsulinInjectionTimeseriesExprField": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + source_provider: typing.Callable[[], T_Result], + source_type: typing.Callable[[], T_Result], + source_app_id: typing.Callable[[], T_Result], + source_workout_id: typing.Callable[[], T_Result], + source_sport: typing.Callable[[], T_Result], + timezone_offset: typing.Callable[[], T_Result], + type: typing.Callable[[], T_Result], + duration: typing.Callable[[], T_Result], + value: typing.Callable[[], T_Result], + delivery_mode: typing.Callable[[], T_Result], + delivery_form: typing.Callable[[], T_Result], + bolus_purpose: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is InsulinInjectionTimeseriesExprField.SOURCE_PROVIDER: + return source_provider() + if self is InsulinInjectionTimeseriesExprField.SOURCE_TYPE: + return source_type() + if self is InsulinInjectionTimeseriesExprField.SOURCE_APP_ID: + return source_app_id() + if self is InsulinInjectionTimeseriesExprField.SOURCE_WORKOUT_ID: + return source_workout_id() + if self is InsulinInjectionTimeseriesExprField.SOURCE_SPORT: + return source_sport() + if self is InsulinInjectionTimeseriesExprField.TIMEZONE_OFFSET: + return timezone_offset() + if self is InsulinInjectionTimeseriesExprField.TYPE: + return type() + if self is InsulinInjectionTimeseriesExprField.DURATION: + return duration() + if self is InsulinInjectionTimeseriesExprField.VALUE: + return value() + if self is InsulinInjectionTimeseriesExprField.DELIVERY_MODE: + return delivery_mode() + if self is InsulinInjectionTimeseriesExprField.DELIVERY_FORM: + return delivery_form() + if self is InsulinInjectionTimeseriesExprField.BOLUS_PURPOSE: + return bolus_purpose() + return _unknown_member(self._value_) diff --git a/src/vital/types/interval_timeseries_expr_timeseries.py b/src/vital/types/interval_timeseries_expr_timeseries.py index faf82855..f8b17d03 100644 --- a/src/vital/types/interval_timeseries_expr_timeseries.py +++ b/src/vital/types/interval_timeseries_expr_timeseries.py @@ -18,7 +18,6 @@ class IntervalTimeseriesExprTimeseries(enum.StrEnum): HEART_RATE_ALERT = "heart_rate_alert" STAND_HOUR = "stand_hour" SLEEP_BREATHING_DISTURBANCE = "sleep_breathing_disturbance" - INSULIN_INJECTION = "insulin_injection" WATER = "water" CAFFEINE = "caffeine" MINDFULNESS_MINUTES = "mindfulness_minutes" @@ -64,7 +63,6 @@ def visit( heart_rate_alert: typing.Callable[[], T_Result], stand_hour: typing.Callable[[], T_Result], sleep_breathing_disturbance: typing.Callable[[], T_Result], - insulin_injection: typing.Callable[[], T_Result], water: typing.Callable[[], T_Result], caffeine: typing.Callable[[], T_Result], mindfulness_minutes: typing.Callable[[], T_Result], @@ -105,8 +103,6 @@ def visit( return stand_hour() if self is IntervalTimeseriesExprTimeseries.SLEEP_BREATHING_DISTURBANCE: return sleep_breathing_disturbance() - if self is IntervalTimeseriesExprTimeseries.INSULIN_INJECTION: - return insulin_injection() if self is IntervalTimeseriesExprTimeseries.WATER: return water() if self is IntervalTimeseriesExprTimeseries.CAFFEINE: diff --git a/src/vital/types/jpeg.py b/src/vital/types/jpeg.py index fbdb1856..38614611 100644 --- a/src/vital/types/jpeg.py +++ b/src/vital/types/jpeg.py @@ -7,7 +7,7 @@ class Jpeg(UniversalBaseModel): - content: str + content: bytes content_type: typing.Literal["image/jpeg"] = "image/jpeg" if IS_PYDANTIC_V2: diff --git a/src/vital/types/lab_account_delegated_flow.py b/src/vital/types/lab_account_delegated_flow.py new file mode 100644 index 00000000..b052a8ca --- /dev/null +++ b/src/vital/types/lab_account_delegated_flow.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class LabAccountDelegatedFlow(enum.StrEnum): + """ + Describes which parts of the lab testing flow are delegated to the customer. + + - ORDER_DELEGATED: Ordering using client's physicians, critical result follow up via Junction + - RESULT_DELEGATED: Ordering using Junction's Physician Network, critical results handled by client + - FULLY_DELEGATED: Order and critical results handled by client + - NOT_DELEGATED: Junction handles both ordering and results â„šī¸ This enum is non-exhaustive. + """ + + ORDER_DELEGATED = "order_delegated" + RESULT_DELEGATED = "result_delegated" + FULLY_DELEGATED = "fully_delegated" + NOT_DELEGATED = "not_delegated" + _UNKNOWN = "__LABACCOUNTDELEGATEDFLOW_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "LabAccountDelegatedFlow": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + order_delegated: typing.Callable[[], T_Result], + result_delegated: typing.Callable[[], T_Result], + fully_delegated: typing.Callable[[], T_Result], + not_delegated: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is LabAccountDelegatedFlow.ORDER_DELEGATED: + return order_delegated() + if self is LabAccountDelegatedFlow.RESULT_DELEGATED: + return result_delegated() + if self is LabAccountDelegatedFlow.FULLY_DELEGATED: + return fully_delegated() + if self is LabAccountDelegatedFlow.NOT_DELEGATED: + return not_delegated() + return _unknown_member(self._value_) diff --git a/src/vital/types/lab_account_status.py b/src/vital/types/lab_account_status.py new file mode 100644 index 00000000..0dedbfec --- /dev/null +++ b/src/vital/types/lab_account_status.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class LabAccountStatus(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + ACTIVE = "active" + PENDING = "pending" + SUSPENDED = "suspended" + _UNKNOWN = "__LABACCOUNTSTATUS_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "LabAccountStatus": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + active: typing.Callable[[], T_Result], + pending: typing.Callable[[], T_Result], + suspended: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is LabAccountStatus.ACTIVE: + return active() + if self is LabAccountStatus.PENDING: + return pending() + if self is LabAccountStatus.SUSPENDED: + return suspended() + return _unknown_member(self._value_) diff --git a/src/vital/types/lab_results_metadata.py b/src/vital/types/lab_results_metadata.py index 639aa61c..2621eebb 100644 --- a/src/vital/types/lab_results_metadata.py +++ b/src/vital/types/lab_results_metadata.py @@ -3,13 +3,17 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata class LabResultsMetadata(UniversalBaseModel): age: str dob: str - clia: typing.Optional[str] = pydantic.Field(alias="clia_#", default=None) + clia: typing_extensions.Annotated[ + typing.Optional[str], FieldMetadata(alias="clia_#"), pydantic.Field(alias="clia_#") + ] = None patient: str provider: typing.Optional[str] = None laboratory: typing.Optional[str] = None diff --git a/src/vital/types/lab_results_raw.py b/src/vital/types/lab_results_raw.py index 92ebde76..22db0f37 100644 --- a/src/vital/types/lab_results_raw.py +++ b/src/vital/types/lab_results_raw.py @@ -4,6 +4,7 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .client_facing_order_transaction import ClientFacingOrderTransaction from .lab_results_metadata import LabResultsMetadata from .lab_results_raw_results import LabResultsRawResults from .missing_biomarker_result import MissingBiomarkerResult @@ -15,6 +16,7 @@ class LabResultsRaw(UniversalBaseModel): results: LabResultsRawResults missing_results: typing.Optional[typing.List[MissingBiomarkerResult]] = None sample_information: typing.Optional[typing.Dict[str, typing.Optional[SampleData]]] = None + order_transaction: typing.Optional[ClientFacingOrderTransaction] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/labs.py b/src/vital/types/labs.py index 400705bb..9fb8bf3e 100644 --- a/src/vital/types/labs.py +++ b/src/vital/types/labs.py @@ -16,6 +16,7 @@ class Labs(enum.StrEnum): SPIRIPLEX = "spiriplex" USSL = "ussl" QUEST = "quest" + SONORA_QUEST = "sonora_quest" LABCORP = "labcorp" BIOREFERENCE = "bioreference" US_BIOTEK = "us_biotek" @@ -24,6 +25,7 @@ class Labs(enum.StrEnum): IHD = "ihd" NEXUS = "nexus" MY_UTI = "my_uti" + CRL = "crl" _UNKNOWN = "__LABS_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -41,6 +43,7 @@ def visit( spiriplex: typing.Callable[[], T_Result], ussl: typing.Callable[[], T_Result], quest: typing.Callable[[], T_Result], + sonora_quest: typing.Callable[[], T_Result], labcorp: typing.Callable[[], T_Result], bioreference: typing.Callable[[], T_Result], us_biotek: typing.Callable[[], T_Result], @@ -49,6 +52,7 @@ def visit( ihd: typing.Callable[[], T_Result], nexus: typing.Callable[[], T_Result], my_uti: typing.Callable[[], T_Result], + crl: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is Labs.AYUMETRIX: @@ -59,6 +63,8 @@ def visit( return ussl() if self is Labs.QUEST: return quest() + if self is Labs.SONORA_QUEST: + return sonora_quest() if self is Labs.LABCORP: return labcorp() if self is Labs.BIOREFERENCE: @@ -75,4 +81,6 @@ def visit( return nexus() if self is Labs.MY_UTI: return my_uti() + if self is Labs.CRL: + return crl() return _unknown_member(self._value_) diff --git a/src/vital/types/manual_providers.py b/src/vital/types/manual_providers.py index f330290d..a9ea0140 100644 --- a/src/vital/types/manual_providers.py +++ b/src/vital/types/manual_providers.py @@ -21,6 +21,7 @@ class ManualProviders(enum.StrEnum): APPLE_HEALTH_KIT = "apple_health_kit" MANUAL = "manual" HEALTH_CONNECT = "health_connect" + SAMSUNG_HEALTH = "samsung_health" _UNKNOWN = "__MANUALPROVIDERS_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -43,6 +44,7 @@ def visit( apple_health_kit: typing.Callable[[], T_Result], manual: typing.Callable[[], T_Result], health_connect: typing.Callable[[], T_Result], + samsung_health: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is ManualProviders.BEURER_BLE: @@ -63,4 +65,6 @@ def visit( return manual() if self is ManualProviders.HEALTH_CONNECT: return health_connect() + if self is ManualProviders.SAMSUNG_HEALTH: + return samsung_health() return _unknown_member(self._value_) diff --git a/src/vital/types/order_low_level_status.py b/src/vital/types/order_low_level_status.py index 02a74d71..64750b5e 100644 --- a/src/vital/types/order_low_level_status.py +++ b/src/vital/types/order_low_level_status.py @@ -37,6 +37,8 @@ class OrderLowLevelStatus(enum.StrEnum): AWAITING_REGISTRATION = "awaiting_registration" REGISTERED = "registered" REDRAW_AVAILABLE = "redraw_available" + CORRECTED = "corrected" + LAB_PROCESSING_BLOCKED = "lab_processing_blocked" _UNKNOWN = "__ORDERLOWLEVELSTATUS_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -75,6 +77,8 @@ def visit( awaiting_registration: typing.Callable[[], T_Result], registered: typing.Callable[[], T_Result], redraw_available: typing.Callable[[], T_Result], + corrected: typing.Callable[[], T_Result], + lab_processing_blocked: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is OrderLowLevelStatus.ORDERED: @@ -127,4 +131,8 @@ def visit( return registered() if self is OrderLowLevelStatus.REDRAW_AVAILABLE: return redraw_available() + if self is OrderLowLevelStatus.CORRECTED: + return corrected() + if self is OrderLowLevelStatus.LAB_PROCESSING_BLOCKED: + return lab_processing_blocked() return _unknown_member(self._value_) diff --git a/src/vital/types/order_origin.py b/src/vital/types/order_origin.py new file mode 100644 index 00000000..d6448b11 --- /dev/null +++ b/src/vital/types/order_origin.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class OrderOrigin(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + INITIAL = "initial" + REDRAW = "redraw" + RECREATION = "recreation" + _UNKNOWN = "__ORDERORIGIN_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "OrderOrigin": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + initial: typing.Callable[[], T_Result], + redraw: typing.Callable[[], T_Result], + recreation: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is OrderOrigin.INITIAL: + return initial() + if self is OrderOrigin.REDRAW: + return redraw() + if self is OrderOrigin.RECREATION: + return recreation() + return _unknown_member(self._value_) diff --git a/src/vital/types/order_status.py b/src/vital/types/order_status.py index 5f0a7c12..05b7e7fd 100644 --- a/src/vital/types/order_status.py +++ b/src/vital/types/order_status.py @@ -9,7 +9,8 @@ class OrderStatus(enum.StrEnum): """ - â„šī¸ This enum is non-exhaustive. + Used in combination with OrderStatusDetail to represent the current order state. + OrderStatus is driven by a FSM whereas OrderStatusDetail is descriptive only. â„šī¸ This enum is non-exhaustive. """ RECEIVED_WALK_IN_TEST_ORDERED = "received.walk_in_test.ordered" @@ -50,6 +51,7 @@ class OrderStatus(enum.StrEnum): COLLECTING_SAMPLE_TESTKIT_WITH_CUSTOMER = "collecting_sample.testkit.with_customer" COLLECTING_SAMPLE_TESTKIT_TRANSIT_LAB = "collecting_sample.testkit.transit_lab" SAMPLE_WITH_LAB_TESTKIT_DELIVERED_TO_LAB = "sample_with_lab.testkit.delivered_to_lab" + SAMPLE_WITH_LAB_TESTKIT_LAB_PROCESSING_BLOCKED = "sample_with_lab.testkit.lab_processing_blocked" COMPLETED_TESTKIT_COMPLETED = "completed.testkit.completed" FAILED_TESTKIT_FAILURE_TO_DELIVER_TO_CUSTOMER = "failed.testkit.failure_to_deliver_to_customer" FAILED_TESTKIT_FAILURE_TO_DELIVER_TO_LAB = "failed.testkit.failure_to_deliver_to_lab" @@ -67,6 +69,10 @@ class OrderStatus(enum.StrEnum): CANCELLED_ON_SITE_COLLECTION_CANCELLED = "cancelled.on_site_collection.cancelled" SAMPLE_WITH_LAB_ON_SITE_COLLECTION_PARTIAL_RESULTS = "sample_with_lab.on_site_collection.partial_results" FAILED_ON_SITE_COLLECTION_SAMPLE_ERROR = "failed.on_site_collection.sample_error" + COMPLETED_WALK_IN_TEST_CORRECTED = "completed.walk_in_test.corrected" + COMPLETED_AT_HOME_PHLEBOTOMY_CORRECTED = "completed.at_home_phlebotomy.corrected" + COMPLETED_ON_SITE_COLLECTION_CORRECTED = "completed.on_site_collection.corrected" + COMPLETED_TESTKIT_CORRECTED = "completed.testkit.corrected" _UNKNOWN = "__ORDERSTATUS_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -112,6 +118,7 @@ def visit( collecting_sample_testkit_with_customer: typing.Callable[[], T_Result], collecting_sample_testkit_transit_lab: typing.Callable[[], T_Result], sample_with_lab_testkit_delivered_to_lab: typing.Callable[[], T_Result], + sample_with_lab_testkit_lab_processing_blocked: typing.Callable[[], T_Result], completed_testkit_completed: typing.Callable[[], T_Result], failed_testkit_failure_to_deliver_to_customer: typing.Callable[[], T_Result], failed_testkit_failure_to_deliver_to_lab: typing.Callable[[], T_Result], @@ -129,6 +136,10 @@ def visit( cancelled_on_site_collection_cancelled: typing.Callable[[], T_Result], sample_with_lab_on_site_collection_partial_results: typing.Callable[[], T_Result], failed_on_site_collection_sample_error: typing.Callable[[], T_Result], + completed_walk_in_test_corrected: typing.Callable[[], T_Result], + completed_at_home_phlebotomy_corrected: typing.Callable[[], T_Result], + completed_on_site_collection_corrected: typing.Callable[[], T_Result], + completed_testkit_corrected: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is OrderStatus.RECEIVED_WALK_IN_TEST_ORDERED: @@ -195,6 +206,8 @@ def visit( return collecting_sample_testkit_transit_lab() if self is OrderStatus.SAMPLE_WITH_LAB_TESTKIT_DELIVERED_TO_LAB: return sample_with_lab_testkit_delivered_to_lab() + if self is OrderStatus.SAMPLE_WITH_LAB_TESTKIT_LAB_PROCESSING_BLOCKED: + return sample_with_lab_testkit_lab_processing_blocked() if self is OrderStatus.COMPLETED_TESTKIT_COMPLETED: return completed_testkit_completed() if self is OrderStatus.FAILED_TESTKIT_FAILURE_TO_DELIVER_TO_CUSTOMER: @@ -229,4 +242,12 @@ def visit( return sample_with_lab_on_site_collection_partial_results() if self is OrderStatus.FAILED_ON_SITE_COLLECTION_SAMPLE_ERROR: return failed_on_site_collection_sample_error() + if self is OrderStatus.COMPLETED_WALK_IN_TEST_CORRECTED: + return completed_walk_in_test_corrected() + if self is OrderStatus.COMPLETED_AT_HOME_PHLEBOTOMY_CORRECTED: + return completed_at_home_phlebotomy_corrected() + if self is OrderStatus.COMPLETED_ON_SITE_COLLECTION_CORRECTED: + return completed_on_site_collection_corrected() + if self is OrderStatus.COMPLETED_TESTKIT_CORRECTED: + return completed_testkit_corrected() return _unknown_member(self._value_) diff --git a/src/vital/types/order_status_detail.py b/src/vital/types/order_status_detail.py new file mode 100644 index 00000000..05ca72ff --- /dev/null +++ b/src/vital/types/order_status_detail.py @@ -0,0 +1,66 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class OrderStatusDetail(enum.StrEnum): + """ + A descriptive-only additional field to be used in combination with OrderStatus. Exposed in the API. â„šī¸ This enum is non-exhaustive. + """ + + FULFILLMENT_ERROR = "fulfillment_error" + DATE_OF_COLLECTION_UNSPECIFIED = "date_of_collection_unspecified" + DEMOGRAPHIC_INFORMATION_UNSPECIFIED = "demographic_information_unspecified" + DEMOGRAPHIC_INFORMATION_MISMATCH = "demographic_information_mismatch" + SAMPLE_QUANTITY_NOT_SUFFICIENT = "sample_quantity_not_sufficient" + SAMPLE_CONTAMINATED = "sample_contaminated" + SAMPLE_STABILITY_EXCEEDED = "sample_stability_exceeded" + SAMPLE_HEMOLYZED = "sample_hemolyzed" + SAMPLE_IMPROPER_COLLECTION = "sample_improper_collection" + _UNKNOWN = "__ORDERSTATUSDETAIL_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "OrderStatusDetail": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + fulfillment_error: typing.Callable[[], T_Result], + date_of_collection_unspecified: typing.Callable[[], T_Result], + demographic_information_unspecified: typing.Callable[[], T_Result], + demographic_information_mismatch: typing.Callable[[], T_Result], + sample_quantity_not_sufficient: typing.Callable[[], T_Result], + sample_contaminated: typing.Callable[[], T_Result], + sample_stability_exceeded: typing.Callable[[], T_Result], + sample_hemolyzed: typing.Callable[[], T_Result], + sample_improper_collection: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is OrderStatusDetail.FULFILLMENT_ERROR: + return fulfillment_error() + if self is OrderStatusDetail.DATE_OF_COLLECTION_UNSPECIFIED: + return date_of_collection_unspecified() + if self is OrderStatusDetail.DEMOGRAPHIC_INFORMATION_UNSPECIFIED: + return demographic_information_unspecified() + if self is OrderStatusDetail.DEMOGRAPHIC_INFORMATION_MISMATCH: + return demographic_information_mismatch() + if self is OrderStatusDetail.SAMPLE_QUANTITY_NOT_SUFFICIENT: + return sample_quantity_not_sufficient() + if self is OrderStatusDetail.SAMPLE_CONTAMINATED: + return sample_contaminated() + if self is OrderStatusDetail.SAMPLE_STABILITY_EXCEEDED: + return sample_stability_exceeded() + if self is OrderStatusDetail.SAMPLE_HEMOLYZED: + return sample_hemolyzed() + if self is OrderStatusDetail.SAMPLE_IMPROPER_COLLECTION: + return sample_improper_collection() + return _unknown_member(self._value_) diff --git a/src/vital/types/order_summary.py b/src/vital/types/order_summary.py new file mode 100644 index 00000000..48f7afd0 --- /dev/null +++ b/src/vital/types/order_summary.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .order_low_level_status import OrderLowLevelStatus +from .order_origin import OrderOrigin + + +class OrderSummary(UniversalBaseModel): + """ + Lightweight order summary. + """ + + id: str + origin: typing.Optional[OrderOrigin] = None + parent_id: typing.Optional[str] = None + last_status: OrderLowLevelStatus + last_status_created_at: dt.datetime + updated_at: dt.datetime + created_at: dt.datetime + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/order_transaction_status.py b/src/vital/types/order_transaction_status.py new file mode 100644 index 00000000..1c7c85aa --- /dev/null +++ b/src/vital/types/order_transaction_status.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class OrderTransactionStatus(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + _UNKNOWN = "__ORDERTRANSACTIONSTATUS_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "OrderTransactionStatus": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + active: typing.Callable[[], T_Result], + completed: typing.Callable[[], T_Result], + cancelled: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is OrderTransactionStatus.ACTIVE: + return active() + if self is OrderTransactionStatus.COMPLETED: + return completed() + if self is OrderTransactionStatus.CANCELLED: + return cancelled() + return _unknown_member(self._value_) diff --git a/src/vital/types/parsing_job.py b/src/vital/types/parsing_job.py index 6cc3e96b..2d1c4176 100644 --- a/src/vital/types/parsing_job.py +++ b/src/vital/types/parsing_job.py @@ -5,13 +5,14 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel from .parsed_lab_report_data import ParsedLabReportData +from .parsing_job_failure_reason import ParsingJobFailureReason from .parsing_job_status import ParsingJobStatus class ParsingJob(UniversalBaseModel): id: str - job_id: str status: ParsingJobStatus + failure_reason: typing.Optional[ParsingJobFailureReason] = None data: typing.Optional[ParsedLabReportData] = None needs_human_review: bool is_reviewed: bool diff --git a/src/vital/types/parsing_job_failure_reason.py b/src/vital/types/parsing_job_failure_reason.py new file mode 100644 index 00000000..9c842e34 --- /dev/null +++ b/src/vital/types/parsing_job_failure_reason.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class ParsingJobFailureReason(enum.StrEnum): + """ + Machine-readable failure reasons for parsing jobs. â„šī¸ This enum is non-exhaustive. + """ + + INVALID_INPUT = "invalid_input" + LOW_QUALITY = "low_quality" + NOT_ENGLISH = "not_english" + _UNKNOWN = "__PARSINGJOBFAILUREREASON_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "ParsingJobFailureReason": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + invalid_input: typing.Callable[[], T_Result], + low_quality: typing.Callable[[], T_Result], + not_english: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is ParsingJobFailureReason.INVALID_INPUT: + return invalid_input() + if self is ParsingJobFailureReason.LOW_QUALITY: + return low_quality() + if self is ParsingJobFailureReason.NOT_ENGLISH: + return not_english() + return _unknown_member(self._value_) diff --git a/src/vital/types/password_providers.py b/src/vital/types/password_providers.py index fb3c531f..1781ac3a 100644 --- a/src/vital/types/password_providers.py +++ b/src/vital/types/password_providers.py @@ -23,6 +23,7 @@ class PasswordProviders(enum.StrEnum): MY_FITNESS_PAL = "my_fitness_pal" KARDIA = "kardia" ABBOTT_LIBREVIEW = "abbott_libreview" + TANDEM_SOURCE = "tandem_source" _UNKNOWN = "__PASSWORDPROVIDERS_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -47,6 +48,7 @@ def visit( my_fitness_pal: typing.Callable[[], T_Result], kardia: typing.Callable[[], T_Result], abbott_libreview: typing.Callable[[], T_Result], + tandem_source: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is PasswordProviders.WHOOP: @@ -71,4 +73,6 @@ def visit( return kardia() if self is PasswordProviders.ABBOTT_LIBREVIEW: return abbott_libreview() + if self is PasswordProviders.TANDEM_SOURCE: + return tandem_source() return _unknown_member(self._value_) diff --git a/src/vital/types/patient_address.py b/src/vital/types/patient_address.py index 3d9c99c4..37187ed9 100644 --- a/src/vital/types/patient_address.py +++ b/src/vital/types/patient_address.py @@ -14,6 +14,7 @@ class PatientAddress(UniversalBaseModel): state: str zip: str country: str + access_notes: typing.Optional[str] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/patient_address_compatible.py b/src/vital/types/patient_address_compatible.py index fc86fbe3..d4a930f1 100644 --- a/src/vital/types/patient_address_compatible.py +++ b/src/vital/types/patient_address_compatible.py @@ -14,6 +14,7 @@ class PatientAddressCompatible(UniversalBaseModel): state: str zip: str country: str + access_notes: typing.Optional[str] = None phone_number: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/vital/types/patient_address_with_validation.py b/src/vital/types/patient_address_with_validation.py index 994c9a3e..5930a16c 100644 --- a/src/vital/types/patient_address_with_validation.py +++ b/src/vital/types/patient_address_with_validation.py @@ -14,6 +14,7 @@ class PatientAddressWithValidation(UniversalBaseModel): state: str zip: str country: str + access_notes: typing.Optional[str] = None phone_number: typing.Optional[str] = None if IS_PYDANTIC_V2: diff --git a/src/vital/types/payor_code_external_provider.py b/src/vital/types/payor_code_external_provider.py index bf516cc9..f854cbe3 100644 --- a/src/vital/types/payor_code_external_provider.py +++ b/src/vital/types/payor_code_external_provider.py @@ -17,6 +17,8 @@ class PayorCodeExternalProvider(enum.StrEnum): STEDI = "stedi" WAYSTAR = "waystar" CLAIM_MD = "claim_md" + APERO = "apero" + PVERIFY = "pverify" _UNKNOWN = "__PAYORCODEEXTERNALPROVIDER_UNKNOWN__" """ This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. @@ -35,6 +37,8 @@ def visit( stedi: typing.Callable[[], T_Result], waystar: typing.Callable[[], T_Result], claim_md: typing.Callable[[], T_Result], + apero: typing.Callable[[], T_Result], + pverify: typing.Callable[[], T_Result], _unknown_member: typing.Callable[[str], T_Result], ) -> T_Result: if self is PayorCodeExternalProvider.CHANGE_HEALTHCARE: @@ -47,4 +51,8 @@ def visit( return waystar() if self is PayorCodeExternalProvider.CLAIM_MD: return claim_md() + if self is PayorCodeExternalProvider.APERO: + return apero() + if self is PayorCodeExternalProvider.PVERIFY: + return pverify() return _unknown_member(self._value_) diff --git a/src/vital/types/per_lab_candidate.py b/src/vital/types/per_lab_candidate.py new file mode 100644 index 00000000..974e9946 --- /dev/null +++ b/src/vital/types/per_lab_candidate.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class PerLabCandidate(UniversalBaseModel): + marker_id: int + lab_id: int + lab_slug: typing.Optional[str] = None + name: str + result_names: typing.Optional[typing.List[str]] = None + provider_id: typing.Optional[str] = None + loinc_set_hash: str + loinc_codes: typing.Optional[typing.List[str]] = None + loinc_components: typing.Optional[typing.List[str]] = None + loinc_groups: typing.Optional[typing.List[str]] = None + cpt_codes: typing.Optional[typing.List[str]] = None + relation: str + confidence: float + reason_codes: typing.Optional[typing.List[str]] = None + marker_popularity_score: float + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/placeholder.py b/src/vital/types/placeholder.py index 60009056..f1fcd0b3 100644 --- a/src/vital/types/placeholder.py +++ b/src/vital/types/placeholder.py @@ -7,7 +7,7 @@ class Placeholder(UniversalBaseModel): - placeholder: bool + placeholder: typing.Literal[True] = True if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/png.py b/src/vital/types/png.py index fdb606e3..760e7a3b 100644 --- a/src/vital/types/png.py +++ b/src/vital/types/png.py @@ -7,7 +7,7 @@ class Png(UniversalBaseModel): - content: str + content: bytes content_type: typing.Literal["image/png"] = "image/png" if IS_PYDANTIC_V2: diff --git a/src/vital/types/provider_id_conversion_response.py b/src/vital/types/provider_id_conversion_response.py new file mode 100644 index 00000000..81da6d57 --- /dev/null +++ b/src/vital/types/provider_id_conversion_response.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .per_lab_candidate import PerLabCandidate + + +class ProviderIdConversionResponse(UniversalBaseModel): + source_provider_id: str + candidates: typing.Optional[typing.List[PerLabCandidate]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/providers.py b/src/vital/types/providers.py index 4c379597..044f3950 100644 --- a/src/vital/types/providers.py +++ b/src/vital/types/providers.py @@ -23,6 +23,7 @@ class Providers(enum.StrEnum): ZWIFT = "zwift" FREESTYLE_LIBRE = "freestyle_libre" ABBOTT_LIBREVIEW = "abbott_libreview" + TANDEM_SOURCE = "tandem_source" FREESTYLE_LIBRE_BLE = "freestyle_libre_ble" EIGHT_SLEEP = "eight_sleep" WITHINGS = "withings" @@ -42,6 +43,7 @@ class Providers(enum.StrEnum): HAMMERHEAD = "hammerhead" MY_FITNESS_PAL = "my_fitness_pal" HEALTH_CONNECT = "health_connect" + SAMSUNG_HEALTH = "samsung_health" POLAR = "polar" CRONOMETER = "cronometer" KARDIA = "kardia" @@ -74,6 +76,7 @@ def visit( zwift: typing.Callable[[], T_Result], freestyle_libre: typing.Callable[[], T_Result], abbott_libreview: typing.Callable[[], T_Result], + tandem_source: typing.Callable[[], T_Result], freestyle_libre_ble: typing.Callable[[], T_Result], eight_sleep: typing.Callable[[], T_Result], withings: typing.Callable[[], T_Result], @@ -93,6 +96,7 @@ def visit( hammerhead: typing.Callable[[], T_Result], my_fitness_pal: typing.Callable[[], T_Result], health_connect: typing.Callable[[], T_Result], + samsung_health: typing.Callable[[], T_Result], polar: typing.Callable[[], T_Result], cronometer: typing.Callable[[], T_Result], kardia: typing.Callable[[], T_Result], @@ -125,6 +129,8 @@ def visit( return freestyle_libre() if self is Providers.ABBOTT_LIBREVIEW: return abbott_libreview() + if self is Providers.TANDEM_SOURCE: + return tandem_source() if self is Providers.FREESTYLE_LIBRE_BLE: return freestyle_libre_ble() if self is Providers.EIGHT_SLEEP: @@ -163,6 +169,8 @@ def visit( return my_fitness_pal() if self is Providers.HEALTH_CONNECT: return health_connect() + if self is Providers.SAMSUNG_HEALTH: + return samsung_health() if self is Providers.POLAR: return polar() if self is Providers.CRONOMETER: diff --git a/src/vital/types/query_group_by_item.py b/src/vital/types/query_group_by_item.py index 969b719c..6a316ff1 100644 --- a/src/vital/types/query_group_by_item.py +++ b/src/vital/types/query_group_by_item.py @@ -5,12 +5,15 @@ from .activity_column_expr import ActivityColumnExpr from .asleep_at_value_macro_expr import AsleepAtValueMacroExpr from .awake_at_value_macro_expr import AwakeAtValueMacroExpr +from .awakenings_value_macro_expr import AwakeningsValueMacroExpr from .blood_pressure_timeseries_expr import BloodPressureTimeseriesExpr from .body_column_expr import BodyColumnExpr from .chronotype_value_macro_expr import ChronotypeValueMacroExpr from .date_part_expr import DatePartExpr from .date_trunc_expr import DateTruncExpr +from .derived_readiness_column_expr import DerivedReadinessColumnExpr from .discrete_timeseries_expr import DiscreteTimeseriesExpr +from .insulin_injection_timeseries_expr import InsulinInjectionTimeseriesExpr from .interval_timeseries_expr import IntervalTimeseriesExpr from .meal_column_expr import MealColumnExpr from .note_timeseries_expr import NoteTimeseriesExpr @@ -27,6 +30,7 @@ DateTruncExpr, DatePartExpr, SleepColumnExpr, + DerivedReadinessColumnExpr, ActivityColumnExpr, WorkoutColumnExpr, BodyColumnExpr, @@ -36,9 +40,11 @@ ChronotypeValueMacroExpr, AsleepAtValueMacroExpr, AwakeAtValueMacroExpr, + AwakeningsValueMacroExpr, UnrecognizedValueMacroExpr, DiscreteTimeseriesExpr, IntervalTimeseriesExpr, + InsulinInjectionTimeseriesExpr, BloodPressureTimeseriesExpr, TemperatureTimeseriesExpr, WorkoutDurationTimeseriesExpr, diff --git a/src/vital/types/query_select_item.py b/src/vital/types/query_select_item.py index aebc82e1..72d02f8e 100644 --- a/src/vital/types/query_select_item.py +++ b/src/vital/types/query_select_item.py @@ -6,12 +6,15 @@ from .aggregate_expr import AggregateExpr from .asleep_at_value_macro_expr import AsleepAtValueMacroExpr from .awake_at_value_macro_expr import AwakeAtValueMacroExpr +from .awakenings_value_macro_expr import AwakeningsValueMacroExpr from .blood_pressure_timeseries_expr import BloodPressureTimeseriesExpr from .body_column_expr import BodyColumnExpr from .chronotype_value_macro_expr import ChronotypeValueMacroExpr +from .derived_readiness_column_expr import DerivedReadinessColumnExpr from .discrete_timeseries_expr import DiscreteTimeseriesExpr from .group_key_column_expr import GroupKeyColumnExpr from .index_column_expr import IndexColumnExpr +from .insulin_injection_timeseries_expr import InsulinInjectionTimeseriesExpr from .interval_timeseries_expr import IntervalTimeseriesExpr from .meal_column_expr import MealColumnExpr from .note_timeseries_expr import NoteTimeseriesExpr @@ -28,6 +31,7 @@ AggregateExpr, GroupKeyColumnExpr, SleepColumnExpr, + DerivedReadinessColumnExpr, ActivityColumnExpr, WorkoutColumnExpr, BodyColumnExpr, @@ -37,9 +41,11 @@ ChronotypeValueMacroExpr, AsleepAtValueMacroExpr, AwakeAtValueMacroExpr, + AwakeningsValueMacroExpr, UnrecognizedValueMacroExpr, DiscreteTimeseriesExpr, IntervalTimeseriesExpr, + InsulinInjectionTimeseriesExpr, BloodPressureTimeseriesExpr, TemperatureTimeseriesExpr, WorkoutDurationTimeseriesExpr, diff --git a/src/vital/types/related_candidate.py b/src/vital/types/related_candidate.py new file mode 100644 index 00000000..ff800b28 --- /dev/null +++ b/src/vital/types/related_candidate.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .canonical_candidate import CanonicalCandidate + + +class RelatedCandidate(UniversalBaseModel): + canonical: CanonicalCandidate + relation: str + confidence: float + reason_codes: typing.Optional[typing.List[str]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/result_metadata.py b/src/vital/types/result_metadata.py index 77331752..f0c4d61b 100644 --- a/src/vital/types/result_metadata.py +++ b/src/vital/types/result_metadata.py @@ -4,13 +4,19 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .result_metadata_gender import ResultMetadataGender class ResultMetadata(UniversalBaseModel): - patient_first_name: str - patient_last_name: str - dob: str - lab_name: str + patient_first_name: typing.Optional[str] = None + patient_last_name: typing.Optional[str] = None + dob: typing.Optional[str] = None + gender: typing.Optional[ResultMetadataGender] = pydantic.Field(default=None) + """ + â„šī¸ This enum is non-exhaustive. + """ + + lab_name: typing.Optional[str] = None date_reported: typing.Optional[str] = None date_collected: typing.Optional[str] = None specimen_number: typing.Optional[str] = None diff --git a/src/vital/types/result_metadata_gender.py b/src/vital/types/result_metadata_gender.py new file mode 100644 index 00000000..7f3a1b0c --- /dev/null +++ b/src/vital/types/result_metadata_gender.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class ResultMetadataGender(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + MALE = "male" + FEMALE = "female" + OTHER = "other" + _UNKNOWN = "__RESULTMETADATAGENDER_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "ResultMetadataGender": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + male: typing.Callable[[], T_Result], + female: typing.Callable[[], T_Result], + other: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is ResultMetadataGender.MALE: + return male() + if self is ResultMetadataGender.FEMALE: + return female() + if self is ResultMetadataGender.OTHER: + return other() + return _unknown_member(self._value_) diff --git a/src/vital/types/search_compendium_response.py b/src/vital/types/search_compendium_response.py new file mode 100644 index 00000000..162a5105 --- /dev/null +++ b/src/vital/types/search_compendium_response.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from .canonical_candidate import CanonicalCandidate +from .per_lab_candidate import PerLabCandidate +from .related_candidate import RelatedCandidate +from .search_mode import SearchMode + + +class SearchCompendiumResponse(UniversalBaseModel): + mode: SearchMode + selected_canonical: typing.Optional[CanonicalCandidate] = None + canonical_candidates: typing.Optional[typing.List[CanonicalCandidate]] = None + per_lab: typing.Optional[typing.Dict[str, typing.List[PerLabCandidate]]] = None + related: typing.Optional[typing.List[RelatedCandidate]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/search_mode.py b/src/vital/types/search_mode.py new file mode 100644 index 00000000..fe242556 --- /dev/null +++ b/src/vital/types/search_mode.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class SearchMode(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + CANONICAL = "canonical" + CROSSWALK = "crosswalk" + _UNKNOWN = "__SEARCHMODE_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "SearchMode": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + canonical: typing.Callable[[], T_Result], + crosswalk: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is SearchMode.CANONICAL: + return canonical() + if self is SearchMode.CROSSWALK: + return crosswalk() + return _unknown_member(self._value_) diff --git a/src/vital/types/sleep_column_expr_sleep.py b/src/vital/types/sleep_column_expr_sleep.py index 70313843..108997d1 100644 --- a/src/vital/types/sleep_column_expr_sleep.py +++ b/src/vital/types/sleep_column_expr_sleep.py @@ -37,6 +37,7 @@ class SleepColumnExprSleep(enum.StrEnum): SKIN_TEMPERATURE_DELTA = "skin_temperature_delta" RESPIRATORY_RATE = "respiratory_rate" SCORE = "score" + RECOVERY_READINESS_SCORE = "recovery_readiness_score" SOURCE_TYPE = "source_type" SOURCE_PROVIDER = "source_provider" SOURCE_APP_ID = "source_app_id" @@ -80,6 +81,7 @@ def visit( skin_temperature_delta: typing.Callable[[], T_Result], respiratory_rate: typing.Callable[[], T_Result], score: typing.Callable[[], T_Result], + recovery_readiness_score: typing.Callable[[], T_Result], source_type: typing.Callable[[], T_Result], source_provider: typing.Callable[[], T_Result], source_app_id: typing.Callable[[], T_Result], @@ -137,6 +139,8 @@ def visit( return respiratory_rate() if self is SleepColumnExprSleep.SCORE: return score() + if self is SleepColumnExprSleep.RECOVERY_READINESS_SCORE: + return recovery_readiness_score() if self is SleepColumnExprSleep.SOURCE_TYPE: return source_type() if self is SleepColumnExprSleep.SOURCE_PROVIDER: diff --git a/src/vital/types/timeseries_metric_point.py b/src/vital/types/timeseries_metric_point.py index 2d31b586..3a1d791d 100644 --- a/src/vital/types/timeseries_metric_point.py +++ b/src/vital/types/timeseries_metric_point.py @@ -4,13 +4,15 @@ import typing import pydantic +import typing_extensions from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel +from ..core.serialization import FieldMetadata class TimeseriesMetricPoint(UniversalBaseModel): date: dt.datetime value: float - all_: float = pydantic.Field(alias="all") + all_: typing_extensions.Annotated[float, FieldMetadata(alias="all"), pydantic.Field(alias="all")] if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/vital/types/us_address.py b/src/vital/types/us_address.py index 3c5f33aa..8d0a3837 100644 --- a/src/vital/types/us_address.py +++ b/src/vital/types/us_address.py @@ -17,6 +17,8 @@ class UsAddress(UniversalBaseModel): Deprecated. Use `second_line` instead to provide the unit number. Subject to removal after 20 Nov 2023. """ + access_notes: typing.Optional[str] = None + if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 else: diff --git a/src/vital/types/us_state.py b/src/vital/types/us_state.py new file mode 100644 index 00000000..3f1d9cd9 --- /dev/null +++ b/src/vital/types/us_state.py @@ -0,0 +1,230 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ..core import enum + +T_Result = typing.TypeVar("T_Result") + + +class UsState(enum.StrEnum): + """ + â„šī¸ This enum is non-exhaustive. + """ + + AL = "AL" + AK = "AK" + AZ = "AZ" + AR = "AR" + CA = "CA" + CO = "CO" + CT = "CT" + DE = "DE" + FL = "FL" + GA = "GA" + HI = "HI" + ID = "ID" + IL = "IL" + IN = "IN" + IA = "IA" + KS = "KS" + KY = "KY" + LA = "LA" + ME = "ME" + MD = "MD" + MA = "MA" + MI = "MI" + MN = "MN" + MS = "MS" + MO = "MO" + MT = "MT" + NE = "NE" + NV = "NV" + NH = "NH" + NJ = "NJ" + NM = "NM" + NY = "NY" + NC = "NC" + ND = "ND" + OH = "OH" + OK = "OK" + OR = "OR" + PA = "PA" + RI = "RI" + SC = "SC" + SD = "SD" + TN = "TN" + TX = "TX" + UT = "UT" + VT = "VT" + VA = "VA" + WA = "WA" + WV = "WV" + WI = "WI" + WY = "WY" + _UNKNOWN = "__USSTATE_UNKNOWN__" + """ + This member is used for forward compatibility. If the value is not recognized by the enum, it will be stored here, and the raw value is accessible through `.value`. + """ + + @classmethod + def _missing_(cls, value: typing.Any) -> "UsState": + unknown = cls._UNKNOWN + unknown._value_ = value + return unknown + + def visit( + self, + al: typing.Callable[[], T_Result], + ak: typing.Callable[[], T_Result], + az: typing.Callable[[], T_Result], + ar: typing.Callable[[], T_Result], + ca: typing.Callable[[], T_Result], + co: typing.Callable[[], T_Result], + ct: typing.Callable[[], T_Result], + de: typing.Callable[[], T_Result], + fl: typing.Callable[[], T_Result], + ga: typing.Callable[[], T_Result], + hi: typing.Callable[[], T_Result], + id: typing.Callable[[], T_Result], + il: typing.Callable[[], T_Result], + in_: typing.Callable[[], T_Result], + ia: typing.Callable[[], T_Result], + ks: typing.Callable[[], T_Result], + ky: typing.Callable[[], T_Result], + la: typing.Callable[[], T_Result], + me: typing.Callable[[], T_Result], + md: typing.Callable[[], T_Result], + ma: typing.Callable[[], T_Result], + mi: typing.Callable[[], T_Result], + mn: typing.Callable[[], T_Result], + ms: typing.Callable[[], T_Result], + mo: typing.Callable[[], T_Result], + mt: typing.Callable[[], T_Result], + ne: typing.Callable[[], T_Result], + nv: typing.Callable[[], T_Result], + nh: typing.Callable[[], T_Result], + nj: typing.Callable[[], T_Result], + nm: typing.Callable[[], T_Result], + ny: typing.Callable[[], T_Result], + nc: typing.Callable[[], T_Result], + nd: typing.Callable[[], T_Result], + oh: typing.Callable[[], T_Result], + ok: typing.Callable[[], T_Result], + or_: typing.Callable[[], T_Result], + pa: typing.Callable[[], T_Result], + ri: typing.Callable[[], T_Result], + sc: typing.Callable[[], T_Result], + sd: typing.Callable[[], T_Result], + tn: typing.Callable[[], T_Result], + tx: typing.Callable[[], T_Result], + ut: typing.Callable[[], T_Result], + vt: typing.Callable[[], T_Result], + va: typing.Callable[[], T_Result], + wa: typing.Callable[[], T_Result], + wv: typing.Callable[[], T_Result], + wi: typing.Callable[[], T_Result], + wy: typing.Callable[[], T_Result], + _unknown_member: typing.Callable[[str], T_Result], + ) -> T_Result: + if self is UsState.AL: + return al() + if self is UsState.AK: + return ak() + if self is UsState.AZ: + return az() + if self is UsState.AR: + return ar() + if self is UsState.CA: + return ca() + if self is UsState.CO: + return co() + if self is UsState.CT: + return ct() + if self is UsState.DE: + return de() + if self is UsState.FL: + return fl() + if self is UsState.GA: + return ga() + if self is UsState.HI: + return hi() + if self is UsState.ID: + return id() + if self is UsState.IL: + return il() + if self is UsState.IN: + return in_() + if self is UsState.IA: + return ia() + if self is UsState.KS: + return ks() + if self is UsState.KY: + return ky() + if self is UsState.LA: + return la() + if self is UsState.ME: + return me() + if self is UsState.MD: + return md() + if self is UsState.MA: + return ma() + if self is UsState.MI: + return mi() + if self is UsState.MN: + return mn() + if self is UsState.MS: + return ms() + if self is UsState.MO: + return mo() + if self is UsState.MT: + return mt() + if self is UsState.NE: + return ne() + if self is UsState.NV: + return nv() + if self is UsState.NH: + return nh() + if self is UsState.NJ: + return nj() + if self is UsState.NM: + return nm() + if self is UsState.NY: + return ny() + if self is UsState.NC: + return nc() + if self is UsState.ND: + return nd() + if self is UsState.OH: + return oh() + if self is UsState.OK: + return ok() + if self is UsState.OR: + return or_() + if self is UsState.PA: + return pa() + if self is UsState.RI: + return ri() + if self is UsState.SC: + return sc() + if self is UsState.SD: + return sd() + if self is UsState.TN: + return tn() + if self is UsState.TX: + return tx() + if self is UsState.UT: + return ut() + if self is UsState.VT: + return vt() + if self is UsState.VA: + return va() + if self is UsState.WA: + return wa() + if self is UsState.WV: + return wv() + if self is UsState.WI: + return wi() + if self is UsState.WY: + return wy() + return _unknown_member(self._value_) diff --git a/src/vital/types/user_address.py b/src/vital/types/user_address.py new file mode 100644 index 00000000..6ca0f955 --- /dev/null +++ b/src/vital/types/user_address.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel + + +class UserAddress(UniversalBaseModel): + first_line: str + second_line: typing.Optional[str] = None + country: str + zip: str + city: str + state: str + access_notes: typing.Optional[str] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/vital/types/user_info.py b/src/vital/types/user_info.py index 6fd295f5..d1ea4005 100644 --- a/src/vital/types/user_info.py +++ b/src/vital/types/user_info.py @@ -4,12 +4,12 @@ import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel -from .address import Address from .ethnicity import Ethnicity from .gender_identity import GenderIdentity from .guarantor_details import GuarantorDetails from .race import Race from .sexual_orientation import SexualOrientation +from .user_address import UserAddress class UserInfo(UniversalBaseModel): @@ -19,7 +19,7 @@ class UserInfo(UniversalBaseModel): phone_number: str gender: str dob: str - address: Address + address: UserAddress medical_proxy: typing.Optional[GuarantorDetails] = None race: typing.Optional[Race] = None ethnicity: typing.Optional[Ethnicity] = None diff --git a/src/vital/types/user_refresh_error_response.py b/src/vital/types/user_refresh_error_response.py index c0781627..385e1e0b 100644 --- a/src/vital/types/user_refresh_error_response.py +++ b/src/vital/types/user_refresh_error_response.py @@ -7,7 +7,7 @@ class UserRefreshErrorResponse(UniversalBaseModel): - success: bool = pydantic.Field() + success: typing.Literal[False] = pydantic.Field(default=False) """ Whether operation was successful or not """ diff --git a/src/vital/types/user_refresh_success_response.py b/src/vital/types/user_refresh_success_response.py index 3dc955a2..0907fbb0 100644 --- a/src/vital/types/user_refresh_success_response.py +++ b/src/vital/types/user_refresh_success_response.py @@ -7,7 +7,7 @@ class UserRefreshSuccessResponse(UniversalBaseModel): - success: bool = pydantic.Field() + success: typing.Literal[True] = pydantic.Field(default=True) """ Whether operation was successful or not """ diff --git a/src/vital/user/client.py b/src/vital/user/client.py index d312f48b..ba76f29f 100644 --- a/src/vital/user/client.py +++ b/src/vital/user/client.py @@ -4,7 +4,6 @@ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.request_options import RequestOptions -from ..types.address import Address from ..types.client_facing_device import ClientFacingDevice from ..types.client_facing_insurance import ClientFacingInsurance from ..types.client_facing_provider_with_status import ClientFacingProviderWithStatus @@ -20,6 +19,7 @@ from ..types.race import Race from ..types.responsible_relationship import ResponsibleRelationship from ..types.sexual_orientation import SexualOrientation +from ..types.user_address import UserAddress from ..types.user_info import UserInfo from ..types.user_refresh_success_response import UserRefreshSuccessResponse from ..types.user_sign_in_token_response import UserSignInTokenResponse @@ -375,7 +375,7 @@ def upsert_user_info( phone_number: str, gender: str, dob: str, - address: Address, + address: UserAddress, medical_proxy: typing.Optional[GuarantorDetails] = OMIT, race: typing.Optional[Race] = OMIT, ethnicity: typing.Optional[Ethnicity] = OMIT, @@ -400,7 +400,7 @@ def upsert_user_info( dob : str - address : Address + address : UserAddress medical_proxy : typing.Optional[GuarantorDetails] @@ -422,7 +422,7 @@ def upsert_user_info( Examples -------- - from vital import Address, Vital + from vital import UserAddress, Vital client = Vital( api_key="YOUR_API_KEY", @@ -435,7 +435,7 @@ def upsert_user_info( phone_number="phone_number", gender="gender", dob="dob", - address=Address( + address=UserAddress( first_line="first_line", country="country", zip="zip", @@ -1270,7 +1270,7 @@ async def upsert_user_info( phone_number: str, gender: str, dob: str, - address: Address, + address: UserAddress, medical_proxy: typing.Optional[GuarantorDetails] = OMIT, race: typing.Optional[Race] = OMIT, ethnicity: typing.Optional[Ethnicity] = OMIT, @@ -1295,7 +1295,7 @@ async def upsert_user_info( dob : str - address : Address + address : UserAddress medical_proxy : typing.Optional[GuarantorDetails] @@ -1319,7 +1319,7 @@ async def upsert_user_info( -------- import asyncio - from vital import Address, AsyncVital + from vital import AsyncVital, UserAddress client = AsyncVital( api_key="YOUR_API_KEY", @@ -1335,7 +1335,7 @@ async def main() -> None: phone_number="phone_number", gender="gender", dob="dob", - address=Address( + address=UserAddress( first_line="first_line", country="country", zip="zip", diff --git a/src/vital/user/raw_client.py b/src/vital/user/raw_client.py index ee5312ca..0c390cfc 100644 --- a/src/vital/user/raw_client.py +++ b/src/vital/user/raw_client.py @@ -11,7 +11,6 @@ from ..core.request_options import RequestOptions from ..errors.bad_request_error import BadRequestError from ..errors.unprocessable_entity_error import UnprocessableEntityError -from ..types.address import Address from ..types.client_facing_device import ClientFacingDevice from ..types.client_facing_insurance import ClientFacingInsurance from ..types.client_facing_provider_with_status import ClientFacingProviderWithStatus @@ -28,6 +27,7 @@ from ..types.race import Race from ..types.responsible_relationship import ResponsibleRelationship from ..types.sexual_orientation import SexualOrientation +from ..types.user_address import UserAddress from ..types.user_info import UserInfo from ..types.user_refresh_success_response import UserRefreshSuccessResponse from ..types.user_sign_in_token_response import UserSignInTokenResponse @@ -480,7 +480,7 @@ def upsert_user_info( phone_number: str, gender: str, dob: str, - address: Address, + address: UserAddress, medical_proxy: typing.Optional[GuarantorDetails] = OMIT, race: typing.Optional[Race] = OMIT, ethnicity: typing.Optional[Ethnicity] = OMIT, @@ -505,7 +505,7 @@ def upsert_user_info( dob : str - address : Address + address : UserAddress medical_proxy : typing.Optional[GuarantorDetails] @@ -1627,7 +1627,7 @@ async def upsert_user_info( phone_number: str, gender: str, dob: str, - address: Address, + address: UserAddress, medical_proxy: typing.Optional[GuarantorDetails] = OMIT, race: typing.Optional[Race] = OMIT, ethnicity: typing.Optional[Ethnicity] = OMIT, @@ -1652,7 +1652,7 @@ async def upsert_user_info( dob : str - address : Address + address : UserAddress medical_proxy : typing.Optional[GuarantorDetails]