🔍 Code Extractor

class InviteParticipantsOperation

Maturity: 46

Represents the status of a long-running participant invitation operation triggered by a call to the participant-invite API in Microsoft Graph Communications.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/operations/invite_participants.py
Lines:
8 - 19
Complexity:
simple

Purpose

This class tracks and provides access to the status of asynchronous participant invitation operations in Microsoft Teams/Skype calls. It extends CommsOperation to provide specific functionality for monitoring invitation operations, allowing developers to check the status of participant invitations and retrieve information about the participants being invited. The class is part of the Office365 Communications API wrapper and is typically instantiated as a result of calling participant invitation endpoints.

Source Code

class InviteParticipantsOperation(CommsOperation):
    """Represents the status of a long-running participant invitation operation,
    triggered by a call to the participant-invite API."""

    @property
    def participants(self):
        """
        The participants to invite.
        """
        return self.properties.get(
            "participants", ClientValueCollection(InvitationParticipantInfo)
        )

Parameters

Name Type Default Kind
bases CommsOperation -

Parameter Details

__init__: Inherits constructor from CommsOperation base class. The exact parameters are not visible in this code snippet but typically include operation metadata such as operation ID, status, and related properties from the parent CommsOperation class.

Return Value

Instantiation returns an InviteParticipantsOperation object that tracks the invitation operation. The 'participants' property returns a ClientValueCollection of InvitationParticipantInfo objects representing the participants being invited, or an empty collection if no participants are set.

Class Interface

Methods

@property participants(self) -> ClientValueCollection[InvitationParticipantInfo] property

Purpose: Retrieves the collection of participants being invited in this operation

Returns: A ClientValueCollection containing InvitationParticipantInfo objects representing the participants to invite. Returns an empty collection if no participants are set.

Attributes

Name Type Description Scope
properties dict Inherited from parent class. Dictionary containing operation properties including the 'participants' key which stores the participant collection instance

Dependencies

  • office365

Required Imports

from office365.communications.calls.invitation_participant_info import InvitationParticipantInfo
from office365.communications.operations.comms import CommsOperation
from office365.runtime.client_value_collection import ClientValueCollection

Usage Example

# Assuming you have a GraphClient instance and a call object
from office365.communications.operations.invite_participants import InviteParticipantsOperation
from office365.communications.calls.invitation_participant_info import InvitationParticipantInfo

# Typically obtained from an API call result
# operation = call.invite_participants(participants_list).execute_query()

# Access the operation object (usually returned from invite API)
operation = InviteParticipantsOperation()

# Get the list of participants being invited
participants = operation.participants

# Iterate through participants
for participant in participants:
    print(f"Inviting participant: {participant.identity}")

# Check operation status (inherited from CommsOperation)
if hasattr(operation, 'status'):
    print(f"Operation status: {operation.status}")

Best Practices

  • This class is typically not instantiated directly by users but returned as a result of calling participant invitation APIs
  • Always check the operation status (inherited from CommsOperation) before accessing participants to ensure the operation has completed
  • The participants property returns a collection that may be empty if the operation hasn't been initialized or if no participants were specified
  • Use this class in conjunction with polling mechanisms to monitor long-running invitation operations
  • Handle cases where the properties dictionary may not contain 'participants' key - the property safely returns an empty ClientValueCollection in such cases
  • This class inherits from CommsOperation, so all parent class methods and properties are available for checking operation status, errors, and completion

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class CommsOperation 65.1% similar

    Represents the status of long-running communications operations in Microsoft Graph API, tracking operation progress and results through notifications.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/operations/comms.py
  • class Participant 64.2% similar

    Represents a participant in a call, providing methods to manage participant state including inviting others, controlling hold music, and accessing participant information.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/calls/participant.py
  • class InvitationParticipantInfo 64.2% similar

    A data class representing an entity being invited to a group call, containing participant identification, visibility settings, and call routing configuration.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/calls/invitation_participant_info.py
  • class UnmuteParticipantOperation 61.4% similar

    A class representing the response format for an unmute participant operation in a communications context, inheriting from CommsOperation.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/communications/operations/unmute_participant.py
  • class Operation 60.3% similar

    A class representing the status of a long-running operation, inheriting from Entity to track operation metadata.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/onenote/operations/operation.py
← Back to Browse