mstrio.distribution_services.contact_group package

Submodules

mstrio.distribution_services.contact_group.contact_group module

class mstrio.distribution_services.contact_group.contact_group.ContactGroup(connection: Connection, id: Optional[str] = None, name: Optional[str] = None)

Bases: mstrio.utils.entity.EntityBase, mstrio.utils.entity.DeleteMixin

Object representation of Microstrategy Contact Group object

name

contact group’s name

id

contact group’s id

description

contact group’s description

enabled

specifies if a contact group is enabled

linked_user

user linked to contact group, instance of User

members

list of contact group’s members, instances of ContactGroupMember

memberships

list of Contact Groups that the Contact Group belongs to

connection

instance of Connection class, represents connection to MicroStrategy Intelligence Server

add_members(members: Iterable[Union[ContactGroupMember, Contact, ContactGroup]])

Add member

Parameters

members – list of members to add to contact group

alter(name: Optional[str] = None, description: Optional[str] = None, enabled: Optional[bool] = None, linked_user: Optional[Union[mstrio.users_and_groups.user.User, str]] = None, members: Optional[Iterable[Union[mstrio.distribution_services.contact_group.contact_group.ContactGroupMember, dict]]] = None)

Update properties of a contact group

Parameters
  • name – name of a contact

  • description – description of a contact

  • enabled – specifies if a contact is enabled

  • linked_user – an object of class User linked to the contact

  • members – list of contact group members, instances of ContactGroupMember

classmethod create(connection: Connection, name: str, linked_user: Union[str, mstrio.users_and_groups.user.User], members: List[Union[dict, mstrio.distribution_services.contact_group.contact_group.ContactGroupMember]], description: Optional[str] = None, enabled: bool = True) ContactGroup

Create a new contact group.

Parameters
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name – contact group name

  • linked_user – user linked to contact

  • members – list of members

  • description – description of contact

  • enabled – specifies if contact should be enabled

Returns

ContactGroup object

remove_members(members: Iterable[Union[ContactGroupMember, Contact, ContactGroup]])

Remove member

Parameters

members – list of members to remove from contact group

class mstrio.distribution_services.contact_group.contact_group.ContactGroupMember(name: str, type: Union[str, mstrio.distribution_services.contact_group.contact_group.ContactGroupMemberType], id: Optional[str] = None, description: Optional[str] = None, enabled: bool = True)

Bases: mstrio.utils.helper.Dictable

ContactGroupMember class, representing either Contact or ContactGroup

name

member’s name

type

type of a member, instance of ContactGroupMemberType

id

id of member, optional

description

member’s description, optional

enabled

specifies if a member is enabled

classmethod from_contact_or_contact_group(obj: Union[Contact, ContactGroup]) ContactGroupMember

Initialize instance of class ContactGroupMember

Parameters
  • obj – object to used as base for initializing instance of

  • ContactGroupMember

Returns

ContactGroupMember object

class mstrio.distribution_services.contact_group.contact_group.ContactGroupMemberType(value)

Bases: mstrio.utils.enum_helper.AutoName

An enumeration.

CONTACT = 'contact'
CONTACT_GROUP = 'contact_group'
mstrio.distribution_services.contact_group.contact_group.list_contact_groups(connection: Connection, to_dictionary: bool = False, limit: Optional[int] = None, **filters) Union[List[ContactGroup], List[dict]]

Get all contact groups as list of ContactGroup objects or dictionaries.

Optionally filter the contact groups by specifying filters.

Parameters
  • connection (object) – MicroStrategy connection object

  • to_dictionary – If True returns a list of contact group dicts, otherwise returns a list of contact group objects

  • limit – limit the number of elements returned. If None (default), all objects are returned.

  • **filters – Available filter parameters: [‘id’, ‘name’, ‘description’, enabled]

Module contents