addUser method
Create a new user.
This endpoint requires password confirmation.
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:
userid
ID of the user.password
Password of the user. Defaults to""
.displayName
Display name of the user. Defaults to""
.email
Email of the user. Defaults to""
.groups
Groups of the user. Defaults to[]
.subadmin
Groups where the user is subadmin. Defaults to[]
.quota
Quota of the user. Defaults to""
.language
Language of the user. Defaults to""
.manager
Manager of the user.oCSAPIRequest
Required to be true for the API request to pass. Defaults totrue
.
Status codes:
- 200: User added successfully
- 403: Missing permissions to make user subadmin
See:
- $addUser_Request for the request send by this method.
- $addUser_Serializer for a converter to parse the
Response
from an executed request.
Implementation
Future<_i1.DynamiteResponse<UsersAddUserResponseApplicationJson, void>> addUser({
required String userid,
String? password,
String? displayName,
String? email,
BuiltList<String>? groups,
BuiltList<String>? subadmin,
String? quota,
String? language,
String? manager,
bool? oCSAPIRequest,
}) async {
final _request = $addUser_Request(
userid: userid,
password: password,
displayName: displayName,
email: email,
groups: groups,
subadmin: subadmin,
quota: quota,
language: language,
manager: manager,
oCSAPIRequest: oCSAPIRequest,
);
final _response = await _rootClient.httpClient.send(_request);
final _serializer = $addUser_Serializer();
final _rawResponse =
await _i1.ResponseConverter<UsersAddUserResponseApplicationJson, void>(_serializer).convert(_response);
return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}