benchling_sdk.apps.config.dependencies module¶
- class ApiDependency¶
Bases:
abc.ABC
,Generic
[benchling_sdk.apps.config.dependencies.ApiConfigType
]Api Dependency.
A dependency that is API identifiable in Benchling, such as a schema.
- link: benchling_sdk.apps.config.dependencies.ApiConfigType¶
- class BaseDependencies¶
Bases:
object
A base class for implementing dependencies.
Used as a facade for the underlying link store, which holds dependency links configured in Benchling.
- __init__(store: DependencyLinkStore, scalar_definitions: Dict[benchling_api_client.v2.beta.models.scalar_config_types.ScalarConfigTypes, ScalarDefinition] = DEFAULT_SCALAR_DEFINITIONS, unknown_scalar_definition: Optional[ScalarDefinition] = None, decryption_provider: Optional[BaseDecryptionProvider] = None)¶
Initialize Base Dependencies.
- Parameters
store â The dependency link store to source dependency links from.
scalar_definitions â A map of scalar types from the API definitions to ScalarDefinitions which
determines how we want map them to concrete Python types and values. Can be overridden to customize deserialization behavior or formatting. :param unknown_scalar_definition: A scalar definition for handling unknown scalar types from the API. Can be used to control behavior for forwards compatibility with new types the SDK does not yet support (e.g., by treating them as strings). :param decryption_provider: A decryption provider that can decrypt secrets from app config. If dependencies attempt to use a secure_textâs decrypted value, a decryption_provider must be specified.
- classmethod from_app(client: Benchling, app_id: str, decryption_provider: Optional[BaseDecryptionProvider] = None) benchling_sdk.apps.config.dependencies.D ¶
Initialize dependencies from an app_id.
- class BenchlingConfigProvider¶
Bases:
benchling_sdk.apps.config.dependencies.ConfigProvider
Benchling Config provider.
Provides a BenchlingAppConfiguration retrieved from Benchlingâs API.
- __init__(client: Benchling, app_id: str)¶
Initialize Benchling Config Provider.
- Parameters
client â A configured Benchling instance for making API calls.
app_id â The app_id from which to retrieve configuration.
- config() benchling_api_client.v2.beta.models.benchling_app_configuration.BenchlingAppConfiguration ¶
Provide a Benchling app configuration from Benchlingâs APIs.
- class ConfigProvider¶
Bases:
typing_extensions.Protocol
Config provider.
Provides a BenchlingAppConfiguration.
- __init__(*args, **kwargs)¶
- config() benchling_api_client.v2.beta.models.benchling_app_configuration.BenchlingAppConfiguration ¶
Implement to provide a Benchling app configuration.
- class DependencyLinkStore¶
Bases:
object
Dependency Link Store.
Marshalls an app configuration from the configuration provider into an indexable structure. Only retrieves app configuration once unless its cache is invalidated.
- __init__(configuration_provider: ConfigProvider)¶
Initialize Dependency Link Store.
- Parameters
configuration_provider â A ConfigProvider that will be invoked to provide the
underlying config from which to organize dependency links.
- config_by_name(name: str, config_type: Type[benchling_sdk.apps.config.dependencies.AnyConfigType]) benchling_sdk.apps.config.dependencies.AnyConfigType ¶
Config by name.
Look up a configuration reference by its name. Only applies to named configuration at the top level, not subdependencies.
- property config_links: Dict[str, Union[benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink, benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink, benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink, benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink, benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink, benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink, benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig]]¶
Config links.
Return a map of configuration item names to their corresponding API link or dependency value.
- property configuration: benchling_api_client.v2.beta.models.benchling_app_configuration.BenchlingAppConfiguration¶
Get the underlying configuration.
Return the raw, stored configuration. Can be used if the provided accessors are inadequate to find particular configuration items.
- classmethod from_app(client: Benchling, app_id: str) DependencyLinkStore ¶
From App.
Instantiate a DependencyLinkStore from an app_id and a configured Benchling instance. Preferred to using the classâs constructor.
- invalidate_cache() None ¶
Invalidate Cache.
Will force retrieval of configuration from the ConfigProvider the next time the link store is accessed.
- map_from_configuration(config: benchling_api_client.v2.beta.models.benchling_app_configuration.BenchlingAppConfiguration) Dict[str, Union[benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink, benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink, benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink, benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink, benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink, benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink, benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig]] ¶
Map from configuration.
Produce a map of Benchling configuration references where the name is the key for easy lookup.
- to_map_value(configuration_item: Union[benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink, benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink, benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink, benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink, benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink, benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink, benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig, benchling_api_client.v2.extensions.UnknownType]) Union[benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink, benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink, benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink, benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink, benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink, benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink, benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig] ¶
Transform configuration item to a map.
This method can be overridden to change handling of UnknownType and type safety for ConfigurationReference.
- class DropdownDependency¶
Bases:
benchling_sdk.apps.config.dependencies.ApiDependency
[benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink
],benchling_sdk.apps.config.dependencies.Subdependencies
Dropdown Dependency.
Links a Benchling dropdown.
- __init__(link: benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink) None ¶
- link: benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink¶
- class DropdownOptionsDependency¶
Bases:
object
Dropdown Options Dependency.
Links a Benchling dropdown with options to the parent that owns those options.
- __init__(parent: DropdownDependency) None ¶
- parent: DropdownDependency¶
- class EntitySchemaDependency¶
Bases:
benchling_sdk.apps.config.dependencies.ApiDependency
[benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink
],benchling_sdk.apps.config.dependencies.SchemaFieldsMixin
Entity Schema Dependency.
Links a Benchling entity schema.
- __init__(link: benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink) None ¶
- link: benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink¶
- class HasConfigWithDecryptionProvider¶
Bases:
typing_extensions.Protocol
Has Config With Decryption Provider.
A mixin for typing to assert that a particular class has a decryption provider and config.
- __init__(*args, **kwargs)¶
- property config: benchling_api_client.v2.beta.models.scalar_config.ScalarConfig¶
Return the underlying scalar config.
- property decryption_provider: Optional[BaseDecryptionProvider]¶
Return the decryption provider.
- class HasEntityLink¶
Bases:
typing_extensions.Protocol
Has Entity Link.
A mixin for typing to assert that a particular class has a link to an entity schema.
- __init__(*args, **kwargs)¶
- property link: Union[benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink, benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink]¶
Return the underlying schema dependency link.
- class HasLink¶
Bases:
typing_extensions.Protocol
Has Link.
A mixin for typing to assert that a particular class has any link.
- __init__(*args, **kwargs)¶
- property link: Union[benchling_api_client.v2.beta.models.dropdown_dependency_link.DropdownDependencyLink, benchling_api_client.v2.beta.models.entity_schema_dependency_link.EntitySchemaDependencyLink, benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink, benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink, benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink, benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink]¶
Return the underlying dependency link.
- class HasScalarDefinition¶
Bases:
typing_extensions.Protocol
Has Scalar Definition.
A mixin for typing to assert that a particular class has scalar attributes.
- __init__(*args, **kwargs)¶
- property config: benchling_api_client.v2.beta.models.scalar_config.ScalarConfig¶
Return the underlying scalar config.
- property definition: Optional[ScalarDefinition]¶
Return the scalar definition, allowing for conversion to Python types.
- class HasWorkflowTaskSchemaLink¶
Bases:
typing_extensions.Protocol
Has Workflow Task Schema Link.
A mixin for typing to assert that a particular class has a link to a workflow task schema.
- __init__(*args, **kwargs)¶
- property link: benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink¶
Return the underlying workflow task schema dependency link.
- class HasWorkflowTaskSchemaParentLink¶
Bases:
typing_extensions.Protocol
Has Workflow Task Schema Parent Link.
A mixin for typing to assert that a particular class has a link to a parent workflow task schema.
- __init__(*args, **kwargs)¶
- property parent: HasWorkflowTaskSchemaLink¶
Return the parent workflow task schema dependency link.
- exception MissingAppConfigError¶
Bases:
Exception
Missing app config error.
The app did not return any configuration. It may not have a manifest installed, or may not have been configured.
- exception MissingDependencyError¶
Bases:
Exception
Missing dependency error.
Indicates a dependency was missing from app config. For instance, no dependency with that name was in the list.
- exception MissingScalarDefinitionError¶
Bases:
Exception
Missing scalar definition error.
The manifest and configuration specified a scalar type which the SDK does not know how to translate to Python values yet.
- class RequiredApiDependencyMixin¶
Bases:
object
Require Api Link.
A mixin for accessing an API link which is required and should always be present. Should only be mixed in with ApiDependency or another class that provides the self.link attribute.
- class RequiredScalarDependencyMixin¶
Bases:
Generic
[benchling_sdk.apps.config.scalars.ScalarType
]Require Scalar Config.
A mixin for accessing a scalar config which is required and should always be present. Should only be mixed in with ScalarConfig.
- property value: benchling_sdk.apps.config.scalars.ScalarType¶
Return the value of the scalar.
- class RequiredSecureTextDependencyMixin¶
Bases:
benchling_sdk.apps.config.dependencies.RequiredScalarDependencyMixin
[str
]Require Secure Text.
A mixin for accessing a secure text config which is required and should always be present. Should only be mixed in with SecureTextConfig.
- class ResourceDependency¶
Bases:
benchling_sdk.apps.config.dependencies.ApiDependency
[benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink
]Resource Dependency.
Holds a reference to an API identified Benchling resource. Typically a singleton, such as a registry, or particular entity.
- __init__(link: benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink) None ¶
- link: benchling_api_client.v2.beta.models.resource_dependency_link.ResourceDependencyLink¶
- class ScalarDependency¶
Bases:
object
Scalar Dependency.
Scalars are values that can be represented outside the Benchling domain.
- __init__(config: Union[benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig], definition: Optional[ScalarDefinition]) None ¶
- config: Union[benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig]¶
- definition: Optional[ScalarDefinition]¶
- class SchemaDependency¶
Bases:
benchling_sdk.apps.config.dependencies.ApiDependency
[benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink
],benchling_sdk.apps.config.dependencies.SchemaFieldsMixin
Schema Dependency.
Links a Benchling schema for types other than bio entities.
- __init__(link: benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink) None ¶
- link: benchling_api_client.v2.beta.models.schema_dependency_link.SchemaDependencyLink¶
- class SchemaFieldsDependency¶
Bases:
object
Schema Fields Dependency.
Links a Benchling object with schema fields to the parent that owns those fields.
- __init__(parent: Union[EntitySchemaDependency, SchemaDependency, WorkflowTaskSchemaDependency, WorkflowTaskSchemaOutputDependency]) None ¶
- class SchemaFieldsMixin¶
Bases:
benchling_sdk.apps.config.dependencies.Subdependencies
Implements Subdependencies for schema fields.
- class SecureTextDependency¶
Bases:
benchling_sdk.apps.config.dependencies.ScalarDependency
SecureText Config.
A dependency for accessing a secure_text config.
- __init__(config: Union[benchling_api_client.v2.beta.models.scalar_config.ScalarConfig, benchling_api_client.v2.beta.models.secure_text_config.SecureTextConfig], definition: Optional[ScalarDefinition], decryption_provider: Optional[BaseDecryptionProvider]) None ¶
- decryption_provider: Optional[BaseDecryptionProvider]¶
- class StaticConfigProvider¶
Bases:
benchling_sdk.apps.config.dependencies.ConfigProvider
Static Config provider.
Provides a BenchlingAppConfiguration from a static declaration. Useful for mocking or testing.
- __init__(configuration: benchling_api_client.v2.beta.models.benchling_app_configuration.BenchlingAppConfiguration)¶
Initialize Static Config Provider.
- Parameters
configuration â The configuration object to return.
- config() benchling_api_client.v2.beta.models.benchling_app_configuration.BenchlingAppConfiguration ¶
Provide a Benchling app configuration from a static object.
- class Subdependencies¶
Bases:
abc.ABC
Subdependencies.
Assigns behavior to a class that can have a list of dependencies, such as schema fields or dropdown options.
- subdependency_by_name(name: str) benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink ¶
Get a subdependency link by its name.
- abstract subdependency_links() List[benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink] ¶
Implement to fetch the list of subdependency links.
- class Subdependency¶
Bases:
benchling_sdk.apps.config.dependencies.ApiDependency
[benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink
]Subdependency.
Holds a reference to an API identified Benchling subdependency that belongs to a parent. Examples are fields on a schema or options on a dropdown.
- link: benchling_api_client.v2.beta.models.subdependency_link.SubdependencyLink¶
- exception UnsupportedDependencyError¶
Bases:
Exception
Unsupported dependency error.
The manifest and configuration specified a dependency which the SDK is incapable of handling yet.
- class WorkflowTaskSchemaDependency¶
Bases:
benchling_sdk.apps.config.dependencies.ApiDependency
[benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink
],benchling_sdk.apps.config.dependencies.SchemaFieldsMixin
Workflow Task Schema Dependency.
Links a Benchling workflow task schema.
- __init__(link: benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink) None ¶
- link: benchling_api_client.v2.beta.models.workflow_task_schema_dependency_link.WorkflowTaskSchemaDependencyLink¶
- class WorkflowTaskSchemaOutputDependency¶
Bases:
benchling_sdk.apps.config.dependencies.WorkflowTaskSchemaOutputFieldsMixin
Workflow Task Schema Output Dependency.
Links a Benchling workflow task schema output to its parent workflow task schema.
- __init__(parent: WorkflowTaskSchemaDependency) None ¶
- parent: WorkflowTaskSchemaDependency¶
- class WorkflowTaskSchemaOutputFieldsMixin¶
Bases:
benchling_sdk.apps.config.dependencies.Subdependencies
Implements Subdependencies for workflow task schema output schema fields.