mstrio > modeling > schema > helpers

class mstrio.modeling.schema.helpers.AttributeDisplays(report_displays, browse_displays)

Bases: Dictable

The collections of report displays and browse displays of the attribute.

Parameters:
report_displays

list of an AttributeSorts for report displays

browse_displays

list of an AttributeSorts for browse displays

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

class mstrio.modeling.schema.helpers.AttributeSort(form, ascending=False)

Bases: Dictable

An individual sort element in an AttributeSorts list.

Parameters:
form

A form reference

ascending

whether the sort is in ascending or descending order

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

class mstrio.modeling.schema.helpers.AttributeSorts(report_sorts=None, browse_sorts=None)

Bases: Dictable

The collections of report sorts and browse sorts of the attribute.

Parameters:
report_sorts

list of an AttributeSorts for report sorts

browse_sorts

list of an AttributeSorts for browse sorts

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

class mstrio.modeling.schema.helpers.DataType(type, precision, scale)

Bases: Dictable

Representation in the object model for a data-type that could be used for a SQL column.

Parameters:
  • type (Type) –

  • precision (str) –

  • scale (str) –

type

gross data type of an actual or proposed column in a database.

precision

for relevant data types, the length of the representation

scale

for relevant data types, the fixed position used

in the representation
enum Type(value)

Bases: AutoName

String literal used to identify the gross data type of an actual or proposed column in a database.

Valid values are as follows:

UNKNOWN = Type.UNKNOWN
RESERVED = Type.RESERVED
INTEGER = Type.INTEGER
UNSIGNED = Type.UNSIGNED
NUMERIC = Type.NUMERIC
DECIMAL = Type.DECIMAL
REAL = Type.REAL
FLOAT = Type.FLOAT
CHAR = Type.CHAR
FIXED_LENGTH_STRING = Type.FIXED_LENGTH_STRING
VARIABLE_LENGTH_STRING = Type.VARIABLE_LENGTH_STRING
BINARY = Type.BINARY
VAR_BIN = Type.VAR_BIN
LONGVARBIN = Type.LONGVARBIN
DATE = Type.DATE
TIME = Type.TIME
TIME_STAMP = Type.TIME_STAMP
N_CHAR = Type.N_CHAR
N_VAR_CHAR = Type.N_VAR_CHAR
SHORT = Type.SHORT
LONG = Type.LONG
MB_CHAR = Type.MB_CHAR
BOOL = Type.BOOL
PATTERN = Type.PATTERN
N_PATTERN = Type.N_PATTERN
CELL_FORMAT_DATA = Type.CELL_FORMAT_DATA
MISSING = Type.MISSING
UTF8_CHAR = Type.UTF8_CHAR
INT64 = Type.INT64
GUID = Type.GUID
DOUBLE_DOUBLE = Type.DOUBLE_DOUBLE
classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

class mstrio.modeling.schema.helpers.FormReference(id=None, name=None)

Bases: Dictable

The reference that identifies a form object within the context of a given attribute. When writing back an attribute, either id or name is needed to identify a form, and if both are provided, id will take the higher priority.

Parameters:
  • id (str) –

  • name (str) –

id

id of the form

name

name of the form

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

enum mstrio.modeling.schema.helpers.ObjectSubType(value)

Bases: AutoName

String literal used to identify the type of a metadata object. Some Strategy One APIs make a distinction between an object’s type and subtype because in some cases (e.g. the different kinds of reports) it can be useful to see one “report” concept rather than to have to always distinguish between different kinds of reports. But there are cases (e.g. filters versus custom-groups or users versus user-groups ) where users want to see the different subtypes of the same type as fundamentally different. Used across different modeling modules e.g. attributes, user hierarchies.

Valid values are as follows:

