listImpersonationRoles method

Future<ListImpersonationRolesResponse> listImpersonationRoles({
  1. required String organizationId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all the impersonation roles for the given WorkMail organization.

May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException.

Parameter organizationId : The WorkMail organization to which the listed impersonation roles belong.

Parameter maxResults : The maximum number of results returned in a single call.

Parameter nextToken : The token used to retrieve the next page of results. The first call doesn't require a token.

Implementation

Future<ListImpersonationRolesResponse> listImpersonationRoles({
  required String organizationId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.ListImpersonationRoles'
  };
  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,
    },
  );

  return ListImpersonationRolesResponse.fromJson(jsonResponse.body);
}