Skip to content

Commit 851aec7

Browse files
authored
Merge pull request #206335 from radubulboaca/master
update quickstarts for communication-services rooms with additional review comments
2 parents f2b670b + 264ed0b commit 851aec7

File tree

5 files changed

+55
-15
lines changed

5 files changed

+55
-15
lines changed

articles/communication-services/quickstarts/rooms/get-started-rooms.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ zone_pivot_groups: acs-js-csharp-java-python
1919

2020
This quickstart will help you get started with Azure Communication Services Rooms. A `room` is a server-managed communications space for a known, fixed set of participants to collaborate for a pre-determined duration. The [rooms conceptual documentation](../../concepts/rooms/room-concept.md) covers more details and use cases for `rooms`.
2121

22-
::: zone pivot="programming-language-javascript"
23-
[!INCLUDE [Use rooms with Java SDK](./includes/rooms-quickstart-javascript.md)]
24-
::: zone-end
25-
2622
::: zone pivot="programming-language-csharp"
2723
[!INCLUDE [Use rooms with .NET SDK](./includes/rooms-quickstart-net.md)]
2824
::: zone-end
@@ -35,6 +31,10 @@ This quickstart will help you get started with Azure Communication Services Room
3531
[!INCLUDE [Use rooms with Java SDK](./includes/rooms-quickstart-python.md)]
3632
::: zone-end
3733

34+
::: zone pivot="programming-language-javascript"
35+
[!INCLUDE [Use rooms with Java SDK](./includes/rooms-quickstart-javascript.md)]
36+
::: zone-end
37+
3838
## Object model
3939

4040
The table below lists the main properties of `room` objects:
@@ -46,6 +46,7 @@ The table below lists the main properties of `room` objects:
4646
| `validUntil` | Latest time a `room` can be used. |
4747
| `roomJoinPolicy` | Specifies which user identities are allowed to join room calls. Valid options are `InviteOnly` and `CommunicationServiceUsers`. |
4848
| `participants` | List of participants to a `room`. Specified as a `CommunicationIdentifier`. |
49+
| `roleType` | The role of a room participant. Can be either `Presenter`, `Attendee`, or `Consumer`. |
4950

5051
## Next steps
5152

articles/communication-services/quickstarts/rooms/includes/rooms-quickstart-java.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ CommunicationRoom roomResult = roomsClient.getRoom(roomId);
114114

115115
### Update the lifetime of a room
116116

117-
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters.
117+
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters. A room can be valid for a maximum of six months.
118118

119119
```java
120120
OffsetDateTime validFrom = OffsetDateTime.of(2022, 2, 1, 5, 30, 20, 10, ZoneOffset.UTC);
@@ -149,6 +149,19 @@ try {
149149

150150
Participants that have been added to a `room` become eligible to join calls.
151151

152+
### Get list of participants
153+
154+
Retrieve the list of participants for an existing `room` by referencing the `roomId`:
155+
156+
```java
157+
try {
158+
ParticipantsCollection participants = roomsClient.listParticipants(roomId);
159+
System.out.println("Participants: \n" + participants.getParticipants());
160+
} catch (Exception ex) {
161+
System.out.println(ex);
162+
}
163+
```
164+
152165
### Remove participants
153166

154167
To remove a participant from a `room` and revoke their access, use the `removeParticipants` method.

articles/communication-services/quickstarts/rooms/includes/rooms-quickstart-javascript.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ console.log(`Retrieved Room with ID ${roomId}`);
8686

8787
### Update the lifetime of a room
8888

89-
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters.
89+
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters. A room can be valid for a maximum of six months.
9090

9191
```javascript
9292
validFrom.setTime(validUntil.getTime());
@@ -128,6 +128,14 @@ To add new participants to a `room`, use the `addParticipants` method exposed on
128128

129129
Participants that have been added to a `room` become eligible to join calls.
130130

