Source code for q2_sdk.hq.db.message_recipient_group

from argparse import _SubParsersAction
from functools import partial
from typing import List

from q2_sdk.hq.table_row import TableRow

from .db_object import DbObject


[docs] class MessageRecipientGroupRow(TableRow): GroupID: int GroupName: str VisibleToEndUser: bool AllowReplies: bool GroupDescription: str
[docs] class MessageRecipientGroup(DbObject): """ Used to gather the CSR message groups that can receive secure messages from within the Q2 platform. Generally used in combination with the SendSecureMessageAsXML HQ method to send a message from an end user to a CSR message group """ GET_BY_NAME_KEY = "GroupName" NAME = "MessageRecipientGroup" REPRESENTATION_ROW_CLASS = MessageRecipientGroupRow
[docs] def add_arguments(self, parser: _SubParsersAction): subparser = parser.add_parser("get_message_recipient_groups") subparser.set_defaults(parser="get_message_recipient_groups") subparser.set_defaults(func=partial(self.get, serialize_for_cli=True))
[docs] async def get(self, serialize_for_cli=False) -> List[MessageRecipientGroupRow]: response = await self.call_hq("sdk_GetMessageRecipientGroups") if serialize_for_cli: response = self.serialize_for_cli( response, fields_to_display=[ "GroupID", "GroupName", "VisibleToEndUser", "AllowReplies", "GroupDescription", ], ) return response