listHumanLoops method

Future<ListHumanLoopsResponse> listHumanLoops({
  1. required String flowDefinitionArn,
  2. DateTime? creationTimeAfter,
  3. DateTime? creationTimeBefore,
  4. int? maxResults,
  5. String? nextToken,
  6. SortOrder? sortOrder,
})

Returns information about human loops, given the specified parameters. If a human loop was deleted, it will not be included.

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

Parameter flowDefinitionArn : The Amazon Resource Name (ARN) of a flow definition.

Parameter creationTimeAfter : (Optional) The timestamp of the date when you want the human loops to begin in ISO 8601 format. For example, 2020-02-24.

Parameter creationTimeBefore : (Optional) The timestamp of the date before which you want the human loops to begin in ISO 8601 format. For example, 2020-02-24.

Parameter maxResults : The total number of items to return. If the total number of available items is more than the value specified in MaxResults, then a NextToken is returned in the output. You can use this token to display the next page of results.

Parameter nextToken : A token to display the next page of results.

Parameter sortOrder : Optional. The order for displaying results. Valid values: Ascending and Descending.

Implementation

Future<ListHumanLoopsResponse> listHumanLoops({
  required String flowDefinitionArn,
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  int? maxResults,
  String? nextToken,
  SortOrder? sortOrder,
}) async {
  ArgumentError.checkNotNull(flowDefinitionArn, 'flowDefinitionArn');
  _s.validateStringLength(
    'flowDefinitionArn',
    flowDefinitionArn,
    0,
    1024,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final $query = <String, List<String>>{
    'FlowDefinitionArn': [flowDefinitionArn],
    if (creationTimeAfter != null)
      'CreationTimeAfter': [_s.iso8601ToJson(creationTimeAfter).toString()],
    if (creationTimeBefore != null)
      'CreationTimeBefore': [_s.iso8601ToJson(creationTimeBefore).toString()],
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (sortOrder != null) 'SortOrder': [sortOrder.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/human-loops',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListHumanLoopsResponse.fromJson(response);
}