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:
roomTypeType of the room.inviteUser, group, … ID to invite. Defaults to''.roomNameName of the room. Defaults to''.sourceSource of the invite ID ('circles' to create a room with a circle, etc.). Defaults to''.objectTypeType of the object. Defaults to''.objectIdID of the object. Defaults to''.apiVersionDefaults tov4.oCSAPIRequestRequired 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
DynamiteRawResponsethat 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;
}