searchFlowExecutions method

Future<SearchFlowExecutionsResponse> searchFlowExecutions({
  1. required String systemInstanceId,
  2. DateTime? endTime,
  3. String? flowExecutionId,
  4. int? maxResults,
  5. String? nextToken,
  6. DateTime? startTime,
})

Searches for AWS IoT Things Graph workflow execution instances.

May throw InvalidRequestException. May throw ThrottlingException. May throw InternalFailureException. May throw ResourceNotFoundException.

Parameter systemInstanceId : The ID of the system instance that contains the flow.

Parameter endTime : The date and time of the latest flow execution to return.

Parameter flowExecutionId : The ID of a flow execution.

Parameter maxResults : The maximum number of results to return in the response.

Parameter nextToken : The string that specifies the next page of results. Use this when you're paginating results.

Parameter startTime : The date and time of the earliest flow execution to return.

Implementation

Future<SearchFlowExecutionsResponse> searchFlowExecutions({
  required String systemInstanceId,
  DateTime? endTime,
  String? flowExecutionId,
  int? maxResults,
  String? nextToken,
  DateTime? startTime,
}) async {
  ArgumentError.checkNotNull(systemInstanceId, 'systemInstanceId');
  _s.validateStringLength(
    'systemInstanceId',
    systemInstanceId,
    0,
    160,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'IotThingsGraphFrontEndService.SearchFlowExecutions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'systemInstanceId': systemInstanceId,
      if (endTime != null) 'endTime': unixTimestampToJson(endTime),
      if (flowExecutionId != null) 'flowExecutionId': flowExecutionId,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (startTime != null) 'startTime': unixTimestampToJson(startTime),
    },
  );

  return SearchFlowExecutionsResponse.fromJson(jsonResponse.body);
}