hubble-sdk-python 0.0.2__py3-none-any.whl

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 (46) hide show
  1. hubble_sdk/__init__.py +43 -0
  2. hubble_sdk/_generated/__init__.py +8 -0
  3. hubble_sdk/_generated/api/__init__.py +1 -0
  4. hubble_sdk/_generated/api/default/__init__.py +1 -0
  5. hubble_sdk/_generated/api/default/attach_client_authorization.py +220 -0
  6. hubble_sdk/_generated/api/default/create_consent_link.py +197 -0
  7. hubble_sdk/_generated/api/default/exchange_token.py +186 -0
  8. hubble_sdk/_generated/api/default/export_patient_pdf.py +194 -0
  9. hubble_sdk/_generated/api/default/get_consent.py +166 -0
  10. hubble_sdk/_generated/api/default/list_consents.py +191 -0
  11. hubble_sdk/_generated/api/default/read_fhir.py +182 -0
  12. hubble_sdk/_generated/api/default/revoke_consent.py +167 -0
  13. hubble_sdk/_generated/client.py +282 -0
  14. hubble_sdk/_generated/errors.py +16 -0
  15. hubble_sdk/_generated/models/__init__.py +59 -0
  16. hubble_sdk/_generated/models/api_error.py +42 -0
  17. hubble_sdk/_generated/models/attach_client_authorization_body.py +112 -0
  18. hubble_sdk/_generated/models/attach_client_authorization_response_201.py +100 -0
  19. hubble_sdk/_generated/models/attach_client_authorization_response_201_status.py +8 -0
  20. hubble_sdk/_generated/models/consent.py +160 -0
  21. hubble_sdk/_generated/models/consent_error.py +50 -0
  22. hubble_sdk/_generated/models/consent_link_request.py +88 -0
  23. hubble_sdk/_generated/models/consent_list.py +56 -0
  24. hubble_sdk/_generated/models/consent_source.py +63 -0
  25. hubble_sdk/_generated/models/consent_source_status.py +10 -0
  26. hubble_sdk/_generated/models/consent_source_type.py +9 -0
  27. hubble_sdk/_generated/models/consent_status.py +12 -0
  28. hubble_sdk/_generated/models/device_authorization_request.py +142 -0
  29. hubble_sdk/_generated/models/device_authorization_response.py +90 -0
  30. hubble_sdk/_generated/models/fhir_resource.py +62 -0
  31. hubble_sdk/_generated/models/o_auth_error.py +54 -0
  32. hubble_sdk/_generated/models/o_auth_error_error.py +16 -0
  33. hubble_sdk/_generated/models/operation_outcome.py +75 -0
  34. hubble_sdk/_generated/models/operation_outcome_issue_item.py +61 -0
  35. hubble_sdk/_generated/models/patient_address.py +69 -0
  36. hubble_sdk/_generated/models/patient_demographics.py +109 -0
  37. hubble_sdk/_generated/models/provider_seed.py +53 -0
  38. hubble_sdk/_generated/models/token_request.py +81 -0
  39. hubble_sdk/_generated/models/token_request_grant_type.py +12 -0
  40. hubble_sdk/_generated/models/token_response.py +84 -0
  41. hubble_sdk/_generated/types.py +54 -0
  42. hubble_sdk/_hubble.py +379 -0
  43. hubble_sdk_python-0.0.2.dist-info/METADATA +89 -0
  44. hubble_sdk_python-0.0.2.dist-info/RECORD +46 -0
  45. hubble_sdk_python-0.0.2.dist-info/WHEEL +4 -0
  46. hubble_sdk_python-0.0.2.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,63 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ from ..models.consent_source_status import ConsentSourceStatus
