getCurrentUser method

Future<GetCurrentUserResponse> getCurrentUser({
  1. required String authenticationToken,
})

Retrieves details of the current user for whom the authentication token was generated. This is not a valid action for SigV4 (administrative API) clients.

This action requires an authentication token. To get an authentication token, register an application with Amazon WorkDocs. For more information, see Authentication and Access Control for User Applications in the Amazon WorkDocs Developer Guide.

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

Parameter authenticationToken : Amazon WorkDocs authentication token.

Implementation

Future<GetCurrentUserResponse> getCurrentUser({
  required String authenticationToken,
}) async {
  ArgumentError.checkNotNull(authenticationToken, 'authenticationToken');
  _s.validateStringLength(
    'authenticationToken',
    authenticationToken,
    1,
    8199,
    isRequired: true,
  );
  final headers = <String, String>{
    'Authentication': authenticationToken.toString(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/api/v1/me',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return GetCurrentUserResponse.fromJson(response);
}