mstrio > server > project_languages¶
- enum mstrio.server.project_languages.CurrentMode(value)¶
Bases:
AutoName
Enum that specify a Current Mode for Data Internationalization.
Valid values are as follows:
- SQL = CurrentMode.SQL¶
- NONE = CurrentMode.NONE¶
- CONNECTION = CurrentMode.CONNECTION¶
- class mstrio.server.project_languages.DataLanguageSettings(default_language, current_mode, languages)¶
Bases:
Dictable
Object that specify a Data Language Settings for a Project.
- Parameters:
default_language (DataLocalizationLanguage) –
current_mode (CurrentMode) –
languages (list[DataLocalizationLanguage]) –
- default_language¶
Default language for the Project.
- Type:
- current_mode¶
Current mode for data internationalization.
- Type:
- languages¶
List of languages for the Project.
- Type:
list[DataLocalizationLanguage]
- add_language(languages)¶
Adds languages to the Project.
- Parameters:
languages (list[DataLocalizationLanguage]) – list of languages to be added to the Project
- Return type:
None
- alter_current_mode(mode)¶
Alters the current mode for data internationalization
- Parameters:
mode (str | CurrentMode) –
mode for data internationalization Available values:
none | CurrentMode.NONE
sql | CurrentMode.SQL
connection | CurrentMode.CONNECTION
- Return type:
None
- alter_default_language(language)¶
Alters the default language used by data internationalization
- Parameters:
language (str | DataLocalizationLanguage) – Language or it’s ID to be set as default.
- Return type:
None
- alter_language(languages, path)¶
Alters languages for the Project.
- Parameters:
languages (list[DataLocalizationLanguage]) – list of languages to be altered for the Project
path (str) – path to target where operation will be performed
values (Available) –
column
table
connectionId
- 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
- remove_language(languages)¶
Removes languages from the Project.
- Parameters:
languages (list[DataLocalizationLanguage]) – list of languages to be removed from the Project
- Return type:
None
- 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
- current_mode: CurrentMode¶
- default_language: DataLocalizationLanguage¶
- languages: list[DataLocalizationLanguage]¶
- class mstrio.server.project_languages.DataLocalizationLanguage(id, name=None, column=None, table=None, connection_id=None)¶
Bases:
SimpleLanguage
Object that specify a Data Localization Language.
- Parameters:
id (str) –
name (str | None) –
column (str | None) –
table (str | None) –
connection_id (str | None) –
- id¶
ID of the language.
- Type:
str
- name¶
Name of the language.
- Type:
str, optional
- column¶
Column name for the language.
- Type:
str, optional
- table¶
Table name for the language.
- Type:
str, optional
- connection_id¶
Connection ID for the language.
- Type:
str, 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
- column: str | None = None¶
- connection_id: str | None = None¶
- id: str¶
- name: str | None = None¶
- table: str | None = None¶
- class mstrio.server.project_languages.MetadataLanguageSettings(default, languages)¶
Bases:
Dictable
Object that specify a Metadata Language Settings for a Project.
- Parameters:
default (SimpleLanguage) –
languages (list[SimpleLanguage]) –
- default¶
Default language for the Project.
- Type:
- languages¶
List of languages for the Project.
- Type:
list[SimpleLanguage]
- add_language(languages)¶
Adds languages to the Project.
- Parameters:
languages (list[SimpleLanguage]) – list of languages to be added to the Project
- 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
- remove_language(languages)¶
Removes languages from the Project.
- Parameters:
languages (list[SimpleLanguage]) – list of languages to be removed from the Project
- Return type:
None
- 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
- default: SimpleLanguage¶
- languages: list[SimpleLanguage]¶
- class mstrio.server.project_languages.SimpleLanguage(id, name=None)¶
Bases:
Dictable
Object that specify a Simple Language.
- Parameters:
id (str) –
name (str | None) –
- id¶
ID of the language.
- Type:
str
- name¶
Name of the language.
- Type:
str, 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
- id: str¶
- name: str | None = None¶