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 to"v4"
.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:
- $createRoom_Request for the request send by this method.
- $createRoom_Serializer for a converter to parse the
Response
from 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);
}