benchling_sdk.apps.config.framework module¶
- class BenchlingConfigProvider¶
Bases:
benchling_sdk.apps.config.framework.ConfigProvider
Benchling Config provider.
Provides a BenchlingAppConfiguration retrieved from Benchlingâs API.
- __init__(benchling: Benchling, app_id: str)¶
Initialize Benchling Config Provider.
- Parameters
benchling â A Benchling instance.
app_id â The app_id from which to retrieve configuration.
- config() List[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]] ¶
Provide a Benchling app configuration from Benchlingâs APIs.
- class ConfigItemStore¶
Bases:
object
Dependency Link Store.
Marshals an app configuration from the configuration provider into an indexed 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.
- array_rows_to_dict(path: List[str]) OrderedDict[str, Dict[str, ConfigItemWrapper]] ¶
Given a path to the root of a config array, return each element as a named dict.
- config_by_path(path: List[str]) ConfigItemWrapper ¶
Config by path.
Find an app config item by its exact path match, if it exists. Does not search partial paths.
- config_keys_by_path(path: List[str]) ordered_set.OrderedSet[str] ¶
Config keys by path.
Find a set of app config keys at the specified path, if any. Does not return keys that are nested beyond the current level.
For instance, given paths: [âOneâ, âTwoâ] [âOneâ, âTwoâ, âThreeâ] [âOneâ, âTwoâ, âFourâ] [âOneâ, âTwoâ, âThreeâ, âFiveâ] [âZeroâ, âOneâ, âTwoâ, âThreeâ]
The expected return from this method when path=[âOneâ, âTwoâ] is a set {âThreeâ, âFourâ}.
- property configuration: List[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]]¶
Get the underlying configuration.
Return the raw, stored configuration. Can be used if the provided accessors are inadequate to find particular configuration items.
- property configuration_path_dict: Dict[Tuple[str, ...], ConfigItemWrapper]¶
Config links.
Return a dict of configuration item paths to their corresponding configuration items.
- class ConfigItemWrapper¶
Bases:
object
Config Item Wrapper.
A decorator class for AppConfigItem to assist with typesafe access to its values. Access the item attribute for the original config item, if present.
- __init__(item: Optional[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]], path: List[str]) None ¶
Init Pathed Config Item.
- item: Optional[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]]¶
- linked_resource() Optional[LinkedAppConfigResourceSummary] ¶
Return an optional LinkedAppConfigResourceSummary.
Raises exceptions if the config item is not of the type that supports linked resources, or the linked resource is inaccessible.
- required() RequiredConfigItemWrapper ¶
Return a RequiredPathedConfigItem to enforce that config item is not optional.
- class ConfigProvider¶
Bases:
Protocol
Config provider.
Provides a list of ConfigurationReference.
- __init__(*args, **kwargs)¶
- config() List[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]] ¶
Implement to provide a list of configuration items, for instance from Benchling APIs.
- class RequiredConfigItemWrapper¶
Bases:
benchling_sdk.apps.config.framework.ConfigItemWrapper
Required Config Item Wrapper.
A decorator class for AppConfigItem to assist with typesafe access to its values. Enforces that a config item is present, and that itâs value is not None. Access the item attribute for the original config item.
- __init__(item: Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem], path: List[str]) None ¶
Init Required Pathed Config Item.
- item: Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]¶
- linked_resource() LinkedAppConfigResourceSummary ¶
Return a LinkedAppConfigResourceSummary.
Raises exceptions if the config item is not of the type that supports linked resources, or the linked resource is inaccessible.
- class StaticConfigProvider¶
Bases:
benchling_sdk.apps.config.framework.ConfigProvider
Static Config provider.
Provides a BenchlingAppConfiguration from a static declaration. Useful for mocking or testing.
- __init__(configuration_items: List[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]])¶
Initialize Static Config Provider.
- Parameters
configuration_items â The configuration items to return.
- config() List[Union[ArrayElementAppConfigItem, DateAppConfigItem, DatetimeAppConfigItem, JsonAppConfigItem, EntitySchemaAppConfigItem, FieldAppConfigItem, BooleanAppConfigItem, IntegerAppConfigItem, FloatAppConfigItem, GenericApiIdentifiedAppConfigItem, SecureTextAppConfigItem, TextAppConfigItem]] ¶
Provide Benchling app configuration items from a static reference.