FILTER = ObjectSubType.FILTER
CUSTOM_GROUP = ObjectSubType.CUSTOM_GROUP
FILTER_PARTITION = ObjectSubType.FILTER_PARTITION
SEGMENT = ObjectSubType.SEGMENT
TEMPLATE = ObjectSubType.TEMPLATE
REPORT_GRID = ObjectSubType.REPORT_GRID
REPORT_GRAPH = ObjectSubType.REPORT_GRAPH
REPORT_ENGINE = ObjectSubType.REPORT_ENGINE
REPORT_TEXT = ObjectSubType.REPORT_TEXT
REPORT_DATAMART = ObjectSubType.REPORT_DATAMART
REPORT_BASE = ObjectSubType.REPORT_BASE
REPORT_GRID_AND_GRAPH = ObjectSubType.REPORT_GRID_AND_GRAPH
REPORT_NON_INTERACTIVE = ObjectSubType.REPORT_NON_INTERACTIVE
REPORT_CUBE = ObjectSubType.REPORT_CUBE
REPORT_INCREMENT_REFRESH = ObjectSubType.REPORT_INCREMENT_REFRESH
REPORT_TRANSACTION = ObjectSubType.REPORT_TRANSACTION
REPORT_EMMA_CUBE = ObjectSubType.REPORT_EMMA_CUBE
REPORT_EMMA_CUBE_IRR = ObjectSubType.REPORT_EMMA_CUBE_IRR
REPORT_HYPER_CARD = ObjectSubType.REPORT_HYPER_CARD
METRIC = ObjectSubType.METRIC
METRIC_SUBTOTAL = ObjectSubType.METRIC_SUBTOTAL
SYSTEM_SUBTOTAL = ObjectSubType.SYSTEM_SUBTOTAL
METRIC_DMX = ObjectSubType.METRIC_DMX
METRIC_TRAINING = ObjectSubType.METRIC_TRAINING
METRIC_EXTREME = ObjectSubType.METRIC_EXTREME
METRIC_REFERENCE_LINE = ObjectSubType.METRIC_REFERENCE_LINE
METRIC_RELATIONSHIP = ObjectSubType.METRIC_RELATIONSHIP
STYLE = ObjectSubType.STYLE
AGG_METRIC = ObjectSubType.AGG_METRIC
FOLDER = ObjectSubType.FOLDER
FOLDER_SYSTEM = ObjectSubType.FOLDER_SYSTEM
DEVICE = ObjectSubType.DEVICE
PROMPT = ObjectSubType.PROMPT
PROMPT_BOOLEAN = ObjectSubType.PROMPT_BOOLEAN
PROMPT_LONG = ObjectSubType.PROMPT_LONG
PROMPT_STRING = ObjectSubType.PROMPT_STRING
PROMPT_DOUBLE = ObjectSubType.PROMPT_DOUBLE
PROMPT_DATE = ObjectSubType.PROMPT_DATE
PROMPT_OBJECTS = ObjectSubType.PROMPT_OBJECTS
PROMPT_ELEMENTS = ObjectSubType.PROMPT_ELEMENTS
PROMPT_EXPRESSION = ObjectSubType.PROMPT_EXPRESSION
PROMPT_EXPRESSION_DRAFT = ObjectSubType.PROMPT_EXPRESSION_DRAFT
PROMPT_DIMTY = ObjectSubType.PROMPT_DIMTY
PROMPT_BIG_DECIMAL = ObjectSubType.PROMPT_BIG_DECIMAL
FUNCTION = ObjectSubType.FUNCTION
FUNCTION_THIRD_PARTY = ObjectSubType.FUNCTION_THIRD_PARTY
ATTRIBUTE = ObjectSubType.ATTRIBUTE
ATTRIBUTE_ROLE = ObjectSubType.ATTRIBUTE_ROLE
ATTRIBUTE_TRANSFORMATION = ObjectSubType.ATTRIBUTE_TRANSFORMATION
ATTRIBUTE_ABSTRACT = ObjectSubType.ATTRIBUTE_ABSTRACT
ATTRIBUTE_RECURSIVE = ObjectSubType.ATTRIBUTE_RECURSIVE
ATTRIBUTE_DERIVED = ObjectSubType.ATTRIBUTE_DERIVED
FACT = ObjectSubType.FACT
DIMENSION_SYSTEM = ObjectSubType.DIMENSION_SYSTEM
DIMENSION_USER = ObjectSubType.DIMENSION_USER
DIMENSION_ORDERED = ObjectSubType.DIMENSION_ORDERED
DIMENSION_USER_HIERARCHY = ObjectSubType.DIMENSION_USER_HIERARCHY
LOGICAL_TABLE = ObjectSubType.LOGICAL_TABLE
TABLE_PARTITION_MD = ObjectSubType.TABLE_PARTITION_MD
TABLE_PARTITION_WH = ObjectSubType.TABLE_PARTITION_WH
DATAMART_REPORT = ObjectSubType.DATAMART_REPORT
FACT_GROUP = ObjectSubType.FACT_GROUP
SHORTCUT = ObjectSubType.SHORTCUT
SHORTCUT_WEAK_REF = ObjectSubType.SHORTCUT_WEAK_REF
RESOLUTION = ObjectSubType.RESOLUTION
ATTRIBUTE_FORM_SYSTEM = ObjectSubType.ATTRIBUTE_FORM_SYSTEM
ATTRIBUTE_FORM_NORMAL = ObjectSubType.ATTRIBUTE_FORM_NORMAL
ATTRIBUTE_FORM_CUSTOM = ObjectSubType.ATTRIBUTE_FORM_CUSTOM
SCHEMA = ObjectSubType.SCHEMA
FORMAT = ObjectSubType.FORMAT
CATALOG = ObjectSubType.CATALOG
CATALOG_DEFN = ObjectSubType.CATALOG_DEFN
COLUMN = ObjectSubType.COLUMN
COLUMN_NORMAL = ObjectSubType.COLUMN_NORMAL
COLUMN_CUSTOM = ObjectSubType.COLUMN_CUSTOM
PROPERTY_GROUP = ObjectSubType.PROPERTY_GROUP
PROPERTY_SET = ObjectSubType.PROPERTY_SET
DB_ROLE = ObjectSubType.DB_ROLE
DB_ROLE_IMPORT = ObjectSubType.DB_ROLE_IMPORT
DB_ROLE_IMPORT_PRIMARY = ObjectSubType.DB_ROLE_IMPORT_PRIMARY
DB_ROLE_O_AUTH = ObjectSubType.DB_ROLE_O_AUTH
DB_ROLE_REMOTE_DATE_SOURCE = ObjectSubType.DB_ROLE_REMOTE_DATE_SOURCE
DB_ROLE_URL_AUTH = ObjectSubType.DB_ROLE_URL_AUTH
DB_ROLE_GENERIC_DATA_CONNECTOR = ObjectSubType.DB_ROLE_GENERIC_DATA_CONNECTOR
DB_ROLE_DATA_IMPORT_SERVER = ObjectSubType.DB_ROLE_DATA_IMPORT_SERVER
DB_ROLE_CLOUD_ELEMENT = ObjectSubType.DB_ROLE_CLOUD_ELEMENT
DB_LOGIN = ObjectSubType.DB_LOGIN
DB_CONNECTION = ObjectSubType.DB_CONNECTION
PROJECT = ObjectSubType.PROJECT
SERVER_DEF = ObjectSubType.SERVER_DEF
USER = ObjectSubType.USER
USER_GROUP = ObjectSubType.USER_GROUP
TRANSMITTER = ObjectSubType.TRANSMITTER
CONFIGURATION = ObjectSubType.CONFIGURATION
REQUEST = ObjectSubType.REQUEST
SEARCH = ObjectSubType.SEARCH
SEARCH_FOLDER = ObjectSubType.SEARCH_FOLDER
SEARCH_FOLDER_CROSS_PROJECT = ObjectSubType.SEARCH_FOLDER_CROSS_PROJECT
DATAMART = ObjectSubType.DATAMART
FUNCTION_PACKAGE_DEFINITION = ObjectSubType.FUNCTION_PACKAGE_DEFINITION
ROLE = ObjectSubType.ROLE
ROLE_TRANSFORMATION = ObjectSubType.ROLE_TRANSFORMATION
SECURITY_ROLE = ObjectSubType.SECURITY_ROLE
LOCALE = ObjectSubType.LOCALE
CONSOLIDATION = ObjectSubType.CONSOLIDATION
CONSOLIDATION_DERIVED = ObjectSubType.CONSOLIDATION_DERIVED
CONSOLIDATION_ELEMENT = ObjectSubType.CONSOLIDATION_ELEMENT
SCHEDULE_EVENT = ObjectSubType.SCHEDULE_EVENT
SCHEDULE_OBJECT = ObjectSubType.SCHEDULE_OBJECT
SCHEDULE_TRIGGER = ObjectSubType.SCHEDULE_TRIGGER
PHYSICAL_TABLE = ObjectSubType.PHYSICAL_TABLE
DB_TABLE_PMT = ObjectSubType.DB_TABLE_PMT
DB_TABLE_SOURCE = ObjectSubType.DB_TABLE_SOURCE
DOCUMENT_DEFINITION = ObjectSubType.DOCUMENT_DEFINITION
REPORT_WRITING_DOCUMENT = ObjectSubType.REPORT_WRITING_DOCUMENT
DOCUMENT_THEME = ObjectSubType.DOCUMENT_THEME
DASHBOARD = ObjectSubType.DASHBOARD
DRILL_MAP = ObjectSubType.DRILL_MAP
DBMS = ObjectSubType.DBMS
MD_SECURITY_FILTER = ObjectSubType.MD_SECURITY_FILTER
MONITOR_PERFORMANCE = ObjectSubType.MONITOR_PERFORMANCE
MONITOR_JOBS = ObjectSubType.MONITOR_JOBS
MONITOR_USER_CONNECTIONS = ObjectSubType.MONITOR_USER_CONNECTIONS
MONITOR_DB_CONNECTIONS = ObjectSubType.MONITOR_DB_CONNECTIONS
PROMPT_ANSWER = ObjectSubType.PROMPT_ANSWER
PROMPT_ANSWER_BOOLEAN = ObjectSubType.PROMPT_ANSWER_BOOLEAN
PROMPT_ANSWER_LONG = ObjectSubType.PROMPT_ANSWER_LONG
PROMPT_ANSWER_STRING = ObjectSubType.PROMPT_ANSWER_STRING
PROMPT_ANSWER_DOUBLE = ObjectSubType.PROMPT_ANSWER_DOUBLE
PROMPT_ANSWER_DATE = ObjectSubType.PROMPT_ANSWER_DATE
PROMPT_ANSWER_OBJECTS = ObjectSubType.PROMPT_ANSWER_OBJECTS
PROMPT_ANSWER_ELEMENTS = ObjectSubType.PROMPT_ANSWER_ELEMENTS
PROMPT_ANSWER_EXPRESSION = ObjectSubType.PROMPT_ANSWER_EXPRESSION
PROMPT_ANSWER_EXPRESSION_DRAFT = ObjectSubType.PROMPT_ANSWER_EXPRESSION_DRAFT
PROMPT_ANSWER_DIMTY = ObjectSubType.PROMPT_ANSWER_DIMTY
PROMPT_ANSWER_BIG_DECIMAL = ObjectSubType.PROMPT_ANSWER_BIG_DECIMAL
PROMPT_ANSWER_INT64 = ObjectSubType.PROMPT_ANSWER_INT64
PROMPT_ANSWERS = ObjectSubType.PROMPT_ANSWERS
GRAPH_STYLE = ObjectSubType.GRAPH_STYLE
BLOB_UNKNOWN = ObjectSubType.BLOB_UNKNOWN
BLOB_OTHER = ObjectSubType.BLOB_OTHER
BLOB_IMAGE = ObjectSubType.BLOB_IMAGE
BLOB_PROJECT_PACKAGE = ObjectSubType.BLOB_PROJECT_PACKAGE
BLOB_EXCEL = ObjectSubType.BLOB_EXCEL
BLOB_HTML_TEMPLATE = ObjectSubType.BLOB_HTML_TEMPLATE
DASHBOARD_TEMPLATE = ObjectSubType.DASHBOARD_TEMPLATE
FLAG = ObjectSubType.FLAG
CHANGE_JOURNAL = ObjectSubType.CHANGE_JOURNAL
EXTERNAL_SHORTCUT_UNKNOWN = ObjectSubType.EXTERNAL_SHORTCUT_UNKNOWN
EXTERNAL_SHORTCUT_URL = ObjectSubType.EXTERNAL_SHORTCUT_URL
EXTERNAL_SHORTCUT_SNAPSHOT = ObjectSubType.EXTERNAL_SHORTCUT_SNAPSHOT
EXTERNAL_SHORTCUT_TARGET = ObjectSubType.EXTERNAL_SHORTCUT_TARGET
RECONCILIATION = ObjectSubType.RECONCILIATION
PALETTE_SYSTEM = ObjectSubType.PALETTE_SYSTEM
PALETTE_CUSTOM = ObjectSubType.PALETTE_CUSTOM
THRESHOLDS = ObjectSubType.THRESHOLDS
SUBSCRIPTION_ADDRESS = ObjectSubType.SUBSCRIPTION_ADDRESS
SUBSCRIPTION_CONTACT = ObjectSubType.SUBSCRIPTION_CONTACT
SUBSCRIPTION_INSTANCE = ObjectSubType.SUBSCRIPTION_INSTANCE
CALENDAR_SYSTEM = ObjectSubType.CALENDAR_SYSTEM
TIMEZONE_SYSTEM = ObjectSubType.TIMEZONE_SYSTEM
enum mstrio.modeling.schema.helpers.PhysicalTableType(value)

