rxfoundry.clients.swifty-api 0.0.593__py3-none-any.whl → 1.0.0__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 (61) hide show
  1. rxfoundry/clients/swifty_api/models/virtual_pharmacy.py +3 -1
  2. {rxfoundry_clients_swifty_api-0.0.593.dist-info → rxfoundry_clients_swifty_api-1.0.0.dist-info}/METADATA +1 -1
  3. rxfoundry_clients_swifty_api-1.0.0.dist-info/RECORD +61 -0
  4. rxfoundry/clients/p2rx_api/__init__.py +0 -79
  5. rxfoundry/clients/p2rx_api/api/__init__.py +0 -17
  6. rxfoundry/clients/p2rx_api/api/async_api.py +0 -862
  7. rxfoundry/clients/p2rx_api/api/code_api.py +0 -337
  8. rxfoundry/clients/p2rx_api/api/fax_api.py +0 -632
  9. rxfoundry/clients/p2rx_api/api/medication_api.py +0 -666
  10. rxfoundry/clients/p2rx_api/api/patient_api.py +0 -981
  11. rxfoundry/clients/p2rx_api/api/pharmacist_api.py +0 -615
  12. rxfoundry/clients/p2rx_api/api/pharmacy_api.py +0 -684
  13. rxfoundry/clients/p2rx_api/api/prescriber_api.py +0 -615
  14. rxfoundry/clients/p2rx_api/api/prescription_api.py +0 -1864
  15. rxfoundry/clients/p2rx_api/api/token_api.py +0 -314
  16. rxfoundry/clients/p2rx_api/api/user_api.py +0 -306
  17. rxfoundry/clients/p2rx_api/api/version_api.py +0 -282
  18. rxfoundry/clients/p2rx_api/api/virtual_pharmacy_api.py +0 -284
  19. rxfoundry/clients/p2rx_api/api_client.py +0 -798
  20. rxfoundry/clients/p2rx_api/api_response.py +0 -21
  21. rxfoundry/clients/p2rx_api/configuration.py +0 -583
  22. rxfoundry/clients/p2rx_api/exceptions.py +0 -217
  23. rxfoundry/clients/p2rx_api/models/__init__.py +0 -50
  24. rxfoundry/clients/p2rx_api/models/address.py +0 -106
  25. rxfoundry/clients/p2rx_api/models/asynchronous_response.py +0 -90
  26. rxfoundry/clients/p2rx_api/models/code.py +0 -92
  27. rxfoundry/clients/p2rx_api/models/code_qualifier_code.py +0 -96
  28. rxfoundry/clients/p2rx_api/models/error_message.py +0 -90
  29. rxfoundry/clients/p2rx_api/models/fax.py +0 -141
  30. rxfoundry/clients/p2rx_api/models/medication.py +0 -137
  31. rxfoundry/clients/p2rx_api/models/medication_program_pricing.py +0 -99
  32. rxfoundry/clients/p2rx_api/models/medication_variant.py +0 -96
  33. rxfoundry/clients/p2rx_api/models/patient.py +0 -128
  34. rxfoundry/clients/p2rx_api/models/patient_activity_notification.py +0 -114
  35. rxfoundry/clients/p2rx_api/models/patient_external_identifier.py +0 -94
  36. rxfoundry/clients/p2rx_api/models/pharmacist.py +0 -104
  37. rxfoundry/clients/p2rx_api/models/pharmacy.py +0 -156
  38. rxfoundry/clients/p2rx_api/models/pharmacy_chain.py +0 -100
  39. rxfoundry/clients/p2rx_api/models/pharmacy_other_identifier.py +0 -98
  40. rxfoundry/clients/p2rx_api/models/pharmacy_program_pricing.py +0 -103
  41. rxfoundry/clients/p2rx_api/models/prescriber.py +0 -106
  42. rxfoundry/clients/p2rx_api/models/prescription.py +0 -278
  43. rxfoundry/clients/p2rx_api/models/prescription_change_request.py +0 -123
  44. rxfoundry/clients/p2rx_api/models/prescription_issue.py +0 -120
  45. rxfoundry/clients/p2rx_api/models/prescription_patch.py +0 -113
  46. rxfoundry/clients/p2rx_api/models/prescription_task.py +0 -130
  47. rxfoundry/clients/p2rx_api/models/prescription_task_status.py +0 -95
  48. rxfoundry/clients/p2rx_api/models/prescription_transfer_request.py +0 -93
  49. rxfoundry/clients/p2rx_api/models/prescription_verification.py +0 -107
  50. rxfoundry/clients/p2rx_api/models/pricing_program.py +0 -90
  51. rxfoundry/clients/p2rx_api/models/surescripts_message.py +0 -111
  52. rxfoundry/clients/p2rx_api/models/token.py +0 -92
  53. rxfoundry/clients/p2rx_api/models/user.py +0 -98
  54. rxfoundry/clients/p2rx_api/models/version.py +0 -88
  55. rxfoundry/clients/p2rx_api/models/virtual_pharmacy.py +0 -96
  56. rxfoundry/clients/p2rx_api/models/workflow_request.py +0 -90
  57. rxfoundry/clients/p2rx_api/py.typed +0 -0
  58. rxfoundry/clients/p2rx_api/rest.py +0 -259
  59. rxfoundry_clients_swifty_api-0.0.593.dist-info/RECORD +0 -116
  60. {rxfoundry_clients_swifty_api-0.0.593.dist-info → rxfoundry_clients_swifty_api-1.0.0.dist-info}/WHEEL +0 -0
  61. {rxfoundry_clients_swifty_api-0.0.593.dist-info → rxfoundry_clients_swifty_api-1.0.0.dist-info}/top_level.txt +0 -0
