listOrganizationAdminAccounts method

Future<ListOrganizationAdminAccountsResponse> listOrganizationAdminAccounts({
  1. SecurityHubFeature? feature,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the Security Hub CSPM administrator accounts. Can only be called by the organization management account.

May throw InternalException. May throw InvalidAccessException. May throw InvalidInputException. May throw LimitExceededException.

Parameter feature : The feature where the delegated administrator account is listed. Defaults to Security Hub CSPM if not specified.

Parameter maxResults : The maximum number of items to return in the response.

Parameter nextToken : The token that is required for pagination. On your first call to the ListOrganizationAdminAccounts operation, set the value of this parameter to NULL. For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.

Implementation

Future<ListOrganizationAdminAccountsResponse> listOrganizationAdminAccounts({
  SecurityHubFeature? feature,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    10,
  );
  final $query = <String, List<String>>{
    if (feature != null) 'Feature': [feature.value],
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/organization/admin',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListOrganizationAdminAccountsResponse.fromJson(response);
}