getEnabledStandards method

Future<GetEnabledStandardsResponse> getEnabledStandards({
  1. int? maxResults,
  2. String? nextToken,
  3. List<StandardsProvider>? providers,
  4. List<String>? standardsSubscriptionArns,
})

Returns a list of the standards that are currently enabled.

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

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

Parameter nextToken : The token that is required for pagination. On your first call to the GetEnabledStandards 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.

Parameter providers : A list of cloud providers to filter the enabled standards by. For example, specify Azure to return only enabled standards that evaluate Azure resources.

Parameter standardsSubscriptionArns : The list of the standards subscription ARNs for the standards to retrieve.

Implementation

Future<GetEnabledStandardsResponse> getEnabledStandards({
  int? maxResults,
  String? nextToken,
  List<StandardsProvider>? providers,
  List<String>? standardsSubscriptionArns,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (providers != null)
      'Providers': providers.map((e) => e.value).toList(),
    if (standardsSubscriptionArns != null)
      'StandardsSubscriptionArns': standardsSubscriptionArns,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/standards/get',
    exceptionFnMap: _exceptionFns,
  );
  return GetEnabledStandardsResponse.fromJson(response);
}