listManagedInsightRules method

Future<ListManagedInsightRulesOutput> listManagedInsightRules({
  1. required String resourceARN,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list that contains the number of managed Contributor Insights rules in your account.

May throw InvalidNextToken. May throw InvalidParameterValueException. May throw MissingRequiredParameterException.

Parameter resourceARN : The ARN of an Amazon Web Services resource that has managed Contributor Insights rules.

Parameter maxResults : The maximum number of results to return in one operation. If you omit this parameter, the default number is used. The default number is 100.

Parameter nextToken : Include this value to get the next set of rules if the value was returned by the previous operation.

Implementation

Future<ListManagedInsightRulesOutput> listManagedInsightRules({
  required String resourceARN,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'GraniteServiceVersion20100801.ListManagedInsightRules'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceARN': resourceARN,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListManagedInsightRulesOutput.fromJson(jsonResponse.body);
}