benchling_sdk.apps.helpers.config_helpers module¶

exception UnsupportedSubTypeError¶

Bases: Exception

Error when an unsupported subtype is encountered.

app_config_type_from_dependency(dependency: Union[benchling_api_client.v2.beta.models.base_manifest_config.BaseManifestConfig, benchling_api_client.v2.beta.models.dropdown_dependency.DropdownDependency, benchling_api_client.v2.beta.models.entity_schema_dependency.EntitySchemaDependency, benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest, benchling_api_client.v2.beta.models.manifest_array_config.ManifestArrayConfig, benchling_api_client.v2.beta.models.manifest_text_scalar_config.ManifestTextScalarConfig, benchling_api_client.v2.beta.models.manifest_float_scalar_config.ManifestFloatScalarConfig, benchling_api_client.v2.beta.models.manifest_integer_scalar_config.ManifestIntegerScalarConfig, benchling_api_client.v2.beta.models.manifest_boolean_scalar_config.ManifestBooleanScalarConfig, benchling_api_client.v2.beta.models.manifest_date_scalar_config.ManifestDateScalarConfig, benchling_api_client.v2.beta.models.manifest_datetime_scalar_config.ManifestDatetimeScalarConfig, benchling_api_client.v2.beta.models.manifest_secure_text_scalar_config.ManifestSecureTextScalarConfig, benchling_api_client.v2.beta.models.manifest_json_scalar_config.ManifestJsonScalarConfig, benchling_api_client.v2.extensions.UnknownType, benchling_api_client.v2.beta.models.resource_dependency.ResourceDependency, benchling_api_client.v2.beta.models.schema_dependency.SchemaDependency, benchling_api_client.v2.beta.models.workflow_task_schema_dependency.WorkflowTaskSchemaDependency]) → Type[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]]¶

App Config Item Type From Item.

Returns the type of the API model corresponding to an app config item. Raises UnsupportedDependencyError if encountering an unknown type.

element_definition_from_dependency(dependency: benchling_api_client.v2.beta.models.manifest_array_config.ManifestArrayConfig) → List[Union[benchling_api_client.v2.beta.models.schema_dependency.SchemaDependency, benchling_api_client.v2.beta.models.entity_schema_dependency.EntitySchemaDependency, benchling_api_client.v2.beta.models.workflow_task_schema_dependency.WorkflowTaskSchemaDependency, benchling_api_client.v2.beta.models.dropdown_dependency.DropdownDependency, benchling_api_client.v2.beta.models.resource_dependency.ResourceDependency, benchling_api_client.v2.beta.models.manifest_text_scalar_config.ManifestTextScalarConfig, benchling_api_client.v2.beta.models.manifest_float_scalar_config.ManifestFloatScalarConfig, benchling_api_client.v2.beta.models.manifest_integer_scalar_config.ManifestIntegerScalarConfig, benchling_api_client.v2.beta.models.manifest_boolean_scalar_config.ManifestBooleanScalarConfig, benchling_api_client.v2.beta.models.manifest_date_scalar_config.ManifestDateScalarConfig, benchling_api_client.v2.beta.models.manifest_datetime_scalar_config.ManifestDatetimeScalarConfig, benchling_api_client.v2.beta.models.manifest_secure_text_scalar_config.ManifestSecureTextScalarConfig, benchling_api_client.v2.beta.models.manifest_json_scalar_config.ManifestJsonScalarConfig, benchling_api_client.v2.extensions.UnknownType]]¶

Safely return an element definition as a list of dependencies from an array dependency or empty list.

field_definitions_from_dependency(dependency: Union[benchling_api_client.v2.beta.models.entity_schema_dependency.EntitySchemaDependency, benchling_api_client.v2.beta.models.schema_dependency.SchemaDependency, benchling_api_client.v2.beta.models.workflow_task_schema_dependency.WorkflowTaskSchemaDependency, benchling_api_client.v2.beta.models.workflow_task_schema_dependency_output.WorkflowTaskSchemaDependencyOutput]) → List[benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest]¶

Safely return a list of field definitions from a schema dependency or empty list.

is_config_multi_valued(dependency: benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest) → bool¶

Safely return if a config item is multi-valued.