9
+ from ..models.consent_source_type import ConsentSourceType
10
+
11
+ T = TypeVar("T", bound="ConsentSource")
12
+
13
+
14
+ @_attrs_define
15
+ class ConsentSource:
16
+ """
17
+ Attributes:
18
+ provider (str): The source as the customer knows it (facility / provider name).
19
+ type_ (ConsentSourceType): live = an ongoing connection re-readable until its access lapses (EHR, HIE); one_time
20
+ = a single pull with no ongoing connection (delegated retrieval).
21
+ status (ConsentSourceStatus): available = records readable now; pending = still being reached out to; failed =
22
+ retrieval failed.
23
+ """
24
+
25
+ provider: str
26
+ type_: ConsentSourceType
27
+ status: ConsentSourceStatus
28
+
29
+ def to_dict(self) -> dict[str, Any]:
30
+ provider = self.provider
31
+
32
+ type_ = self.type_.value
33
+
34
+ status = self.status.value
35
+
36
+ field_dict: dict[str, Any] = {}
37
+
38
+ field_dict.update(
39
+ {
40
+ "provider": provider,
41
+ "type": type_,
42
+ "status": status,
43
+ }
44
+ )
45
+
46
+ return field_dict
47
+
48
+ @classmethod
49
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
50
+ d = dict(src_dict)
51
+ provider = d.pop("provider")
52
+
53
+ type_ = ConsentSourceType(d.pop("type"))
54
+
55
+ status = ConsentSourceStatus(d.pop("status"))
56
+
57
+ consent_source = cls(
58
+ provider=provider,
59
+ type_=type_,
60
+ status=status,
61
+ )
62
+
63
+ return consent_source
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ConsentSourceStatus(str, Enum):
5
+ AVAILABLE = "available"
6
+ FAILED = "failed"
7
+ PENDING = "pending"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ConsentSourceType(str, Enum):
5
+ LIVE = "live"
6
+ ONE_TIME = "one_time"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,12 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ConsentStatus(str, Enum):
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)
@@ -0,0 +1,142 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="DeviceAuthorizationRequest")
11
+
12
+
13
+ @_attrs_define
14
+ class DeviceAuthorizationRequest:
15
+ """
16
+ Attributes:
17
+ patient_ref (str | Unset): Your own reference for the patient, echoed back on the consent.
18
+ patient_first_name (str | Unset): Patient's legal first name.
19
+ patient_last_name (str | Unset): Patient's legal last name.
20
+ patient_birth_date (str | Unset): Patient's date of birth, ISO YYYY-MM-DD.
21
+ patient_sex (str | Unset): Patient's sex.
22
+ patient_address_line1 (str | Unset): Patient's street address.
23
+ patient_city (str | Unset): Patient's city.
24
+ patient_state (str | Unset): Patient's state or region.
25
+ patient_postal_code (str | Unset): Patient's postal code.
26
+ patient_phone (str | Unset): Patient's phone number.
27
+ patient_email (str | Unset): Patient's email, used as the signer identity.
28
+ providers (str | Unset): JSON array of provider seeds to prefill the patient's list, each `{ "name", "phone"?
29
+ }`. Seeded by name (freeform); the patient can add, change, or remove them on the link page.
30
+ """
31
+
32
+ patient_ref: str | Unset = UNSET
33
+ patient_first_name: str | Unset = UNSET
34
+ patient_last_name: str | Unset = UNSET
35
+ patient_birth_date: str | Unset = UNSET
36
+ patient_sex: str | Unset = UNSET
37
+ patient_address_line1: str | Unset = UNSET
38
+ patient_city: str | Unset = UNSET
39
+ patient_state: str | Unset = UNSET
40
+ patient_postal_code: str | Unset = UNSET
41
+ patient_phone: str | Unset = UNSET
42
+ patient_email: str | Unset = UNSET
43
+ providers: str | Unset = UNSET
44
+
45
+ def to_dict(self) -> dict[str, Any]:
46
+ patient_ref = self.patient_ref
47
+
48
+ patient_first_name = self.patient_first_name
49
+
50
+ patient_last_name = self.patient_last_name
51
+
52
+ patient_birth_date = self.patient_birth_date
53
+
54
+ patient_sex = self.patient_sex
55
+
56
+ patient_address_line1 = self.patient_address_line1
57
+
58
+ patient_city = self.patient_city
59
+
60
+ patient_state = self.patient_state
61
+
62
+ patient_postal_code = self.patient_postal_code
63
+
64
+ patient_phone = self.patient_phone
65
+
66
+ patient_email = self.patient_email
67
+
68
+ providers = self.providers
69
+
70
+ field_dict: dict[str, Any] = {}
71
+
72
+ field_dict.update({})
73
+ if patient_ref is not UNSET:
74
+ field_dict["patient_ref"] = patient_ref
75
+ if patient_first_name is not UNSET:
76
+ field_dict["patient_first_name"] = patient_first_name
77
+ if patient_last_name is not UNSET:
78
+ field_dict["patient_last_name"] = patient_last_name
79
+ if patient_birth_date is not UNSET:
80
+ field_dict["patient_birth_date"] = patient_birth_date
81
+ if patient_sex is not UNSET:
82
+ field_dict["patient_sex"] = patient_sex
83
+ if patient_address_line1 is not UNSET:
84
+ field_dict["patient_address_line1"] = patient_address_line1
85
+ if patient_city is not UNSET:
86
+ field_dict["patient_city"] = patient_city
87
+ if patient_state is not UNSET:
88
+ field_dict["patient_state"] = patient_state
89
+ if patient_postal_code is not UNSET:
90
+ field_dict["patient_postal_code"] = patient_postal_code
91
+ if patient_phone is not UNSET:
92
+ field_dict["patient_phone"] = patient_phone
93
+ if patient_email is not UNSET:
94
+ field_dict["patient_email"] = patient_email
95
+ if providers is not UNSET:
96
+ field_dict["providers"] = providers
97
+
98
+ return field_dict
99
+
100
+ @classmethod
101
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
102
+ d = dict(src_dict)
103
+ patient_ref = d.pop("patient_ref", UNSET)
104
+
105
+ patient_first_name = d.pop("patient_first_name", UNSET)
106
+
107
+ patient_last_name = d.pop("patient_last_name", UNSET)
108
+
109
+ patient_birth_date = d.pop("patient_birth_date", UNSET)
110
+
111
+ patient_sex = d.pop("patient_sex", UNSET)
112
+
113
+ patient_address_line1 = d.pop("patient_address_line1", UNSET)
114
+
115
+ patient_city = d.pop("patient_city", UNSET)
116
+
117
+ patient_state = d.pop("patient_state", UNSET)
118
+
119
+ patient_postal_code = d.pop("patient_postal_code", UNSET)
120
+
121
+ patient_phone = d.pop("patient_phone", UNSET)
122
+
123
+ patient_email = d.pop("patient_email", UNSET)
124
+
125
+ providers = d.pop("providers", UNSET)
126
+
127
+ device_authorization_request = cls(
128
+ patient_ref=patient_ref,
129
+ patient_first_name=patient_first_name,
130
+ patient_last_name=patient_last_name,
131
+ patient_birth_date=patient_birth_date,
132
+ patient_sex=patient_sex,
133
+ patient_address_line1=patient_address_line1,
134
+ patient_city=patient_city,
135
+ patient_state=patient_state,
136
+ patient_postal_code=patient_postal_code,
137
+ patient_phone=patient_phone,
138
+ patient_email=patient_email,
139
+ providers=providers,
140
+ )
141
+
142
+ return device_authorization_request
@@ -0,0 +1,90 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ T = TypeVar("T", bound="DeviceAuthorizationResponse")
9
+
10
+
11
+ @_attrs_define
12
+ class DeviceAuthorizationResponse:
13
+ """
14
+ Attributes:
15
+ device_code (str): Opaque code your app polls the token endpoint with.
16
+ user_code (str): Short code shown to the patient (unused in the link flow).
17
+ verification_uri (str): Base patient link.
18
+ verification_uri_complete (str): Ready-to-open patient link — send the patient here to authorize.
19
+ consent_id (str): The consent this authorization will grant.
20
+ expires_in (int): Seconds until the link and device_code expire.
21
+ interval (int): Minimum seconds to wait between token-endpoint polls.
22
+ """
23
+
24
+ device_code: str
25
+ user_code: str
26
+ verification_uri: str
27
+ verification_uri_complete: str
28
+ consent_id: str
29
+ expires_in: int
30
+ interval: int
31
+
32
+ def to_dict(self) -> dict[str, Any]:
33
+ device_code = self.device_code
34
+
35
+ user_code = self.user_code
36
+
37
+ verification_uri = self.verification_uri
38
+
39
+ verification_uri_complete = self.verification_uri_complete
40
+
41
+ consent_id = self.consent_id
42
+
43
+ expires_in = self.expires_in
44
+
45
+ interval = self.interval
46
+
47
+ field_dict: dict[str, Any] = {}
48
+
49
+ field_dict.update(
50
+ {
51
+ "device_code": device_code,
52
+ "user_code": user_code,
53
+ "verification_uri": verification_uri,
54
+ "verification_uri_complete": verification_uri_complete,
55
+ "consent_id": consent_id,
56
+ "expires_in": expires_in,
57
+ "interval": interval,
58
+ }
59
+ )
60
+
61
+ return field_dict
62
+
63
+ @classmethod
64
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
65
+ d = dict(src_dict)
66
+ device_code = d.pop("device_code")
67
+
68
+ user_code = d.pop("user_code")
69
+
70
+ verification_uri = d.pop("verification_uri")
71
+
72
+ verification_uri_complete = d.pop("verification_uri_complete")
73
+
74
+ consent_id = d.pop("consent_id")
75
+
76
+ expires_in = d.pop("expires_in")
77
+
78
+ interval = d.pop("interval")
79
+
80
+ device_authorization_response = cls(
81
+ device_code=device_code,
82
+ user_code=user_code,
83
+ verification_uri=verification_uri,
84
+ verification_uri_complete=verification_uri_complete,
85
+ consent_id=consent_id,
86
+ expires_in=expires_in,
87
+ interval=interval,
88
+ )
89
+
90
+ return device_authorization_response
@@ -0,0 +1,62 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+ from attrs import field as _attrs_field
8
+
9
+ T = TypeVar("T", bound="FhirResource")
10
+
11
+
12
+ @_attrs_define
13
+ class FhirResource:
14
+ """An arbitrary FHIR R4 resource. Has a `resourceType`; otherwise open.
15
+
16
+ Attributes:
17
+ resource_type (str):
18
+ """
19
+
20
+ resource_type: str
21
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
22
+
23
+ def to_dict(self) -> dict[str, Any]:
24
+ resource_type = self.resource_type
25
+
26
+ field_dict: dict[str, Any] = {}
27
+ field_dict.update(self.additional_properties)
28
+ field_dict.update(
29
+ {
30
+ "resourceType": resource_type,
31
+ }
32
+ )
33
+
34
+ return field_dict
35
+
36
+ @classmethod
37
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
38
+ d = dict(src_dict)
39
+ resource_type = d.pop("resourceType")
40
+
41
+ fhir_resource = cls(
42
+ resource_type=resource_type,
43
+ )
44
+
45
+ fhir_resource.additional_properties = d
46
+ return fhir_resource
47
+
48
+ @property
49
+ def additional_keys(self) -> list[str]:
50
+ return list(self.additional_properties.keys())
51
+
52
+ def __getitem__(self, key: str) -> Any:
53
+ return self.additional_properties[key]
54
+
55
+ def __setitem__(self, key: str, value: Any) -> None:
56
+ self.additional_properties[key] = value
57
+
58
+ def __delitem__(self, key: str) -> None:
59
+ del self.additional_properties[key]
60
+
61
+ def __contains__(self, key: str) -> bool:
62
+ return key in self.additional_properties
@@ -0,0 +1,54 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ from ..models.o_auth_error_error import OAuthErrorError
9
+ from ..types import UNSET, Unset
10
+
11
+ T = TypeVar("T", bound="OAuthError")
12
+
13
+
14
+ @_attrs_define
15
+ class OAuthError:
16
+ """
17
+ Attributes:
18
+ error (OAuthErrorError):
19
+ error_description (str | Unset):
20
+ """
21
+
22
+ error: OAuthErrorError
23
+ error_description: str | Unset = UNSET
24
+
25
+ def to_dict(self) -> dict[str, Any]:
26
+ error = self.error.value
27
+
28
+ error_description = self.error_description
29
+
30
+ field_dict: dict[str, Any] = {}
31
+
32
+ field_dict.update(
33
+ {
34
+ "error": error,
35
+ }
36
+ )
37
+ if error_description is not UNSET:
38
+ field_dict["error_description"] = error_description
39
+
40
+ return field_dict
41
+
42
+ @classmethod
43
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
44
+ d = dict(src_dict)
45
+ error = OAuthErrorError(d.pop("error"))
46
+
47
+ error_description = d.pop("error_description", UNSET)
48
+
49
+ o_auth_error = cls(
50
+ error=error,
51
+ error_description=error_description,
52
+ )
53
+
54
+ return o_auth_error
@@ -0,0 +1,16 @@
1
+ from enum import Enum
2
+
3
+
4
+ class OAuthErrorError(str, Enum):
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)
@@ -0,0 +1,75 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import (
5
+ TYPE_CHECKING,
6
+ Any,
7
+ Literal,
8
+ Self,
9
+ TypeVar,
10
+ cast,
11
+ )
12
+
13
+ from attrs import define as _attrs_define
14
+
15
+ if TYPE_CHECKING:
16
+ from ..models.operation_outcome_issue_item import OperationOutcomeIssueItem
17
+
18
+
19
+ T = TypeVar("T", bound="OperationOutcome")
20
+
21
+
22
+ @_attrs_define
23
+ class OperationOutcome:
24
+ """
25
+ Attributes:
26
+ resource_type (Literal['OperationOutcome']):
27
+ issue (list[OperationOutcomeIssueItem]):
28
+ """
29
+
30
+ resource_type: Literal["OperationOutcome"]
31
+ issue: list[OperationOutcomeIssueItem]
32
+
33
+ def to_dict(self) -> dict[str, Any]:
34
+ resource_type = self.resource_type
35
+
36
+ issue = []
37
+ for issue_item_data in self.issue:
38
+ issue_item = issue_item_data.to_dict()
39
+ issue.append(issue_item)
40
+
41
+ field_dict: dict[str, Any] = {}
42
+
43
+ field_dict.update(
44
+ {
45
+ "resourceType": resource_type,
46
+ "issue": issue,
47
+ }
48
+ )
49
+
50
+ return field_dict
51
+
52
+ @classmethod
53
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
54
+ from ..models.operation_outcome_issue_item import OperationOutcomeIssueItem
55
+
56
+ d = dict(src_dict)
57
+ resource_type = cast(Literal["OperationOutcome"], d.pop("resourceType"))
58
+ if resource_type != "OperationOutcome":
59
+ raise ValueError(
60
+ f"resourceType must match const 'OperationOutcome', got '{resource_type}'"
61
+ )
62
+
63
+ issue = []
64
+ _issue = d.pop("issue")
65
+ for issue_item_data in _issue:
66
+ issue_item = OperationOutcomeIssueItem.from_dict(issue_item_data)
67
+
68
+ issue.append(issue_item)
69
+
70
+ operation_outcome = cls(
71
+ resource_type=resource_type,
72
+ issue=issue,
73
+ )
74
+
75
+ return operation_outcome
@@ -0,0 +1,61 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="OperationOutcomeIssueItem")
11
+
12
+
13
+ @_attrs_define
14
+ class OperationOutcomeIssueItem:
15
+ """
16
+ Attributes:
17
+ severity (str):
18
+ code (str):
19
+ diagnostics (str | Unset):
20
+ """
21
+
22
+ severity: str
23
+ code: str
24
+ diagnostics: str | Unset = UNSET
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ severity = self.severity
28
+
29
+ code = self.code
30
+
31
+ diagnostics = self.diagnostics
32
+
33
+ field_dict: dict[str, Any] = {}
34
+
35
+ field_dict.update(
36
+ {
37
+ "severity": severity,
38
+ "code": code,
39
+ }
40
+ )
41
+ if diagnostics is not UNSET:
42
+ field_dict["diagnostics"] = diagnostics
43
+
44
+ return field_dict
45
+
46
+ @classmethod
47
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
48
+ d = dict(src_dict)
49
+ severity = d.pop("severity")
50
+
51
+ code = d.pop("code")
52
+
53
+ diagnostics = d.pop("diagnostics", UNSET)
54
+
55
+ operation_outcome_issue_item = cls(
56
+ severity=severity,
57
+ code=code,
58
+ diagnostics=diagnostics,
59
+ )
60
+
61
+ return operation_outcome_issue_item
@@ -0,0 +1,69 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Mapping
4
+ from typing import Any, Self, TypeVar
5
+
6
+ from attrs import define as _attrs_define
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="PatientAddress")
11
+
12
+
13
+ @_attrs_define
14
+ class PatientAddress:
15
+ """
16
+ Attributes:
17
+ line1 (str | Unset): Street address.
18
+ city (str | Unset): City.
19
+ state (str | Unset): State or region.
20
+ postal_code (str | Unset): Postal code.
21
+ """
22
+
23
+ line1: str | Unset = UNSET
24
+ city: str | Unset = UNSET
25
+ state: str | Unset = UNSET
26
+ postal_code: str | Unset = UNSET
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ line1 = self.line1
30
+
31
+ city = self.city
32
+
33
+ state = self.state
34
+
35
+ postal_code = self.postal_code
36
+
37
+ field_dict: dict[str, Any] = {}
38
+
39
+ field_dict.update({})
40
+ if line1 is not UNSET:
41
+ field_dict["line1"] = line1
42
+ if city is not UNSET:
43
+ field_dict["city"] = city
44
+ if state is not UNSET:
45
+ field_dict["state"] = state
46
+ if postal_code is not UNSET:
47
+ field_dict["postal_code"] = postal_code
48
+
49
+ return field_dict
50
+
51
+ @classmethod
52
+ def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
53
+ d = dict(src_dict)
54
+ line1 = d.pop("line1", UNSET)
55
+
56
+ city = d.pop("city", UNSET)
57
+
58
+ state = d.pop("state", UNSET)
59
+
60
+ postal_code = d.pop("postal_code", UNSET)
61
+
62
+ patient_address = cls(
63
+ line1=line1,
64
+ city=city,
65
+ state=state,
66
+ postal_code=postal_code,
67
+ )
68
+
69
+ return patient_address