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 to"v4".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:
- $createRoom_Request for the request send by this method.
- $createRoom_Serializer for a converter to parse the
Responsefrom an executed request.
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 _request = $createRoom_Request(
roomType: roomType,
invite: invite,
roomName: roomName,
source: source,
objectType: objectType,
objectId: objectId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $createRoom_Serializer();
final _rawResponse =
await _i1.ResponseConverter<RoomCreateRoomResponseApplicationJson, void>(_serializer).convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}