mstrio > object_management > migration > package¶
- enum mstrio.object_management.migration.package.Action(value)¶
Bases:
AutoName
The default action used for objects which don’t have actions explicitly, for example the dependents objects. USE_EXISTING: No change is made to the destination object. The source object is not copied. REPLACE: The destination object is replaced with the source object. Note the following:
If the conflict type is Exists identically except for path, or
Exists identically except for Distribution Services objects, the destination object is updated to reflect the path or Distribution Services addresses and contacts of the source object. • Replace moves the object into the same parent folder as source object. If the parent path is the same between source and destination but the grandparent path is different, Replace may appear to do nothing because Replace puts the object into the same parent path. • Non-empty folders in the destination location will never have the same version ID and modification time as the source, because the folder is copied first and the objects are added to it, thus changing version ID and modification times during the copy process.
KEEP_BOTH: No change is made to the destination object. The source object is duplicated if destination object doesn’t exist. But if the destination object exists with the same id and same version, this source object is ignored.If the destination object exists with the same id and different version, this source object is saved as new object. USE_NEWER: If the source object’s modification time is more recent than the destination object’s, the Replace action is used.Otherwise, the Use existing action is used. USE_OLDER: If the source object’s modification time is more recent than the destination object’s, the Use existing action is used. Otherwise, the Replace action is used. FORCE_REPLACE: Replace the object in the destination project with the version of the object in the update package, even if both versions of the object have the same Version ID. DELETE: Delete the object from the destination project. The version of the object in the update package is not imported into the destination project.Warning: If the object in the destination has any used-by dependencies when you import the update package, the import will fail.
Valid values are as follows:
- USE_EXISTING = Action.USE_EXISTING¶
- REPLACE = Action.REPLACE¶
- KEEP_BOTH = Action.KEEP_BOTH¶
- USE_NEWER = Action.USE_NEWER¶
- USE_OLDER = Action.USE_OLDER¶
- FORCE_REPLACE = Action.FORCE_REPLACE¶
- DELETE = Action.DELETE¶
- class mstrio.object_management.migration.package.ImportInfo(id, environment, creator=None, creation_date=None, last_updated_date=None, status=None, import_request_status=None, undo_request_status=None, progress=None, message=None, undo_storage=None, project=None, deleted=None)¶
Bases:
Dictable
Python representation of a ImportInfo Migration field. .. attribute:: id
ID of the import
- type:
str
- Parameters:
id (str) –
environment (Environment | dict) –
creator (User | None) –
creation_date (datetime | None) –
last_updated_date (datetime | None) –
status (ImportStatus | None) –
import_request_status (RequestStatus | None) –
undo_request_status (RequestStatus | None) –
progress (float | None) –
message (str | None) –
undo_storage (PackageStorage | None) –
project (Project | None) –
deleted (bool | None) –
- creator¶
Creator data id name full_name (str, optional)
- Type:
dict, optional
- creation_date¶
Date of creation, in the format “yyyy-MM-dd’T’HH:mm:ss.SSSZ”
- Type:
str, optional
- last_updated_date¶
Date of last update, in the format “yyyy-MM-dd’T’HH:mm:ss.SSSZ”
- Type:
str, optional
- environment¶
Environment data id name
- Type:
dict
- status¶
Status of the import.
- Type:
ImportStatus, optional
- import_request_status¶
Status of the import request.
- Type:
RequestStatus, optional
- undo_request_status¶
Status of the undo request.
- Type:
RequestStatus, optional
- progress¶
Progress of the import.
- Type:
float, optional
- message¶
Record information such as the reason of import failure
- Type:
str, optional
- undo_storage¶
Storage data for the undo package size path
- Type:
dict, optional
- project¶
Project data id name
- Type:
dict, optional
- deleted¶
Whether the import is deleted
- Type:
bool, optional
- 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
- creation_date: datetime | None = None¶
- deleted: bool | None = None¶
- environment: Environment | dict¶
- id: str¶
- import_request_status: RequestStatus | None = None¶
- last_updated_date: datetime | None = None¶
- message: str | None = None¶
- progress: float | None = None¶
- status: ImportStatus | None = None¶
- undo_request_status: RequestStatus | None = None¶
- undo_storage: PackageStorage | None = None¶
- enum mstrio.object_management.migration.package.ImportStatus(value)¶
Bases:
AutoName
Status of Migration Import. Allowed values are: - pending - importing - imported - import_failed - undoing - undo_success - undo_failed
Valid values are as follows:
- PENDING = ImportStatus.PENDING¶
- IMPORTING = ImportStatus.IMPORTING¶
- IMPORTED = ImportStatus.IMPORTED¶
- IMPORT_FAILED = ImportStatus.IMPORT_FAILED¶
- UNDOING = ImportStatus.UNDOING¶
- UNDO_SUCCESS = ImportStatus.UNDO_SUCCESS¶
- UNDO_FAILED = ImportStatus.UNDO_FAILED¶
- enum mstrio.object_management.migration.package.MigratedObjectTypes(value)¶
Bases:
AutoName
Valid values are as follows:
- DASHBOARD = MigratedObjectTypes.DASHBOARD¶
- DOCUMENT = MigratedObjectTypes.DOCUMENT¶
- CARD = MigratedObjectTypes.CARD¶
- REPORT = MigratedObjectTypes.REPORT¶
- DATASET = MigratedObjectTypes.DATASET¶
- BOT = MigratedObjectTypes.BOT¶
- ATTRIBUTE = MigratedObjectTypes.ATTRIBUTE¶
- BASE_FORMULA = MigratedObjectTypes.BASE_FORMULA¶
- CONSOLIDATION = MigratedObjectTypes.CONSOLIDATION¶
- CUSTOM_GROUP = MigratedObjectTypes.CUSTOM_GROUP¶
- CONSOLIDATION_ELEMENT = MigratedObjectTypes.CONSOLIDATION_ELEMENT¶
- COLUMN = MigratedObjectTypes.COLUMN¶
- DRILL_MAP = MigratedObjectTypes.DRILL_MAP¶
- FACT = MigratedObjectTypes.FACT¶
- FILTER = MigratedObjectTypes.FILTER¶
- FUNCTION = MigratedObjectTypes.FUNCTION¶
- HIERARCHY = MigratedObjectTypes.HIERARCHY¶
- METRIC = MigratedObjectTypes.METRIC¶
- PROMPT = MigratedObjectTypes.PROMPT¶
- SMART_ATTRIBUTE = MigratedObjectTypes.SMART_ATTRIBUTE¶
- SUBTOTAL = MigratedObjectTypes.SUBTOTAL¶
- AUTO_STYLE = MigratedObjectTypes.AUTO_STYLE¶
- EXTERNAL_SHORTCUT = MigratedObjectTypes.EXTERNAL_SHORTCUT¶
- SEARCH = MigratedObjectTypes.SEARCH¶
- SECURITY_FILTER = MigratedObjectTypes.SECURITY_FILTER¶
- SHORTCUT = MigratedObjectTypes.SHORTCUT¶
- TABLE = MigratedObjectTypes.TABLE¶
- TEMPLATE = MigratedObjectTypes.TEMPLATE¶
- TRANSFORMATION = MigratedObjectTypes.TRANSFORMATION¶
- SCRIPT = MigratedObjectTypes.SCRIPT¶
- USER = MigratedObjectTypes.USER¶
- USER_GROUP = MigratedObjectTypes.USER_GROUP¶
- DATA_SOURCE = MigratedObjectTypes.DATA_SOURCE¶
- SECURITY_ROLE = MigratedObjectTypes.SECURITY_ROLE¶
- CUSTOM_APPLICATION = MigratedObjectTypes.CUSTOM_APPLICATION¶
- PALETTE = MigratedObjectTypes.PALETTE¶
- TIMEZONE = MigratedObjectTypes.TIMEZONE¶
- CALENDAR = MigratedObjectTypes.CALENDAR¶
- CONTENT_BUNDLE = MigratedObjectTypes.CONTENT_BUNDLE¶
- DEVICE = MigratedObjectTypes.DEVICE¶
- LOCALE = MigratedObjectTypes.LOCALE¶
- SCHEDULE_EVENT = MigratedObjectTypes.SCHEDULE_EVENT¶
- SCHEDULE_TRIGGER = MigratedObjectTypes.SCHEDULE_TRIGGER¶
- TRANSMITTER = MigratedObjectTypes.TRANSMITTER¶
- SCRIPT_RUNTIME_ENV = MigratedObjectTypes.SCRIPT_RUNTIME_ENV¶
- enum mstrio.object_management.migration.package.MigrationPurpose(value)¶
Bases:
AutoName
Migration purpose. Possible values are: - object_migration - project_merge - migration_from_shared_file_store
Valid values are as follows:
- OBJECT_MIGRATION = MigrationPurpose.OBJECT_MIGRATION¶
- PROJECT_MERGE = MigrationPurpose.PROJECT_MERGE¶
- FROM_FILE = MigrationPurpose.FROM_FILE¶
- class mstrio.object_management.migration.package.ObjectMigrationPackageTocView(settings: PackageSettings, content: list[PackageContentInfo] | None = None)¶
Bases:
Dictable
- Parameters:
settings (PackageSettings) –
content (list[PackageContentInfo] | 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
- content: list[PackageContentInfo] | None = None¶
- settings: PackageSettings¶
- class mstrio.object_management.migration.package.PackageCertificationInfo(status: PackageCertificationStatus, operator: User, last_updated_date: datetime.datetime)¶
Bases:
Dictable
- Parameters:
status (PackageCertificationStatus) –
operator (User) –
last_updated_date (datetime) –
- 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
- last_updated_date: datetime¶
- status: PackageCertificationStatus¶
- enum mstrio.object_management.migration.package.PackageCertificationStatus(value)¶
Bases:
AutoName
Valid values are as follows:
- UNCERTIFIED = PackageCertificationStatus.UNCERTIFIED¶
- REQUESTED = PackageCertificationStatus.REQUESTED¶
- CERTIFIED = PackageCertificationStatus.CERTIFIED¶
- REJECTED = PackageCertificationStatus.REJECTED¶
- class mstrio.object_management.migration.package.PackageConfig(settings, content)¶
Bases:
Dictable
Package Update Data Transfer Object
- Parameters:
settings (PackageSettings) –
content (list[PackageContentInfo] | PackageContentInfo) –
- settings¶
settings details of package
- Type:
- content¶
content details of package
- Type:
- 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.object_management.migration.package.PackageContentInfo(id, action=Action.USE_EXISTING, name=None, version=None, type=None, owner=None, date_created=None, date_modified=None, include_dependents=None, explicit_included=None, level=None)¶
Bases:
Dictable
Object representation of package content information
- Parameters:
id (str) –
action (Action | str) –
name (str | None) –
version (str | None) –
type (ObjectTypes | None) –
owner (Owner | None) –
date_created (str | None) –
date_modified (str | None) –
include_dependents (bool | None) –
explicit_included (bool | None) –
level (Level | str | None) –
- id¶
object ID
- Type:
str
- name¶
object name
- Type:
Optional[str]
- version¶
object version
- Type:
Optional[str]
- type¶
object type
- Type:
Optional[ObjectTypes]
- date_created¶
object creation date
- Type:
Optional[str]
- date_modified¶
object modification date
- Type:
Optional[str]
- include_dependents¶
whether include the dependents for this object or not
- Type:
Optional[bool]
- explicit_included¶
whether explicitly included or not
- Type:
Optional[bool]
- enum Level(value)¶
Bases:
AutoName
Valid values are as follows:
- PROJECT_OBJECT = Level.PROJECT_OBJECT¶
- CONFIGURATION_OBJECT = Level.CONFIGURATION_OBJECT¶
- UNKNOWN = Level.UNKNOWN¶
- class Owner(id, connection=None)¶
Bases:
User
This class overrides from_dict() and __init__() methods as PackageContentInfo inherits from Dictable and not EntityBase. Therefore, despite Owner being a User, connection param here is optional. If connection is specified, User constructor will be used
- Parameters:
id (str) –
connection (Connection | None) –
- acl_add(rights, trustees, denied=False, inheritable=None, propagate_to_children=None, propagation_behavior=None)¶
Add Access Control Element (ACE) to the object ACL.
Note
To add rights for the Root Folder and the Freeform Objects, apply the required rights for these folders:
Root Folder: D43364C684E34A5F9B2F9AD7108F7828
Freeform Objects: 93D8CF3849C1F85DC1A48E8B9E4271F1
Argument propagate_to_children is used only for objects with type ObjectTypes.FOLDER.
- Parameters:
rights (int | Rights | AggregatedRights) – The degree to which the user or group is granted or denied access to the object. The available permissions are defined in Rights and AggregatedRights Enums
trustees (list[UserOrGroup] | UserOrGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE for
denied (bool) – flag to indicate granted or denied access to the object
inheritable (bool | None) – Applies only to folders. If set, any objects placed in the folder inherit the folder’s entry in the ACL.
propagate_to_children (bool | None) – used for folder objects only, default value is None, if set to True/False adds propagateACLToChildren keyword to the request body and sets its value accordingly
propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.
self (Entity) –
- Return type:
None
Examples
>>> obj.acl_add(rights=Rights.BROWSE | Rights.EXECUTE, >>> trustees=user_obj, denied=True)
- acl_alter(rights, trustees, denied=False, inheritable=None, propagate_to_children=None, propagation_behavior=None)¶
Alter an existing Access Control Element (ACE) of the object ACL.
Note
To alter rights for the Root Folder and the Freeform Objects, change the required rights for these folders:
Root Folder: D43364C684E34A5F9B2F9AD7108F7828
Freeform Objects: 93D8CF3849C1F85DC1A48E8B9E4271F1
Argument propagate_to_children is used only for objects with type ObjectTypes.FOLDER.
- Parameters:
rights (int | Rights | AggregatedRights) – The degree to which the user or group is granted or denied access to the object. The available permissions are defined in Rights and AggregatedRights Enums
trustees (list[UserOrGroup] | UserOrGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE for
denied (bool) – flag to indicate granted or denied access to the object
inheritable (bool | None) – Applies only to folders. If set, any objects placed in the folder inherit the folder’s entry in the ACL.
propagate_to_children (bool | None) – used for folder objects only, default value is None, if set to True/False adds propagateACLToChildren keyword to the request body and sets its value accordingly
propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.
self (Entity) –
- Return type:
None
Examples
>>> obj.acl_alter(rights=Rights.BROWSE | Rights.EXECUTE, >>> trustees=user_obj, denied=True)
- acl_remove(rights, trustees, denied=False, inheritable=None, propagate_to_children=None, propagation_behavior=None)¶
Remove Access Control Element (ACE) from the object ACL.
Note
To remove rights from the Root Folder and the Freeform Objects, remove them from these folders:
Root Folder: D43364C684E34A5F9B2F9AD7108F7828
Freeform Objects: 93D8CF3849C1F85DC1A48E8B9E4271F1
Argument propagate_to_children is used only for objects with type ObjectTypes.FOLDER.
- Parameters:
rights (int | Rights | AggregatedRights) – The degree to which the user or group is granted or denied access to the object. The available permissions are defined in Rights and AggregatedRights Enums
trustees (list[UserOrGroup] | UserOrGroup) – list of trustees (User or UserGroup objects or ids) to update the ACE for
denied (bool) – flag to indicate granted or denied access to the object
inheritable (bool | None) – Applies only to folders. If set, any objects placed in the folder inherit the folder’s entry in the ACL.
propagate_to_children (bool | None) – used for folder objects only, default value is None, if set to True/False adds propagateACLToChildren keyword to the request body and sets its value accordingly
propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.
self (Entity) –
- Return type:
None
Examples
>>> obj.acl_remove(rights=Rights.BROWSE | Rights.EXECUTE, >>> trustees=user_obj, denied=True)
- add_address(name=None, address=None, default=True, delivery_type=None, device_id=None, contact_address=None)¶
Add new address to the user object.
- Parameters:
name (str, optional) – User-specified name for the address
address (str, optional) – The actual value of the physical address, e.g. email address or file path associated with this address name/id
default (bool, optional) – Specifies whether this address is the default address (change isDefault parameter). Default value is set to True.
delivery_type (str, optional) – Delivery type
device_id (str, optional) – Device ID
contact_address (ContactAddress, optional) – ContactAddress object. If provided, the initial values for the address will be taken from this object. If both contact_address and other parameters are provided, the other parameters will take precedence.
- Return type:
None
- add_to_user_groups(user_groups)¶
Adds this User to user groups specified in user_groups.
- add_translation(translations)¶
Adds translations to the Object.
- Parameters:
translations (list[OperationData]) – list of translations to be added to the Object
self (Entity) –
- Returns:
A list of translations for the Object.
- Return type:
list[’Translation’]
- alter(username=None, full_name=None, description=None, password=None, enabled=None, password_modifiable=None, password_auto_expire=None, password_expiration_date=None, password_expiration_frequency=None, standard_auth=None, require_new_password=None, ldapdn=None, trust_id=None, database_auth_login=None, owner=None, default_timezone=None, language=None, comments=None, default_email_address=None, email_device=None)¶
Alter user properties.
- Parameters:
username (str | None) – username of user
full_name (str | None) – user full name
description (str | None) – user description
password (str | None) – user password
enabled (bool | None) – specifies if user is allowed to log in
password_modifiable (bool | None) – Specifies if user password can be modified
password_auto_expire (bool | None) – specifies if password will expire automatically
password_expiration_date (str | None) – Expiration date of user password, “yyyy-MM-dd HH:mm:ss” in UTC
password_expiration_frequency (str | None) – frequency of password expiration specified in days
standard_auth (bool | None) – Specifies whether standard authentication is allowed for user.
require_new_password (bool | None) – Specifies if user is required to provide a new password.
ldapdn (str | None) – User’s LDAP distinguished name
trust_id (str | None) – Unique user ID provided by trusted authentication provider
database_auth_login (str | None) – Database Authentication Login
owner (User | str | None) – owner of user
default_timezone (str| dict | None) – default timezone for user
language (str | Language | None) – language for user
comments (str | None) – long description of the object
default_email_address (str | None) – default email address for user
email_device (str | Device | None) – ID or Device object of the email device to which the default email address will be assigned
- Return type:
None
- alter_translation(translations)¶
Alters translations of the Object.
- Parameters:
translations (list[OperationData]) – list of translations to be added to the Object
self (Entity) –
- Return type:
None
- apply_security_filter(security_filter)¶
Apply a security filter to the user.
- Parameters:
security_filter (string or object) – identifier of security filter or SecurityFilter object which will be applied to the user.
- Returns:
True when applying was successful. False otherwise.
- Return type:
bool
- assign_security_role(security_role, project)¶
Assigns a Security Role to the user for given project.
- Parameters:
security_role (SecurityRole | str) – Security Role ID or object
project (Project | str) – Project name or object
- Return type:
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(connection, username, full_name, password=None, description=None, enabled=True, password_modifiable=True, password_auto_expire=None, password_expiration_date=None, password_expiration_frequency=None, require_new_password=True, standard_auth=True, ldapdn=None, trust_id=None, database_auth_login=None, memberships=None, language=None, default_timezone=None, owner=None, default_email_address=None, email_device=None)¶
Create a new user on the I-Server. Returns User object.
- Parameters:
connection (Connection) – Strategy One connection object returned by connection.Connection()
username (str) – username of user
full_name (str) – user full name
password (str | None) – user password
description (str | None) – user description
enabled (bool) – specifies if user is allowed to log in
password_modifiable (bool) – Specifies if user password can be modified
password_auto_expire (bool | None) – specifies if password will expire automatically
password_expiration_date (str | datetime | None) – Expiration date of user password either as a datetime or string: “yyyy-MM-dd HH:mm:ss” in UTC
password_expiration_frequency (int | None) – frequency of password expiration specified in days
require_new_password (bool) – Specifies if user is required to provide a new password.
standard_auth (bool) – Specifies whether standard authentication is allowed for user.
ldapdn (str | None) – User’s LDAP distinguished name
trust_id (str | None) – Unique user ID provided by trusted authentication provider
database_auth_login (str | None) – Database Authentication Login
memberships (list | None) – specify User Group IDs which User will be member off.
owner (User | str | None) – owner of user
default_timezone (str | dict | None) – default timezone for user
language (str | Language | None) – language for user
default_email_address (str | None) – default email address for user
email_device (str | Device | None) – ID or Device object of the email device to which the default email address will be assigned. If not provided, the Generic Email will be used
- Return type:
- create_profile_folder(destination_folder=None, project_id=None, project_name=None, project=None)¶
Creates a profile folder for the user.
- Parameters:
destination_folder (Folder or str, optional) – Destination folder where the profile folder will be created.
project_id (str, optional) – ID of the project for which the profile folder will be created. If the project is not specified, the profile folder will be created in the project corresponding to the connection used to retrieve the user. May be substituted with project_name or project parameter.
project_name (str, optional) – Name the project for which the profile folder will be created. May be used instead of project_id.
project (Project, optional) – Object for the project for which the profile folder will be created. May be used instead of project_id.
- Return type:
- create_shortcut(target_folder_id=None, target_folder_path=None, target_folder=None, project_id=None, project_name=None, project=None, to_dictionary=False)¶
Create a shortcut to the object.
- Parameters:
target_folder_id (str, optional) – ID of the target folder. Target folder must be specified, but target_folder_id may be substituted with target_folder_path or target_folder.
target_folder_path (str, optional) – Path to the target folder, e.g. ‘/MicroStrategy Tutorial/Public Objects’. May be used instead of target_folder_id.
target_folder (Folder, optional) – Target folder object. May be used instead of target_folder_id.
project_id (str, optional) – ID of the target project of the new shortcut. The project may be specified by either project_id, project_name or project. If the project is not specified in either way, the project from the connection object is used.
project_name (str, optional) – Name of the target project. May be used instead of project_id.
project (Project, optional) – Project object specifying the target project. May be used instead of project_id.
to_dictionary (bool, optional) – If True, the method will return a dictionary with the shortcut’s properties instead of a Shortcut object. Defaults to False.
- Return type:
- delete(force=False, delete_profile=False)¶
Deletes the user.
- Parameters:
force (bool, optional) – If True, no additional prompt will be shown before deleting User.
delete_profile (bool, optional) – If True, User’s profile folder will be deleted as well.
- Returns:
True for success. False otherwise.
- Return type:
bool
- delete_profile_folder(project_id=None, project_name=None, project=None, force=False)¶
Deletes the user’s profile folder.
- Parameters:
project_id (str, Project, optional) – ID of the project from which the profile folder will be deleted. May be substituted with project_name or project parameter. If the project is not specified, the profile folder will be deleted from all loaded projects.
project_name (str, optional) – Name the project for which the profile folder will be deleted. May be used instead of project_id.
project (Project, optional) – Object for the project for which the profile folder will be deleted. May be used instead of project_id.
force (bool, optional) – If True, no additional prompt will be shown before deleting User’s profile folder
- Returns:
True for success. False otherwise.
- Return type:
bool
- disconnect(nodes=None)¶
Disconnect all active user connection sessions for the specified node.
- Parameters:
nodes (str | list[str] | None) – list of node names
- Return type:
None
- fetch(attr=None)¶
Fetch the latest object’s state from the I-Server.
Note
This method can overwrite local changes made to the object.
- Parameters:
attr (Optional[str]) – Attribute name to be fetched. If not specified
dictionary. (it will use all getters specified in _API_GETTERS) –
None. (Defaults to) –
- Raises:
ValueError – If attr cannot be fetched.
- Return type:
None
- classmethod from_dict(source, connection=None)¶
- Overrides Dictable.from_dict() to instantiate an object from
a dictionary without calling any additional getters.
- 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) – A Strategy One Connection object.
to_snake_case (bool, optional) – Set to True if attribute names should be converted from camel case to snake case, default True.
with_missing_value – (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
- get(name)¶
Get object’s attribute by its name.
- get_api_token()¶
Get the API token for the user.
- Returns:
API token for the user.
- Return type:
str
- grant_privilege(privilege)¶
Grant privileges directly to the user.
- list_acl(to_dataframe=False, to_dictionary=False, **filters)¶
Get Access Control List (ACL) for this object. Optionally filter ACLs by specifying filters.
- Parameters:
to_dataframe (bool, optional) – if True, return datasets as pandas DataFrame
to_dictionary (bool, optional) – if True, return datasets as dicts
**filters – Available filter parameters: [deny, type, rights, trustee_id, trustee_name, trustee_type, trustee_subtype, inheritable]
- Return type:
DataFrame | list[dict | mstrio.utils.acl.ACE]
Examples
>>> list_acl(deny=True, trustee_name="John")
- list_dependencies(project=None, name=None, pattern=4, domain=2, object_types=None, used_by_recursive=False, root=None, root_path=None, limit=None, offset=None, results_format='LIST', to_dictionary=True, **filters)¶
List list_dependencies of an object.
- Parameters:
project (string) – Project object or ID
name (string) – Value the search pattern is set to, which will be applied to the names of object types being searched. For example, search for all report objects (type) whose name begins with (pattern) B (name).
pattern (integer or enum class object) – Pattern to search for, such as Begin With or Exactly. Possible values are available in ENUM mstrio.object_management.SearchPattern. Default value is CONTAINS (4).
domain (integer or enum class object) – Domain where the search will be performed, such as Local or Project. Possible values are available in ENUM mstrio.object_management.SearchDomain. Default value is PROJECT (2).
root (string, optional) – Folder ID of the root folder where the search will be performed.
root_path (str, optional) –
Path of the root folder in which the search will be performed. Can be provided as an alternative to root parameter. If both are provided, root is used.
- the path has to be provided in the following format:
- if it’s inside of a project, example:
/MicroStrategy Tutorial/Public Objects/Metrics
- if it’s a root folder, example:
/CASTOR_SERVER_CONFIGURATION/Users
class (object_types(enum class object or integer or list of enum) – objects or integers): Type(s) of object(s) to be searched, such as Folder, Attribute or User. Possible values available in ENUMs mstrio.types.ObjectTypes and mstrio.types.ObjectSubTypes
used_by_recursive (boolean, optional) – Control the Intelligence server to also find objects that are used by the given objects indirectly. Default value is false.
results_format (SearchResultsFormat) – either a list or a tree format
to_dictionary (bool) – If False returns objects, by default (True) returns dictionaries.
limit (int) – limit the number of elements returned. If None (default), all objects are returned.
offset (int) – Starting point within the collection of returned results. Used to control paging behavior. Default is 0.
**filters – Available filter parameters: [‘id’, ‘name’, ‘description’ ,’date_created’, ‘date_modified’, ‘acg’]
self (Entity) –
object_types (TypeOrSubtype | None) –
- Returns:
list of objects or list of dictionaries
- list_dependents(project=None, name=None, pattern=4, domain=2, object_types=None, uses_recursive=False, root=None, root_path=None, limit=None, offset=None, results_format='LIST', to_dictionary=True, **filters)¶
List dependents of an object.
- Parameters:
project (string) – Project object or ID
name (string) – Value the search pattern is set to, which will be applied to the names of object types being searched. For example, search for all report objects (type) whose name begins with (pattern) B (name).
pattern (integer or enum class object) – Pattern to search for, such as Begin With or Exactly. Possible values are available in ENUM mstrio.object_management.SearchPattern. Default value is CONTAINS (4).
domain (integer or enum class object) – Domain where the search will be performed, such as Local or Project. Possible values are available in ENUM mstrio.object_management.SearchDomain. Default value is PROJECT (2).
root (string, optional) – Folder ID of the root folder where the search will be performed.
root_path (str, optional) –
Path of the root folder in which the search will be performed. Can be provided as an alternative to root parameter. If both are provided, root is used.
- the path has to be provided in the following format:
- if it’s inside of a project, example:
/MicroStrategy Tutorial/Public Objects/Metrics
- if it’s a root folder, example:
/CASTOR_SERVER_CONFIGURATION/Users
class (object_types(enum class object or integer or list of enum) – objects or integers): Type(s) of object(s) to be searched, such as Folder, Attribute or User. Possible values available in ENUMs mstrio.types.ObjectTypes and mstrio.types.ObjectSubTypes
uses_recursive (boolean) – Control the Intelligence server to also find objects that use the given objects indirectly. Default value is false.
results_format (SearchResultsFormat) – either a list or a tree format
to_dictionary (bool) – If False returns objects, by default (True) returns dictionaries.
limit (int) – limit the number of elements returned. If None (default), all objects are returned.
offset (int) – Starting point within the collection of returned results. Used to control paging behavior. Default is 0.
**filters – Available filter parameters: [‘id’, ‘name’, ‘description’ ,’date_created’, ‘date_modified’, ‘acg’]
self (Entity) –
object_types (TypeOrSubtype | None) –
- Returns:
list of objects or list of dictionaries
- list_privileges(mode=PrivilegeMode.ALL, to_dataframe=False)¶
List privileges for user.
- Parameters:
mode (PrivilegeMode | str) – Filter by source of privileges. One of: ALL, INHERITED, or GRANTED. See: privilege.PrivilegeMode enum.
to_dataframe (bool) – If True, return a DataFrame object containing privileges.
- Return type:
list
- list_properties(excluded_properties=None)¶
Fetches all attributes from the server and converts all properties of the object to a dictionary.
- Parameters:
excluded_properties (list[str], optional) – A list of object properties that should be excluded from the dict. Defaults to None.
- Returns:
- A dictionary which keys are object’s attribute names, and
which values are object’s attribute values.
- Return type:
dict
List all subscriptions that are dependent on the object.
- list_security_filters(projects=None, to_dictionary=False)¶
Get the list of security filters for user. They can be filtered by the projects’ ids.
- Parameters:
projects (str or list of str, optional) – collection of projects’ ids which is used for filtering data
to_dictionary (bool) – If True returns security filters as dicts, by default (False) returns them as objects.
- Returns:
Dictionary with project names as keys and list with security filters as values. In case of no security filter for the given user in the particular project, then this project is not placed in the dictionary.
- Return type:
dict
- list_translations(languages=None, to_dictionary=False)¶
Lists translations for the Object.
- Parameters:
languages (list, optional) –
list of languages to list the translations for, only translations from these languages will be listed. Languages in the list should be one of the following:
lcid attribute of the language
ID of the language
Language class object
to_dictionary (bool, optional) – If True returns dict, by default (False) returns Translation objects
self (Entity) –
- Returns:
A list of dictionaries representing translations for the Object or a list of Translation Objects.
- Return type:
list[’Translation’] | list[dict]
- print()¶
Pretty Print all properties of the object.
- Return type:
None
- remove_address(name=None, address=None, id=None)¶
Remove existing address from the user object. Specify either address ID or name. Warning, address names are not unique and can potentially remove multiple addresses.
- Parameters:
name (str | None) – User-specified name for the address
address (str | None) – The actual value of the address i.e. email address associated with this address name/id
id (str | None) – ID of the address.
- Return type:
None
- remove_from_all_user_groups()¶
Removes this User from all user groups.
- Return type:
None
- remove_from_user_groups(user_groups)¶
Removes this User from user groups specified in user_groups.
- remove_translation(translations)¶
Removes translations from the Object.
- Parameters:
translations (list[OperationData]) – list of translations to be added to the Object
self (Entity) –
- Return type:
None
- revoke_all_privileges(force=False)¶
Revoke directly granted user privileges.
- Parameters:
force (bool) – If True, no additional prompt will be shown before revoking all privileges from User.
- Return type:
None
- revoke_privilege(privilege)¶
Revoke directly granted user privileges.
- revoke_security_filter(security_filter)¶
Revoke a security filter from the user.
- Parameters:
security_filter (string or object) – identifier of security filter or SecurityFilter object which will be revoked from the user.
- Returns:
True when revoking was successful. False otherwise.
- Return type:
bool
- revoke_security_role(security_role, project)¶
Removes a Security Role from the user for given project.
- Parameters:
security_role (SecurityRole | str) – Security Role ID or object
project (Project | str) – Project name or object
- Return type:
None
- set_custom_permissions(to_objects, object_type, project=None, execute=None, use=None, control=None, delete=None, write=None, read=None, browse=None)¶
Set custom permissions to perform actions on given object(s).
Function is used to set rights of the trustee to perform given actions on the provided objects. Within one execution of the function rights will be set in the same manner for each of the provided objects. None of the rights is necessary, but if provided then only possible values are ‘grant’ (to grant right), ‘deny’ (to deny right), ‘default’ (to reset right) or None which is default value and means that nothing will be changed for this right. All objects to which the rights will be given have to be of the same type which is also provided.
- Parameters:
to_objects (str | list[str]) – (str, list(str)): List of object ids on access list to which the permissions will be set
object_type (int, ObjectTypes) – Type of objects on access list
project (str, Project) – Object or id of Project in which the object is located. If not passed, Project (project_id) selected in Connection object is used.
execute (str) – value for right “Execute”. Available are ‘grant’, ‘deny’, ‘default’ or None
use (str) – value for right “Use”. Available are ‘grant’, ‘deny’, ‘default’ or None
control (str) – value for right “Control”. Available are ‘grant’, ‘deny’, ‘default’ or None
delete (str) – value for right “Delete”. Available are ‘grant’, ‘deny’, ‘default’ or None
write (str) – value for right “Write”. Available are ‘grant’, ‘deny’, ‘default’ or None
read (str) – value for right “Read”. Available are ‘grant’, ‘deny’, ‘default’ or None
browse (str) – value for right “Browse. Available are ‘grant’, ‘deny’, ‘default’ or None
self (UserOrGroup) –
- Returns:
None
- Return type:
None
- set_permission(permission, to_objects, object_type, project=None, propagate_to_children=None, propagation_behavior=None)¶
Set permission to perform actions on given object(s).
Function is used to set permission of the trustee to perform given actions on the provided objects. Within one execution of the function permission will be set in the same manner for each of the provided objects. The only available values of permission are: ‘View’, ‘Modify’, ‘Full Control’, ‘Denied All’, ‘Default All’. Permission is the predefined set of rights. All objects to which the rights will be given have to be of the same type which is also provided.
- Parameters:
permission (Permissions | str) – The Permission which defines set of rights. See: Permissions enum
to_objects (str | list[str]) – List of object ids on access list for which the permissions will be set
object_type (ObjectTypes | int) – Type of objects on access list. See: ObjectTypes enum
project (Project | str | None) – Object or id of Project where the object is located. If not passed, Project (project_id) selected in Connection object is used
propagate_to_children (bool | None) – Flag used in the request to determine if those rights will be propagated to children of the trustee
propagation_behavior (PropagationBehavior | str | None) – Behavior of ACL propagation to children.
self (UserOrGroup) –
- Returns:
None
- Return type:
None
- classmethod to_csv(objects, name, path=None, properties=None)¶
Exports MSTR objects to a csv file.
Optionally, saves only the object properties specified in the properties parameter.
- Parameters:
objects (T | list[T]) – List of objects of the same type that
exported. (will be) –
name (str) – The name of the csv file ending with ‘.csv’
path (Optional[str], optional) – A path to the directory where the file will be saved. Defaults to None.
properties (Optional[list[str]], optional) – A list of object’s attribute names that should be included in the exported file. Defaults to None.
- Raises:
TypeError – If objects is not of type T or list of type T
objects. –
- Return type:
None
- classmethod to_csv_from_list(objects, path=None, properties=None)¶
Exports list of user objects to csv (if path is provided) or to string (if path is not provided). The properties that are lists, dictionaries, or objects of custom classes, are first converted to dictionary using to_dict() method, then serialized string as json.
- Parameters:
objects (list) – list of user objects to be exported
path (str, optional) – a path specifying where to save the csv file
properties (list, optional) – list of properties of user object to be exported
- Return type:
str | None
Returns: str or None
- Raises:
TypeError if objects parameter contains objects other than – of type User
- Parameters:
objects (list[User]) –
path (str | None) –
properties (list[str] | None) –
- Return type:
str | None
- classmethod to_datafame_from_list(objects, properties=None)¶
Exports list of user objects to dataframe. The properties that are lists, dictionaries, or objects of custom classes, are first converted to dictionary using to_dict() method, then serialized string as json.
- Parameters:
objects (list) – list of user objects to be exported
properties (list, optional) – list of properties of user object to be exported
- Return type:
DataFrame
Returns: dataframe
- Raises:
TypeError if objects parameter contains objects other than – of type User
- Parameters:
objects (list[User]) –
properties (list[str] | None) –
- Return type:
DataFrame
- to_dataframe()¶
Converts all properties of the object to a dataframe.
- Returns:
A DataFrame object containing object properties.
- Return type:
DataFrame
- 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
- update_address(id, name=None, address=None, default=None, delivery_type=None, device_id=None)¶
Update existing address. The address ID has to be specified as the name is not unique.
- Parameters:
id (str) – ID of the address
name (str, optional) – New user-specified name for the address
address (str, optional) – New address value
default (bool, optional) – Whether the address should be (un)marked as default
delivery_type (str, optional) – Delivery type
device_id (str, optional) – Device ID
- Return type:
None
- update_properties()¶
Save compatible local changes of the object attributes to the I-Server. Changes are retrieved from the self._altered_properties dictionary. After the process of update has finished, self._altered_properties is cleared. For this method to work properly, you must override the _alter_properties() method in a subclass.
- Raises:
requests.HTTPError – If I-Server raises exception
- Return type:
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
- class mstrio.object_management.migration.package.PackageInfo(name, creator, creation_date, last_updated_date, type, environment=None, id=None, replicated=None, storage=None, project=None, status=None, message=None, warnings=None, progress=None, deleted=None, existing=None, toc_view=None, purpose=None, tree_view=None, certification=None)¶
Bases:
Dictable
Python representation of a PackageInfo Migration field.
- Parameters:
name (str) –
creator (User) –
creation_date (datetime) –
last_updated_date (datetime) –
type (PackageType) –
environment (str | None) –
id (str | None) –
replicated (bool | None) –
storage (PackageStorage | None) –
project (Project | None) –
status (PackageStatus | None) –
message (str | None) –
warnings (list[PackageWarning] | None) –
progress (float | None) –
deleted (bool | None) –
existing (bool | None) –
toc_view (ProjectMergePackageTocView | ObjectMigrationPackageTocView | None) –
purpose (MigrationPurpose | None) –
tree_view (dict | None) –
certification (PackageCertificationInfo | None) –
- attribute_id¶
ID of the mapped attribute
- attribute_form_id¶
ID of the mapped attribute’s 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
- certification: PackageCertificationInfo | None = None¶
- creation_date: datetime¶
- deleted: bool | None = None¶
- environment: str | None = None¶
- existing: bool | None = None¶
- id: str | None = None¶
- last_updated_date: datetime¶
- message: str | None = None¶
- name: str¶
- progress: float | None = None¶
- purpose: MigrationPurpose | None = None¶
- replicated: bool | None = None¶
- status: PackageStatus | None = None¶
- storage: PackageStorage | None = None¶
- toc_view: ProjectMergePackageTocView | ObjectMigrationPackageTocView | None = None¶
- tree_view: dict | None = None¶
- type: PackageType¶
- warnings: list[PackageWarning] | None = None¶
- class mstrio.object_management.migration.package.PackageObjectAction(id: str, action: Action, object_type: ObjectTypes | None = None)¶
Bases:
Dictable
- Parameters:
id (str) –
action (Action) –
object_type (ObjectTypes | 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
- id: str¶
- object_type: ObjectTypes | None = None¶
- class mstrio.object_management.migration.package.PackageObjectTypeAction(type: ObjectTypes, action: Action, sub_type: ObjectSubTypes | None = None)¶
Bases:
Dictable
- Parameters:
type (ObjectTypes) –
action (Action) –
sub_type (ObjectSubTypes | 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
- sub_type: ObjectSubTypes | None = None¶
- type: ObjectTypes¶
- class mstrio.object_management.migration.package.PackageSettings(default_action=Action.USE_EXISTING, update_schema=None, acl_on_replacing_objects=AclOnReplacingObjects.USE_EXISTING, acl_on_new_objects=AclOnNewObjects.KEEP_ACL_AS_SOURCE_OBJECT)¶
Bases:
Dictable
Object representation of package settings details.
- Parameters:
default_action (Action) –
update_schema (UpdateSchema | None) –
acl_on_replacing_objects (AclOnReplacingObjects) –
acl_on_new_objects (AclOnNewObjects) –
- update_schema¶
update_schema for Package
- Type:
Optional[UpdateSchema]
- acl_on_replacing_objects¶
ACL setting on replacing objects
- Type:
Optional[AclOnReplacingObjects]
- acl_on_new_objects¶
ACL setting on new objects
- Type:
Optional[AclOnNewObjects]
- enum AclOnNewObjects(value)¶
Bases:
AutoName
If you add a new object to the destination project with the “Create New” or “Keep Both action”, you can choose to have the object inherit its ACL from the destination folder instead of keeping its own ACL. This is helpful when copying an object into a user’s profile folder, so that the user can have full control over the object.
Valid values are as follows:
- KEEP_ACL_AS_SOURCE_OBJECT = AclOnNewObjects.KEEP_ACL_AS_SOURCE_OBJECT¶
- INHERIT_ACL_AS_DEST_FOLDER = AclOnNewObjects.INHERIT_ACL_AS_DEST_FOLDER¶
- enum AclOnReplacingObjects(value)¶
Bases:
AutoName
If you resolve a conflict with the “Replace” action, and the access control lists (ACL) of the objects are different between the two projects, you can choose whether to keep the existing ACL in the destination project or replace it with the ACL from the source project. Note: This is not supported for project security packages.
Valid values are as follows:
- USE_EXISTING = AclOnReplacingObjects.USE_EXISTING¶
- REPLACE = AclOnReplacingObjects.REPLACE¶
- KEEP_BOTH = AclOnReplacingObjects.KEEP_BOTH¶
- enum UpdateSchema(value)¶
Bases:
AutoName
They allow you to configure the package to automatically perform certain schema update functions. These options can be useful if you make any changes to schema objects. Use the recalculate table keys and fact entry levels if you changed the key structure of a table or if you changed the level at which a fact is stored.Use the recalculate table logical sizes to override any modifications that you have made to logical table sizes. (Logical table sizes affect how the Strategy One SQL Engine determines which tables to use in a query.)
Valid values are as follows:
- RECAL_TABLE_LOGICAL_SIZE = UpdateSchema.RECAL_TABLE_LOGICAL_SIZE¶
- RECAL_TABLE_KEYS_FACT_ENTRY_LEVEL = UpdateSchema.RECAL_TABLE_KEYS_FACT_ENTRY_LEVEL¶
- UPDATE_SCHEMA_LOGICAL_INFO = UpdateSchema.UPDATE_SCHEMA_LOGICAL_INFO¶
- 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.object_management.migration.package.PackageStatus(value)¶
Bases:
AutoName
Status of Migration Package. Allowed values are: - locked - created - create_failed - creating - empty - unknown
Valid values are as follows:
- LOCKED = PackageStatus.LOCKED¶
- CREATED = PackageStatus.CREATED¶
- CREATE_FAILED = PackageStatus.CREATE_FAILED¶
- CREATING = PackageStatus.CREATING¶
- EMPTY = PackageStatus.EMPTY¶
- UNKNOWN = PackageStatus.UNKNOWN¶
- class mstrio.object_management.migration.package.PackageStorage(size: int | None = None, path: str | None = None)¶
Bases:
Dictable
- Parameters:
size (int | None) –
path (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
- path: str | None = None¶
- size: int | None = None¶
- enum mstrio.object_management.migration.package.PackageType(value)¶
Bases:
Enum
Migration type.
Valid values are as follows:
- OBJECT = <PackageType.OBJECT: 'project'>¶
- ADMINISTRATION = <PackageType.ADMINISTRATION: 'configuration'>¶
- PROJECT = <PackageType.PROJECT: 'project_security'>¶
- class mstrio.object_management.migration.package.PackageWarning(message: str | None = None, iserver_error_code: int | None = None, banned_object_count: int | None = None)¶
Bases:
Dictable
- Parameters:
message (str | None) –
iserver_error_code (int | None) –
banned_object_count (int | 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
- banned_object_count: int | None = None¶
- iserver_error_code: int | None = None¶
- message: str | None = None¶
- class mstrio.object_management.migration.package.ProjectMergePackageSettings(acl_on_replacing_objects: AclOnReplacingObjects, acl_on_new_objects: AclOnNewObjects, default_action: Action, validate_dependencies: bool, translation_action: TranslationAction, folder_actions: dict | None = None, object_actions: dict | None = None, object_type_actions: dict | None = None, update_schema: UpdateSchema | None = None)¶
Bases:
Dictable
- Parameters:
acl_on_replacing_objects (AclOnReplacingObjects) –
acl_on_new_objects (AclOnNewObjects) –
default_action (Action) –
validate_dependencies (bool) –
translation_action (TranslationAction) –
folder_actions (dict | None) –
object_actions (dict | None) –
object_type_actions (dict | None) –
update_schema (UpdateSchema | 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
- acl_on_new_objects: AclOnNewObjects¶
- acl_on_replacing_objects: AclOnReplacingObjects¶
- folder_actions: dict | None = None¶
- object_actions: dict | None = None¶
- object_type_actions: dict | None = None¶
- translation_action: TranslationAction¶
- update_schema: UpdateSchema | None = None¶
- validate_dependencies: bool¶
- class mstrio.object_management.migration.package.ProjectMergePackageTocView(settings: ProjectMergePackageSettings)¶
Bases:
Dictable
- Parameters:
settings (ProjectMergePackageSettings) –
- 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
- settings: ProjectMergePackageSettings¶
- enum mstrio.object_management.migration.package.RequestStatus(value)¶
Bases:
AutoName
Status of a request such as import or undo. Allowed values are: - unknown - pending - requested - rejected - approved
Valid values are as follows:
- UNKNOWN = RequestStatus.UNKNOWN¶
- PENDING = RequestStatus.PENDING¶
- REQUESTED = RequestStatus.REQUESTED¶
- REJECTED = RequestStatus.REJECTED¶
- APPROVED = RequestStatus.APPROVED¶
- enum mstrio.object_management.migration.package.TranslationAction(value)¶
Bases:
AutoName
Translation action for Project Merge Package Settings. Allowed values are: - not_merged - use_existing - replace - force_replace
Valid values are as follows:
- NOT_MERGED = TranslationAction.NOT_MERGED¶
- USE_EXISTING = TranslationAction.USE_EXISTING¶
- REPLACE = TranslationAction.REPLACE¶
- FORCE_REPLACE = TranslationAction.FORCE_REPLACE¶
- class mstrio.object_management.migration.package.Validation(status: ValidationStatus | None = None, progress: float | None = None, message: str | None = None, creation_date: datetime.datetime | None = None, last_update_date: datetime.datetime | None = None)¶
Bases:
Dictable
- Parameters:
status (ValidationStatus | None) –
progress (float | None) –
message (str | None) –
creation_date (datetime | None) –
last_update_date (datetime | 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
- creation_date: datetime | None = None¶
- last_update_date: datetime | None = None¶
- message: str | None = None¶
- progress: float | None = None¶
- status: ValidationStatus | None = None¶