Bases: AutoName

Valid values are as follows:

NORMAL = PhysicalTableType.NORMAL
WAREHOUSE_PARTITION = PhysicalTableType.WAREHOUSE_PARTITION
SQL = PhysicalTableType.SQL
RESERVED = PhysicalTableType.RESERVED
class mstrio.modeling.schema.helpers.SchemaObjectReference(sub_type, object_id=None, name=None, is_embedded=None)

Bases: Dictable

Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

Parameters:
  • sub_type (ObjectSubType) –

  • object_id (str | None) –

  • name (str | None) –

  • is_embedded (bool | None) –

object_id

object’s id, a globally unique identifier used to distinguish between metadata objects within the same project

Type:

str | None

sub_type

string literal used to identify the type of a metadata object

Type:

ObjectSubType

name

the name of the metadata object

Type:

str | None

is_embedded

if true indicates that the target object of this reference is embedded within this object, bool

Type:

bool | None

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod create_from(schema_object, is_embedded=None)

Converts a schema object into a schema object reference

Parameters:
  • schema_object (Attribute | UserHierarchy) – a schema object

  • is_embeded – a boolean indicating whether the schema object is embedded or not

  • is_embedded (bool) –

Returns:

SchemaObjectReference of the given schema object

Return type:

SchemaObjectReference

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

