deleteUser method

Future<void> deleteUser({
  1. required String userId,
  2. String? authenticationToken,
})

Deletes the specified user from a Simple AD or Microsoft AD directory.

May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.

Parameter userId : The ID of the user.

Parameter authenticationToken : Amazon WorkDocs authentication token. Do not set this field when using administrative API actions, as in accessing the API using AWS credentials.

Implementation

Future<void> deleteUser({
  required String userId,
  String? authenticationToken,
}) async {
  ArgumentError.checkNotNull(userId, 'userId');
  _s.validateStringLength(
    'userId',
    userId,
    1,
    256,
    isRequired: true,
  );
  _s.validateStringLength(
    'authenticationToken',
    authenticationToken,
    1,
    8199,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/api/v1/users/${Uri.encodeComponent(userId)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}