listSessions method

Future<ListSessionsResponse> listSessions({
  1. required String approvalTeamArn,
  2. List<Filter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

Returns a list of approval sessions. For more information, see Session in the Multi-party approval User Guide.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter approvalTeamArn : Amazon Resource Name (ARN) for the approval team.

Parameter filters : An array of Filter objects. Contains the filter to apply when listing sessions.

Parameter maxResults : The maximum number of items to return in the response. If more results exist than the specified MaxResults value, a token is included in the response so that you can retrieve the remaining results.

Parameter nextToken : If present, indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a next call to the operation to get more output. You can repeat this until the NextToken response element returns null.

Implementation

Future<ListSessionsResponse> listSessions({
  required String approvalTeamArn,
  List<Filter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  final $payload = <String, dynamic>{
    if (filters != null) 'Filters': filters,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/approval-teams/${Uri.encodeComponent(approvalTeamArn)}/sessions/?List',
    exceptionFnMap: _exceptionFns,
  );
  return ListSessionsResponse.fromJson(response);
}