to_object(connection)

Converts a schema object reference into a schema object.

Parameters:

connection (Connection) – a connection object required to fetch the schema object

Return type:

Attribute | UserHierarchy

is_embedded: bool | None = None
name: str | None = None
object_id: str | None = None
sub_type: ObjectSubType
class mstrio.modeling.schema.helpers.TableColumn(data_type, column_name=None, name=None, id=None, sub_type=None, date_created=None, date_modified=None, version_id=None, primary_locale=None)

Bases: Dictable

An object representation of a physical column that might appear in some data source. In addition to representing physical columns, we also use this object to represent columns that do not actually appear in any data source but which the engine should create if it needs to make a column to contain data for some higher level construct (e.g. a fact, an attribute form etc.).

Parameters:
  • data_type (DataType) –

  • column_name (str | None) –

  • name (str | None) –

  • id (str | None) –

  • sub_type (ObjectSubType | None) –

  • date_created (str | None) –

  • date_modified (str | None) –

  • version_id (str | None) –

  • primary_locale (str | None) –

classmethod bulk_from_dict(source_list, connection=None, to_snake_case=True, with_missing_value=False)

Creates multiple objects from a list of dictionaries. For each dictionary provided the keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in the object’s _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of the objects that should be created.

  • source_list (List[Dict[str, Any]]) – A list of dictionaries from which the objects will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