Assumes False in the case that a multi-valued constraint is unspecified (Unset).

is_config_multi_valued_or_unset(dependency: benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest) → Optional[bool]¶

Safely return if a config item is multi-valued or None if it’s Unset.

Multi-valued constraint being undefined cannot be safely inferred for type coercion.

For instance, a required text field could be typed as: isMulti == True: List[str] isMulti == False: str isMulti == Unset: Union[str, List[str]]

is_config_required(dependency: Union[benchling_api_client.v2.beta.models.base_manifest_config.BaseManifestConfig, benchling_api_client.v2.beta.models.dropdown_dependency.DropdownDependency, benchling_api_client.v2.beta.models.entity_schema_dependency.EntitySchemaDependency, benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest, benchling_api_client.v2.beta.models.manifest_array_config.ManifestArrayConfig, benchling_api_client.v2.beta.models.manifest_text_scalar_config.ManifestTextScalarConfig, benchling_api_client.v2.beta.models.manifest_float_scalar_config.ManifestFloatScalarConfig, benchling_api_client.v2.beta.models.manifest_integer_scalar_config.ManifestIntegerScalarConfig, benchling_api_client.v2.beta.models.manifest_boolean_scalar_config.ManifestBooleanScalarConfig, benchling_api_client.v2.beta.models.manifest_date_scalar_config.ManifestDateScalarConfig, benchling_api_client.v2.beta.models.manifest_datetime_scalar_config.ManifestDatetimeScalarConfig, benchling_api_client.v2.beta.models.manifest_secure_text_scalar_config.ManifestSecureTextScalarConfig, benchling_api_client.v2.beta.models.manifest_json_scalar_config.ManifestJsonScalarConfig, benchling_api_client.v2.extensions.UnknownType, benchling_api_client.v2.beta.models.resource_dependency.ResourceDependency, benchling_api_client.v2.beta.models.schema_dependency.SchemaDependency, benchling_api_client.v2.beta.models.workflow_task_schema_dependency.WorkflowTaskSchemaDependency]) → bool¶

Safely return if a config item is required.

is_field_value_required(dependency: benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest) → bool¶

Safely return if a field must have a value.

A field must be specified as requiredConfig: true AND isRequired: true to require a value.

model_type_from_dependency(dependency: Union[benchling_api_client.v2.beta.models.entity_schema_dependency.EntitySchemaDependency, benchling_api_client.v2.beta.models.schema_dependency.SchemaDependency]) → Optional[Type[Union[AssayResult, AssayRun, Box, Container, Entry, Location, Plate, Request, AaSequence, CustomEntity, DnaOligo, DnaSequence, Mixture, Molecule, RnaOligo, RnaSequence]]]¶

Translate a schema dependency to its model class. Must have a valid subtype.

options_from_dependency(dependency: benchling_api_client.v2.beta.models.dropdown_dependency.DropdownDependency) → List[benchling_api_client.v2.beta.models.base_manifest_config.BaseManifestConfig]¶

Safely return a list of options from a dropdown dependency or empty list.

scalar_type_from_config(config: benchling_api_client.v2.beta.models.scalar_config.ScalarConfig) → Union[object, Type[Union[bool, date, datetime, float, int, str]]]¶

Translate a scalar config to its Pyton type.

scalar_type_from_field_config(config: benchling_api_client.v2.beta.models.field_definitions_manifest.FieldDefinitionsManifest) → Union[object, Type[Union[bool, date, datetime, float, int, str]]]¶

Translate a field config to its Pyton type.

subtype_from_entity_schema_dependency(dependency: benchling_api_client.v2.beta.models.entity_schema_dependency.EntitySchemaDependency) → Optional[benchling_api_client.v2.beta.models.schema_dependency_subtypes.SchemaDependencySubtypes]¶

Safely return an entity schema dependency’s subtype, if present.

workflow_task_schema_output_from_dependency(dependency: benchling_api_client.v2.beta.models.workflow_task_schema_dependency.WorkflowTaskSchemaDependency) → Optional[benchling_api_client.v2.beta.models.workflow_task_schema_dependency_output.WorkflowTaskSchemaDependencyOutput]¶

Safely return a workflow task schema output from a workflow task schema or None.