createRoom method
Create a room with a user, a group or a circle.
Returns a Future containing a DynamiteResponse
with the status code, deserialized body and headers.
Throws a DynamiteApiException
if the API call does not return an expected status code.
Parameters:
roomType
Type of the room.invite
User, group, … ID to invite. Defaults to''
.roomName
Name of the room. Defaults to''
.source
Source of the invite ID ('circles' to create a room with a circle, etc.). Defaults to''
.objectType
Type of the object. Defaults to''
.objectId
ID of the object. Defaults to''
.apiVersion
Defaults tov4
.oCSAPIRequest
Required to be true for the API request to pass. Defaults totrue
.
Status codes:
- 200: Room already existed
- 201: Room created successfully
- 400: Room type invalid
- 403: Missing permissions to create room
- 404: User, group or other target to invite was not found
See:
- createRoomRaw for an experimental operation that returns a
DynamiteRawResponse
that can be serialized.
Implementation
Future<_i1.DynamiteResponse<RoomCreateRoomResponseApplicationJson, void>> createRoom({
required int roomType,
String? invite,
String? roomName,
String? source,
String? objectType,
String? objectId,
RoomCreateRoomApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final rawResponse = createRoomRaw(
roomType: roomType,
invite: invite,
roomName: roomName,
source: source,
objectType: objectType,
objectId: objectId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
return rawResponse.future;
}