@@ -86,7 +86,7 @@ Create a new `RoomsClient` object that will be used to create new `rooms` and ma
86
86
var connectionString = " <connection_string>" ;
87
87
RoomsClient roomsClient = new RoomsClient (connectionString );
88
88
89
- // create identities for users
89
+ // Create identities for users
90
90
CommunicationIdentityClient identityClient = new CommunicationIdentityClient (connectionString );
91
91
CommunicationUserIdentifier user1 = await identityClient .CreateUser ();
92
92
CommunicationUserIdentifier user2 = await identityClient .CreateUser ();
@@ -99,7 +99,7 @@ Create a new `room` with default properties using the code snippet below:
99
99
100
100
``` csharp
101
101
102
- // Create a room
102
+ // Create a room
103
103
List roomParticipants = new List <RoomParticipant >();
104
104
roomParticipants .Add (new RoomParticipant (new CommunicationUserIdentifier (user1 .Value .User .Id ), RoleType .Presenter ));
105
105
@@ -142,24 +142,26 @@ The lifetime of a `room` can be modified by issuing an update request for the `V
142
142
143
143
``` csharp
144
144
145
- // Update room lifetime
145
+ // Update room lifetime
146
146
DateTimeOffset validFrom = DateTimeOffset .UtcNow ;
147
147
DateTimeOffset validUntil = DateTimeOffset .UtcNow .AddDays (10 );
148
148
CommunicationRoom updatedRoom = await roomsClient .UpdateRoomAsync (roomId , validFrom , validUntil , cancellationToken );
149
149
Console .WriteLine (" \n Updated room with validFrom: " + updatedRoom .ValidFrom + " and validUntil: " + updatedRoom .ValidUntil );
150
150
```
151
151
152
- ### List all valid rooms
152
+ ### List all active rooms
153
153
154
- To retrieve all valid rooms, use the ` GetRoomsAsync ` method exposed on the client.
154
+ To retrieve all active rooms, use the ` GetRoomsAsync ` method exposed on the client.
155
155
156
156
``` csharp
157
+
158
+ // List all active rooms
157
159
AsyncPageable < CommunicationRoom > allRooms = await roomsClient .GetRoomsAsync ();
158
160
await foreach (CommunicationRoom room in allRooms )
159
161
{
160
162
if (room is not null )
161
163
{
162
- Console .WriteLine (" \n First room id in all valid rooms: " + room .Id );
164
+ Console .WriteLine (" \n First room id in all active rooms: " + room .Id );
163
165
break ;
164
166
}
165
167
}
@@ -193,26 +195,28 @@ Participants that have been added to a `room` become eligible to join calls. Par
193
195
Retrieve the list of participants for an existing ` room ` by referencing the ` roomId ` :
194
196
195
197
``` csharp
198
+
196
199
// Get list of participants in room
197
200
AsyncPageable < RoomParticipant > existingParticipants = await roomsClient .GetParticipantsAsync (roomId );
198
201
Console .WriteLine (" \n Retrieved participants from room: " );
199
202
await foreach (RoomParticipant participant in existingParticipants )
200
203
{
201
204
Console .WriteLine ($" {participant .CommunicationIdentifier .ToString ()}, {participant .Role .ToString ()}" );
202
205
}
206
+
203
207
```
204
208
205
209
## Remove participants
206
210
207
211
To remove a participant from a ` room ` and revoke their access, use the ` RemoveParticipantsAsync ` method.
208
212
209
213
``` csharp
214
+
210
215
// Remove user from room
211
216
List < CommunicationIdentifier > participants = new List <CommunicationIdentifier >();
212
217
participants .Add (user2 );
213
218
214
219
Response removeParticipantsResponse = await roomsClient .RemoveParticipantsAsync (roomId , participants );
215
- await roomsClient .removeParticipants (roomId , removeParticipantsList );
216
220
Console .WriteLine (" \n Removed participants from room" );
217
221
218
222
```
@@ -249,7 +253,7 @@ Retrieved room with id: 99445276259151407
249
253
250
254
Updated room with validFrom: 2023-05-11T22:11:46.784Z and validUntil: 2023-05-21T22:16:46.784Z
251
255
252
- First room id in all valid rooms: 99445276259151407
256
+ First room id in all active rooms: 99445276259151407
253
257
254
258
Added or updated participants to room
255
259
0 commit comments