getWorkflowRuns method

Future<GetWorkflowRunsResponse> getWorkflowRuns({
  1. required String name,
  2. bool? includeGraph,
  3. int? maxResults,
  4. String? nextToken,
})

Retrieves metadata for all runs of a given workflow.

May throw InvalidInputException. May throw EntityNotFoundException. May throw InternalServiceException. May throw OperationTimeoutException.

Parameter name : Name of the workflow whose metadata of runs should be returned.

Parameter includeGraph : Specifies whether to include the workflow graph in response or not.

Parameter maxResults : The maximum number of workflow runs to be included in the response.

Parameter nextToken : The maximum size of the response.

Implementation

Future<GetWorkflowRunsResponse> getWorkflowRuns({
  required String name,
  bool? includeGraph,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    255,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetWorkflowRuns'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (includeGraph != null) 'IncludeGraph': includeGraph,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetWorkflowRunsResponse.fromJson(jsonResponse.body);
}