participant_dao
Participant data access object (DAO) module.
Attributes
Classes
ParticipantDao
Bases: BaseDao
Participant data access object (DAO)
Note that Participant is polymorphic and should typically be used by either the User or Agent DAOs
Attributes
Functions
get_in_namespace
get_in_namespace(
*,
namespace_key: str,
resource_key: str,
filter_deleted: bool = True,
filter_disabled: bool = True
) -> Participant | None
Retrieve an Participant in a specified namespace by its primary key ID or name.
Parameters:
-
namespace_key(str) –The primary key ID of the namespace.
-
resource_key(str) –The primary key ID or name of the participant.
-
filter_deleted(bool, default:True) –Whether to filter out deleted activity sessions. Defaults to True.
-
filter_disabled(bool, default:True) –Whether to filter out disabled activity sessions. Defaults to True.
Returns:
-
Participant | None–Participant | None: The matching
ParticipantorNoneif not found.
get_participant_ref
get_participant_ref(
participant_pkid: str,
filter_deleted: bool = True,
filter_disabled: bool = True,
) -> Optional[Participant]
Retrieve the reference to a participant based on the provided participant_pkid.
Parameters:
-
participant_pkid(str) –The primary key of the participant.
-
filter_deleted(bool, default:True) –Whether to filter out deleted participants. Defaults to True.
-
filter_disabled(bool, default:True) –Whether to filter out disabled participants. Defaults to True.
Returns:
-
Participant(Optional[Participant]) –The reference to the participant if found, otherwise None.
get_participant_session_ref
get_participant_session_ref(
participant_pkid: str, session_pkid: str
) -> Optional[ActivitySessionParticipant]
Retrieves the reference to the participant’s activity session.
Parameters:
-
participant_pkid(str) –The primary key of the participant.
-
session_pkid(str) –The primary key of the session.
Returns:
-
ActivitySessionParticipant(Optional[ActivitySessionParticipant]) –The reference to the participant’s activity session.
hard_delete_by_pkid
hard_delete_by_pkid(
pkid: str, participant_type: ParticipantType
) -> int
Hard delete all participant records for a specific agent.
Parameters:
-
pkid(str) –Participant PKID
-
participant_type(ParticipantType) –Participant type
Returns:
-
int(int) –Number of records deleted