mex.backend.identity package¶
Submodules¶
mex.backend.identity.main module¶
- mex.backend.identity.main.assign_identity(request: IdentityAssignRequest) Identity ¶
Insert a new identity or update an existing one.
- mex.backend.identity.main.fetch_identity(hadPrimarySource: Identifier | None = None, identifierInPrimarySource: str | None = None, stableTargetId: Identifier | None = None) IdentityFetchResponse ¶
Find an Identity instance from the database if it can be found.
Either provide stableTargetId or hadPrimarySource and identifierInPrimarySource together to get a unique result.
mex.backend.identity.models module¶
- class mex.backend.identity.models.IdentityAssignRequest(*, hadPrimarySource: MergedPrimarySourceIdentifier, identifierInPrimarySource: str)¶
Bases:
BaseModel
Request body for identity upsert requests.
- hadPrimarySource: MergedPrimarySourceIdentifier¶
- identifierInPrimarySource: str¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'str_max_length': 100000, 'str_min_length': 1, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'hadPrimarySource': FieldInfo(annotation=MergedPrimarySourceIdentifier, required=True), 'identifierInPrimarySource': FieldInfo(annotation=str, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- class mex.backend.identity.models.IdentityFetchResponse(*, items: list[Identity], total: int)¶
Bases:
BaseModel
Response body for identity fetch requests.
- items: list[Identity]¶
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'str_max_length': 100000, 'str_min_length': 1, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'items': FieldInfo(annotation=list[Identity], required=True), 'total': FieldInfo(annotation=int, required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- total: int¶
mex.backend.identity.provider module¶
- class mex.backend.identity.provider.GraphIdentityProvider¶
Bases:
BaseProvider
,GraphConnector
Identity provider that communicates with the graph database.
- __init__() None ¶
Create a new graph identity provider.
- _do_assign(had_primary_source: MergedPrimarySourceIdentifier, identifier_in_primary_source: str) Identity ¶
Find an Identity in the database or assign a new one.
- assign(had_primary_source: MergedPrimarySourceIdentifier, identifier_in_primary_source: str) Identity ¶
Return a cached Identity from the database or newly assigned one.
- fetch(*, had_primary_source: Identifier | None = None, identifier_in_primary_source: str | None = None, stable_target_id: Identifier | None = None) list[Identity] ¶
Find Identity instances matching the given filters.
Either provide stable_target_id or had_primary_source and identifier_in_primary_source together to get a unique result.