131+
### Get list of participants
132+
133+
Retrieve the list of participants for an existing `room` by referencing the `roomId`:
134+
135+
```javascript
136+
const participantsList = await roomsClient.getParticipants(roomId);
137+
```
138+
131139
### Remove participants
132140

133141
To remove a participant from a `room` and revoke their access, use the `removeParticipants` method.

articles/communication-services/quickstarts/rooms/includes/rooms-quickstart-net.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ RoomModel getCommunicationRoom = getRoomResponse.Value;
7878

7979
### Update the lifetime of a room
8080

81-
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters.
81+
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters. A room can be valid for a maximum of six months.
8282

8383
```csharp
8484
var validFrom = new DateTime(2022, 05, 01, 00, 00, 00, DateTimeKind.Utc);
@@ -112,6 +112,15 @@ ParticipantsCollection addedParticipantsRoom = addParticipantResponse.Value;
112112

113113
Participants that have been added to a `room` become eligible to join calls.
114114

115+
### Get list of participants
116+
117+
Retrieve the list of participants for an existing `room` by referencing the `roomId`:
118+
119+
```csharp
120+
Response<ParticipantsCollection> getParticipantsResponse = await roomsClient.GetParticipantsAsync(roomId);
121+
ParticipantsCollection roomParticipants = getParticipantsResponse.Value;
122+
```
123+
115124
### Remove participants
116125

117126
To remove a participant from a `room` and revoke their access, use the `RemoveParticipantsAsync` method.

articles/communication-services/quickstarts/rooms/includes/rooms-quickstart-python.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ if __name__ == '__main__':
5353
From a console prompt, navigate to the directory containing the rooms.py file, then execute the following command:
5454

5555
```console
56-
pip install azure_communication_rooms
57-
pip install azure.communication.identity
56+
pip install azure-communication-rooms
57+
pip install azure-communication-identity
5858
```
5959

6060
### Initialize a room client
@@ -63,7 +63,7 @@ Create a new `RoomsClient` object that will be used to create new `rooms` and ma
6363

6464
```python
6565
#Find your Communication Services resource in the Azure portal
66-
self.connection_string = os.getenv("COMMUNICATION_SAMPLES_CONNECTION_STRING")
66+
self.connection_string = <COMMUNICATION_SAMPLES_CONNECTION_STRING>
6767
self.rooms_client = RoomsClient.from_connection_string(self.connection_string)
6868
```
6969

@@ -100,7 +100,7 @@ except HttpResponseError as ex:
100100

101101
### Update the lifetime of a room
102102

103-
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters.
103+
The lifetime of a `room` can be modified by issuing an update request for the `ValidFrom` and `ValidUntil` parameters. A room can be valid for a maximum of six months.
104104

105105
```python
106106
# set attributes you want to change
@@ -121,17 +121,26 @@ To add new participants to a `room`, use the `add_participants` method exposed o
121121
```python
122122
try:
123123
participants = []
124-
for p in participants_list:
125-
participants.append(RoomParticipant(CommunicationUserIdentifier(p), RoleType.ATTENDEE))
124+
participants.append(RoomParticipant(CommunicationUserIdentifier("<ACS User MRI identity 1>"), RoleType.ATTENDEE))
126125
self.rooms_client.add_participants(room_id, participants)
127126

128-
print(str(len(participants)) + ' new participants added to the room : ' + str(room_id))
129127
except Exception as ex:
130-
print('Error in adding participants to room.',ex)
128+
print('Error in adding participants to room.', ex)
131129
```
132130

133131
Participants that have been added to a `room` become eligible to join calls.
134132

133+
### Get list of participants
134+
135+
Retrieve the list of participants for an existing `room` by referencing the `roomId`:
136+
137+
```python
138+
try:
139+
participants = self.rooms_client.get_participants(room_id)
140+
except HttpResponseError as ex:
141+
print(ex)
142+
```
143+
135144
### Remove participants
136145

137146
To remove a participant from a `room` and revoke their access, use the `remove_participants` method.

0 commit comments

Comments
 (0)