getInsights method

Future<GetInsightsResponse> getInsights({
  1. List<String>? insightArns,
  2. int? maxResults,
  3. String? nextToken,
})

Lists and describes insights for the specified insight ARNs.

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

Parameter insightArns : The ARNs of the insights to describe. If you do not provide any insight ARNs, then GetInsights returns all of your custom insights. It does not return any managed insights.

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 GetInsights 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<GetInsightsResponse> getInsights({
  List<String>? insightArns,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    if (insightArns != null) 'InsightArns': insightArns,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/insights/get',
    exceptionFnMap: _exceptionFns,
  );
  return GetInsightsResponse.fromJson(response);
}