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:
useridID of the user.passwordPassword of the user. Defaults to"".displayNameDisplay name of the user. Defaults to"".emailEmail of the user. Defaults to"".groupsGroups of the user. Defaults to[].subadminGroups where the user is subadmin. Defaults to[].quotaQuota of the user. Defaults to"".languageLanguage of the user. Defaults to"".managerManager of the user.oCSAPIRequestRequired 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
Responsefrom 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);
}