azure.communication.rooms package

class azure.communication.rooms.CommunicationRoom(*, id: str, created_on: datetime.datetime, valid_from: datetime.datetime, valid_until: datetime.datetime, room_join_policy: azure.communication.rooms._generated.models._enums.RoomJoinPolicy, participants: Optional[List[azure.communication.rooms._models._models.RoomParticipant]] = None, **kwargs)[source]

The response object from rooms service.

Variables
  • id (str) – Unique identifier of a room. This id is server generated.

  • created_on (datetime) – The timestamp when the room was created at the server.

  • valid_from (datetime) – The timestamp from when the room is open for joining.

  • valid_until (datetime) – The timestamp from when the room can no longer be joined.

  • room_join_policy (RoomJoinPolicy) – The join policy of the room.

  • participants (Optional[List[RoomParticipant]]) – Collection of room participants.

Parameters
  • id (str) – Unique identifier of a room. This id is server generated.

  • created_on (datetime) – The timestamp when the room was created at the server.

  • valid_from (datetime) – The timestamp from when the room is open for joining.

  • valid_until (datetime) – The timestamp from when the room can no longer be joined.

  • room_join_policy – The join policy of the room. Allows only participants or any communication

service users to join :type room_join_policy: ~azure.communication.rooms.RoomJoinPolicy :param participants: Collection of room participants. :type participants: Optional[List[~azure.communication.rooms.RoomParticipant]]

class azure.communication.rooms.ParticipantsCollection(*, participants: List[azure.communication.rooms._generated.models._models.RoomParticipant], **kwargs)[source]

Collection of participants in a room.

All required parameters must be populated in order to send to Azure.

Variables

participants (List[RoomParticipant]) – Room Participants. Required.

class azure.communication.rooms.RoleType(value)[source]

The Role of a room participant.

ATTENDEE = 'Attendee'
CONSUMER = 'Consumer'
PRESENTER = 'Presenter'
class azure.communication.rooms.RoomJoinPolicy(value)[source]

The Policy based on which Participants can join a room.

COMMUNICATION_SERVICE_USERS = 'CommunicationServiceUsers'
INVITE_ONLY = 'InviteOnly'
class azure.communication.rooms.RoomParticipant(*, communication_identifier: azure.communication.rooms._shared.models.CommunicationIdentifier, role: Optional[Union[str, azure.communication.rooms._generated.models._enums.RoleType]] = None, **kwargs)[source]

A participant of the room.

All required parameters must be populated in order to send to Azure.

Variables

communication_identifier – Identifies a participant in Azure Communication services. A

