hubble-sdk-python 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/CHANGELOG.md +18 -0
  2. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/PKG-INFO +1 -1
  3. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/attach_client_authorization.py +32 -8
  4. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/consent.py +17 -9
  5. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/consent_source.py +18 -3
  6. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/consent_source_status.py +30 -0
  7. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/consent_source_type.py +28 -0
  8. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/consent_status.py +31 -0
  9. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/device_authorization_request.py +2 -2
  10. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/export_patient_fhir_prefer.py +27 -0
  11. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/export_patient_fhir_response_202.py +1 -1
  12. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/export_patient_fhir_response_202_status.py +28 -0
  13. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/export_patient_pdf_prefer.py +27 -0
  14. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/export_patient_pdf_response_202.py +1 -1
  15. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/export_patient_pdf_response_202_status.py +28 -0
  16. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/get_patient_pdf_export_download.py +27 -0
  17. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/get_patient_pdf_export_response_200.py +1 -1
  18. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/get_patient_pdf_export_response_200_status.py +27 -0
  19. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/o_auth_error.py +1 -1
  20. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/o_auth_error_error.py +35 -0
  21. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/provider_seed.py +11 -0
  22. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/token_request.py +1 -1
  23. hubble_sdk_python-0.2.1/hubble_sdk/_generated/models/token_request_grant_type.py +30 -0
  24. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_hubble.py +13 -8
  25. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_webhooks.py +8 -1
  26. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/pyproject.toml +1 -1
  27. hubble_sdk_python-0.2.1/templates/property_templates/enum_property.py.jinja +33 -0
  28. hubble_sdk_python-0.2.1/templates/str_enum.py.jinja +28 -0
  29. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/tests/test_hubble.py +65 -3
  30. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/tests/test_webhooks.py +17 -0
  31. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/consent_source_status.py +0 -11
  32. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/consent_source_type.py +0 -9
  33. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/consent_status.py +0 -12
  34. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/export_patient_fhir_prefer.py +0 -8
  35. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/export_patient_fhir_response_202_status.py +0 -9
  36. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/export_patient_pdf_prefer.py +0 -8
  37. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/export_patient_pdf_response_202_status.py +0 -9
  38. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/get_patient_pdf_export_download.py +0 -8
  39. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/get_patient_pdf_export_response_200_status.py +0 -8
  40. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/o_auth_error_error.py +0 -16
  41. hubble_sdk_python-0.2.0/hubble_sdk/_generated/models/token_request_grant_type.py +0 -11
  42. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/.gitignore +0 -0
  43. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/LICENSE +0 -0
  44. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/README.md +0 -0
  45. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/config.yaml +0 -0
  46. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/__init__.py +0 -0
  47. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/__init__.py +0 -0
  48. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/__init__.py +0 -0
  49. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/__init__.py +0 -0
  50. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/create_consent_link.py +0 -0
  51. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/exchange_token.py +0 -0
  52. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/export_patient_fhir.py +0 -0
  53. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/export_patient_pdf.py +0 -0
  54. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/get_consent.py +0 -0
  55. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/get_patient_pdf_export.py +0 -0
  56. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/list_consents.py +0 -0
  57. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/read_fhir.py +0 -0
  58. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/api/default/revoke_consent.py +0 -0
  59. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/client.py +0 -0
  60. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/errors.py +0 -0
  61. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/__init__.py +0 -0
  62. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/api_error.py +0 -0
  63. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/attach_client_authorization_body.py +0 -0
  64. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/consent_error.py +0 -0
  65. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/consent_link_request.py +0 -0
  66. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/consent_list.py +0 -0
  67. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/device_authorization_response.py +0 -0
  68. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/fhir_resource.py +0 -0
  69. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/operation_outcome.py +0 -0
  70. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/operation_outcome_issue_item.py +0 -0
  71. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/patient_address.py +0 -0
  72. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/patient_demographics.py +0 -0
  73. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/models/token_response.py +0 -0
  74. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/hubble_sdk/_generated/types.py +0 -0
  75. {hubble_sdk_python-0.2.0 → hubble_sdk_python-0.2.1}/pydoc-markdown.yml +0 -0
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.1](https://github.com/hubble-dot-ai/hubble-sdks/compare/hubble-sdk-python-v0.2.0...hubble-sdk-python-v0.2.1) (2026-10-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * echo provider_ref on sources from a seeded provider ([#57](https://github.com/hubble-dot-ai/hubble-sdks/issues/57)) ([dbfc576](https://github.com/hubble-dot-ai/hubble-sdks/commit/dbfc5763b2514aecbc520bd0406eeefedae1f6ac))
9
+ * mark Consent.error deprecated and optional ([#58](https://github.com/hubble-dot-ai/hubble-sdks/issues/58)) ([dacf748](https://github.com/hubble-dot-ai/hubble-sdks/commit/dacf7488d5d4b073b9781914d20bdd6897075c50))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * accept enum values this SDK version does not know ([#56](https://github.com/hubble-dot-ai/hubble-sdks/issues/56)) ([45d69ad](https://github.com/hubble-dot-ai/hubble-sdks/commit/45d69ad44d67de470f122803e842a914b9342915))
15
+
16
+
17
+ ### Documentation
18
+
19
+ * state the BYO attestation and who checks the authorization ([#54](https://github.com/hubble-dot-ai/hubble-sdks/issues/54)) ([7ddecdd](https://github.com/hubble-dot-ai/hubble-sdks/commit/7ddecddf1d1ffc61e92825aa202d5105c7647092))
20
+
3
21
  ## [0.2.0](https://github.com/hubble-dot-ai/hubble-sdks/compare/hubble-sdk-python-v0.1.0...hubble-sdk-python-v0.2.0) (2026-09-30)
4
22
 
5
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hubble-sdk-python
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Python client for the Hubble Patient Access API.
5
5
  Project-URL: Homepage, https://github.com/hubble-dot-ai/hubble-sdks
6
6
  Project-URL: Repository, https://github.com/hubble-dot-ai/hubble-sdks
@@ -98,8 +98,14 @@ def sync_detailed(
98
98
  """Attach a customer-supplied HIPAA authorization
99
99
 
100
100
  Upload an already-signed HIPAA authorization for a consent and grant delegated retrieval from the
101
- providers it names. The artifact IS the evidence, so the consent is granted at once with no patient
102
- step. Requires the `byo_hipaa_authorization` entitlement on your organization.
101
+ providers it names. Hubble keeps a copy of the signed authorization on file and, based on your
102
+ attestation, makes the consent `active` right away with no patient step. If your organization also
103
+ uses EHR sign-in, health plans, or the health information network, the consent stays `pending` until
104
+ the patient finishes the link. Requires the `byo_hipaa_authorization` entitlement on your
105
+ organization. Attaching an authorization is your organization's attestation that it holds a valid
106
+ HIPAA authorization signed by the patient, and that it covers the providers you name. Hubble does
107
+ not review the document or ask the patient to confirm it, so your organization is responsible for
108
+ checking that the authorization is correct before you attach it.
103
109
 
104
110
  Args:
105
111
  id (str):
@@ -134,8 +140,14 @@ def sync(
134
140
  """Attach a customer-supplied HIPAA authorization
135
141
 
136
142
  Upload an already-signed HIPAA authorization for a consent and grant delegated retrieval from the
137
- providers it names. The artifact IS the evidence, so the consent is granted at once with no patient
138
- step. Requires the `byo_hipaa_authorization` entitlement on your organization.
143
+ providers it names. Hubble keeps a copy of the signed authorization on file and, based on your
144
+ attestation, makes the consent `active` right away with no patient step. If your organization also
145
+ uses EHR sign-in, health plans, or the health information network, the consent stays `pending` until
146
+ the patient finishes the link. Requires the `byo_hipaa_authorization` entitlement on your
147
+ organization. Attaching an authorization is your organization's attestation that it holds a valid
148
+ HIPAA authorization signed by the patient, and that it covers the providers you name. Hubble does
149
+ not review the document or ask the patient to confirm it, so your organization is responsible for
150
+ checking that the authorization is correct before you attach it.
139
151
 
140
152
  Args:
141
153
  id (str):
@@ -165,8 +177,14 @@ async def asyncio_detailed(
165
177
  """Attach a customer-supplied HIPAA authorization
166
178
 
167
179
  Upload an already-signed HIPAA authorization for a consent and grant delegated retrieval from the
168
- providers it names. The artifact IS the evidence, so the consent is granted at once with no patient
169
- step. Requires the `byo_hipaa_authorization` entitlement on your organization.
180
+ providers it names. Hubble keeps a copy of the signed authorization on file and, based on your
181
+ attestation, makes the consent `active` right away with no patient step. If your organization also
182
+ uses EHR sign-in, health plans, or the health information network, the consent stays `pending` until
183
+ the patient finishes the link. Requires the `byo_hipaa_authorization` entitlement on your
184
+ organization. Attaching an authorization is your organization's attestation that it holds a valid
185
+ HIPAA authorization signed by the patient, and that it covers the providers you name. Hubble does
186
+ not review the document or ask the patient to confirm it, so your organization is responsible for
187
+ checking that the authorization is correct before you attach it.
170
188
 
171
189
  Args:
172
190
  id (str):
@@ -199,8 +217,14 @@ async def asyncio(
199
217
  """Attach a customer-supplied HIPAA authorization
200
218
 
201
219
  Upload an already-signed HIPAA authorization for a consent and grant delegated retrieval from the
202
- providers it names. The artifact IS the evidence, so the consent is granted at once with no patient
203
- step. Requires the `byo_hipaa_authorization` entitlement on your organization.
220
+ providers it names. Hubble keeps a copy of the signed authorization on file and, based on your
221
+ attestation, makes the consent `active` right away with no patient step. If your organization also
222
+ uses EHR sign-in, health plans, or the health information network, the consent stays `pending` until
223
+ the patient finishes the link. Requires the `byo_hipaa_authorization` entitlement on your
224
+ organization. Attaching an authorization is your organization's attestation that it holds a valid
225
+ HIPAA authorization signed by the patient, and that it covers the providers you name. Hubble does
226
+ not review the document or ask the patient to confirm it, so your organization is responsible for
227
+ checking that the authorization is correct before you attach it.
204
228
 
205
229
  Args:
206
230
  id (str):
@@ -7,6 +7,7 @@ from typing import TYPE_CHECKING, Any, Self, TypeVar, cast
7
7
  from attrs import define as _attrs_define
8
8
 
9
9
  from ..models.consent_status import ConsentStatus
10
+ from ..types import UNSET, Unset
10
11
 
11
12
  if TYPE_CHECKING:
12
13
  from ..models.consent_error import ConsentError
@@ -27,7 +28,9 @@ class Consent:
27
28
  expires_at (datetime.datetime): When the patient link expires.
28
29
  sources (list[ConsentSource]): Each source on the consent and its progress (live vs one-time,
29
30
  available/pending/failed).
30
- error (ConsentError | None): Populated only when status is error.
31
+ error (ConsentError | None | Unset): Deprecated and scheduled for removal. Branch on `status` instead: `error`
32
+ means the consent finished with no source attached. `code` is always `authorization_failed`, and `message` is
33
+ internal diagnostic text, so neither is safe to depend on.
31
34
  """
32
35
 
33
36
  id: str
@@ -36,7 +39,7 @@ class Consent:
36
39
  created_at: datetime.datetime
37
40
  expires_at: datetime.datetime
38
41
  sources: list[ConsentSource]
39
- error: ConsentError | None
42
+ error: ConsentError | None | Unset = UNSET
40
43
 
41
44
  def to_dict(self) -> dict[str, Any]:
42
45
  from ..models.consent_error import ConsentError
@@ -57,8 +60,10 @@ class Consent:
57
60
  sources_item = sources_item_data.to_dict()
58
61
  sources.append(sources_item)
59
62
 
60
- error: dict[str, Any] | None
61
- if isinstance(self.error, ConsentError):
63
+ error: dict[str, Any] | None | Unset
64
+ if isinstance(self.error, Unset):
65
+ error = UNSET
66
+ elif isinstance(self.error, ConsentError):
62
67
  error = self.error.to_dict()
63
68
  else:
64
69
  error = self.error
@@ -73,9 +78,10 @@ class Consent:
73
78
  "created_at": created_at,
74
79
  "expires_at": expires_at,
75
80
  "sources": sources,
76
- "error": error,
77
81
  }
78
82
  )
83
+ if error is not UNSET:
84
+ field_dict["error"] = error
79
85
 
80
86
  return field_dict
81
87
 
@@ -87,7 +93,7 @@ class Consent:
87
93
  d = dict(src_dict)
88
94
  id = d.pop("id")
89
95
 
90
- status = ConsentStatus(d.pop("status"))
96
+ status = ConsentStatus._from_value(d.pop("status"))
91
97
 
92
98
  def _parse_patient_ref(data: object) -> None | str:
93
99
  if data is None:
@@ -107,9 +113,11 @@ class Consent:
107
113
 
108
114
  sources.append(sources_item)
109
115
 
110
- def _parse_error(data: object) -> ConsentError | None:
116
+ def _parse_error(data: object) -> ConsentError | None | Unset:
111
117
  if data is None:
112
118
  return data
119
+ if isinstance(data, Unset):
120
+ return data
113
121
  try:
114
122
  if not isinstance(data, dict):
115
123
  raise TypeError()
@@ -118,9 +126,9 @@ class Consent:
118
126
  return error_type_0
119
127
  except (TypeError, ValueError, AttributeError, KeyError):
120
128
  pass
121
- return cast(ConsentError | None, data)
129
+ return cast(ConsentError | None | Unset, data)
122
130
 
123
- error = _parse_error(d.pop("error"))
131
+ error = _parse_error(d.pop("error", UNSET))
124
132
 
125
133
  consent = cls(
126
134
  id=id,
@@ -1,7 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from collections.abc import Mapping
4
- from typing import Any, Self, TypeVar
4
+ from typing import Any, Self, TypeVar, cast
5
5
 
6
6
  from attrs import define as _attrs_define
7
7
 
@@ -18,6 +18,8 @@ class ConsentSource:
18
18
  id (str): The source's id. Pass it as `connection=<id>` to read or export this one source instead of all of
19
19
  them. Present on every source, including ones still pending.
20
20
  provider (str): The source as the customer knows it (facility / provider name).
21
+ provider_ref (None | str): The `provider_ref` you gave the seeded provider this source came from. Null for a
22
+ source the patient added themselves.
21
23
  type_ (ConsentSourceType): live = an ongoing connection re-readable until its access lapses (EHR, HIE); one_time
22
24
  = a single pull with no ongoing connection (delegated retrieval).
23
25
  status (ConsentSourceStatus): available = records readable now; pending = still being reached out to; failed =
@@ -27,6 +29,7 @@ class ConsentSource:
27
29
 
28
30
  id: str
29
31
  provider: str
32
+ provider_ref: None | str
30
33
  type_: ConsentSourceType
31
34
  status: ConsentSourceStatus
32
35
 
@@ -35,6 +38,9 @@ class ConsentSource:
35
38
 
36
39
  provider = self.provider
37
40
 
41
+ provider_ref: None | str
42
+ provider_ref = self.provider_ref
43
+
38
44
  type_ = self.type_.value
39
45
 
40
46
  status = self.status.value
@@ -45,6 +51,7 @@ class ConsentSource:
45
51
  {
46
52
  "id": id,
47
53
  "provider": provider,
54
+ "provider_ref": provider_ref,
48
55
  "type": type_,
49
56
  "status": status,
50
57
  }
@@ -59,13 +66,21 @@ class ConsentSource:
59
66
 
60
67
  provider = d.pop("provider")
61
68
 
62
- type_ = ConsentSourceType(d.pop("type"))
69
+ def _parse_provider_ref(data: object) -> None | str:
70
+ if data is None:
71
+ return data
72
+ return cast(None | str, data)
73
+
74
+ provider_ref = _parse_provider_ref(d.pop("provider_ref"))
75
+
76
+ type_ = ConsentSourceType._from_value(d.pop("type"))
63
77
 
64
- status = ConsentSourceStatus(d.pop("status"))
78
+ status = ConsentSourceStatus._from_value(d.pop("status"))
65
79
 
66
80
  consent_source = cls(
67
81
  id=id,
68
82
  provider=provider,
83
+ provider_ref=provider_ref,
69
84
  type_=type_,
70
85
  status=status,
71
86
  )
@@ -0,0 +1,30 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ConsentSourceStatus(StrEnum):
5
+ AVAILABLE = "available"
6
+ FAILED = "failed"
7
+ PENDING = "pending"
8
+ REVOKED = "revoked"
9
+
10
+ def __str__(self) -> str:
11
+ return str(self.value)
12
+
13
+ # How API responses are parsed. The API may add values to this enum without a
14
+ # new SDK release, so a value this version does not know becomes a member
15
+ # carrying the raw string instead of raising. It compares equal to that string
16
+ # and is absent from list(ConsentSourceStatus), which is how to tell it apart.
17
+ # A value that is not a string is a malformed response and still raises.
18
+ # Constructing the enum directly stays strict, so a typo in a value you pass
19
+ # in still raises and membership checks are unchanged.
20
+ @classmethod
21
+ def _from_value(cls, value: object) -> "ConsentSourceStatus":
22
+ try:
23
+ return cls(value)
24
+ except ValueError:
25
+ if not isinstance(value, str):
26
+ raise
27
+ member = str.__new__(cls, value)
28
+ member._name_ = value
29
+ member._value_ = value
30
+ return member
@@ -0,0 +1,28 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ConsentSourceType(StrEnum):
5
+ LIVE = "live"
6
+ ONE_TIME = "one_time"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
10
+
11
+ # How API responses are parsed. The API may add values to this enum without a
12
+ # new SDK release, so a value this version does not know becomes a member
13
+ # carrying the raw string instead of raising. It compares equal to that string
14
+ # and is absent from list(ConsentSourceType), which is how to tell it apart.
15
+ # A value that is not a string is a malformed response and still raises.
16
+ # Constructing the enum directly stays strict, so a typo in a value you pass
17
+ # in still raises and membership checks are unchanged.
18
+ @classmethod
19
+ def _from_value(cls, value: object) -> "ConsentSourceType":
20
+ try:
21
+ return cls(value)
22
+ except ValueError:
23
+ if not isinstance(value, str):
24
+ raise
25
+ member = str.__new__(cls, value)
26
+ member._name_ = value
27
+ member._value_ = value
28
+ return member
@@ -0,0 +1,31 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ConsentStatus(StrEnum):
5
+ ACTIVE = "active"
6
+ ERROR = "error"
7
+ EXPIRED = "expired"
8
+ PENDING = "pending"
9
+ REVOKED = "revoked"
10
+
11
+ def __str__(self) -> str:
12
+ return str(self.value)
13
+
14
+ # How API responses are parsed. The API may add values to this enum without a
15
+ # new SDK release, so a value this version does not know becomes a member
16
+ # carrying the raw string instead of raising. It compares equal to that string
17
+ # and is absent from list(ConsentStatus), which is how to tell it apart.
18
+ # A value that is not a string is a malformed response and still raises.
19
+ # Constructing the enum directly stays strict, so a typo in a value you pass
20
+ # in still raises and membership checks are unchanged.
21
+ @classmethod
22
+ def _from_value(cls, value: object) -> "ConsentStatus":
23
+ try:
24
+ return cls(value)
25
+ except ValueError:
26
+ if not isinstance(value, str):
27
+ raise
28
+ member = str.__new__(cls, value)
29
+ member._name_ = value
30
+ member._value_ = value
31
+ return member
@@ -29,8 +29,8 @@ class DeviceAuthorizationRequest:
29
29
  patient_postal_code (str | Unset): Patient's postal code.
30
30
  patient_phone (str | Unset): Patient's phone number.
31
31
  patient_email (str | Unset): Patient's email, used as the signer identity.
32
- providers (str | Unset): JSON array of provider seeds to prefill the patient's list, each `{ "name", "phone"?
33
- }`. Seeded by name (freeform); the patient can add, change, or remove them on the link page.
32
+ providers (str | Unset): JSON array of provider seeds to prefill the patient's list, each a `ProviderSeed`.
33
+ Seeded by name (freeform); the patient can add, change, or remove them on the link page.
34
34
  """
35
35
 
36
36
  patient_ref: str | Unset = UNSET
@@ -0,0 +1,27 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ExportPatientFhirPrefer(StrEnum):
5
+ RESPOND_ASYNC = "respond-async"
6
+
7
+ def __str__(self) -> str:
8
+ return str(self.value)
9
+
10
+ # How API responses are parsed. The API may add values to this enum without a
11
+ # new SDK release, so a value this version does not know becomes a member
12
+ # carrying the raw string instead of raising. It compares equal to that string
13
+ # and is absent from list(ExportPatientFhirPrefer), which is how to tell it apart.
14
+ # A value that is not a string is a malformed response and still raises.
15
+ # Constructing the enum directly stays strict, so a typo in a value you pass
16
+ # in still raises and membership checks are unchanged.
17
+ @classmethod
18
+ def _from_value(cls, value: object) -> "ExportPatientFhirPrefer":
19
+ try:
20
+ return cls(value)
21
+ except ValueError:
22
+ if not isinstance(value, str):
23
+ raise
24
+ member = str.__new__(cls, value)
25
+ member._name_ = value
26
+ member._value_ = value
27
+ return member
@@ -70,7 +70,7 @@ class ExportPatientFhirResponse202:
70
70
  if isinstance(_status, Unset):
71
71
  status = UNSET
72
72
  else:
73
- status = ExportPatientFhirResponse202Status(_status)
73
+ status = ExportPatientFhirResponse202Status._from_value(_status)
74
74
 
75
75
  _expires_at = d.pop("expiresAt", UNSET)
76
76
  expires_at: datetime.datetime | Unset
@@ -0,0 +1,28 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ExportPatientFhirResponse202Status(StrEnum):
5
+ PENDING = "pending"
6
+ RUNNING = "running"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
10
+
11
+ # How API responses are parsed. The API may add values to this enum without a
12
+ # new SDK release, so a value this version does not know becomes a member
13
+ # carrying the raw string instead of raising. It compares equal to that string
14
+ # and is absent from list(ExportPatientFhirResponse202Status), which is how to tell it apart.
15
+ # A value that is not a string is a malformed response and still raises.
16
+ # Constructing the enum directly stays strict, so a typo in a value you pass
17
+ # in still raises and membership checks are unchanged.
18
+ @classmethod
19
+ def _from_value(cls, value: object) -> "ExportPatientFhirResponse202Status":
20
+ try:
21
+ return cls(value)
22
+ except ValueError:
23
+ if not isinstance(value, str):
24
+ raise
25
+ member = str.__new__(cls, value)
26
+ member._name_ = value
27
+ member._value_ = value
28
+ return member
@@ -0,0 +1,27 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ExportPatientPdfPrefer(StrEnum):
5
+ RESPOND_ASYNC = "respond-async"
6
+
7
+ def __str__(self) -> str:
8
+ return str(self.value)
9
+
10
+ # How API responses are parsed. The API may add values to this enum without a
11
+ # new SDK release, so a value this version does not know becomes a member
12
+ # carrying the raw string instead of raising. It compares equal to that string
13
+ # and is absent from list(ExportPatientPdfPrefer), which is how to tell it apart.
14
+ # A value that is not a string is a malformed response and still raises.
15
+ # Constructing the enum directly stays strict, so a typo in a value you pass
16
+ # in still raises and membership checks are unchanged.
17
+ @classmethod
18
+ def _from_value(cls, value: object) -> "ExportPatientPdfPrefer":
19
+ try:
20
+ return cls(value)
21
+ except ValueError:
22
+ if not isinstance(value, str):
23
+ raise
24
+ member = str.__new__(cls, value)
25
+ member._name_ = value
26
+ member._value_ = value
27
+ return member
@@ -70,7 +70,7 @@ class ExportPatientPdfResponse202:
70
70
  if isinstance(_status, Unset):
71
71
  status = UNSET
72
72
  else:
73
- status = ExportPatientPdfResponse202Status(_status)
73
+ status = ExportPatientPdfResponse202Status._from_value(_status)
74
74
 
75
75
  _expires_at = d.pop("expiresAt", UNSET)
76
76
  expires_at: datetime.datetime | Unset
@@ -0,0 +1,28 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class ExportPatientPdfResponse202Status(StrEnum):
5
+ PENDING = "pending"
6
+ RUNNING = "running"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
10
+
11
+ # How API responses are parsed. The API may add values to this enum without a
12
+ # new SDK release, so a value this version does not know becomes a member
13
+ # carrying the raw string instead of raising. It compares equal to that string
14
+ # and is absent from list(ExportPatientPdfResponse202Status), which is how to tell it apart.
15
+ # A value that is not a string is a malformed response and still raises.
16
+ # Constructing the enum directly stays strict, so a typo in a value you pass
17
+ # in still raises and membership checks are unchanged.
18
+ @classmethod
19
+ def _from_value(cls, value: object) -> "ExportPatientPdfResponse202Status":
20
+ try:
21
+ return cls(value)
22
+ except ValueError:
23
+ if not isinstance(value, str):
24
+ raise
25
+ member = str.__new__(cls, value)
26
+ member._name_ = value
27
+ member._value_ = value
28
+ return member
@@ -0,0 +1,27 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class GetPatientPdfExportDownload(StrEnum):
5
+ VALUE_0 = "1"
6
+
7
+ def __str__(self) -> str:
8
+ return str(self.value)
9
+
10
+ # How API responses are parsed. The API may add values to this enum without a
11
+ # new SDK release, so a value this version does not know becomes a member
12
+ # carrying the raw string instead of raising. It compares equal to that string
13
+ # and is absent from list(GetPatientPdfExportDownload), which is how to tell it apart.
14
+ # A value that is not a string is a malformed response and still raises.
15
+ # Constructing the enum directly stays strict, so a typo in a value you pass
16
+ # in still raises and membership checks are unchanged.
17
+ @classmethod
18
+ def _from_value(cls, value: object) -> "GetPatientPdfExportDownload":
19
+ try:
20
+ return cls(value)
21
+ except ValueError:
22
+ if not isinstance(value, str):
23
+ raise
24
+ member = str.__new__(cls, value)
25
+ member._name_ = value
26
+ member._value_ = value
27
+ return member
@@ -76,7 +76,7 @@ class GetPatientPdfExportResponse200:
76
76
  if isinstance(_status, Unset):
77
77
  status = UNSET
78
78
  else:
79
- status = GetPatientPdfExportResponse200Status(_status)
79
+ status = GetPatientPdfExportResponse200Status._from_value(_status)
80
80
 
81
81
  download_url = d.pop("downloadUrl", UNSET)
82
82
 
@@ -0,0 +1,27 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class GetPatientPdfExportResponse200Status(StrEnum):
5
+ READY = "ready"
6
+
7
+ def __str__(self) -> str:
8
+ return str(self.value)
9
+
10
+ # How API responses are parsed. The API may add values to this enum without a
11
+ # new SDK release, so a value this version does not know becomes a member
12
+ # carrying the raw string instead of raising. It compares equal to that string
13
+ # and is absent from list(GetPatientPdfExportResponse200Status), which is how to tell it apart.
14
+ # A value that is not a string is a malformed response and still raises.
15
+ # Constructing the enum directly stays strict, so a typo in a value you pass
16
+ # in still raises and membership checks are unchanged.
17
+ @classmethod
18
+ def _from_value(cls, value: object) -> "GetPatientPdfExportResponse200Status":
19
+ try:
20
+ return cls(value)
21
+ except ValueError:
22
+ if not isinstance(value, str):
23
+ raise
24
+ member = str.__new__(cls, value)
25
+ member._name_ = value
26
+ member._value_ = value
27
+ return member
@@ -42,7 +42,7 @@ class OAuthError:
42
42
  @classmethod
43
43
  def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
44
44
  d = dict(src_dict)
45
- error = OAuthErrorError(d.pop("error"))
45
+ error = OAuthErrorError._from_value(d.pop("error"))
46
46
 
47
47
  error_description = d.pop("error_description", UNSET)
48
48
 
@@ -0,0 +1,35 @@
1
+ from enum import StrEnum
2
+
3
+
4
+ class OAuthErrorError(StrEnum):
5
+ ACCESS_DENIED = "access_denied"
6
+ AUTHORIZATION_PENDING = "authorization_pending"
7
+ EXPIRED_TOKEN = "expired_token"
8
+ INVALID_CLIENT = "invalid_client"
9
+ INVALID_GRANT = "invalid_grant"
10
+ INVALID_REQUEST = "invalid_request"
11
+ SERVER_ERROR = "server_error"
12
+ SLOW_DOWN = "slow_down"
13
+ UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type"
14
+
15
+ def __str__(self) -> str:
16
+ return str(self.value)
17
+
18
+ # How API responses are parsed. The API may add values to this enum without a
19
+ # new SDK release, so a value this version does not know becomes a member
20
+ # carrying the raw string instead of raising. It compares equal to that string
21
+ # and is absent from list(OAuthErrorError), which is how to tell it apart.
22
+ # A value that is not a string is a malformed response and still raises.
23
+ # Constructing the enum directly stays strict, so a typo in a value you pass
24
+ # in still raises and membership checks are unchanged.
25
+ @classmethod
26
+ def _from_value(cls, value: object) -> "OAuthErrorError":
27
+ try:
28
+ return cls(value)
29
+ except ValueError:
30
+ if not isinstance(value, str):
31
+ raise
32
+ member = str.__new__(cls, value)
33
+ member._name_ = value
34
+ member._value_ = value
35
+ return member
@@ -16,16 +16,22 @@ class ProviderSeed:
16
16
  Attributes:
17
17
  name (str): Provider name, as the patient would recognize it.
18
18
  phone (str | Unset): Optional contact, for a provider that isn't reachable electronically.
19
+ provider_ref (str | Unset): Your own id for this provider, echoed as `provider_ref` on every source that comes
20
+ from it, in GET /consents/{id} and in source webhooks. A source the patient added themselves has none. Must be
21
+ unique within the request.
19
22
  """
20
23
 
21
24
  name: str
22
25
  phone: str | Unset = UNSET
26
+ provider_ref: str | Unset = UNSET
23
27
 
24
28
  def to_dict(self) -> dict[str, Any]:
25
29
  name = self.name
26
30
 
27
31
  phone = self.phone
28
32
 
33
+ provider_ref = self.provider_ref
34
+
29
35
  field_dict: dict[str, Any] = {}
30
36
 
31
37
  field_dict.update(
@@ -35,6 +41,8 @@ class ProviderSeed:
35
41
  )
36
42
  if phone is not UNSET:
37
43
  field_dict["phone"] = phone
44
+ if provider_ref is not UNSET:
45
+ field_dict["provider_ref"] = provider_ref
38
46
 
39
47
  return field_dict
40
48
 
@@ -45,9 +53,12 @@ class ProviderSeed:
45
53
 
46
54
  phone = d.pop("phone", UNSET)
47
55
 
56
+ provider_ref = d.pop("provider_ref", UNSET)
57
+
48
58
  provider_seed = cls(
49
59
  name=name,
50
60
  phone=phone,
61
+ provider_ref=provider_ref,
51
62
  )
52
63
 
53
64
  return provider_seed