listBackendJobs method

Future<ListBackendJobsResponse> listBackendJobs({
  1. required String appId,
  2. required String backendEnvironmentName,
  3. String? jobId,
  4. int? maxResults,
  5. String? nextToken,
  6. String? operation,
  7. String? status,
})

Lists the jobs for the backend of an Amplify app.

May throw BadRequestException. May throw GatewayTimeoutException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter appId : The app ID.

Parameter backendEnvironmentName : The name of the backend environment.

Parameter jobId : The ID for the job.

Parameter maxResults : The maximum number of results that you want in the response.

Parameter nextToken : The token for the next set of results.

Parameter operation : Filters the list of response objects to include only those with the specified operation name.

Parameter status : Filters the list of response objects to include only those with the specified status.

Implementation

Future<ListBackendJobsResponse> listBackendJobs({
  required String appId,
  required String backendEnvironmentName,
  String? jobId,
  int? maxResults,
  String? nextToken,
  String? operation,
  String? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    25,
  );
  final $payload = <String, dynamic>{
    if (jobId != null) 'jobId': jobId,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (operation != null) 'operation': operation,
    if (status != null) 'status': status,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/backend/${Uri.encodeComponent(appId)}/job/${Uri.encodeComponent(backendEnvironmentName)}',
    exceptionFnMap: _exceptionFns,
  );
  return ListBackendJobsResponse.fromJson(response);
}