listProblems method

Future<ListProblemsResponse> listProblems({
  1. String? accountId,
  2. String? componentName,
  3. DateTime? endTime,
  4. int? maxResults,
  5. String? nextToken,
  6. String? resourceGroupName,
  7. DateTime? startTime,
  8. Visibility? visibility,
})

Lists the problems with your application.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter accountId : The Amazon Web Services account ID for the resource group owner.

Parameter componentName : The name of the component.

Parameter endTime : The time when the problem ended, in epoch seconds. If not specified, problems within the past seven days are returned.

Parameter maxResults : The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned NextToken value.

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

Parameter resourceGroupName : The name of the resource group.

Parameter startTime : The time when the problem was detected, in epoch seconds. If you don't specify a time frame for the request, problems within the past seven days are returned.

Parameter visibility : Specifies whether or not you can view the problem. If not specified, visible and ignored problems are returned.

Implementation

Future<ListProblemsResponse> listProblems({
  String? accountId,
  String? componentName,
  DateTime? endTime,
  int? maxResults,
  String? nextToken,
  String? resourceGroupName,
  DateTime? startTime,
  Visibility? visibility,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    40,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'EC2WindowsBarleyService.ListProblems'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (accountId != null) 'AccountId': accountId,
      if (componentName != null) 'ComponentName': componentName,
      if (endTime != null) 'EndTime': unixTimestampToJson(endTime),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (resourceGroupName != null) 'ResourceGroupName': resourceGroupName,
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
      if (visibility != null) 'Visibility': visibility.value,
    },
  );

  return ListProblemsResponse.fromJson(jsonResponse.body);
}