A list of objects of type T.

Return type:

T

classmethod from_dict(source, connection=None, to_snake_case=True, with_missing_value=False)

Creates an object from a dictionary. The dictionary’s keys in camel case are changed to object’s attribute names (by default in snake case) and dict values are composed to their proper data types such as Enums, list of Enums etc. as specified in _FROM_DICT_MAP.

Parameters:
  • cls (T) – Class (type) of an object that should be created.

  • source (Dict[str, Any]) – A dictionary from which an object will be constructed.

  • connection (Connection, optional) – A MSTR Connection object. Defaults to None.

  • to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case. Defaults to True.

  • with_missing_value (bool) – (bool, optional): If True, class attributes possible to fetch and missing in source will be set as MissingValue objects.

Returns:

An object of type T.

Return type:

T

to_dict(camel_case=True)

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

column_name: str | None = None
data_type: DataType
date_created: str | None = None
date_modified: str | None = None
id: str | None = None
name: str | None = None
primary_locale: str | None = None
sub_type: ObjectSubType | None = None
version_id: str | None = None
enum mstrio.modeling.schema.helpers.TableColumnMergeOption(value)

Bases: AutoName

Valid values are as follows:

REUSE_ANY = TableColumnMergeOption.REUSE_ANY
REUSE_COMPATIBLE_DATA_TYPE = TableColumnMergeOption.REUSE_COMPATIBLE_DATA_TYPE
REUSE_MATCHED_DATA_TYPE = TableColumnMergeOption.REUSE_MATCHED_DATA_TYPE
enum mstrio.modeling.schema.helpers.TablePrefixOption(value)

Bases: AutoName

Valid values are as follows:

ADD_DEFAULT_PREFIX = TablePrefixOption.ADD_DEFAULT_PREFIX
ADD_NAMESPACE = TablePrefixOption.ADD_NAMESPACE