BoM reference builders#

Record reference builder#

Many types of entity are referenced within a Granta MI database. These references can use several different ways of identifying the target object. The RecordReferenceBuilder helps to ensure that a reference contains the required information and to reduce the risk of ambiguous references being provided.

class RecordReferenceBuilder(db_key, *, record_uid=None)#

Create a MIRecordReference with a valid combination of properties.

New in version 2.0.

Parameters:
db_keystr

Database key specifying the database to which the Record belongs.

record_uidOptional[str]

Optional identifier to annotate this record reference, will be returned with the response unchanged.

with_record_history_id(record_history_id, *, record_version_number=None)#

Specify the record by its history identity, and optionally the version number if the record is in a Version-Controlled table.

Parameters:
record_history_idint

The record history identity.

record_version_numberOptional[int]

If the record is in a Version-Controlled table, return a specific version of the record, otherwise the latest released version will be returned.

Returns:
_FinalRecordReferenceBuilder
with_record_guid(record_guid)#

Specify the record by its GUID.

This will specify an exact version if the table is Version-Controlled.

Parameters:
record_guidstr

The record version GUID.

Returns:
_FinalRecordReferenceBuilder
with_record_history_guid(record_history_guid)#

Specify the record by its History GUID.

This will return the latest released version of the record. If a specific version is required then use the with_record_guid method instead.

Parameters:
record_history_guidstr

The record history GUID.

Returns:
_FinalRecordReferenceBuilder
with_lookup_value(*, lookup_value, lookup_attribute_reference)#

Specify the record by a unique value on a short-text attribute.

You must specify both the attribute and the lookup value. If the value is not unique then an exception will be raised.

Parameters:
lookup_valuestr

The value identifying the record.

lookup_attribute_referenceMIAttributeReference

The short-text attribute or compatible pseudo-attribute to use for the lookup.

Returns:
_FinalRecordReferenceBuilder

Attribute reference builder#

Records can be referred to by a unique text value, this must be accompanied by a reference to the attribute containing the value. The AttributeReferenceBuilder helps to ensure that this reference contains the required information and to reduce the risk of ambiguous references being provided.

class AttributeReferenceBuilder(db_key)#

Create a MI Attribute Reference with a valid combination of properties.

New in version 2.0.

Parameters:
db_keystr

Database Key specifying the database the Attribute is in.

with_attribute_identity(attribute_identity)#

Specify the attribute by its identity.

Parameters:
attribute_identityint

The attribute’s identity.

Returns:
_FinalAttributeReferenceBuilder
as_pseudo_attribute(pseudo_attribute)#

Specify the attribute as a specific pseudo-attribute.

Parameters:
pseudo_attributePseudoAttribute
Returns:
_FinalAttributeReferenceBuilder
with_attribute_name(attribute_name, *, is_standard_name=False)#

Specify the attribute by name, which may be a standard name.

Parameters:
attribute_namestr

The attribute’s name.

is_standard_namebool

If True, the attribute is defined by a standard name (default false).

Returns:
_AttributeReferenceByNameBuilder