benchling-sdk 1.10.0a4__py3-none-any.whl → 1.10.0a6__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_sdk/apps/canvas/framework.py +74 -68
- benchling_sdk/apps/canvas/types.py +4 -4
- benchling_sdk/apps/config/__init__.py +0 -3
- benchling_sdk/apps/config/decryption_provider.py +0 -3
- benchling_sdk/apps/config/errors.py +30 -0
- benchling_sdk/apps/config/framework.py +162 -26
- benchling_sdk/apps/{helpers/config_helpers.py → config/helpers.py} +16 -97
- benchling_sdk/apps/config/mock_config.py +68 -69
- benchling_sdk/apps/config/types.py +3 -1
- benchling_sdk/apps/status/framework.py +1 -21
- benchling_sdk/apps/status/helpers.py +20 -0
- benchling_sdk/apps/status/types.py +1 -1
- benchling_sdk/services/v2/stable/assay_result_service.py +18 -0
- {benchling_sdk-1.10.0a4.dist-info → benchling_sdk-1.10.0a6.dist-info}/METADATA +2 -2
- {benchling_sdk-1.10.0a4.dist-info → benchling_sdk-1.10.0a6.dist-info}/RECORD +17 -17
- benchling_sdk/apps/config/scalars.py +0 -190
- {benchling_sdk-1.10.0a4.dist-info → benchling_sdk-1.10.0a6.dist-info}/LICENSE +0 -0
- {benchling_sdk-1.10.0a4.dist-info → benchling_sdk-1.10.0a6.dist-info}/WHEEL +0 -0
@@ -4,7 +4,7 @@ from datetime import date, datetime
|
|
4
4
|
import json
|
5
5
|
import random
|
6
6
|
import string
|
7
|
-
from typing import Dict, get_args, List, Optional, Protocol,
|
7
|
+
from typing import cast, Dict, get_args, List, Optional, Protocol, Union
|
8
8
|
|
9
9
|
from benchling_api_client.v2.beta.models.base_manifest_config import BaseManifestConfig
|
10
10
|
from benchling_api_client.v2.beta.models.benchling_app_manifest import BenchlingAppManifest
|
@@ -34,29 +34,19 @@ from benchling_api_client.v2.extensions import UnknownType
|
|
34
34
|
from benchling_api_client.v2.stable.types import UNSET, Unset
|
35
35
|
|
36
36
|
from benchling_sdk.apps.config.decryption_provider import BaseDecryptionProvider
|
37
|
+
from benchling_sdk.apps.config.errors import UnsupportedConfigItemError
|
37
38
|
from benchling_sdk.apps.config.framework import _supported_config_item, ConfigItemStore, StaticConfigProvider
|
38
|
-
from benchling_sdk.apps.config.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
ScalarDefinition,
|
47
|
-
ScalarType,
|
48
|
-
SecureTextScalar,
|
49
|
-
TextScalar,
|
50
|
-
)
|
51
|
-
from benchling_sdk.apps.config.types import ConfigurationReference
|
52
|
-
from benchling_sdk.apps.helpers.config_helpers import (
|
53
|
-
element_definition_from_dependency,
|
54
|
-
enum_from_dependency,
|
55
|
-
field_definitions_from_dependency,
|
56
|
-
options_from_dependency,
|
57
|
-
subtype_from_entity_schema_dependency,
|
58
|
-
workflow_task_schema_output_from_dependency,
|
39
|
+
from benchling_sdk.apps.config.helpers import (
|
40
|
+
_element_definition_from_dependency,
|
41
|
+
_enum_from_dependency,
|
42
|
+
_field_definitions_from_dependency,
|
43
|
+
_options_from_dependency,
|
44
|
+
_subtype_from_entity_schema_dependency,
|
45
|
+
_workflow_task_schema_output_from_dependency,
|
46
|
+
datetime_config_value_to_str,
|
59
47
|
)
|
48
|
+
from benchling_sdk.apps.config.types import ConfigurationReference, JsonType
|
49
|
+
from benchling_sdk.helpers.logging_helpers import log_stability_warning, StabilityLevel
|
60
50
|
from benchling_sdk.models import (
|
61
51
|
AppConfigItem,
|
62
52
|
ArrayElementAppConfigItem,
|
@@ -98,6 +88,8 @@ ManifestDependencies = Union[
|
|
98
88
|
UnknownType,
|
99
89
|
]
|
100
90
|
|
91
|
+
log_stability_warning(StabilityLevel.BETA)
|
92
|
+
|
101
93
|
|
102
94
|
class MockDecryptionFunction(Protocol):
|
103
95
|
"""Mock out a decryption function for use with secure text."""
|
@@ -296,7 +288,7 @@ def mock_datetime_app_config_item(path: List[str], value: Optional[datetime]) ->
|
|
296
288
|
"""Mock a datetime app config item with a path and specified value."""
|
297
289
|
return DatetimeAppConfigItem(
|
298
290
|
path=path,
|
299
|
-
value=value
|
291
|
+
value=datetime_config_value_to_str(value) if value else None,
|
300
292
|
type=DatetimeAppConfigItemType.DATETIME,
|
301
293
|
id=_random_string("aci_"),
|
302
294
|
)
|
@@ -354,9 +346,10 @@ def mock_text_app_config_item(path: List[str], value: Optional[str]) -> TextAppC
|
|
354
346
|
|
355
347
|
def _mock_dependency(
|
356
348
|
dependency: ManifestDependencies,
|
357
|
-
parent_path: List[str] =
|
349
|
+
parent_path: Optional[List[str]] = None,
|
358
350
|
) -> List[AppConfigItem]:
|
359
351
|
"""Mock a dependency from its manifest definition."""
|
352
|
+
parent_path = parent_path if parent_path else []
|
360
353
|
# MyPy has trouble inferring lists with [config_item] + sub_items so use the syntax like:
|
361
354
|
# [*[config_item], *sub_items]
|
362
355
|
# See https://github.com/python/mypy/issues/3933#issuecomment-808739063
|
@@ -371,12 +364,12 @@ def _mock_dependency(
|
|
371
364
|
)
|
372
365
|
sub_items = [
|
373
366
|
_mock_subdependency(subdependency, dependency, parent_path=parent_path)
|
374
|
-
for subdependency in
|
367
|
+
for subdependency in _options_from_dependency(dependency)
|
375
368
|
]
|
376
369
|
return [*[config_item], *sub_items]
|
377
370
|
elif isinstance(dependency, EntitySchemaDependency):
|
378
371
|
linked_resource_id = _random_string("val_")
|
379
|
-
subtype =
|
372
|
+
subtype = _subtype_from_entity_schema_dependency(dependency)
|
380
373
|
optional_subtype: Union[SchemaDependencySubtypes, Unset] = (
|
381
374
|
_convert_entity_subtype(subtype) if subtype is not None else UNSET
|
382
375
|
)
|
@@ -390,7 +383,7 @@ def _mock_dependency(
|
|
390
383
|
)
|
391
384
|
sub_items = [
|
392
385
|
_mock_subdependency(subdependency, dependency, parent_path=parent_path)
|
393
|
-
for subdependency in
|
386
|
+
for subdependency in _field_definitions_from_dependency(dependency)
|
394
387
|
]
|
395
388
|
return [*[entity_item], *sub_items]
|
396
389
|
elif isinstance(dependency, SchemaDependency):
|
@@ -404,7 +397,7 @@ def _mock_dependency(
|
|
404
397
|
)
|
405
398
|
sub_items = [
|
406
399
|
_mock_subdependency(subdependency, dependency, parent_path=parent_path)
|
407
|
-
for subdependency in
|
400
|
+
for subdependency in _field_definitions_from_dependency(dependency)
|
408
401
|
]
|
409
402
|
return [*[config_item], *sub_items]
|
410
403
|
elif isinstance(dependency, WorkflowTaskSchemaDependency):
|
@@ -418,11 +411,11 @@ def _mock_dependency(
|
|
418
411
|
)
|
419
412
|
sub_items = [
|
420
413
|
_mock_subdependency(subdependency, dependency, parent_path=parent_path)
|
421
|
-
for subdependency in
|
414
|
+
for subdependency in _field_definitions_from_dependency(dependency)
|
422
415
|
]
|
423
|
-
workflow_task_output =
|
416
|
+
workflow_task_output = _workflow_task_schema_output_from_dependency(dependency)
|
424
417
|
if workflow_task_output:
|
425
|
-
output_fields =
|
418
|
+
output_fields = _field_definitions_from_dependency(workflow_task_output)
|
426
419
|
output_items = [
|
427
420
|
_mock_workflow_output_subdependency(subdependency, dependency, parent_path=parent_path)
|
428
421
|
for subdependency in output_fields
|
@@ -458,39 +451,40 @@ def _convert_entity_subtype(manifest_subtype: SchemaDependencySubtypesBeta) -> S
|
|
458
451
|
|
459
452
|
|
460
453
|
def _mock_scalar_dependency(
|
461
|
-
dependency: ManifestScalarConfig, parent_path: List[str] =
|
454
|
+
dependency: ManifestScalarConfig, parent_path: Optional[List[str]] = None
|
462
455
|
) -> AppConfigItem:
|
456
|
+
parent_path = parent_path if parent_path else []
|
463
457
|
if isinstance(dependency, ManifestBooleanScalarConfig):
|
464
|
-
bool_value =
|
458
|
+
bool_value = cast(bool, _mock_scalar_value(dependency))
|
465
459
|
bool_config = mock_bool_app_config_item([dependency.name], bool_value)
|
466
460
|
return _append_config_item_path(bool_config, parent_path)
|
467
461
|
elif isinstance(dependency, ManifestDateScalarConfig):
|
468
|
-
date_value =
|
462
|
+
date_value = cast(date, _mock_scalar_value(dependency))
|
469
463
|
date_config = mock_date_app_config_item([dependency.name], date_value)
|
470
464
|
return _append_config_item_path(date_config, parent_path)
|
471
465
|
elif isinstance(dependency, ManifestDatetimeScalarConfig):
|
472
|
-
datetime_value =
|
466
|
+
datetime_value = cast(datetime, _mock_scalar_value(dependency))
|
473
467
|
datetime_config = mock_datetime_app_config_item([dependency.name], datetime_value)
|
474
468
|
return _append_config_item_path(datetime_config, parent_path)
|
475
469
|
elif isinstance(dependency, ManifestFloatScalarConfig):
|
476
|
-
float_value =
|
470
|
+
float_value = cast(float, _mock_scalar_value(dependency))
|
477
471
|
float_config = mock_float_app_config_item([dependency.name], float_value)
|
478
472
|
return _append_config_item_path(float_config, parent_path)
|
479
473
|
elif isinstance(dependency, ManifestIntegerScalarConfig):
|
480
|
-
int_value =
|
474
|
+
int_value = cast(int, _mock_scalar_value(dependency))
|
481
475
|
int_config = mock_int_app_config_item([dependency.name], int_value)
|
482
476
|
return _append_config_item_path(int_config, parent_path)
|
483
477
|
elif isinstance(dependency, ManifestJsonScalarConfig):
|
484
|
-
json_value =
|
478
|
+
json_value = cast(JsonType, _mock_scalar_value(dependency))
|
485
479
|
json_config = mock_json_app_config_item([dependency.name], json_value)
|
486
480
|
return _append_config_item_path(json_config, parent_path)
|
487
481
|
elif isinstance(dependency, ManifestSecureTextScalarConfig):
|
488
|
-
secure_text_value =
|
482
|
+
secure_text_value = cast(str, _mock_scalar_value(dependency))
|
489
483
|
secure_text_config = mock_secure_text_app_config_item([dependency.name], secure_text_value)
|
490
484
|
return _append_config_item_path(secure_text_config, parent_path)
|
491
485
|
else:
|
492
486
|
assert not isinstance(dependency, UnknownType), f"Unable to mock unknown type {dependency}"
|
493
|
-
text_value =
|
487
|
+
text_value = cast(str, _mock_scalar_value(dependency))
|
494
488
|
text_config = mock_text_app_config_item([dependency.name], text_value)
|
495
489
|
return _append_config_item_path(text_config, parent_path)
|
496
490
|
|
@@ -503,12 +497,13 @@ def _append_config_item_path(config_item: AppConfigItem, parent_path: List[str])
|
|
503
497
|
|
504
498
|
|
505
499
|
def _mock_array_dependency(
|
506
|
-
dependency: ManifestArrayConfig, parent_path: List[str] =
|
500
|
+
dependency: ManifestArrayConfig, parent_path: Optional[List[str]] = None, rows: int = 1
|
507
501
|
) -> List[AppConfigItem]:
|
508
502
|
config_rows = []
|
503
|
+
parent_path = parent_path if parent_path else []
|
509
504
|
for i in range(rows):
|
510
505
|
row = _mock_array_row(dependency, parent_path=parent_path)
|
511
|
-
elements =
|
506
|
+
elements = _element_definition_from_dependency(dependency)
|
512
507
|
element_configs = [_mock_dependency(element, row.path) for element in elements]
|
513
508
|
flattened_configs = [element for sublist in element_configs for element in sublist]
|
514
509
|
config_rows.append(row)
|
@@ -516,8 +511,9 @@ def _mock_array_dependency(
|
|
516
511
|
return config_rows
|
517
512
|
|
518
513
|
|
519
|
-
def _mock_array_row(dependency: ManifestArrayConfig, parent_path: List[str] =
|
514
|
+
def _mock_array_row(dependency: ManifestArrayConfig, parent_path: Optional[List[str]] = None):
|
520
515
|
row_name = _random_string("Row ")
|
516
|
+
parent_path = parent_path if parent_path else []
|
521
517
|
return ArrayElementAppConfigItem(
|
522
518
|
id=_random_string("aci_"),
|
523
519
|
path=parent_path + [dependency.name, row_name],
|
@@ -526,25 +522,16 @@ def _mock_array_row(dependency: ManifestArrayConfig, parent_path: List[str] = li
|
|
526
522
|
)
|
527
523
|
|
528
524
|
|
529
|
-
def
|
530
|
-
dependency: ManifestScalarConfig, scalar_definition_type: Type[ScalarDefinition[ScalarType]]
|
531
|
-
) -> Optional[ScalarType]:
|
532
|
-
assert not isinstance(dependency, UnknownType), f"Unable to mock unknown type {dependency}"
|
533
|
-
# These types should be equivalent and this appeases MyPy
|
534
|
-
mocked_value_type = ScalarConfigTypes(dependency.type)
|
535
|
-
mocked_value_str = (
|
536
|
-
_mock_scalar_with_enum(dependency)
|
537
|
-
if _is_scalar_with_enum(dependency)
|
538
|
-
else _mock_scalar_value(mocked_value_type)
|
539
|
-
)
|
540
|
-
return scalar_definition_type.from_str(mocked_value_str)
|
541
|
-
|
542
|
-
|
543
|
-
def _mock_scalar_with_enum(dependency: ManifestScalarConfig) -> str:
|
525
|
+
def _mock_scalar_with_enum(dependency: ManifestScalarConfig) -> Union[float, int, str]:
|
544
526
|
assert isinstance(
|
545
527
|
dependency, (ManifestFloatScalarConfig, ManifestIntegerScalarConfig, ManifestTextScalarConfig)
|
546
528
|
)
|
547
|
-
|
529
|
+
value = random.choice(dependency.enum)
|
530
|
+
if isinstance(dependency, ManifestFloatScalarConfig):
|
531
|
+
return cast(float, value)
|
532
|
+
elif isinstance(dependency, ManifestIntegerScalarConfig):
|
533
|
+
return cast(int, value)
|
534
|
+
return str(value)
|
548
535
|
|
549
536
|
|
550
537
|
def _is_scalar_with_enum(dependency: ManifestScalarConfig) -> bool:
|
@@ -552,15 +539,16 @@ def _is_scalar_with_enum(dependency: ManifestScalarConfig) -> bool:
|
|
552
539
|
dependency, (ManifestFloatScalarConfig, ManifestIntegerScalarConfig, ManifestTextScalarConfig)
|
553
540
|
):
|
554
541
|
# MyPy doesn't find this to be truthy without a specific len check
|
555
|
-
return len(
|
542
|
+
return len(_enum_from_dependency(dependency)) > 0
|
556
543
|
return False
|
557
544
|
|
558
545
|
|
559
546
|
def _mock_subdependency(
|
560
547
|
subdependency: Union[BaseManifestConfig, FieldDefinitionsManifest],
|
561
548
|
parent_config,
|
562
|
-
parent_path: List[str] =
|
549
|
+
parent_path: Optional[List[str]] = None,
|
563
550
|
) -> AppConfigItem:
|
551
|
+
parent_path = parent_path if parent_path else []
|
564
552
|
if isinstance(parent_config, DropdownDependency):
|
565
553
|
linked_resource_id = _random_string("opt_")
|
566
554
|
return GenericApiIdentifiedAppConfigItem(
|
@@ -587,8 +575,9 @@ def _mock_subdependency(
|
|
587
575
|
def _mock_workflow_output_subdependency(
|
588
576
|
subdependency: Union[BaseManifestConfig, FieldDefinitionsManifest],
|
589
577
|
parent_config,
|
590
|
-
parent_path: List[str] =
|
578
|
+
parent_path: Optional[List[str]] = None,
|
591
579
|
) -> AppConfigItem:
|
580
|
+
parent_path = parent_path if parent_path else []
|
592
581
|
linked_resource_id = _random_string("tsf_")
|
593
582
|
app_config = FieldAppConfigItem(
|
594
583
|
id=_random_string("aci_"),
|
@@ -604,18 +593,28 @@ def _mock_linked_resource(id: str, name: Optional[str] = None) -> LinkedAppConfi
|
|
604
593
|
return LinkedAppConfigResourceSummary(id=id, name=name if name else _random_string("Resource Name"))
|
605
594
|
|
606
595
|
|
607
|
-
def _mock_scalar_value(
|
596
|
+
def _mock_scalar_value(
|
597
|
+
dependency: ManifestScalarConfig,
|
598
|
+
) -> Union[bool, date, datetime, int, float, str, Dict[str, Union[str, float]]]:
|
608
599
|
"""Mock a scalar config value from its manifest definition."""
|
609
|
-
if
|
610
|
-
|
600
|
+
if isinstance(dependency, UnknownType):
|
601
|
+
raise UnsupportedConfigItemError(
|
602
|
+
f"Unable to mock scalar value for unsupported dependency type {dependency}"
|
603
|
+
)
|
604
|
+
# These types should be equivalent and this appeases MyPy
|
605
|
+
scalar_type = ScalarConfigTypes(dependency.type)
|
606
|
+
if _is_scalar_with_enum(dependency):
|
607
|
+
return _mock_scalar_with_enum(dependency)
|
608
|
+
elif scalar_type == scalar_type.BOOLEAN:
|
609
|
+
return True
|
611
610
|
elif scalar_type == scalar_type.DATE:
|
612
|
-
return date.today()
|
611
|
+
return date.today()
|
613
612
|
elif scalar_type == scalar_type.DATETIME:
|
614
|
-
return datetime.now()
|
613
|
+
return datetime.now()
|
615
614
|
elif scalar_type == scalar_type.FLOAT:
|
616
|
-
return
|
615
|
+
return random.random()
|
617
616
|
elif scalar_type == scalar_type.INTEGER:
|
618
|
-
return
|
617
|
+
return random.randint(-1000, 1000)
|
619
618
|
elif scalar_type == scalar_type.JSON:
|
620
619
|
return json.dumps(
|
621
620
|
{_random_string(): [_random_string(), _random_string()], _random_string(): random.random()}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Tuple instead of list so it's hashable and preserves order
|
2
|
-
from typing import Tuple, Union
|
2
|
+
from typing import Any, Dict, List, Tuple, Union
|
3
3
|
|
4
4
|
from benchling_sdk.models import (
|
5
5
|
ArrayElementAppConfigItem,
|
@@ -34,3 +34,5 @@ ConfigurationReference = Union[
|
|
34
34
|
SecureTextAppConfigItem,
|
35
35
|
TextAppConfigItem,
|
36
36
|
]
|
37
|
+
|
38
|
+
JsonType = Union[Dict[str, Any], List[Any], str, int, float, bool]
|
@@ -14,9 +14,8 @@ from benchling_sdk.apps.status.errors import (
|
|
14
14
|
SessionClosedError,
|
15
15
|
SessionContextClosedError,
|
16
16
|
)
|
17
|
-
from benchling_sdk.apps.status.types import _ReferencedSessionLinkType
|
18
17
|
from benchling_sdk.errors import BenchlingError
|
19
|
-
from benchling_sdk.helpers.logging_helpers import
|
18
|
+
from benchling_sdk.helpers.logging_helpers import sdk_logger
|
20
19
|
from benchling_sdk.models import (
|
21
20
|
AppCanvasUpdate,
|
22
21
|
AppSession,
|
@@ -35,8 +34,6 @@ if TYPE_CHECKING:
|
|
35
34
|
|
36
35
|
_DEFAULT_APP_ERROR_MESSAGE = "An unexpected error occurred in the app"
|
37
36
|
|
38
|
-
log_stability_warning(StabilityLevel.BETA)
|
39
|
-
|
40
37
|
|
41
38
|
class SessionProvider(Protocol):
|
42
39
|
"""Provide a Benchling App Session to convey app status."""
|
@@ -685,20 +682,3 @@ def continue_session_context(
|
|
685
682
|
context_enter_handler,
|
686
683
|
context_exit_handler,
|
687
684
|
)
|
688
|
-
|
689
|
-
|
690
|
-
def ref(reference: _ReferencedSessionLinkType) -> str:
|
691
|
-
"""
|
692
|
-
Ref.
|
693
|
-
|
694
|
-
Helper method for easily serializing a referenced object into a string embeddable in AppSessionMessageCreate
|
695
|
-
content.
|
696
|
-
|
697
|
-
Example:
|
698
|
-
dna_sequence = benchling.dna_sequences.get_by_id("seq_1234")
|
699
|
-
AppSessionMessageCreate(f"This is my DNA sequence {ref(dna_sequence)} for analysis"
|
700
|
-
"""
|
701
|
-
# Not sure {} are possible in Benchling IDs, but the spec says we're escaping
|
702
|
-
unescape_id = reference.id
|
703
|
-
escaped_id = unescape_id.replace("{", "\\{").replace("}", "\\}")
|
704
|
-
return f"{{id:{escaped_id}}}"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from benchling_sdk.apps.status.types import ReferencedSessionLinkType
|
4
|
+
|
5
|
+
|
6
|
+
def ref(reference: ReferencedSessionLinkType) -> str:
|
7
|
+
"""
|
8
|
+
Ref.
|
9
|
+
|
10
|
+
Helper method for easily serializing a referenced object into a string embeddable in AppSessionMessageCreate
|
11
|
+
content.
|
12
|
+
|
13
|
+
Example:
|
14
|
+
dna_sequence = benchling.dna_sequences.get_by_id("seq_1234")
|
15
|
+
AppSessionMessageCreate(f"This is my DNA sequence {ref(dna_sequence)} for analysis"
|
16
|
+
"""
|
17
|
+
# Not sure {} are possible in Benchling IDs, but the spec says we're escaping
|
18
|
+
unescape_id = reference.id
|
19
|
+
escaped_id = unescape_id.replace("{", "\\{").replace("}", "\\}")
|
20
|
+
return f"{{id:{escaped_id}}}"
|
@@ -23,7 +23,7 @@ from benchling_sdk.models import (
|
|
23
23
|
|
24
24
|
# Taken from CHIP_SUPPORTED_COLUMN_TYPES in Benchling server
|
25
25
|
# Anything we miss, they can still embed the ID themselves in a message
|
26
|
-
|
26
|
+
ReferencedSessionLinkType = Union[
|
27
27
|
AaSequence,
|
28
28
|
Blob,
|
29
29
|
Box,
|
@@ -3,6 +3,7 @@ from typing import Iterable, List, Optional, Union
|
|
3
3
|
from benchling_api_client.v2.stable.api.assay_results import (
|
4
4
|
abort_assay_results_transaction,
|
5
5
|
archive_assay_results,
|
6
|
+
bulk_create_assay_results,
|
6
7
|
bulk_get_assay_results,
|
7
8
|
commit_assay_results_transaction,
|
8
9
|
create_assay_results,
|
@@ -31,10 +32,12 @@ from benchling_sdk.models import (
|
|
31
32
|
AssayResultIdsRequest,
|
32
33
|
AssayResultIdsResponse,
|
33
34
|
AssayResultsArchive,
|
35
|
+
AssayResultsBulkCreateInTableRequest,
|
34
36
|
AssayResultsBulkCreateRequest,
|
35
37
|
AssayResultsCreateResponse,
|
36
38
|
AssayResultsPaginatedList,
|
37
39
|
AssayResultTransactionCreateResponse,
|
40
|
+
AsyncTaskLink,
|
38
41
|
ListAssayResultsSort,
|
39
42
|
)
|
40
43
|
from benchling_sdk.services.v2.base_service import BaseService
|
@@ -196,6 +199,21 @@ class AssayResultService(BaseService):
|
|
196
199
|
response = create_assay_results.sync_detailed(client=self.client, json_body=create_results)
|
197
200
|
return model_from_detailed(response)
|
198
201
|
|
202
|
+
@api_method
|
203
|
+
def bulk_create(
|
204
|
+
self, assay_results: Iterable[AssayResultCreate], table_id: Optional[str] = None
|
205
|
+
) -> AsyncTaskLink:
|
206
|
+
"""
|
207
|
+
Create 1 or more results.
|
208
|
+
|
209
|
+
See https://benchling.com/api/reference#/Assay%20Results/bulkCreateAssayResults
|
210
|
+
"""
|
211
|
+
request_body = AssayResultsBulkCreateInTableRequest(
|
212
|
+
assay_results=list(assay_results), **({"table_id": table_id} if table_id else {})
|
213
|
+
)
|
214
|
+
response = bulk_create_assay_results.sync_detailed(client=self.client, json_body=request_body)
|
215
|
+
return model_from_detailed(response)
|
216
|
+
|
199
217
|
@api_method
|
200
218
|
def archive(self, assay_result_ids: Iterable[str]) -> AssayResultIdsResponse:
|
201
219
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: benchling-sdk
|
3
|
-
Version: 1.10.
|
3
|
+
Version: 1.10.0a6
|
4
4
|
Summary: SDK for interacting with the Benchling Platform.
|
5
5
|
License: Apache-2.0
|
6
6
|
Author: Benchling Support
|
@@ -17,7 +17,7 @@ Provides-Extra: python-jose
|
|
17
17
|
Requires-Dist: PyYAML (>=6.0,<7.0)
|
18
18
|
Requires-Dist: attrs (>=20.1.0,<23)
|
19
19
|
Requires-Dist: backoff (>=1.10.0,<2.0.0)
|
20
|
-
Requires-Dist: benchling-api-client (==2.0.
|
20
|
+
Requires-Dist: benchling-api-client (==2.0.241)
|
21
21
|
Requires-Dist: certifi (>=2022.12.7)
|
22
22
|
Requires-Dist: cryptography (>=41.0.3,<42.0.0) ; extra == "cryptography"
|
23
23
|
Requires-Dist: dataclasses-json (>=0.5.2,<0.6.0)
|
@@ -3,25 +3,25 @@ benchling_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
benchling_sdk/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
benchling_sdk/apps/canvas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
benchling_sdk/apps/canvas/errors.py,sha256=5YTZOhSV-O0WqURjB1a676BIO429drCKfz5aQjsezms,358
|
6
|
-
benchling_sdk/apps/canvas/framework.py,sha256=
|
7
|
-
benchling_sdk/apps/canvas/types.py,sha256=
|
8
|
-
benchling_sdk/apps/config/__init__.py,sha256=
|
6
|
+
benchling_sdk/apps/canvas/framework.py,sha256=99Ox8V-CvPjxWNyJQ0eaJmP-O8wABVBumjmfw7UMH5U,22971
|
7
|
+
benchling_sdk/apps/canvas/types.py,sha256=tmuU0kpzd1pXqxs3X6x5kjWpCZJrJMb6hnfN1CbtFG4,3613
|
8
|
+
benchling_sdk/apps/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
benchling_sdk/apps/config/cryptography_helpers.py,sha256=VCzgQURLAitYjcjdwFzMPSKZ7MOD6ghxFdbPGA_6RbY,1778
|
10
|
-
benchling_sdk/apps/config/decryption_provider.py,sha256
|
11
|
-
benchling_sdk/apps/config/errors.py,sha256
|
12
|
-
benchling_sdk/apps/config/framework.py,sha256=
|
13
|
-
benchling_sdk/apps/config/
|
14
|
-
benchling_sdk/apps/config/
|
15
|
-
benchling_sdk/apps/config/types.py,sha256=
|
10
|
+
benchling_sdk/apps/config/decryption_provider.py,sha256=-HgjkBto8mYlooV0LXFenfaiP7PDhHRnKEHkK1P6gh4,2184
|
11
|
+
benchling_sdk/apps/config/errors.py,sha256=-qkfLdcUTuuRD-V4L2l7nzQWnWTRuifDtkNDv8tfHoo,800
|
12
|
+
benchling_sdk/apps/config/framework.py,sha256=a2cIkPugEVUfBNtHm2cbE3Qu326xb-SpMuM0Gi6U-3Q,13337
|
13
|
+
benchling_sdk/apps/config/helpers.py,sha256=LTLDR0GCDoo_8Sx4kepQnMmgVEQT7MHfKAxIoAvV9TM,7077
|
14
|
+
benchling_sdk/apps/config/mock_config.py,sha256=kMSKL5P5upxGW4O0R7CY9F3FvWjE5fH6bymmpuQ4k98,26931
|
15
|
+
benchling_sdk/apps/config/types.py,sha256=loVMi9RshnP3dGmdTRm6ckkI3Hm-ZeMx0fAZdAMFJ9E,1038
|
16
16
|
benchling_sdk/apps/framework.py,sha256=H51rAzwH4PQHMGTxx2MdYgHMW1oKa_FLnozzY8XGL2g,3308
|
17
17
|
benchling_sdk/apps/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
-
benchling_sdk/apps/helpers/config_helpers.py,sha256=_t_ccSS53WpaNnwcSx3Mx5ranRJgxIQWcpBoUSWFKFA,9318
|
19
18
|
benchling_sdk/apps/helpers/manifest_helpers.py,sha256=yidiKA5mwWdAFR1ZSUu40QoG0Us-bc6V8tYHYqheEtM,945
|
20
19
|
benchling_sdk/apps/helpers/webhook_helpers.py,sha256=T-ZJLWb37nzSKMQFAQQ8FJU7al_QFBgNRhTfWDfCfYU,7077
|
21
20
|
benchling_sdk/apps/status/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
21
|
benchling_sdk/apps/status/errors.py,sha256=E9PugMd0YwZQWweTztIZyqycECBuVvH6PcLfij0Cb3k,2279
|
23
|
-
benchling_sdk/apps/status/framework.py,sha256=
|
24
|
-
benchling_sdk/apps/status/
|
22
|
+
benchling_sdk/apps/status/framework.py,sha256=CWPIlj8WhRZeIImCLka9LmhXvzbK0be9ekdLxiUKKJk,26358
|
23
|
+
benchling_sdk/apps/status/helpers.py,sha256=o8jdgdxUYdGh2j0Gb3AYoeXI9Bu-ubyIkgWBuCGLKgE,705
|
24
|
+
benchling_sdk/apps/status/types.py,sha256=vE7-_7ns3mvPRJoVv-GQxc3389dIIH4mcG0VDNWpVhQ,746
|
25
25
|
benchling_sdk/auth/__init__.py,sha256=N4pJYVUnTLzg5HO9ZldHaI-Am97i6AOCdQS0M5QcVpA,120
|
26
26
|
benchling_sdk/auth/api_key_auth.py,sha256=Ui-cnvGMjcwVPV_b2GdBaoTjEyHJIu9CjtZScVBEUvU,641
|
27
27
|
benchling_sdk/auth/bearer_token_auth.py,sha256=nymI8V91evcnK-TWKkBXZwck8U1qSh4WaseyQbvF-Cg,1268
|
@@ -70,7 +70,7 @@ benchling_sdk/services/v2/stable/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
70
70
|
benchling_sdk/services/v2/stable/aa_sequence_service.py,sha256=3RCNwyFBrryQowC9fbLoQHSSqKyGA6TQ0VQYBUyeg1U,11782
|
71
71
|
benchling_sdk/services/v2/stable/api_service.py,sha256=e0RNp4Jne9UTaHOYMOxxXJpsyUO3WMSFPzN7hB8iliU,12371
|
72
72
|
benchling_sdk/services/v2/stable/app_service.py,sha256=dy9FMVvMiJrkYbxZswKuB37EB9K_jCqQr9FfAa0BMgE,23126
|
73
|
-
benchling_sdk/services/v2/stable/assay_result_service.py,sha256=
|
73
|
+
benchling_sdk/services/v2/stable/assay_result_service.py,sha256=_qtSpMznVrGHlB2VnHI87IPjVQHCX1pZbLPJ_LYuW7U,13362
|
74
74
|
benchling_sdk/services/v2/stable/assay_run_service.py,sha256=tLpG1pAztEoaDatqlgYlRZ_LgwDly1_UeWt4G4UXvd4,9023
|
75
75
|
benchling_sdk/services/v2/stable/blob_service.py,sha256=KwchH3FGzPLfZx85GEG3voQp_ZxyVL_dds_9awRWa0Q,17115
|
76
76
|
benchling_sdk/services/v2/stable/box_service.py,sha256=M40smqG-jQlioyRfLBu9Cr9aQmdh06crsYbH1fiZ0BM,12359
|
@@ -114,7 +114,7 @@ benchling_sdk/services/v2/v2_alpha_service.py,sha256=vNfYK0Dheml9ozR_0tzTlA3blPD
|
|
114
114
|
benchling_sdk/services/v2/v2_beta_service.py,sha256=7v9ngWH_XTinkVC7bIxxbaA1UeFQqkzR4ANGtQQN-fA,11521
|
115
115
|
benchling_sdk/services/v2/v2_stable_service.py,sha256=YIc-_0p6x1NQqj7awnWgCTHxbxYO7ZOolePZyW90whc,35246
|
116
116
|
benchling_sdk/services/v2_service.py,sha256=3eoIjYEmGLPdWCpBN0pl7q7_HNWCsUvfvTn3Hcz0wSM,2860
|
117
|
-
benchling_sdk-1.10.
|
118
|
-
benchling_sdk-1.10.
|
119
|
-
benchling_sdk-1.10.
|
120
|
-
benchling_sdk-1.10.
|
117
|
+
benchling_sdk-1.10.0a6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
118
|
+
benchling_sdk-1.10.0a6.dist-info/METADATA,sha256=qh_k4Rt0UQn_8-6_wadg9SPAsbr04LhJP4jlWhaTMYQ,2126
|
119
|
+
benchling_sdk-1.10.0a6.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
120
|
+
benchling_sdk-1.10.0a6.dist-info/RECORD,,
|