@@ -1,217 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX Backend
7
-
8
- The version of the OpenAPI document: 0.1.DEV-0
9
- Contact: paul.tindall@rxfoundry.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
- from typing import Any, Optional
16
- from typing_extensions import Self
17
-
18
- class OpenApiException(Exception):
19
- """The base exception class for all OpenAPIExceptions"""
20
-
21
-
22
- class ApiTypeError(OpenApiException, TypeError):
23
- def __init__(self, msg, path_to_item=None, valid_classes=None,
24
- key_type=None) -> None:
25
- """ Raises an exception for TypeErrors
26
-
27
- Args:
28
- msg (str): the exception message
29
-
30
- Keyword Args:
31
- path_to_item (list): a list of keys an indices to get to the
32
- current_item
33
- None if unset
34
- valid_classes (tuple): the primitive classes that current item
35
- should be an instance of
36
- None if unset
37
- key_type (bool): False if our value is a value in a dict
38
- True if it is a key in a dict
39
- False if our item is an item in a list
40
- None if unset
41
- """
42
- self.path_to_item = path_to_item
43
- self.valid_classes = valid_classes
44
- self.key_type = key_type
45
- full_msg = msg
46
- if path_to_item:
47
- full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
48
- super(ApiTypeError, self).__init__(full_msg)
49
-
50
-
51
- class ApiValueError(OpenApiException, ValueError):
52
- def __init__(self, msg, path_to_item=None) -> None:
53
- """
54
- Args:
55
- msg (str): the exception message
56
-
57
- Keyword Args:
58
- path_to_item (list) the path to the exception in the
59
- received_data dict. None if unset
60
- """
61
-
62
- self.path_to_item = path_to_item
63
- full_msg = msg
64
- if path_to_item:
65
- full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
66
- super(ApiValueError, self).__init__(full_msg)
67
-
68
-
69
- class ApiAttributeError(OpenApiException, AttributeError):
70
- def __init__(self, msg, path_to_item=None) -> None:
71
- """
72
- Raised when an attribute reference or assignment fails.
73
-
74
- Args:
75
- msg (str): the exception message
76
-
77
- Keyword Args:
78
- path_to_item (None/list) the path to the exception in the
79
- received_data dict
80
- """
81
- self.path_to_item = path_to_item
82
- full_msg = msg
83
- if path_to_item:
84
- full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
85
- super(ApiAttributeError, self).__init__(full_msg)
86
-
87
-
88
- class ApiKeyError(OpenApiException, KeyError):
89
- def __init__(self, msg, path_to_item=None) -> None:
90
- """
91
- Args:
92
- msg (str): the exception message
93
-
94
- Keyword Args:
95
- path_to_item (None/list) the path to the exception in the
96
- received_data dict
97
- """
98
- self.path_to_item = path_to_item
99
- full_msg = msg
100
- if path_to_item:
101
- full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
102
- super(ApiKeyError, self).__init__(full_msg)
103
-
104
-
105
- class ApiException(OpenApiException):
106
-
107
- def __init__(
108
- self,
109
- status=None,
110
- reason=None,
111
- http_resp=None,
112
- *,
113
- body: Optional[str] = None,
114
- data: Optional[Any] = None,
115
- ) -> None:
116
- self.status = status
117
- self.reason = reason
118
- self.body = body
119
- self.data = data
120
- self.headers = None
121
-
122
- if http_resp:
123
- if self.status is None:
124
- self.status = http_resp.status
125
- if self.reason is None:
126
- self.reason = http_resp.reason
127
- if self.body is None:
128
- try:
129
- self.body = http_resp.data.decode('utf-8')
130
- except Exception:
131
- pass
132
- self.headers = http_resp.getheaders()
133
-
134
- @classmethod
135
- def from_response(
136
- cls,
137
- *,
138
- http_resp,
139
- body: Optional[str],
140
- data: Optional[Any],
141
- ) -> Self:
142
- if http_resp.status == 400:
143
- raise BadRequestException(http_resp=http_resp, body=body, data=data)
144
-
145
- if http_resp.status == 401:
146
- raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
147
-
148
- if http_resp.status == 403:
149
- raise ForbiddenException(http_resp=http_resp, body=body, data=data)
150
-
151
- if http_resp.status == 404:
152
- raise NotFoundException(http_resp=http_resp, body=body, data=data)
153
-
154
- # Added new conditions for 409 and 422
155
- if http_resp.status == 409:
156
- raise ConflictException(http_resp=http_resp, body=body, data=data)
157
-
158
- if http_resp.status == 422:
159
- raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
160
-
161
- if 500 <= http_resp.status <= 599:
162
- raise ServiceException(http_resp=http_resp, body=body, data=data)
163
- raise ApiException(http_resp=http_resp, body=body, data=data)
164
-
165
- def __str__(self):
166
- """Custom error messages for exception"""
167
- error_message = "({0})\n"\
168
- "Reason: {1}\n".format(self.status, self.reason)
169
- if self.headers:
170
- error_message += "HTTP response headers: {0}\n".format(
171
- self.headers)
172
-
173
- if self.data or self.body:
174
- error_message += "HTTP response body: {0}\n".format(self.data or self.body)
175
-
176
- return error_message
177
-
178
-
179
- class BadRequestException(ApiException):
180
- pass
181
-
182
-
183
- class NotFoundException(ApiException):
184
- pass
185
-
186
-
187
- class UnauthorizedException(ApiException):
188
- pass
189
-
190
-
191
- class ForbiddenException(ApiException):
192
- pass
193
-
194
-
195
- class ServiceException(ApiException):
196
- pass
197
-
198
-
199
- class ConflictException(ApiException):
200
- """Exception for HTTP 409 Conflict."""
201
- pass
202
-
203
-
204
- class UnprocessableEntityException(ApiException):
205
- """Exception for HTTP 422 Unprocessable Entity."""
206
- pass
207
-
208
-
209
- def render_path(path_to_item):
210
- """Returns a string representation of a path"""
211
- result = ""
212
- for pth in path_to_item:
213
- if isinstance(pth, int):
214
- result += "[{0}]".format(pth)
215
- else:
216
- result += "['{0}']".format(pth)
217
- return result
@@ -1,50 +0,0 @@
1
- # coding: utf-8
2
-
3
- # flake8: noqa
4
- """
5
- P2RX API
6
-
7
- API for the P2RX Backend
8
-
9
- The version of the OpenAPI document: 0.1.DEV-0
10
- Contact: paul.tindall@rxfoundry.com
11
- Generated by OpenAPI Generator (https://openapi-generator.tech)
12
-
13
- Do not edit the class manually.
14
- """ # noqa: E501
15
-
16
-
17
- # import models into model package
18
- from rxfoundry.clients.swifty_api.models.address import Address
19
- from rxfoundry.clients.swifty_api.models.asynchronous_response import AsynchronousResponse
20
- from rxfoundry.clients.swifty_api.models.code import Code
21
- from rxfoundry.clients.swifty_api.models.code_qualifier_code import CodeQualifierCode
22
- from rxfoundry.clients.swifty_api.models.error_message import ErrorMessage
23
- from rxfoundry.clients.swifty_api.models.fax import Fax
24
- from rxfoundry.clients.swifty_api.models.medication import Medication
25
- from rxfoundry.clients.swifty_api.models.medication_program_pricing import MedicationProgramPricing
26
- from rxfoundry.clients.swifty_api.models.medication_variant import MedicationVariant
27
- from rxfoundry.clients.swifty_api.models.patient import Patient
28
- from rxfoundry.clients.swifty_api.models.patient_activity_notification import PatientActivityNotification
29
- from rxfoundry.clients.swifty_api.models.patient_external_identifier import PatientExternalIdentifier
30
- from rxfoundry.clients.swifty_api.models.pharmacist import Pharmacist
31
- from rxfoundry.clients.swifty_api.models.pharmacy import Pharmacy
32
- from rxfoundry.clients.swifty_api.models.pharmacy_chain import PharmacyChain
33
- from rxfoundry.clients.swifty_api.models.pharmacy_other_identifier import PharmacyOtherIdentifier
34
- from rxfoundry.clients.swifty_api.models.pharmacy_program_pricing import PharmacyProgramPricing
35
- from rxfoundry.clients.swifty_api.models.prescriber import Prescriber
36
- from rxfoundry.clients.swifty_api.models.prescription import Prescription
37
- from rxfoundry.clients.swifty_api.models.prescription_change_request import PrescriptionChangeRequest
38
- from rxfoundry.clients.swifty_api.models.prescription_issue import PrescriptionIssue
39
- from rxfoundry.clients.swifty_api.models.prescription_patch import PrescriptionPatch
40
- from rxfoundry.clients.swifty_api.models.prescription_task import PrescriptionTask
41
- from rxfoundry.clients.swifty_api.models.prescription_task_status import PrescriptionTaskStatus
42
- from rxfoundry.clients.swifty_api.models.prescription_transfer_request import PrescriptionTransferRequest
43
- from rxfoundry.clients.swifty_api.models.prescription_verification import PrescriptionVerification
44
- from rxfoundry.clients.swifty_api.models.pricing_program import PricingProgram
45
- from rxfoundry.clients.swifty_api.models.surescripts_message import SurescriptsMessage
46
- from rxfoundry.clients.swifty_api.models.token import Token
47
- from rxfoundry.clients.swifty_api.models.user import User
48
- from rxfoundry.clients.swifty_api.models.version import Version
49
- from rxfoundry.clients.swifty_api.models.virtual_pharmacy import VirtualPharmacy
50
- from rxfoundry.clients.swifty_api.models.workflow_request import WorkflowRequest
@@ -1,106 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX Backend
7
-
8
- The version of the OpenAPI document: 0.1.DEV-0
9
- Contact: paul.tindall@rxfoundry.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional, Union
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class Address(BaseModel):
27
- """
28
- Address
29
- """ # noqa: E501
30
- uuid: Optional[StrictStr] = None
31
- address_line_one: Optional[StrictStr] = None
32
- address_line_two: Optional[StrictStr] = None
33
- city: Optional[StrictStr] = None
34
- state_province: Optional[StrictStr] = None
35
- postal_code: Optional[StrictStr] = None
36
- country_code: Optional[StrictStr] = None
37
- longitude: Optional[Union[StrictFloat, StrictInt]] = None
38
- latitude: Optional[Union[StrictFloat, StrictInt]] = None
39
- distance: Optional[Union[StrictFloat, StrictInt]] = None
40
- __properties: ClassVar[List[str]] = ["uuid", "address_line_one", "address_line_two", "city", "state_province", "postal_code", "country_code", "longitude", "latitude", "distance"]
41
-
42
- model_config = ConfigDict(
43
- populate_by_name=True,
44
- validate_assignment=True,
45
- protected_namespaces=(),
46
- )
47
-
48
-
49
- def to_str(self) -> str:
50
- """Returns the string representation of the model using alias"""
51
- return pprint.pformat(self.model_dump(by_alias=True))
52
-
53
- def to_json(self) -> str:
54
- """Returns the JSON representation of the model using alias"""
55
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
- return json.dumps(self.to_dict())
57
-
58
- @classmethod
59
- def from_json(cls, json_str: str) -> Optional[Self]:
60
- """Create an instance of Address from a JSON string"""
61
- return cls.from_dict(json.loads(json_str))
62
-
63
- def to_dict(self) -> Dict[str, Any]:
64
- """Return the dictionary representation of the model using alias.
65
-
66
- This has the following differences from calling pydantic's
67
- `self.model_dump(by_alias=True)`:
68
-
69
- * `None` is only added to the output dict for nullable fields that
70
- were set at model initialization. Other fields with value `None`
71
- are ignored.
72
- """
73
- excluded_fields: Set[str] = set([
74
- ])
75
-
76
- _dict = self.model_dump(
77
- by_alias=True,
78
- exclude=excluded_fields,
79
- exclude_none=True,
80
- )
81
- return _dict
82
-
83
- @classmethod
84
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
- """Create an instance of Address from a dict"""
86
- if obj is None:
87
- return None
88
-
89
- if not isinstance(obj, dict):
90
- return cls.model_validate(obj)
91
-
92
- _obj = cls.model_validate({
93
- "uuid": obj.get("uuid"),
94
- "address_line_one": obj.get("address_line_one"),
95
- "address_line_two": obj.get("address_line_two"),
96
- "city": obj.get("city"),
97
- "state_province": obj.get("state_province"),
98
- "postal_code": obj.get("postal_code"),
99
- "country_code": obj.get("country_code"),
100
- "longitude": obj.get("longitude"),
101
- "latitude": obj.get("latitude"),
102
- "distance": obj.get("distance")
103
- })
104
- return _obj
105
-
106
-
@@ -1,90 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX Backend
7
-
8
- The version of the OpenAPI document: 0.1.DEV-0
9
- Contact: paul.tindall@rxfoundry.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class AsynchronousResponse(BaseModel):
27
- """
28
- AsynchronousResponse
29
- """ # noqa: E501
30
- status: Optional[StrictStr] = None
31
- message_id: Optional[StrictStr] = None
32
- __properties: ClassVar[List[str]] = ["status", "message_id"]
33
-
34
- model_config = ConfigDict(
35
- populate_by_name=True,
36
- validate_assignment=True,
37
- protected_namespaces=(),
38
- )
39
-
40
-
41
- def to_str(self) -> str:
42
- """Returns the string representation of the model using alias"""
43
- return pprint.pformat(self.model_dump(by_alias=True))
44
-
45
- def to_json(self) -> str:
46
- """Returns the JSON representation of the model using alias"""
47
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
- return json.dumps(self.to_dict())
49
-
50
- @classmethod
51
- def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of AsynchronousResponse from a JSON string"""
53
- return cls.from_dict(json.loads(json_str))
54
-
55
- def to_dict(self) -> Dict[str, Any]:
56
- """Return the dictionary representation of the model using alias.
57
-
58
- This has the following differences from calling pydantic's
59
- `self.model_dump(by_alias=True)`:
60
-
61
- * `None` is only added to the output dict for nullable fields that
62
- were set at model initialization. Other fields with value `None`
63
- are ignored.
64
- """
65
- excluded_fields: Set[str] = set([
66
- ])
67
-
68
- _dict = self.model_dump(
69
- by_alias=True,
70
- exclude=excluded_fields,
71
- exclude_none=True,
72
- )
73
- return _dict
74
-
75
- @classmethod
76
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
- """Create an instance of AsynchronousResponse from a dict"""
78
- if obj is None:
79
- return None
80
-
81
- if not isinstance(obj, dict):
82
- return cls.model_validate(obj)
83
-
84
- _obj = cls.model_validate({
85
- "status": obj.get("status"),
86
- "message_id": obj.get("message_id")
87
- })
88
- return _obj
89
-
90
-
@@ -1,92 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX Backend
7
-
8
- The version of the OpenAPI document: 0.1.DEV-0
9
- Contact: paul.tindall@rxfoundry.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class Code(BaseModel):
27
- """
28
- Code
29
- """ # noqa: E501
30
- uuid: Optional[StrictStr] = None
31
- code: Optional[StrictStr] = None
32
- description: Optional[StrictStr] = None
33
- __properties: ClassVar[List[str]] = ["uuid", "code", "description"]
34
-
35
- model_config = ConfigDict(
36
- populate_by_name=True,
37
- validate_assignment=True,
38
- protected_namespaces=(),
39
- )
40
-
41
-
42
- def to_str(self) -> str:
43
- """Returns the string representation of the model using alias"""
44
- return pprint.pformat(self.model_dump(by_alias=True))
45
-
46
- def to_json(self) -> str:
47
- """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
50
-
51
- @classmethod
52
- def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of Code from a JSON string"""
54
- return cls.from_dict(json.loads(json_str))
55
-
56
- def to_dict(self) -> Dict[str, Any]:
57
- """Return the dictionary representation of the model using alias.
58
-
59
- This has the following differences from calling pydantic's
60
- `self.model_dump(by_alias=True)`:
61
-
62
- * `None` is only added to the output dict for nullable fields that
63
- were set at model initialization. Other fields with value `None`
64
- are ignored.
65
- """
66
- excluded_fields: Set[str] = set([
67
- ])
68
-
69
- _dict = self.model_dump(
70
- by_alias=True,
71
- exclude=excluded_fields,
72
- exclude_none=True,
73
- )
74
- return _dict
75
-
76
- @classmethod
77
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
- """Create an instance of Code from a dict"""
79
- if obj is None:
80
- return None
81
-
82
- if not isinstance(obj, dict):
83
- return cls.model_validate(obj)
84
-
85
- _obj = cls.model_validate({
86
- "uuid": obj.get("uuid"),
87
- "code": obj.get("code"),
88
- "description": obj.get("description")
89
- })
90
- return _obj
91
-
92
-
@@ -1,96 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- P2RX API
5
-
6
- API for the P2RX Backend
7
-
8
- The version of the OpenAPI document: 0.1.DEV-0
9
- Contact: paul.tindall@rxfoundry.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
-
16
- from __future__ import annotations
17
- import pprint
18
- import re # noqa: F401
19
- import json
20
-
21
- from pydantic import BaseModel, ConfigDict, StrictStr
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from rxfoundry.clients.swifty_api.models.code import Code
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class CodeQualifierCode(BaseModel):
28
- """
29
- CodeQualifierCode
30
- """ # noqa: E501
31
- uuid: Optional[StrictStr] = None
32
- code_qualifier: Optional[Code] = None
33
- code: Optional[StrictStr] = None
34
- __properties: ClassVar[List[str]] = ["uuid", "code_qualifier", "code"]
35
-
36
- model_config = ConfigDict(
37
- populate_by_name=True,
38
- validate_assignment=True,
39
- protected_namespaces=(),
40
- )
41
-
42
-
43
- def to_str(self) -> str:
44
- """Returns the string representation of the model using alias"""
45
- return pprint.pformat(self.model_dump(by_alias=True))
46
-
47
- def to_json(self) -> str:
48
- """Returns the JSON representation of the model using alias"""
49
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
- return json.dumps(self.to_dict())
51
-
52
- @classmethod
53
- def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of CodeQualifierCode from a JSON string"""
55
- return cls.from_dict(json.loads(json_str))
56
-
57
- def to_dict(self) -> Dict[str, Any]:
58
- """Return the dictionary representation of the model using alias.
59
-
60
- This has the following differences from calling pydantic's
61
- `self.model_dump(by_alias=True)`:
62
-
63
- * `None` is only added to the output dict for nullable fields that
64
- were set at model initialization. Other fields with value `None`
65
- are ignored.
66
- """
67
- excluded_fields: Set[str] = set([
68
- ])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- # override the default output from pydantic by calling `to_dict()` of code_qualifier
76
- if self.code_qualifier:
77
- _dict['code_qualifier'] = self.code_qualifier.to_dict()
78
- return _dict
79
-
80
- @classmethod
81
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
- """Create an instance of CodeQualifierCode from a dict"""
83
- if obj is None:
84
- return None
85
-
86
- if not isinstance(obj, dict):
87
- return cls.model_validate(obj)
88
-
89
- _obj = cls.model_validate({
90
- "uuid": obj.get("uuid"),
91
- "code_qualifier": Code.from_dict(obj["code_qualifier"]) if obj.get("code_qualifier") is not None else None,
92
- "code": obj.get("code")
93
- })
94
- return _obj
95
-
96
-