mstrio > distribution_services > schedule > schedule_time

class mstrio.distribution_services.schedule.schedule_time.ScheduleEnums

Bases: object

Object representations of recurrence information of a time-based schedule

enum DailyPattern(value)

Bases: AutoName

Valid values are as follows:

DAY = DailyPattern.DAY
WEEKDAY = DailyPattern.WEEKDAY
NONE = DailyPattern.NONE
enum DaysOfWeek(value)

Bases: AutoName

Valid values are as follows:

MONDAY = DaysOfWeek.MONDAY
TUESDAY = DaysOfWeek.TUESDAY
WEDNESDAY = DaysOfWeek.WEDNESDAY
THURSDAY = DaysOfWeek.THURSDAY
FRIDAY = DaysOfWeek.FRIDAY
SATURDAY = DaysOfWeek.SATURDAY
SUNDAY = DaysOfWeek.SUNDAY
NONE = DaysOfWeek.NONE
enum ExecutionPattern(value)

Bases: AutoName

Valid values are as follows:

ONCE = ExecutionPattern.ONCE
REPEAT = ExecutionPattern.REPEAT
enum MonthlyPattern(value)

Bases: AutoName

Valid values are as follows:

DAY = MonthlyPattern.DAY
DAY_OF_WEEK = MonthlyPattern.DAY_OF_WEEK
WEEKDAY = MonthlyPattern.WEEKDAY
LAST_DAY = MonthlyPattern.LAST_DAY
DAYS_OF_MONTH = MonthlyPattern.DAYS_OF_MONTH
NONE = MonthlyPattern.NONE
enum RecurrencePattern(value)

Bases: AutoName

Valid values are as follows:

DAILY = RecurrencePattern.DAILY
WEEKLY = RecurrencePattern.WEEKLY
MONTHLY = RecurrencePattern.MONTHLY
YEARLY = RecurrencePattern.YEARLY
enum WeekOffset(value)

Bases: AutoName

Valid values are as follows:

FIRST = WeekOffset.FIRST
SECOND = WeekOffset.SECOND
THIRD = WeekOffset.THIRD
FOURTH = WeekOffset.FOURTH
LAST = WeekOffset.LAST
NONE = WeekOffset.NONE
enum WeekdayOffset(value)

Bases: AutoName

Valid values are as follows:

FIRST = WeekdayOffset.FIRST
LAST = WeekdayOffset.LAST
NONE = WeekdayOffset.NONE
enum YearlyPattern(value)

Bases: AutoName

Valid values are as follows:

DAY = YearlyPattern.DAY
DAY_OF_WEEK = YearlyPattern.DAY_OF_WEEK
NONE = YearlyPattern.NONE
class mstrio.distribution_services.schedule.schedule_time.ScheduleTime(recurrence_pattern=None, execution=None, daily=None, weekly=None, monthly=None, yearly=None)

Bases: Dictable

Object representation of details of time-based schedule

Parameters:
class Daily(daily_pattern=DailyPattern.DAY, repeat_interval=1)

Bases: Dictable

Object representation of daily recurrence information of the schedule

Parameters:
  • daily_pattern (DailyPattern | str) –

  • repeat_interval (int) –

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 Execution(execution_pattern=ExecutionPattern.ONCE, execution_time=None, start_time=None, stop_time=None, repeat_interval=1)

Bases: Dictable

Object representation of the execution information of the schedule

