listBatchJobDefinitions method

Future<ListBatchJobDefinitionsResponse> listBatchJobDefinitions({
  1. required String applicationId,
  2. int? maxResults,
  3. String? nextToken,
  4. String? prefix,
})

Lists all the available batch job definitions based on the batch job resources uploaded during the application creation. You can use the batch job definitions in the list to start a batch job.

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

Parameter applicationId : The identifier of the application.

Parameter maxResults : The maximum number of batch job definitions to return.

Parameter nextToken : A pagination token returned from a previous call to this operation. This specifies the next item to return. To return to the beginning of the list, exclude this parameter.

Parameter prefix : If the batch job definition is a FileBatchJobDefinition, the prefix allows you to search on the file names of FileBatchJobDefinitions.

Implementation

Future<ListBatchJobDefinitionsResponse> listBatchJobDefinitions({
  required String applicationId,
  int? maxResults,
  String? nextToken,
  String? prefix,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    2000,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (prefix != null) 'prefix': [prefix],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/batch-job-definitions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListBatchJobDefinitionsResponse.fromJson(response);
}