listTriggers method

Future<ListTriggersResponse> listTriggers({
  1. String? dependentJobName,
  2. int? maxResults,
  3. String? nextToken,
  4. Map<String, String>? tags,
})

Retrieves the names of all trigger resources in this AWS account, or the resources with the specified tag. This operation allows you to see which resources are available in your account, and their names.

This operation takes the optional Tags field, which you can use as a filter on the response so that tagged resources can be retrieved as a group. If you choose to use tags filtering, only resources with the tag are retrieved.

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

Parameter dependentJobName : The name of the job for which to retrieve triggers. The trigger that can start this job is returned. If there is no such trigger, all triggers are returned.

Parameter maxResults : The maximum size of a list to return.

Parameter nextToken : A continuation token, if this is a continuation request.

Parameter tags : Specifies to return only these tagged resources.

Implementation

Future<ListTriggersResponse> listTriggers({
  String? dependentJobName,
  int? maxResults,
  String? nextToken,
  Map<String, String>? tags,
}) async {
  _s.validateStringLength(
    'dependentJobName',
    dependentJobName,
    1,
    255,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.ListTriggers'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (dependentJobName != null) 'DependentJobName': dependentJobName,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (tags != null) 'Tags': tags,
    },
  );

  return ListTriggersResponse.fromJson(jsonResponse.body);
}