azure.communication.rooms.aio package¶
-
class
azure.communication.rooms.aio.
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.
-
async
add_participants
(*, room_id: str, participants: List[azure.communication.rooms._models._models.RoomParticipant], **kwargs) → None[source]¶ Add participants to a roomMaximum 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
-
async
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
- Raises
~azure.core.exceptions.HttpResponseError
-
classmethod
from_connection_string
(conn_str: str, **kwargs) → azure.communication.rooms.aio._rooms_client_async.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:
-
async
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
-
async
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
- Raises
~azure.core.exceptions.HttpResponseError
-
async
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 participants: Required. Collection of identities to be removed from the room. :type participants: List[~azure.communication.rooms._shared.models.CommunicationIdentifier] :return: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError
-
async
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 those 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 to be updated :type participants: List[~azure.communication.rooms.RoomParticipant] :return: None :raises: ~azure.core.exceptions.HttpResponseError, ValueError
-
async
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
- Raises
~azure.core.exceptions.HttpResponseError, ValueError