benchling-api-client 2.0.415__py3-none-any.whl → 2.0.416__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.
- benchling_api_client/models/container_content.py +183 -26
- benchling_api_client/models/entity.py +19 -7
- benchling_api_client/models/entity_or_inaccessible_resource.py +19 -7
- benchling_api_client/models/molecule_with_entity_type.py +787 -0
- benchling_api_client/models/molecule_with_entity_type_entity_type.py +22 -0
- benchling_api_client/models/registered_entities_list.py +89 -32
- benchling_api_client/models/request_response_samples_item_entity.py +216 -74
- benchling_api_client/models/rna_sequence_with_entity_type.py +1151 -0
- benchling_api_client/models/rna_sequence_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/aa_sequence_with_entity_type.py +865 -0
- benchling_api_client/v2/beta/models/aa_sequence_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/container_content.py +183 -26
- benchling_api_client/v2/beta/models/custom_entity_creator.py +2 -100
- benchling_api_client/v2/beta/models/custom_entity_with_entity_type.py +747 -0
- benchling_api_client/v2/beta/models/custom_entity_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/dna_oligo_with_entity_type.py +972 -0
- benchling_api_client/v2/beta/models/dna_oligo_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/dna_sequence_with_entity_type.py +1102 -0
- benchling_api_client/v2/beta/models/dna_sequence_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/entity.py +19 -7
- benchling_api_client/v2/beta/models/entity_or_inaccessible_resource.py +19 -7
- benchling_api_client/v2/beta/models/mixture_creator.py +2 -100
- benchling_api_client/v2/beta/models/mixture_with_entity_type.py +867 -0
- benchling_api_client/v2/beta/models/mixture_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/molecule_with_entity_type.py +787 -0
- benchling_api_client/v2/beta/models/molecule_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/rna_oligo_with_entity_type.py +972 -0
- benchling_api_client/v2/beta/models/rna_oligo_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/models/rna_sequence.py +1109 -0
- benchling_api_client/v2/beta/models/rna_sequence_part.py +183 -0
- benchling_api_client/v2/beta/models/rna_sequence_with_entity_type.py +1151 -0
- benchling_api_client/v2/beta/models/rna_sequence_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/beta/openapi.yaml +216 -6
- benchling_api_client/v2/stable/models/container_content.py +183 -26
- benchling_api_client/v2/stable/models/entity.py +19 -7
- benchling_api_client/v2/stable/models/entity_or_inaccessible_resource.py +19 -7
- benchling_api_client/v2/stable/models/molecule_with_entity_type.py +787 -0
- benchling_api_client/v2/stable/models/molecule_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/stable/models/registered_entities_list.py +89 -32
- benchling_api_client/v2/stable/models/request_response_samples_item_entity.py +216 -74
- benchling_api_client/v2/stable/models/rna_sequence_with_entity_type.py +1151 -0
- benchling_api_client/v2/stable/models/rna_sequence_with_entity_type_entity_type.py +22 -0
- benchling_api_client/v2/stable/openapi.yaml +40 -22
- {benchling_api_client-2.0.415.dist-info → benchling_api_client-2.0.416.dist-info}/METADATA +1 -1
- {benchling_api_client-2.0.415.dist-info → benchling_api_client-2.0.416.dist-info}/RECORD +47 -21
- {benchling_api_client-2.0.415.dist-info → benchling_api_client-2.0.416.dist-info}/LICENSE +0 -0
- {benchling_api_client-2.0.415.dist-info → benchling_api_client-2.0.416.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from typing import Any, cast, Dict, List, Optional, Type, TypeVar, Union
|
|
3
|
+
|
|
4
|
+
import attr
|
|
5
|
+
from dateutil.parser import isoparse
|
|
6
|
+
|
|
7
|
+
from ..extensions import NotPresentError
|
|
8
|
+
from ..models.archive_record import ArchiveRecord
|
|
9
|
+
from ..models.custom_fields import CustomFields
|
|
10
|
+
from ..models.fields import Fields
|
|
11
|
+
from ..models.ingredient import Ingredient
|
|
12
|
+
from ..models.mixture_creator import MixtureCreator
|
|
13
|
+
from ..models.mixture_measurement_units import MixtureMeasurementUnits
|
|
14
|
+
from ..models.mixture_with_entity_type_entity_type import MixtureWithEntityTypeEntityType
|
|
15
|
+
from ..models.registration_origin import RegistrationOrigin
|
|
16
|
+
from ..models.schema_summary import SchemaSummary
|
|
17
|
+
from ..models.user_summary import UserSummary
|
|
18
|
+
from ..types import UNSET, Unset
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="MixtureWithEntityType")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@attr.s(auto_attribs=True, repr=False)
|
|
24
|
+
class MixtureWithEntityType:
|
|
25
|
+
""" """
|
|
26
|
+
|
|
27
|
+
_entity_type: Union[Unset, MixtureWithEntityTypeEntityType] = UNSET
|
|
28
|
+
_aliases: Union[Unset, List[str]] = UNSET
|
|
29
|
+
_allow_measured_ingredients: Union[Unset, bool] = UNSET
|
|
30
|
+
_amount: Union[Unset, str] = UNSET
|
|
31
|
+
_api_url: Union[Unset, str] = UNSET
|
|
32
|
+
_archive_record: Union[Unset, None, ArchiveRecord] = UNSET
|
|
33
|
+
_authors: Union[Unset, List[UserSummary]] = UNSET
|
|
34
|
+
_created_at: Union[Unset, datetime.datetime] = UNSET
|
|
35
|
+
_creator: Union[Unset, MixtureCreator] = UNSET
|
|
36
|
+
_custom_fields: Union[Unset, CustomFields] = UNSET
|
|
37
|
+
_entity_registry_id: Union[Unset, None, str] = UNSET
|
|
38
|
+
_fields: Union[Unset, Fields] = UNSET
|
|
39
|
+
_folder_id: Union[Unset, None, str] = UNSET
|
|
40
|
+
_id: Union[Unset, str] = UNSET
|
|
41
|
+
_ingredients: Union[Unset, List[Ingredient]] = UNSET
|
|
42
|
+
_modified_at: Union[Unset, datetime.datetime] = UNSET
|
|
43
|
+
_name: Union[Unset, str] = UNSET
|
|
44
|
+
_registration_origin: Union[Unset, None, RegistrationOrigin] = UNSET
|
|
45
|
+
_registry_id: Union[Unset, None, str] = UNSET
|
|
46
|
+
_schema: Union[Unset, SchemaSummary] = UNSET
|
|
47
|
+
_units: Union[Unset, MixtureMeasurementUnits] = UNSET
|
|
48
|
+
_web_url: Union[Unset, str] = UNSET
|
|
49
|
+
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
50
|
+
|
|
51
|
+
def __repr__(self):
|
|
52
|
+
fields = []
|
|
53
|
+
fields.append("entity_type={}".format(repr(self._entity_type)))
|
|
54
|
+
fields.append("aliases={}".format(repr(self._aliases)))
|
|
55
|
+
fields.append("allow_measured_ingredients={}".format(repr(self._allow_measured_ingredients)))
|
|
56
|
+
fields.append("amount={}".format(repr(self._amount)))
|
|
57
|
+
fields.append("api_url={}".format(repr(self._api_url)))
|
|
58
|
+
fields.append("archive_record={}".format(repr(self._archive_record)))
|
|
59
|
+
fields.append("authors={}".format(repr(self._authors)))
|
|
60
|
+
fields.append("created_at={}".format(repr(self._created_at)))
|
|
61
|
+
fields.append("creator={}".format(repr(self._creator)))
|
|
62
|
+
fields.append("custom_fields={}".format(repr(self._custom_fields)))
|
|
63
|
+
fields.append("entity_registry_id={}".format(repr(self._entity_registry_id)))
|
|
64
|
+
fields.append("fields={}".format(repr(self._fields)))
|
|
65
|
+
fields.append("folder_id={}".format(repr(self._folder_id)))
|
|
66
|
+
fields.append("id={}".format(repr(self._id)))
|
|
67
|
+
fields.append("ingredients={}".format(repr(self._ingredients)))
|
|
68
|
+
fields.append("modified_at={}".format(repr(self._modified_at)))
|
|
69
|
+
fields.append("name={}".format(repr(self._name)))
|
|
70
|
+
fields.append("registration_origin={}".format(repr(self._registration_origin)))
|
|
71
|
+
fields.append("registry_id={}".format(repr(self._registry_id)))
|
|
72
|
+
fields.append("schema={}".format(repr(self._schema)))
|
|
73
|
+
fields.append("units={}".format(repr(self._units)))
|
|
74
|
+
fields.append("web_url={}".format(repr(self._web_url)))
|
|
75
|
+
fields.append("additional_properties={}".format(repr(self.additional_properties)))
|
|
76
|
+
return "MixtureWithEntityType({})".format(", ".join(fields))
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
79
|
+
entity_type: Union[Unset, int] = UNSET
|
|
80
|
+
if not isinstance(self._entity_type, Unset):
|
|
81
|
+
entity_type = self._entity_type.value
|
|
82
|
+
|
|
83
|
+
aliases: Union[Unset, List[Any]] = UNSET
|
|
84
|
+
if not isinstance(self._aliases, Unset):
|
|
85
|
+
aliases = self._aliases
|
|
86
|
+
|
|
87
|
+
allow_measured_ingredients = self._allow_measured_ingredients
|
|
88
|
+
amount = self._amount
|
|
89
|
+
api_url = self._api_url
|
|
90
|
+
archive_record: Union[Unset, None, Dict[str, Any]] = UNSET
|
|
91
|
+
if not isinstance(self._archive_record, Unset):
|
|
92
|
+
archive_record = self._archive_record.to_dict() if self._archive_record else None
|
|
93
|
+
|
|
94
|
+
authors: Union[Unset, List[Any]] = UNSET
|
|
95
|
+
if not isinstance(self._authors, Unset):
|
|
96
|
+
authors = []
|
|
97
|
+
for authors_item_data in self._authors:
|
|
98
|
+
authors_item = authors_item_data.to_dict()
|
|
99
|
+
|
|
100
|
+
authors.append(authors_item)
|
|
101
|
+
|
|
102
|
+
created_at: Union[Unset, str] = UNSET
|
|
103
|
+
if not isinstance(self._created_at, Unset):
|
|
104
|
+
created_at = self._created_at.isoformat()
|
|
105
|
+
|
|
106
|
+
creator: Union[Unset, Dict[str, Any]] = UNSET
|
|
107
|
+
if not isinstance(self._creator, Unset):
|
|
108
|
+
creator = self._creator.to_dict()
|
|
109
|
+
|
|
110
|
+
custom_fields: Union[Unset, Dict[str, Any]] = UNSET
|
|
111
|
+
if not isinstance(self._custom_fields, Unset):
|
|
112
|
+
custom_fields = self._custom_fields.to_dict()
|
|
113
|
+
|
|
114
|
+
entity_registry_id = self._entity_registry_id
|
|
115
|
+
fields: Union[Unset, Dict[str, Any]] = UNSET
|
|
116
|
+
if not isinstance(self._fields, Unset):
|
|
117
|
+
fields = self._fields.to_dict()
|
|
118
|
+
|
|
119
|
+
folder_id = self._folder_id
|
|
120
|
+
id = self._id
|
|
121
|
+
ingredients: Union[Unset, List[Any]] = UNSET
|
|
122
|
+
if not isinstance(self._ingredients, Unset):
|
|
123
|
+
ingredients = []
|
|
124
|
+
for ingredients_item_data in self._ingredients:
|
|
125
|
+
ingredients_item = ingredients_item_data.to_dict()
|
|
126
|
+
|
|
127
|
+
ingredients.append(ingredients_item)
|
|
128
|
+
|
|
129
|
+
modified_at: Union[Unset, str] = UNSET
|
|
130
|
+
if not isinstance(self._modified_at, Unset):
|
|
131
|
+
modified_at = self._modified_at.isoformat()
|
|
132
|
+
|
|
133
|
+
name = self._name
|
|
134
|
+
registration_origin: Union[Unset, None, Dict[str, Any]] = UNSET
|
|
135
|
+
if not isinstance(self._registration_origin, Unset):
|
|
136
|
+
registration_origin = self._registration_origin.to_dict() if self._registration_origin else None
|
|
137
|
+
|
|
138
|
+
registry_id = self._registry_id
|
|
139
|
+
schema: Union[Unset, Dict[str, Any]] = UNSET
|
|
140
|
+
if not isinstance(self._schema, Unset):
|
|
141
|
+
schema = self._schema.to_dict()
|
|
142
|
+
|
|
143
|
+
units: Union[Unset, int] = UNSET
|
|
144
|
+
if not isinstance(self._units, Unset):
|
|
145
|
+
units = self._units.value
|
|
146
|
+
|
|
147
|
+
web_url = self._web_url
|
|
148
|
+
|
|
149
|
+
field_dict: Dict[str, Any] = {}
|
|
150
|
+
field_dict.update(self.additional_properties)
|
|
151
|
+
# Allow the model to serialize even if it was created outside of the constructor, circumventing validation
|
|
152
|
+
if entity_type is not UNSET:
|
|
153
|
+
field_dict["entityType"] = entity_type
|
|
154
|
+
if aliases is not UNSET:
|
|
155
|
+
field_dict["aliases"] = aliases
|
|
156
|
+
if allow_measured_ingredients is not UNSET:
|
|
157
|
+
field_dict["allowMeasuredIngredients"] = allow_measured_ingredients
|
|
158
|
+
if amount is not UNSET:
|
|
159
|
+
field_dict["amount"] = amount
|
|
160
|
+
if api_url is not UNSET:
|
|
161
|
+
field_dict["apiURL"] = api_url
|
|
162
|
+
if archive_record is not UNSET:
|
|
163
|
+
field_dict["archiveRecord"] = archive_record
|
|
164
|
+
if authors is not UNSET:
|
|
165
|
+
field_dict["authors"] = authors
|
|
166
|
+
if created_at is not UNSET:
|
|
167
|
+
field_dict["createdAt"] = created_at
|
|
168
|
+
if creator is not UNSET:
|
|
169
|
+
field_dict["creator"] = creator
|
|
170
|
+
if custom_fields is not UNSET:
|
|
171
|
+
field_dict["customFields"] = custom_fields
|
|
172
|
+
if entity_registry_id is not UNSET:
|
|
173
|
+
field_dict["entityRegistryId"] = entity_registry_id
|
|
174
|
+
if fields is not UNSET:
|
|
175
|
+
field_dict["fields"] = fields
|
|
176
|
+
if folder_id is not UNSET:
|
|
177
|
+
field_dict["folderId"] = folder_id
|
|
178
|
+
if id is not UNSET:
|
|
179
|
+
field_dict["id"] = id
|
|
180
|
+
if ingredients is not UNSET:
|
|
181
|
+
field_dict["ingredients"] = ingredients
|
|
182
|
+
if modified_at is not UNSET:
|
|
183
|
+
field_dict["modifiedAt"] = modified_at
|
|
184
|
+
if name is not UNSET:
|
|
185
|
+
field_dict["name"] = name
|
|
186
|
+
if registration_origin is not UNSET:
|
|
187
|
+
field_dict["registrationOrigin"] = registration_origin
|
|
188
|
+
if registry_id is not UNSET:
|
|
189
|
+
field_dict["registryId"] = registry_id
|
|
190
|
+
if schema is not UNSET:
|
|
191
|
+
field_dict["schema"] = schema
|
|
192
|
+
if units is not UNSET:
|
|
193
|
+
field_dict["units"] = units
|
|
194
|
+
if web_url is not UNSET:
|
|
195
|
+
field_dict["webURL"] = web_url
|
|
196
|
+
|
|
197
|
+
return field_dict
|
|
198
|
+
|
|
199
|
+
@classmethod
|
|
200
|
+
def from_dict(cls: Type[T], src_dict: Dict[str, Any], strict: bool = False) -> T:
|
|
201
|
+
d = src_dict.copy()
|
|
202
|
+
|
|
203
|
+
def get_entity_type() -> Union[Unset, MixtureWithEntityTypeEntityType]:
|
|
204
|
+
entity_type = UNSET
|
|
205
|
+
_entity_type = d.pop("entityType")
|
|
206
|
+
if _entity_type is not None and _entity_type is not UNSET:
|
|
207
|
+
try:
|
|
208
|
+
entity_type = MixtureWithEntityTypeEntityType(_entity_type)
|
|
209
|
+
except ValueError:
|
|
210
|
+
entity_type = MixtureWithEntityTypeEntityType.of_unknown(_entity_type)
|
|
211
|
+
|
|
212
|
+
return entity_type
|
|
213
|
+
|
|
214
|
+
try:
|
|
215
|
+
entity_type = get_entity_type()
|
|
216
|
+
except KeyError:
|
|
217
|
+
if strict:
|
|
218
|
+
raise
|
|
219
|
+
entity_type = cast(Union[Unset, MixtureWithEntityTypeEntityType], UNSET)
|
|
220
|
+
|
|
221
|
+
def get_aliases() -> Union[Unset, List[str]]:
|
|
222
|
+
aliases = cast(List[str], d.pop("aliases"))
|
|
223
|
+
|
|
224
|
+
return aliases
|
|
225
|
+
|
|
226
|
+
try:
|
|
227
|
+
aliases = get_aliases()
|
|
228
|
+
except KeyError:
|
|
229
|
+
if strict:
|
|
230
|
+
raise
|
|
231
|
+
aliases = cast(Union[Unset, List[str]], UNSET)
|
|
232
|
+
|
|
233
|
+
def get_allow_measured_ingredients() -> Union[Unset, bool]:
|
|
234
|
+
allow_measured_ingredients = d.pop("allowMeasuredIngredients")
|
|
235
|
+
return allow_measured_ingredients
|
|
236
|
+
|
|
237
|
+
try:
|
|
238
|
+
allow_measured_ingredients = get_allow_measured_ingredients()
|
|
239
|
+
except KeyError:
|
|
240
|
+
if strict:
|
|
241
|
+
raise
|
|
242
|
+
allow_measured_ingredients = cast(Union[Unset, bool], UNSET)
|
|
243
|
+
|
|
244
|
+
def get_amount() -> Union[Unset, str]:
|
|
245
|
+
amount = d.pop("amount")
|
|
246
|
+
return amount
|
|
247
|
+
|
|
248
|
+
try:
|
|
249
|
+
amount = get_amount()
|
|
250
|
+
except KeyError:
|
|
251
|
+
if strict:
|
|
252
|
+
raise
|
|
253
|
+
amount = cast(Union[Unset, str], UNSET)
|
|
254
|
+
|
|
255
|
+
def get_api_url() -> Union[Unset, str]:
|
|
256
|
+
api_url = d.pop("apiURL")
|
|
257
|
+
return api_url
|
|
258
|
+
|
|
259
|
+
try:
|
|
260
|
+
api_url = get_api_url()
|
|
261
|
+
except KeyError:
|
|
262
|
+
if strict:
|
|
263
|
+
raise
|
|
264
|
+
api_url = cast(Union[Unset, str], UNSET)
|
|
265
|
+
|
|
266
|
+
def get_archive_record() -> Union[Unset, None, ArchiveRecord]:
|
|
267
|
+
archive_record = None
|
|
268
|
+
_archive_record = d.pop("archiveRecord")
|
|
269
|
+
|
|
270
|
+
if _archive_record is not None and not isinstance(_archive_record, Unset):
|
|
271
|
+
archive_record = ArchiveRecord.from_dict(_archive_record)
|
|
272
|
+
|
|
273
|
+
return archive_record
|
|
274
|
+
|
|
275
|
+
try:
|
|
276
|
+
archive_record = get_archive_record()
|
|
277
|
+
except KeyError:
|
|
278
|
+
if strict:
|
|
279
|
+
raise
|
|
280
|
+
archive_record = cast(Union[Unset, None, ArchiveRecord], UNSET)
|
|
281
|
+
|
|
282
|
+
def get_authors() -> Union[Unset, List[UserSummary]]:
|
|
283
|
+
authors = []
|
|
284
|
+
_authors = d.pop("authors")
|
|
285
|
+
for authors_item_data in _authors or []:
|
|
286
|
+
authors_item = UserSummary.from_dict(authors_item_data, strict=False)
|
|
287
|
+
|
|
288
|
+
authors.append(authors_item)
|
|
289
|
+
|
|
290
|
+
return authors
|
|
291
|
+
|
|
292
|
+
try:
|
|
293
|
+
authors = get_authors()
|
|
294
|
+
except KeyError:
|
|
295
|
+
if strict:
|
|
296
|
+
raise
|
|
297
|
+
authors = cast(Union[Unset, List[UserSummary]], UNSET)
|
|
298
|
+
|
|
299
|
+
def get_created_at() -> Union[Unset, datetime.datetime]:
|
|
300
|
+
created_at: Union[Unset, datetime.datetime] = UNSET
|
|
301
|
+
_created_at = d.pop("createdAt")
|
|
302
|
+
if _created_at is not None and not isinstance(_created_at, Unset):
|
|
303
|
+
created_at = isoparse(cast(str, _created_at))
|
|
304
|
+
|
|
305
|
+
return created_at
|
|
306
|
+
|
|
307
|
+
try:
|
|
308
|
+
created_at = get_created_at()
|
|
309
|
+
except KeyError:
|
|
310
|
+
if strict:
|
|
311
|
+
raise
|
|
312
|
+
created_at = cast(Union[Unset, datetime.datetime], UNSET)
|
|
313
|
+
|
|
314
|
+
def get_creator() -> Union[Unset, MixtureCreator]:
|
|
315
|
+
creator: Union[Unset, Union[Unset, MixtureCreator]] = UNSET
|
|
316
|
+
_creator = d.pop("creator")
|
|
317
|
+
|
|
318
|
+
if not isinstance(_creator, Unset):
|
|
319
|
+
creator = MixtureCreator.from_dict(_creator)
|
|
320
|
+
|
|
321
|
+
return creator
|
|
322
|
+
|
|
323
|
+
try:
|
|
324
|
+
creator = get_creator()
|
|
325
|
+
except KeyError:
|
|
326
|
+
if strict:
|
|
327
|
+
raise
|
|
328
|
+
creator = cast(Union[Unset, MixtureCreator], UNSET)
|
|
329
|
+
|
|
330
|
+
def get_custom_fields() -> Union[Unset, CustomFields]:
|
|
331
|
+
custom_fields: Union[Unset, Union[Unset, CustomFields]] = UNSET
|
|
332
|
+
_custom_fields = d.pop("customFields")
|
|
333
|
+
|
|
334
|
+
if not isinstance(_custom_fields, Unset):
|
|
335
|
+
custom_fields = CustomFields.from_dict(_custom_fields)
|
|
336
|
+
|
|
337
|
+
return custom_fields
|
|
338
|
+
|
|
339
|
+
try:
|
|
340
|
+
custom_fields = get_custom_fields()
|
|
341
|
+
except KeyError:
|
|
342
|
+
if strict:
|
|
343
|
+
raise
|
|
344
|
+
custom_fields = cast(Union[Unset, CustomFields], UNSET)
|
|
345
|
+
|
|
346
|
+
def get_entity_registry_id() -> Union[Unset, None, str]:
|
|
347
|
+
entity_registry_id = d.pop("entityRegistryId")
|
|
348
|
+
return entity_registry_id
|
|
349
|
+
|
|
350
|
+
try:
|
|
351
|
+
entity_registry_id = get_entity_registry_id()
|
|
352
|
+
except KeyError:
|
|
353
|
+
if strict:
|
|
354
|
+
raise
|
|
355
|
+
entity_registry_id = cast(Union[Unset, None, str], UNSET)
|
|
356
|
+
|
|
357
|
+
def get_fields() -> Union[Unset, Fields]:
|
|
358
|
+
fields: Union[Unset, Union[Unset, Fields]] = UNSET
|
|
359
|
+
_fields = d.pop("fields")
|
|
360
|
+
|
|
361
|
+
if not isinstance(_fields, Unset):
|
|
362
|
+
fields = Fields.from_dict(_fields)
|
|
363
|
+
|
|
364
|
+
return fields
|
|
365
|
+
|
|
366
|
+
try:
|
|
367
|
+
fields = get_fields()
|
|
368
|
+
except KeyError:
|
|
369
|
+
if strict:
|
|
370
|
+
raise
|
|
371
|
+
fields = cast(Union[Unset, Fields], UNSET)
|
|
372
|
+
|
|
373
|
+
def get_folder_id() -> Union[Unset, None, str]:
|
|
374
|
+
folder_id = d.pop("folderId")
|
|
375
|
+
return folder_id
|
|
376
|
+
|
|
377
|
+
try:
|
|
378
|
+
folder_id = get_folder_id()
|
|
379
|
+
except KeyError:
|
|
380
|
+
if strict:
|
|
381
|
+
raise
|
|
382
|
+
folder_id = cast(Union[Unset, None, str], UNSET)
|
|
383
|
+
|
|
384
|
+
def get_id() -> Union[Unset, str]:
|
|
385
|
+
id = d.pop("id")
|
|
386
|
+
return id
|
|
387
|
+
|
|
388
|
+
try:
|
|
389
|
+
id = get_id()
|
|
390
|
+
except KeyError:
|
|
391
|
+
if strict:
|
|
392
|
+
raise
|
|
393
|
+
id = cast(Union[Unset, str], UNSET)
|
|
394
|
+
|
|
395
|
+
def get_ingredients() -> Union[Unset, List[Ingredient]]:
|
|
396
|
+
ingredients = []
|
|
397
|
+
_ingredients = d.pop("ingredients")
|
|
398
|
+
for ingredients_item_data in _ingredients or []:
|
|
399
|
+
ingredients_item = Ingredient.from_dict(ingredients_item_data, strict=False)
|
|
400
|
+
|
|
401
|
+
ingredients.append(ingredients_item)
|
|
402
|
+
|
|
403
|
+
return ingredients
|
|
404
|
+
|
|
405
|
+
try:
|
|
406
|
+
ingredients = get_ingredients()
|
|
407
|
+
except KeyError:
|
|
408
|
+
if strict:
|
|
409
|
+
raise
|
|
410
|
+
ingredients = cast(Union[Unset, List[Ingredient]], UNSET)
|
|
411
|
+
|
|
412
|
+
def get_modified_at() -> Union[Unset, datetime.datetime]:
|
|
413
|
+
modified_at: Union[Unset, datetime.datetime] = UNSET
|
|
414
|
+
_modified_at = d.pop("modifiedAt")
|
|
415
|
+
if _modified_at is not None and not isinstance(_modified_at, Unset):
|
|
416
|
+
modified_at = isoparse(cast(str, _modified_at))
|
|
417
|
+
|
|
418
|
+
return modified_at
|
|
419
|
+
|
|
420
|
+
try:
|
|
421
|
+
modified_at = get_modified_at()
|
|
422
|
+
except KeyError:
|
|
423
|
+
if strict:
|
|
424
|
+
raise
|
|
425
|
+
modified_at = cast(Union[Unset, datetime.datetime], UNSET)
|
|
426
|
+
|
|
427
|
+
def get_name() -> Union[Unset, str]:
|
|
428
|
+
name = d.pop("name")
|
|
429
|
+
return name
|
|
430
|
+
|
|
431
|
+
try:
|
|
432
|
+
name = get_name()
|
|
433
|
+
except KeyError:
|
|
434
|
+
if strict:
|
|
435
|
+
raise
|
|
436
|
+
name = cast(Union[Unset, str], UNSET)
|
|
437
|
+
|
|
438
|
+
def get_registration_origin() -> Union[Unset, None, RegistrationOrigin]:
|
|
439
|
+
registration_origin = None
|
|
440
|
+
_registration_origin = d.pop("registrationOrigin")
|
|
441
|
+
|
|
442
|
+
if _registration_origin is not None and not isinstance(_registration_origin, Unset):
|
|
443
|
+
registration_origin = RegistrationOrigin.from_dict(_registration_origin)
|
|
444
|
+
|
|
445
|
+
return registration_origin
|
|
446
|
+
|
|
447
|
+
try:
|
|
448
|
+
registration_origin = get_registration_origin()
|
|
449
|
+
except KeyError:
|
|
450
|
+
if strict:
|
|
451
|
+
raise
|
|
452
|
+
registration_origin = cast(Union[Unset, None, RegistrationOrigin], UNSET)
|
|
453
|
+
|
|
454
|
+
def get_registry_id() -> Union[Unset, None, str]:
|
|
455
|
+
registry_id = d.pop("registryId")
|
|
456
|
+
return registry_id
|
|
457
|
+
|
|
458
|
+
try:
|
|
459
|
+
registry_id = get_registry_id()
|
|
460
|
+
except KeyError:
|
|
461
|
+
if strict:
|
|
462
|
+
raise
|
|
463
|
+
registry_id = cast(Union[Unset, None, str], UNSET)
|
|
464
|
+
|
|
465
|
+
def get_schema() -> Union[Unset, SchemaSummary]:
|
|
466
|
+
schema: Union[Unset, Union[Unset, SchemaSummary]] = UNSET
|
|
467
|
+
_schema = d.pop("schema")
|
|
468
|
+
|
|
469
|
+
if not isinstance(_schema, Unset):
|
|
470
|
+
schema = SchemaSummary.from_dict(_schema)
|
|
471
|
+
|
|
472
|
+
return schema
|
|
473
|
+
|
|
474
|
+
try:
|
|
475
|
+
schema = get_schema()
|
|
476
|
+
except KeyError:
|
|
477
|
+
if strict:
|
|
478
|
+
raise
|
|
479
|
+
schema = cast(Union[Unset, SchemaSummary], UNSET)
|
|
480
|
+
|
|
481
|
+
def get_units() -> Union[Unset, MixtureMeasurementUnits]:
|
|
482
|
+
units = UNSET
|
|
483
|
+
_units = d.pop("units")
|
|
484
|
+
if _units is not None and _units is not UNSET:
|
|
485
|
+
try:
|
|
486
|
+
units = MixtureMeasurementUnits(_units)
|
|
487
|
+
except ValueError:
|
|
488
|
+
units = MixtureMeasurementUnits.of_unknown(_units)
|
|
489
|
+
|
|
490
|
+
return units
|
|
491
|
+
|
|
492
|
+
try:
|
|
493
|
+
units = get_units()
|
|
494
|
+
except KeyError:
|
|
495
|
+
if strict:
|
|
496
|
+
raise
|
|
497
|
+
units = cast(Union[Unset, MixtureMeasurementUnits], UNSET)
|
|
498
|
+
|
|
499
|
+
def get_web_url() -> Union[Unset, str]:
|
|
500
|
+
web_url = d.pop("webURL")
|
|
501
|
+
return web_url
|
|
502
|
+
|
|
503
|
+
try:
|
|
504
|
+
web_url = get_web_url()
|
|
505
|
+
except KeyError:
|
|
506
|
+
if strict:
|
|
507
|
+
raise
|
|
508
|
+
web_url = cast(Union[Unset, str], UNSET)
|
|
509
|
+
|
|
510
|
+
mixture_with_entity_type = cls(
|
|
511
|
+
entity_type=entity_type,
|
|
512
|
+
aliases=aliases,
|
|
513
|
+
allow_measured_ingredients=allow_measured_ingredients,
|
|
514
|
+
amount=amount,
|
|
515
|
+
api_url=api_url,
|
|
516
|
+
archive_record=archive_record,
|
|
517
|
+
authors=authors,
|
|
518
|
+
created_at=created_at,
|
|
519
|
+
creator=creator,
|
|
520
|
+
custom_fields=custom_fields,
|
|
521
|
+
entity_registry_id=entity_registry_id,
|
|
522
|
+
fields=fields,
|
|
523
|
+
folder_id=folder_id,
|
|
524
|
+
id=id,
|
|
525
|
+
ingredients=ingredients,
|
|
526
|
+
modified_at=modified_at,
|
|
527
|
+
name=name,
|
|
528
|
+
registration_origin=registration_origin,
|
|
529
|
+
registry_id=registry_id,
|
|
530
|
+
schema=schema,
|
|
531
|
+
units=units,
|
|
532
|
+
web_url=web_url,
|
|
533
|
+
)
|
|
534
|
+
|
|
535
|
+
mixture_with_entity_type.additional_properties = d
|
|
536
|
+
return mixture_with_entity_type
|
|
537
|
+
|
|
538
|
+
@property
|
|
539
|
+
def additional_keys(self) -> List[str]:
|
|
540
|
+
return list(self.additional_properties.keys())
|
|
541
|
+
|
|
542
|
+
def __getitem__(self, key: str) -> Any:
|
|
543
|
+
return self.additional_properties[key]
|
|
544
|
+
|
|
545
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
546
|
+
self.additional_properties[key] = value
|
|
547
|
+
|
|
548
|
+
def __delitem__(self, key: str) -> None:
|
|
549
|
+
del self.additional_properties[key]
|
|
550
|
+
|
|
551
|
+
def __contains__(self, key: str) -> bool:
|
|
552
|
+
return key in self.additional_properties
|
|
553
|
+
|
|
554
|
+
def get(self, key, default=None) -> Optional[Any]:
|
|
555
|
+
return self.additional_properties.get(key, default)
|
|
556
|
+
|
|
557
|
+
@property
|
|
558
|
+
def entity_type(self) -> MixtureWithEntityTypeEntityType:
|
|
559
|
+
if isinstance(self._entity_type, Unset):
|
|
560
|
+
raise NotPresentError(self, "entity_type")
|
|
561
|
+
return self._entity_type
|
|
562
|
+
|
|
563
|
+
@entity_type.setter
|
|
564
|
+
def entity_type(self, value: MixtureWithEntityTypeEntityType) -> None:
|
|
565
|
+
self._entity_type = value
|
|
566
|
+
|
|
567
|
+
@entity_type.deleter
|
|
568
|
+
def entity_type(self) -> None:
|
|
569
|
+
self._entity_type = UNSET
|
|
570
|
+
|
|
571
|
+
@property
|
|
572
|
+
def aliases(self) -> List[str]:
|
|
573
|
+
if isinstance(self._aliases, Unset):
|
|
574
|
+
raise NotPresentError(self, "aliases")
|
|
575
|
+
return self._aliases
|
|
576
|
+
|
|
577
|
+
@aliases.setter
|
|
578
|
+
def aliases(self, value: List[str]) -> None:
|
|
579
|
+
self._aliases = value
|
|
580
|
+
|
|
581
|
+
@aliases.deleter
|
|
582
|
+
def aliases(self) -> None:
|
|
583
|
+
self._aliases = UNSET
|
|
584
|
+
|
|
585
|
+
@property
|
|
586
|
+
def allow_measured_ingredients(self) -> bool:
|
|
587
|
+
""" Derived from the mixture's schema. """
|
|
588
|
+
if isinstance(self._allow_measured_ingredients, Unset):
|
|
589
|
+
raise NotPresentError(self, "allow_measured_ingredients")
|
|
590
|
+
return self._allow_measured_ingredients
|
|
591
|
+
|
|
592
|
+
@allow_measured_ingredients.setter
|
|
593
|
+
def allow_measured_ingredients(self, value: bool) -> None:
|
|
594
|
+
self._allow_measured_ingredients = value
|
|
595
|
+
|
|
596
|
+
@allow_measured_ingredients.deleter
|
|
597
|
+
def allow_measured_ingredients(self) -> None:
|
|
598
|
+
self._allow_measured_ingredients = UNSET
|
|
599
|
+
|
|
600
|
+
@property
|
|
601
|
+
def amount(self) -> str:
|
|
602
|
+
""" The positive numerical amount value of this mixture in string format (to preserve full precision). Pair with `units`. Supports scientific notation (1.23e4). """
|
|
603
|
+
if isinstance(self._amount, Unset):
|
|
604
|
+
raise NotPresentError(self, "amount")
|
|
605
|
+
return self._amount
|
|
606
|
+
|
|
607
|
+
@amount.setter
|
|
608
|
+
def amount(self, value: str) -> None:
|
|
609
|
+
self._amount = value
|
|
610
|
+
|
|
611
|
+
@amount.deleter
|
|
612
|
+
def amount(self) -> None:
|
|
613
|
+
self._amount = UNSET
|
|
614
|
+
|
|
615
|
+
@property
|
|
616
|
+
def api_url(self) -> str:
|
|
617
|
+
""" The canonical url of the Mixture in the API. """
|
|
618
|
+
if isinstance(self._api_url, Unset):
|
|
619
|
+
raise NotPresentError(self, "api_url")
|
|
620
|
+
return self._api_url
|
|
621
|
+
|
|
622
|
+
@api_url.setter
|
|
623
|
+
def api_url(self, value: str) -> None:
|
|
624
|
+
self._api_url = value
|
|
625
|
+
|
|
626
|
+
@api_url.deleter
|
|
627
|
+
def api_url(self) -> None:
|
|
628
|
+
self._api_url = UNSET
|
|
629
|
+
|
|
630
|
+
@property
|
|
631
|
+
def archive_record(self) -> Optional[ArchiveRecord]:
|
|
632
|
+
if isinstance(self._archive_record, Unset):
|
|
633
|
+
raise NotPresentError(self, "archive_record")
|
|
634
|
+
return self._archive_record
|
|
635
|
+
|
|
636
|
+
@archive_record.setter
|
|
637
|
+
def archive_record(self, value: Optional[ArchiveRecord]) -> None:
|
|
638
|
+
self._archive_record = value
|
|
639
|
+
|
|
640
|
+
@archive_record.deleter
|
|
641
|
+
def archive_record(self) -> None:
|
|
642
|
+
self._archive_record = UNSET
|
|
643
|
+
|
|
644
|
+
@property
|
|
645
|
+
def authors(self) -> List[UserSummary]:
|
|
646
|
+
if isinstance(self._authors, Unset):
|
|
647
|
+
raise NotPresentError(self, "authors")
|
|
648
|
+
return self._authors
|
|
649
|
+
|
|
650
|
+
@authors.setter
|
|
651
|
+
def authors(self, value: List[UserSummary]) -> None:
|
|
652
|
+
self._authors = value
|
|
653
|
+
|
|
654
|
+
@authors.deleter
|
|
655
|
+
def authors(self) -> None:
|
|
656
|
+
self._authors = UNSET
|
|
657
|
+
|
|
658
|
+
@property
|
|
659
|
+
def created_at(self) -> datetime.datetime:
|
|
660
|
+
if isinstance(self._created_at, Unset):
|
|
661
|
+
raise NotPresentError(self, "created_at")
|
|
662
|
+
return self._created_at
|
|
663
|
+
|
|
664
|
+
@created_at.setter
|
|
665
|
+
def created_at(self, value: datetime.datetime) -> None:
|
|
666
|
+
self._created_at = value
|
|
667
|
+
|
|
668
|
+
@created_at.deleter
|
|
669
|
+
def created_at(self) -> None:
|
|
670
|
+
self._created_at = UNSET
|
|
671
|
+
|
|
672
|
+
@property
|
|
673
|
+
def creator(self) -> MixtureCreator:
|
|
674
|
+
if isinstance(self._creator, Unset):
|
|
675
|
+
raise NotPresentError(self, "creator")
|
|
676
|
+
return self._creator
|
|
677
|
+
|
|
678
|
+
@creator.setter
|
|
679
|
+
def creator(self, value: MixtureCreator) -> None:
|
|
680
|
+
self._creator = value
|
|
681
|
+
|
|
682
|
+
@creator.deleter
|
|
683
|
+
def creator(self) -> None:
|
|
684
|
+
self._creator = UNSET
|
|
685
|
+
|
|
686
|
+
@property
|
|
687
|
+
def custom_fields(self) -> CustomFields:
|
|
688
|
+
if isinstance(self._custom_fields, Unset):
|
|
689
|
+
raise NotPresentError(self, "custom_fields")
|
|
690
|
+
return self._custom_fields
|
|
691
|
+
|
|
692
|
+
@custom_fields.setter
|
|
693
|
+
def custom_fields(self, value: CustomFields) -> None:
|
|
694
|
+
self._custom_fields = value
|
|
695
|
+
|
|
696
|
+
@custom_fields.deleter
|
|
697
|
+
def custom_fields(self) -> None:
|
|
698
|
+
self._custom_fields = UNSET
|
|
699
|
+
|
|
700
|
+
@property
|
|
701
|
+
def entity_registry_id(self) -> Optional[str]:
|
|
702
|
+
if isinstance(self._entity_registry_id, Unset):
|
|
703
|
+
raise NotPresentError(self, "entity_registry_id")
|
|
704
|
+
return self._entity_registry_id
|
|
705
|
+
|
|
706
|
+
@entity_registry_id.setter
|
|
707
|
+
def entity_registry_id(self, value: Optional[str]) -> None:
|
|
708
|
+
self._entity_registry_id = value
|
|
709
|
+
|
|
710
|
+
@entity_registry_id.deleter
|
|
711
|
+
def entity_registry_id(self) -> None:
|
|
712
|
+
self._entity_registry_id = UNSET
|
|
713
|
+
|
|
714
|
+
@property
|
|
715
|
+
def fields(self) -> Fields:
|
|
716
|
+
if isinstance(self._fields, Unset):
|
|
717
|
+
raise NotPresentError(self, "fields")
|
|
718
|
+
return self._fields
|
|
719
|
+
|
|
720
|
+
@fields.setter
|
|
721
|
+
def fields(self, value: Fields) -> None:
|
|
722
|
+
self._fields = value
|
|
723
|
+
|
|
724
|
+
@fields.deleter
|
|
725
|
+
def fields(self) -> None:
|
|
726
|
+
self._fields = UNSET
|
|
727
|
+
|
|
728
|
+
@property
|
|
729
|
+
def folder_id(self) -> Optional[str]:
|
|
730
|
+
if isinstance(self._folder_id, Unset):
|
|
731
|
+
raise NotPresentError(self, "folder_id")
|
|
732
|
+
return self._folder_id
|
|
733
|
+
|
|
734
|
+
@folder_id.setter
|
|
735
|
+
def folder_id(self, value: Optional[str]) -> None:
|
|
736
|
+
self._folder_id = value
|
|
737
|
+
|
|
738
|
+
@folder_id.deleter
|
|
739
|
+
def folder_id(self) -> None:
|
|
740
|
+
self._folder_id = UNSET
|
|
741
|
+
|
|
742
|
+
@property
|
|
743
|
+
def id(self) -> str:
|
|
744
|
+
if isinstance(self._id, Unset):
|
|
745
|
+
raise NotPresentError(self, "id")
|
|
746
|
+
return self._id
|
|
747
|
+
|
|
748
|
+
@id.setter
|
|
749
|
+
def id(self, value: str) -> None:
|
|
750
|
+
self._id = value
|
|
751
|
+
|
|
752
|
+
@id.deleter
|
|
753
|
+
def id(self) -> None:
|
|
754
|
+
self._id = UNSET
|
|
755
|
+
|
|
756
|
+
@property
|
|
757
|
+
def ingredients(self) -> List[Ingredient]:
|
|
758
|
+
""" List of ingredients on this mixture. """
|
|
759
|
+
if isinstance(self._ingredients, Unset):
|
|
760
|
+
raise NotPresentError(self, "ingredients")
|
|
761
|
+
return self._ingredients
|
|
762
|
+
|
|
763
|
+
@ingredients.setter
|
|
764
|
+
def ingredients(self, value: List[Ingredient]) -> None:
|
|
765
|
+
self._ingredients = value
|
|
766
|
+
|
|
767
|
+
@ingredients.deleter
|
|
768
|
+
def ingredients(self) -> None:
|
|
769
|
+
self._ingredients = UNSET
|
|
770
|
+
|
|
771
|
+
@property
|
|
772
|
+
def modified_at(self) -> datetime.datetime:
|
|
773
|
+
if isinstance(self._modified_at, Unset):
|
|
774
|
+
raise NotPresentError(self, "modified_at")
|
|
775
|
+
return self._modified_at
|
|
776
|
+
|
|
777
|
+
@modified_at.setter
|
|
778
|
+
def modified_at(self, value: datetime.datetime) -> None:
|
|
779
|
+
self._modified_at = value
|
|
780
|
+
|
|
781
|
+
@modified_at.deleter
|
|
782
|
+
def modified_at(self) -> None:
|
|
783
|
+
self._modified_at = UNSET
|
|
784
|
+
|
|
785
|
+
@property
|
|
786
|
+
def name(self) -> str:
|
|
787
|
+
if isinstance(self._name, Unset):
|
|
788
|
+
raise NotPresentError(self, "name")
|
|
789
|
+
return self._name
|
|
790
|
+
|
|
791
|
+
@name.setter
|
|
792
|
+
def name(self, value: str) -> None:
|
|
793
|
+
self._name = value
|
|
794
|
+
|
|
795
|
+
@name.deleter
|
|
796
|
+
def name(self) -> None:
|
|
797
|
+
self._name = UNSET
|
|
798
|
+
|
|
799
|
+
@property
|
|
800
|
+
def registration_origin(self) -> Optional[RegistrationOrigin]:
|
|
801
|
+
if isinstance(self._registration_origin, Unset):
|
|
802
|
+
raise NotPresentError(self, "registration_origin")
|
|
803
|
+
return self._registration_origin
|
|
804
|
+
|
|
805
|
+
@registration_origin.setter
|
|
806
|
+
def registration_origin(self, value: Optional[RegistrationOrigin]) -> None:
|
|
807
|
+
self._registration_origin = value
|
|
808
|
+
|
|
809
|
+
@registration_origin.deleter
|
|
810
|
+
def registration_origin(self) -> None:
|
|
811
|
+
self._registration_origin = UNSET
|
|
812
|
+
|
|
813
|
+
@property
|
|
814
|
+
def registry_id(self) -> Optional[str]:
|
|
815
|
+
if isinstance(self._registry_id, Unset):
|
|
816
|
+
raise NotPresentError(self, "registry_id")
|
|
817
|
+
return self._registry_id
|
|
818
|
+
|
|
819
|
+
@registry_id.setter
|
|
820
|
+
def registry_id(self, value: Optional[str]) -> None:
|
|
821
|
+
self._registry_id = value
|
|
822
|
+
|
|
823
|
+
@registry_id.deleter
|
|
824
|
+
def registry_id(self) -> None:
|
|
825
|
+
self._registry_id = UNSET
|
|
826
|
+
|
|
827
|
+
@property
|
|
828
|
+
def schema(self) -> SchemaSummary:
|
|
829
|
+
if isinstance(self._schema, Unset):
|
|
830
|
+
raise NotPresentError(self, "schema")
|
|
831
|
+
return self._schema
|
|
832
|
+
|
|
833
|
+
@schema.setter
|
|
834
|
+
def schema(self, value: SchemaSummary) -> None:
|
|
835
|
+
self._schema = value
|
|
836
|
+
|
|
837
|
+
@schema.deleter
|
|
838
|
+
def schema(self) -> None:
|
|
839
|
+
self._schema = UNSET
|
|
840
|
+
|
|
841
|
+
@property
|
|
842
|
+
def units(self) -> MixtureMeasurementUnits:
|
|
843
|
+
if isinstance(self._units, Unset):
|
|
844
|
+
raise NotPresentError(self, "units")
|
|
845
|
+
return self._units
|
|
846
|
+
|
|
847
|
+
@units.setter
|
|
848
|
+
def units(self, value: MixtureMeasurementUnits) -> None:
|
|
849
|
+
self._units = value
|
|
850
|
+
|
|
851
|
+
@units.deleter
|
|
852
|
+
def units(self) -> None:
|
|
853
|
+
self._units = UNSET
|
|
854
|
+
|
|
855
|
+
@property
|
|
856
|
+
def web_url(self) -> str:
|
|
857
|
+
if isinstance(self._web_url, Unset):
|
|
858
|
+
raise NotPresentError(self, "web_url")
|
|
859
|
+
return self._web_url
|
|
860
|
+
|
|
861
|
+
@web_url.setter
|
|
862
|
+
def web_url(self, value: str) -> None:
|
|
863
|
+
self._web_url = value
|
|
864
|
+
|
|
865
|
+
@web_url.deleter
|
|
866
|
+
def web_url(self) -> None:
|
|
867
|
+
self._web_url = UNSET
|