listJobs method

Future<ListJobsResult> listJobs({
  1. required String appId,
  2. required String branchName,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the jobs for a branch of an Amplify app.

May throw BadRequestException. May throw InternalFailureException. May throw LimitExceededException. May throw UnauthorizedException.

Parameter appId : The unique ID for an Amplify app.

Parameter branchName : The name of the branch to use for the request.

Parameter maxResults : The maximum number of records to list in a single response.

Parameter nextToken : A pagination token. Set to null to start listing steps from the start. If a non-null pagination token is returned in a result, pass its value in here to list more steps.

Implementation

Future<ListJobsResult> listJobs({
  required String appId,
  required String branchName,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    50,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/apps/${Uri.encodeComponent(appId)}/branches/${Uri.encodeComponent(branchName)}/jobs',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListJobsResult.fromJson(response);
}