Parameters:
  • execution_pattern (ExecutionPattern | str) –

  • execution_time (str | None) –

  • start_time (str | None) –

  • stop_time (str | None) –

  • repeat_interval (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

class Monthly(monthly_pattern, repeat_interval, day=None, week_offset=None, day_of_week=None, weekday_offset=None, days_of_month=None)

Bases: Dictable

Object representation of monthly recurrence information of the schedule

Parameters:
  • monthly_pattern (MonthlyPattern | str) –

  • repeat_interval (int) –

  • day (int | None) –

  • week_offset (WeekOffset | str | None) –

  • day_of_week (DaysOfWeek | str | None) –

  • weekday_offset (WeekdayOffset | str | None) –

  • days_of_month (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

class Weekly(days_of_week=None, repeat_interval=1)

Bases: Dictable

Object representation of weekly recurrence information of the schedule

Parameters:
  • days_of_week (list[DaysOfWeek] | list[str] | None) –

  • repeat_interval (int) –

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 Yearly(yearly_pattern=YearlyPattern.DAY, month=1, day=1, week_offset=None, day_of_week=None)

Bases: Dictable

Object representation of yearly recurrence information of the schedule

Parameters:
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_details(recurrence_pattern, execution_pattern, execution_time=None, start_time=None, stop_time=None, execution_repeat_interval=None, daily_pattern=DailyPattern.NONE, repeat_interval=None, days_of_week=None, day=None, month=None, week_offset=WeekOffset.NONE, day_of_week=DaysOfWeek.NONE, weekday_offset=None, days_of_month=None, monthly_pattern=MonthlyPattern.NONE, yearly_pattern=YearlyPattern.NONE)

Uses provided properties to create object representation of details of a time-based schedule.

This object is used as ‘time’ part of request body and is needed for creating and updating schedule.

Parameters:
  • recurrence_pattern (RecurrencePattern, optional) – The recurrence pattern of the schedule. Possible values are DAILY, WEEKLY, MONTHLY, YEARLY Defaults to None.

  • execution_pattern (ExecutionPattern, optional) – The execution pattern of the schedule. Possible values are ONCE, REPEAT. Defaults to None.

  • execution_time (str, optional) – The execution time of the execution day, if execution_pattern is ONCE. Format should be HH:mm:ss. Defaults to ‘’.

  • start_time (str, optional) – The start time of the execution day, if execution_pattern is REPEAT. Format should be HH:mm:ss. Defaults to ‘’.

  • stop_time (str, optional) – The stop time of the execution day, if execution_pattern is REPEAT. Format should be HH:mm:ss. Defaults to ‘’.

  • execution_repeat_interval (int, optional) – The repeat interval of minutes of the execution day, if execution_pattern is REPEAT. Defaults to None.

  • daily_pattern (DailyPattern, optional) – The daily recurrence pattern of the schedule. Possible values are DAY, WEEKDAY. Defaults to None.

  • repeat_interval (int, optional) – The repeat interval of days of daily schedule, if daily_pattern is DAY or, The repeat interval of weeks of weekly schedule or, The repeat interval of months of monthly schedule. Defaults to None.

  • day (int, optional) – The day in month of monthly schedule, if monthly_pattern is DAY or, The day in month of yearly schedule, if yearly_pattern is DAY. Defaults to None.

  • month (int, optional) – The month in year of yearly schedule. Defaults to None.

  • week_offset (WeekOffset, optional) – The week offset in month of monthly schedule, if monthly_pattern is DAY_OF_WEEK or, The week offset in year of yearly schedule, if yearly_pattern is DAY_OF_WEEK. Possible values are FIRST, SECOND, THIRD, FOURTH, LAST. Defaults to None.

  • day_of_week (DaysOfWeek, optional) – The days of week of weekly schedule or, The day of week in month of monthly schedule, if monthly_pattern is DAY_OF_WEEK or, The day of week in year of yearly schedule, if yearly_pattern is DAY_OF_WEEK. Possible values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. Defaults to None.

  • weekday_offset (WeekdayOffset, optional) – The weekday offset in month of monthly schedule, if monthly_pattern is WEEKDAY. Possible values are: FIRST, LAST. Defaults to None.

  • days_of_month (List[str], optional) – The days of month of monthly schedule, if monthly_pattern is DAYS_OF_MONTH. Must be provided as a list of one or more stringified digits (from ‘1’ to ‘31’). Defaults to None.

  • monthly_pattern (MonthlyPattern, optional) – The monthly recurrence pattern of the schedule. Possible values are: DAY, DAY_OF_WEEK, WEEKDAY, LAST_DAY, DAYS_OF_MONTH. Defaults to None.

  • yearly_pattern (YearlyPattern, optional) – The yearly recurrence pattern of the schedule. Possible values are DAY, DAY_OF_WEEK. Defaults to None.

  • days_of_week (list[DaysOfWeek] | list[str] | None) –

Returns:

Object representation of details of time-based schedule.

Return type:

ScheduleTime

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

update_properties(recurrence_pattern=None, execution_pattern=None, execution_time=None, start_time=None, stop_time=None, execution_repeat_interval=None, daily_pattern=None, repeat_interval=None, days_of_week=None, day=None, month=None, week_offset=None, day_of_week=None, weekday_offset=None, days_of_month=None, monthly_pattern=None, yearly_pattern=None)

Updates ScheduleTime object according to provided parameters. If a provided parameter is not None then update it, else use its current value.

Parameters:
  • recurrence_pattern (RecurrencePattern, optional) – The recurrence pattern of the schedule. Possible values are DAILY, WEEKLY, MONTHLY, YEARLY. Defaults to None.

  • execution_pattern (ExecutionPattern, optional) – The execution pattern of the schedule. Possible values are ONCE, REPEAT. Defaults to None.

  • execution_time (str, optional) – The execution time of the execution day, if execution_pattern is ONCE. Format should be HH:mm:ss. Defaults to ‘’.

  • start_time (str, optional) – The start time of the execution day, if execution_pattern is REPEAT. Format should be HH:mm:ss. Defaults to ‘’.

  • stop_time (str, optional) – The stop time of the execution day, if execution_pattern is REPEAT. Format should be HH:mm:ss. Defaults to ‘’.

  • execution_repeat_interval (int, optional) – The repeat interval of minutes of the execution day, if execution_pattern is REPEAT. Defaults to None.

  • daily_pattern (DailyPattern, optional) – The daily recurrence pattern of the schedule. Possible values are DAY, WEEKDAY. Defaults to None.

  • repeat_interval (int, optional) – The repeat interval of days of daily schedule, if daily_pattern is DAY. Defaults to None.

  • day (int, optional) – The day in month of monthly schedule, if monthly_pattern is DAY or The day in month of yearly schedule, if yearly_pattern is DAY. Defaults to None.

  • month (int, optional) – The month in year of yearly schedule. Defaults to None.

  • week_offset (WeekOffset, optional) – The week offset in month of monthly schedule, if monthly_pattern is DAY_OF_WEEK or, The week offset in year of yearly schedule, if yearly_pattern is DAY_OF_WEEK. Possible values are FIRST, SECOND, THIRD, FOURTH, LAST. Defaults to None.

  • day_of_week (DaysOfWeek, optional) – The day of week in month of monthly schedule, if monthly_pattern is DAY_OF_WEEK or, The day of week in year of yearly schedule, if yearly_pattern is DAY_OF_WEEK. Possible values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. Defaults to None.

  • days_of_week (List[DaysOfWeek], optional) – The days of week of weekly schedule. Possible values are: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. Defaults to None.

  • weekday_offset (WeekdayOffset, optional) – The weekday offset in month of monthly schedule, if monthly_pattern is WEEKDAY. Defaults to None.

  • days_of_month (List[str], optional) – The days of month of monthly schedule, if monthly_pattern is DAYS_OF_MONTH. Must be provided as a list of one or more stringified digits (from ‘1’ to ‘31’). Defaults to None.

  • monthly_pattern (MonthlyPattern, optional) – The monthly recurrence pattern of the schedule. Possible values are: DAY, DAY_OF_WEEK, WEEKDAY, LAST_DAY, DAYS_OF_MONTH. Defaults to None.

  • yearly_pattern (YearlyPattern, optional) – The yearly recurrence pattern of the schedule. Possible values are DAY, DAY_OF_WEEK. Defaults to None.