mstrio > distribution_services > subscription > content¶
- class mstrio.distribution_services.subscription.content.Content(id, type=None, name=None, personalization=None, refresh_condition=None)¶
Bases:
Dictable
Class representation of subscription content object.
- Parameters:
id (str) –
type (Type | None) –
name (str | None) –
personalization (Properties | None) –
refresh_condition (RefreshCondition | None) –
- id¶
Content identifier
- type¶
Type of content
- name¶
Name of content
- personalization¶
Properties object which personalize content
- refresh_condition¶
RefreshCondition object which sets refresh condition of the content
- class Properties(format_mode=FormatMode.DEFAULT, view_mode=ViewMode.DEFAULT, format_type=FormatType.PDF, export_to_pdf_settings=None, delimiter=None, bursting=None, prompt=None, file_name=None, content_modes=None, bookmark_ids=None)¶
Bases:
Dictable
Class representation of personalization properties
- Parameters:
format_mode (FormatMode) –
view_mode (ViewMode) –
format_type (FormatType) –
export_to_pdf_settings (ExportToPdfSettings | None) –
delimiter (str | None) –
bursting (Bursting | None) –
prompt (Prompt | None) –
file_name (str | None) –
content_modes (list[str] | None) –
bookmark_ids (list[str] | None) –
- format_mode¶
Type that defines how much of the Report Services document, which has group by units, should be delivered
- view_mode¶
Indicates the view mode that is supported by this format
- format_type¶
Content format mode
- export_to_pdf_settings¶
ExportToPdfSettings object which specifies pdf settings if format_type is set to PDF
- delimiter¶
Format delimiter
- bursting¶
Bursting settings object
- prompt¶
Prompt settings object
- file_name¶
file name of content
- class Bursting(slicing_attributes=None, address_attribute_id=None, address_attribute_name=None, address_attribute=None, device_id=None, device=None, form_id=None, form=None)¶
Bases:
Dictable
Bursting settings
- Parameters:
slicing_attributes (str | Attribute | list[str] | list[Attribute] | None) –
address_attribute_id (str | None) –
address_attribute_name (str | None) –
address_attribute (Attribute | None) –
device_id (str | None) –
device (Device | None) –
form_id (str | None) –
form (AttributeForm | None) –
- slicing_attributes¶
The list of attributes to slice on
- address_attribute_id¶
Attribute ID in the email burst feature
- device_id¶
Device ID in the email burst feature
- form_id¶
Form ID in the email burst feature
- 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 ExportToPdfSettings(page_option=PageOption.PAGE, page_size=PageSize.LETTER, orientation=Orientation.AUTOMATIC, page_detail_level=PageDetailLevel.OVERVIEW, include_header=True, include_footer=True, include_toc=False, filter_summary=FilterSummary.BAR, fit_to_page=False, repeat_column_header=False, grid_paging_mode=GridPagingMode.NONE)¶
Bases:
Dictable
Export to PDF Settings
- Parameters:
page_option (PageOption) –
page_size (PageSize) –
orientation (Orientation) –
include_header (bool) –
include_footer (bool) –
include_toc (bool) –
filter_summary (FilterSummary) –
fit_to_page (bool) –
repeat_column_header (bool) –
grid_paging_mode (GridPagingMode) –
- page_option¶
Specifies whether to export current page or all pages
- page_size¶
Page size of the PDF file
- orientation¶
Page orientation. If ‘auto’ is being used, the exporting engine might swap the width and the height of the page to optimize the export
- page_detail_level¶
Specifies the detail level of page to be displayed
- include_header¶
Specifies whether to include header
Specifies whether to include footer
- include_toc¶
Specifies whether to include table of contents
- filter_summary¶
Specifies the options of including filter summary in the exported PDF. If ‘NONE’ is being used, no filter summary will be displayed. If ‘BAR’ is being used, filter summary bar will be displayed on each page. If ‘PAGE’ is being used, filter summary page will be displayed at the end of each chapter. If ‘ALL’ is being used, both filter summary bar and page will be displayed.
- fit_to_page¶
Specifies whether to fit grid to page
- repeat_column_header¶
Specifies whether to repeat grid column header
- grid_paging_mode¶
Specifies how grids should be paginated
- enum FilterSummary(value)¶
Bases:
AutoUpperName
Valid values are as follows:
- NONE = <FilterSummary.NONE: 'NONE'>¶
- BAR = <FilterSummary.BAR: 'BAR'>¶
- PAGE = <FilterSummary.PAGE: 'PAGE'>¶
- ALL = <FilterSummary.ALL: 'ALL'>¶
- enum GridPagingMode(value)¶
Bases:
AutoName
Valid values are as follows:
- NONE = GridPagingMode.NONE¶
- ENLARGE = GridPagingMode.ENLARGE¶
- enum Orientation(value)¶
Bases:
AutoName
Valid values are as follows:
- AUTOMATIC = Orientation.AUTOMATIC¶
- PORTRAIT = Orientation.PORTRAIT¶
- LANDSCAPE = Orientation.LANDSCAPE¶
- enum PageDetailLevel(value)¶
Bases:
AutoName
Valid values are as follows:
- OVERVIEW = PageDetailLevel.OVERVIEW¶
- DETAILED_PAGES = PageDetailLevel.DETAILED_PAGES¶
- OVERVIEW_AND_DETAILED_PAGES = PageDetailLevel.OVERVIEW_AND_DETAILED_PAGES¶
- enum PageOption(value)¶
Bases:
AutoUpperName
Valid values are as follows:
- DEFAULT = <PageOption.DEFAULT: 'DEFAULT'>¶
- ALL = <PageOption.ALL: 'ALL'>¶
- CURRENT = <PageOption.CURRENT: 'CURRENT'>¶
- PAGE = <PageOption.PAGE: 'PAGE'>¶
- enum PageSize(value)¶
Bases:
AutoName
Valid values are as follows:
- A0 = PageSize.A0¶
- A1 = PageSize.A1¶
- A2 = PageSize.A2¶
- A3 = PageSize.A3¶
- A4 = PageSize.A4¶
- A5 = PageSize.A5¶
- B4 = PageSize.B4¶
- B5 = PageSize.B5¶
- LETTER = PageSize.LETTER¶
- LEGAL = PageSize.LEGAL¶
- LEDGER = PageSize.LEDGER¶
- EXECUTIVE = PageSize.EXECUTIVE¶
- FOLIO = PageSize.FOLIO¶
- STATEMENT = PageSize.STATEMENT¶
- UNSUPPORTED = PageSize.UNSUPPORTED¶
- 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 FormatMode(value)¶
Bases:
AutoUpperName
Valid values are as follows:
- DEFAULT = <FormatMode.DEFAULT: 'DEFAULT'>¶
- CURRENT_PAGE = <FormatMode.CURRENT_PAGE: 'CURRENT_PAGE'>¶
- ALL_PAGES = <FormatMode.ALL_PAGES: 'ALL_PAGES'>¶
- ALL_PAGES_SEPARATED = <FormatMode.ALL_PAGES_SEPARATED: 'ALL_PAGES_SEPARATED'>¶
- CURRENT_WINDOW = <FormatMode.CURRENT_WINDOW: 'CURRENT_WINDOW'>¶
- CURRENT_LAYOUT = <FormatMode.CURRENT_LAYOUT: 'CURRENT_LAYOUT'>¶
- enum FormatType(value)¶
Bases:
AutoUpperName
Valid values are as follows:
- PLAIN_TEXT = <FormatType.PLAIN_TEXT: 'PLAIN_TEXT'>¶
- EXCEL = <FormatType.EXCEL: 'EXCEL'>¶
- HTML = <FormatType.HTML: 'HTML'>¶
- PDF = <FormatType.PDF: 'PDF'>¶
- STREAMING = <FormatType.STREAMING: 'STREAMING'>¶
- SWF_MHT = <FormatType.SWF_MHT: 'SWF_MHT'>¶
- SWF_HTML = <FormatType.SWF_HTML: 'SWF_HTML'>¶
- CSV = <FormatType.CSV: 'CSV'>¶
- VIEW = <FormatType.VIEW: 'VIEW'>¶
- INTERACTIVE = <FormatType.INTERACTIVE: 'INTERACTIVE'>¶
- EDITABLE = <FormatType.EDITABLE: 'EDITABLE'>¶
- EXPORT_FLASH = <FormatType.EXPORT_FLASH: 'EXPORT_FLASH'>¶
- PHONE = <FormatType.PHONE: 'PHONE'>¶
- TABLET = <FormatType.TABLET: 'TABLET'>¶
- JSON = <FormatType.JSON: 'JSON'>¶
- MSTR = <FormatType.MSTR: 'MSTR'>¶
- class Prompt(enabled, instance_id=None)¶
Bases:
Dictable
- Parameters:
enabled (bool) –
instance_id (str) –
- 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 ViewMode(value)¶
Bases:
AutoUpperName
Valid values are as follows:
- DEFAULT = <ViewMode.DEFAULT: 'DEFAULT'>¶
- GRID = <ViewMode.GRID: 'GRID'>¶
- GRAPH = <ViewMode.GRAPH: 'GRAPH'>¶
- BOTH = <ViewMode.BOTH: 'BOTH'>¶
- NONINTERACTIVE = <ViewMode.NONINTERACTIVE: 'NONINTERACTIVE'>¶
- 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 RefreshCondition(tables, dataset_refresh_policy=None, filters=None)¶
Bases:
Dictable
Dataset refresh condition settings
- Parameters:
tables (list[TableRefreshInfo]) –
dataset_refresh_policy (RefreshPolicy | None) –
filters (list[SubscriptionFilter] | None) –
- tables¶
List of TableRefreshInfo objects
- dataset_refresh_policy¶
Default refresh policy for all the tables in the dataset. The setting value must be provided if the tables setting value is not provided or empty.
- filters¶
list of SubscriptionFilter objects
- class SubscriptionFilter(type, expression)¶
Bases:
Dictable
- Subscription filter. The format of the subscription filters are
exactly the same as the view filters. Please refer to https://microstrategy.github.io/rest-api-docs/common-workflows /analytics/filter-data/filter-report-and-cube-instances /filter-report-and-cube-instances-using-view-filters /code-sample#multiple-filters-on-attribute-forms for detailed information. But it should be noted that subscription filters only support Filter on attribute forms and Multiple filters on attribute forms.
- Parameters:
type (str) –
- type¶
Filter type
- expression¶
Metric limits
- 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 TableRefreshInfo(id, refresh_policy, alternate_source=None)¶
Bases:
Dictable
- Table refresh settings. When the setting is absent in the
response or the array is empty, the datasetRefreshPolicy setting value must be provided and will be used as the refresh policy for all the tables, including the new added table after the scheduler is set up.
- Parameters:
id (str) –
refresh_policy (RefreshPolicy) –
alternate_source (AlternateSource | None) –
- id¶
Table ID
- refresh_policy¶
Table refresh policy
- alternateSource¶
AlternateSource object
- class AlternateSource(db_role_id=None, namespace=None, table_name=None, url=None)¶
Bases:
Dictable
Alternate source
- Parameters:
db_role_id (str | None) –
namespace (str | None) –
table_name (str | None) –
url (str | None) –
- db_role_id¶
Database instance ID of alternate source
- namespace¶
Database namespace of alternate source
- table_name¶
Table name of alternate source
- url¶
URL of alternate source
- 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
- 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
- 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 Type(value)¶
Bases:
AutoName
Valid values are as follows:
- REPORT = Type.REPORT¶
- DOCUMENT = Type.DOCUMENT¶
- CUBE = Type.CUBE¶
- UNSUPPORTED = Type.UNSUPPORTED¶
- DASHBOARD = Type.DASHBOARD¶
- 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