listReplays method

Future<ListReplaysResponse> listReplays({
  1. String? eventSourceArn,
  2. int? limit,
  3. String? namePrefix,
  4. String? nextToken,
  5. ReplayState? state,
})

Lists your replays. You can either list all the replays or you can provide a prefix to match to the replay names. Filter parameters are exclusive.

May throw InternalException.

Parameter eventSourceArn : The ARN of the event source associated with the replay.

Parameter limit : The maximum number of replays to retrieve.

Parameter namePrefix : A name prefix to filter the replays returned. Only replays with name that match the prefix are returned.

Parameter nextToken : The token returned by a previous call to retrieve the next set of results.

Parameter state : The state of the replay.

Implementation

Future<ListReplaysResponse> listReplays({
  String? eventSourceArn,
  int? limit,
  String? namePrefix,
  String? nextToken,
  ReplayState? state,
}) async {
  _s.validateStringLength(
    'eventSourceArn',
    eventSourceArn,
    1,
    1600,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    100,
  );
  _s.validateStringLength(
    'namePrefix',
    namePrefix,
    1,
    64,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSEvents.ListReplays'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (eventSourceArn != null) 'EventSourceArn': eventSourceArn,
      if (limit != null) 'Limit': limit,
      if (namePrefix != null) 'NamePrefix': namePrefix,
      if (nextToken != null) 'NextToken': nextToken,
      if (state != null) 'State': state.toValue(),
    },
  );

  return ListReplaysResponse.fromJson(jsonResponse.body);
}