listWorkflows method

Future<ListWorkflowsResponse> listWorkflows({
  1. required String domainName,
  2. int? maxResults,
  3. String? nextToken,
  4. DateTime? queryEndDate,
  5. DateTime? queryStartDate,
  6. Status? status,
  7. WorkflowType? workflowType,
})

Query to list all workflows.

May throw AccessDeniedException. May throw BadRequestException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter domainName : The unique name of the domain.

Parameter maxResults : The maximum number of results to return per page.

Parameter nextToken : The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Parameter queryEndDate : Retrieve workflows ended after timestamp.

Parameter queryStartDate : Retrieve workflows started after timestamp.

Parameter status : Status of workflow execution.

Parameter workflowType : The type of workflow. The only supported value is APPFLOW_INTEGRATION.

Implementation

Future<ListWorkflowsResponse> listWorkflows({
  required String domainName,
  int? maxResults,
  String? nextToken,
  DateTime? queryEndDate,
  DateTime? queryStartDate,
  Status? status,
  WorkflowType? workflowType,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'max-results': [maxResults.toString()],
    if (nextToken != null) 'next-token': [nextToken],
  };
  final $payload = <String, dynamic>{
    if (queryEndDate != null)
      'QueryEndDate': unixTimestampToJson(queryEndDate),
    if (queryStartDate != null)
      'QueryStartDate': unixTimestampToJson(queryStartDate),
    if (status != null) 'Status': status.value,
    if (workflowType != null) 'WorkflowType': workflowType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/domains/${Uri.encodeComponent(domainName)}/workflows',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListWorkflowsResponse.fromJson(response);
}