12/05 Granta Base Types#

The models documented in this section are Python bindings for the Granta Base Types 12/05 XML schema. These are typically used to define references to attributes and records in a Granta MI database.

Tip

Use the BoM reference builders to ensure a valid combination of properties are provided for the classes in this module.

Classes on this page are available in the module ansys.grantami.bomanalytics.bom_types.gbt1205.

Changed in version 2.3: The types documented on this page have moved from ansys.grantami.bomanalytics.bom_types to ansys.grantami.bomanalytics.bom_types.gbt1205. They are still importable from the old location for compatibility.

class PseudoAttribute(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Valid values for PseudoAttribute.

classmethod from_string(value)#

Convert string representation of this object into an instance of this object.

Parameters:
value: str

String representation of this object.

to_string()#

Convert this Enum object to its string representation.

Returns:
str

String representation of this object.

class PartialTableReference(table_identity=None, table_guid=None, table_name=None)#

A type that partially identifies a Table, but does not specify the MI Database. Usually, just one of the several optional fields should be provided; where more than one is provided, the highest priority one is used, where the descending priority order is: tableIdentity, tableGUID, tableName.

table_identity: int | None = None#

The identity of the table, this is the fastest way to reference a table.

table_guid: str | None = None#

The GUID of the table, this is likely to be a persistent way to refer to a table.

table_name: str | None = None#

The name of the table. Note that table names can vary between localisations of a database, so this may not be a safe way to refer to a table if the MI Database supports multiple locales.

class MIAttributeReference(db_key, attribute_identity=None, table_reference=None, attribute_name=None, pseudo=None, is_standard=None)#

A type that allows identification of a particular Attribute in an MI Database. This may be done directly by specifying the Identity of the Attribute, or indirectly by specifying a lookup that will match (only) the Attribute.

Note: in certain cases, an MIAttributeReference may match more than one Attribute in the MI Database; depending on the operation, this may be legal or may result in a Fault.

db_key: str#

The key that uniquely identifies a particular Database on the MI Server.

attribute_identity: int | None = None#

The identity of the attribute within the MI Database.

table_reference: PartialTableReference | None = None#

A reference to the table hosting the attribute. Required if attribute_name is specified and is_standard is not True.

attribute_name: str | None = None#

Name of the Attribute.

pseudo: PseudoAttribute | None = None#

The pseudo-attribute type if referring to a pseudo-attribute.

is_standard: bool | None = None#

If True indicates that the provided attribute_name is a Standard Name.

class MIRecordReference(db_key, record_history_identity=None, record_version_number=None, record_guid=None, record_history_guid=None, lookup_attribute_reference=None, lookup_value=None, record_uid=None)#

A type that allows identification of a particular Record in an MI Database. This may be done directly by specifying the Identity or GUID of the Record, or indirectly by specifying a lookup that will match (only) the Record.

For input, you should provide exactly one of either identity, recordGUID, recordHistoryGUID or lookupValue. If more than one element identifying the record is given, only one is used; the descending order of priority is: identity, recordGUID, recordHistoryGUID, lookupValue. The Service Layer does not check that the several elements identifying the record are all referencing the same record, it just picks the highest-priority one and uses that.

db_key: str#

The key that uniquely identifies a particular Database on the MI Server.

record_history_identity: int | None = None#

This is the best-performing and highest-priority way to reference a record; however, identities might not be suitable for long-term persistence.

record_version_number: int | None = None#

If omitted, this means the latest version visible to the user.

record_guid: str | None = None#

Identifies a particular version of a record by its GUID, this is a more persistent way to refer to a record.

record_history_guid: str | None = None#

Identifies a record history, the latest visible version will be returned. record_version_number has no effect on references that use record_history_guid.

lookup_attribute_reference: MIAttributeReference | None = None#

When provided in combination with lookup_value identifies a record by a unique short-text attribute. Specifies the attribute to be used for the lookup operation.

lookup_value: str | None = None#

When provided in combination with lookup_attribute_reference identifies a record by a unique short-text attribute. Specifies the value to be used for the lookup operation. If this is not unique an error will be returned.

record_uid: str | None = None#

The recordUID may be used to identify a particular XML element representing a record. It does not represent any property or attribute of an actual MI Record.