participant is, for example, an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. Required. :vartype communication_identifier: ~azure.communication.rooms._shared.models.CommunicationIdentifier :ivar role: Role Name. :vartype role: Optional[Union[str, RoleType]

Parameters
  • communication_identifier (CommunicationIdentifier) – Identifies a participant in Azure Communication services. A participant is, for example, an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. Required.

  • role (Optional[Union[str, RoleType]]) – The Role of a room participant. Known values are: “Presenter”, “Attendee”, and “Consumer”.

class azure.communication.rooms.RoomsClient(endpoint: str, credential: azure.core.credentials.AzureKeyCredential, **kwargs)[source]

A client to interact with the AzureCommunicationService Rooms gateway.

This client provides operations to manage rooms.

Parameters
  • endpoint (str) – The endpoint url for Azure Communication Service resource.

  • credential (AzureKeyCredential) – The access key we use to authenticate against the service.

add_participants(*, room_id: str, participants: List[azure.communication.rooms._models._models.RoomParticipant], **kwargs)None[source]

Add participants to a room. Maximum room size is 350 participants. Adding more participants will result in exceptions. Existing participants cannot be added again.

Parameters
  • room_id (str) – Required. Id of room to be updated

  • participants (List[RoomParticipant]) – Required. Collection of identities invited to the room.

Returns

None

Raises

~azure.core.exceptions.HttpResponseError, ValueError

create_room(*, valid_from: Optional[datetime.datetime] = None, valid_until: Optional[datetime.datetime] = None, room_join_policy: Optional[azure.communication.rooms._generated.models._enums.RoomJoinPolicy] = None, participants: Optional[List[azure.communication.rooms._models._models.RoomParticipant]] = None, **kwargs)azure.communication.rooms._models._models.CommunicationRoom[source]

Create a new room.

Parameters
  • valid_from (datetime) – The timestamp from when the room is open for joining. Optional.

  • valid_until (datetime) – The timestamp from when the room can no longer be joined. Optional.

  • room_join_policy (RoomJoinPolicy) – The join policy of the room. Optional.

  • participants (List[RoomParticipant]) – Collection of identities invited to the room. Optional.

Returns

Created room.

Return type

CommunicationRoom

Raises

~azure.core.exceptions.HttpResponseError

delete_room(room_id: str, **kwargs)None[source]

Delete room.

Parameters

room_id (str) – Required. Id of room to be deleted

Returns

None.

Return type

None

Raises

~azure.core.exceptions.HttpResponseError

classmethod from_connection_string(conn_str: str, **kwargs)azure.communication.rooms._rooms_client.RoomsClient[source]

Create RoomsClient from a Connection String.

Parameters

conn_str (str) – A connection string to an Azure Communication Service resource.

Returns

Instance of RoomsClient.

Return type

RoomsClient

Example:

get_participants(room_id: str, **kwargs)azure.communication.rooms._models._models.ParticipantsCollection[source]

Get participants of a room :param room_id: Required. Id of room whose participants to be fetched. :type room_id: str :returns: ParticipantsCollection containing all participants in the room. :rtype: ~azure.communication.rooms.ParticipantsCollection :raises: ~azure.core.exceptions.HttpResponseError

get_room(room_id: str, **kwargs)azure.communication.rooms._models._models.CommunicationRoom[source]

Get a valid room

Parameters

room_id (str) – Required. Id of room to be fetched

Returns

Room with current attributes.

Return type

CommunicationRoom

Raises

~azure.core.exceptions.HttpResponseError

remove_participants(*, room_id: str, communication_identifiers: List[azure.communication.rooms._shared.models.CommunicationIdentifier], **kwargs)None[source]

Remove participants from a room :param room_id: Required. Id of room to be updated :type room_id: str :param communication_identifiers: Required. Collection of identities to be removed from the room. :type communication_identifiers: List[~azure.communication.rooms._shared.models.CommunicationIdentifier] :return: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError

update_participants(*, room_id: str, participants: List[azure.communication.rooms._models._models.RoomParticipant], **kwargs)None[source]

Update participants to a room. It looks for the room participants based on their communication identifier and replace the existing participants with the value passed in this API. :param room_id: Required. Id of room to be updated :type room_id: str :param participants: Required. Collection of identities invited to be updated :type participants: List[~azure.communication.rooms.RoomParticipant] :return: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError

update_room(*, room_id: str, valid_from: Optional[datetime.datetime] = None, valid_until: Optional[datetime.datetime] = None, room_join_policy: Optional[azure.communication.rooms._generated.models._enums.RoomJoinPolicy] = None, participants: Optional[List[azure.communication.rooms._models._models.RoomParticipant]] = None, **kwargs)azure.communication.rooms._models._models.CommunicationRoom[source]

Update a valid room’s attributes. For any argument that is passed in, the corresponding room property will be replaced with the new value.

Parameters
  • room_id (str) – Required. Id of room to be updated

  • valid_from (datetime) – The timestamp from when the room is open for joining.Optional

  • valid_until (datetime) – The timestamp from when the room can no longer be joined. Optional.

  • room_join_policy (RoomJoinPolicy) – The join policy of the room.Optional.

  • participants (List[RoomParticipant]) – Collection of identities invited to the room. Optional.

Returns

Updated room.

Return type

CommunicationRoom

Raises

~azure.core.exceptions.HttpResponseError, ValueError