listPersonalAccessTokens method
Returns a summary of your Personal Access Tokens.
May throw EntityNotFoundException.
May throw EntityStateException.
May throw InvalidParameterException.
May throw OrganizationNotFoundException.
May throw OrganizationStateException.
Parameter organizationId :
The Organization ID.
Parameter maxResults :
The maximum amount of items that should be returned in a response.
Parameter nextToken :
The token from the previous response to query the next page.
Parameter userId :
The WorkMail User ID.
Implementation
Future<ListPersonalAccessTokensResponse> listPersonalAccessTokens({
required String organizationId,
int? maxResults,
String? nextToken,
String? userId,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'WorkMailService.ListPersonalAccessTokens'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'OrganizationId': organizationId,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
if (userId != null) 'UserId': userId,
},
);
return ListPersonalAccessTokensResponse.fromJson(jsonResponse.body);
}