listFreeTrialStatusesV2 method

Future<ListFreeTrialStatusesV2Response> listFreeTrialStatusesV2({
  1. List<String>? accountIds,
  2. int? maxResults,
  3. String? nextToken,
  4. List<FreeTrialStatusValue>? statuses,
})

Lists the free trial status of Security Hub features. A delegated Security Hub administrator can list the status for accounts in its organization. Any other account can list the status only for itself. Free trial status remains available after a feature is disabled.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter accountIds : The Amazon Web Services account identifiers to list free trial status for. You can specify accounts other than your own only if you are a delegated Security Hub administrator.

Parameter maxResults : The maximum number of results to return. If you don't specify a value, Security Hub returns up to 100 results.

Parameter nextToken : The pagination token to request the next page of results.

Parameter statuses : The free trial statuses to filter the results by. Valid values:

  • ACTIVE returns only features with an ongoing free trial period.
  • INACTIVE returns only features whose free trial period has ended, or that never started.

Implementation

Future<ListFreeTrialStatusesV2Response> listFreeTrialStatusesV2({
  List<String>? accountIds,
  int? maxResults,
  String? nextToken,
  List<FreeTrialStatusValue>? statuses,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    if (accountIds != null) 'AccountIds': accountIds,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (statuses != null) 'Statuses': statuses.map((e) => e.value).toList(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/freetrial/statusv2/list',
    exceptionFnMap: _exceptionFns,
  );
  return ListFreeTrialStatusesV2Response.fromJson(response);
}