listArtifacts method
Returns a list of end-to-end testing artifacts for a specified app, branch, and job.
To return the build artifacts, use the GetJob API.
For more information about Amplify testing support, see Setting up end-to-end Cypress tests for your Amplify application in the Amplify Hosting User Guide.
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 a branch that is part of an Amplify app.
Parameter jobId :
The unique ID for a job.
Parameter maxResults :
The maximum number of records to list in a single response.
Parameter nextToken :
A pagination token. Set to null to start listing artifacts from start. If
a non-null pagination token is returned in a result, pass its value in
here to list more artifacts.
Implementation
Future<ListArtifactsResult> listArtifacts({
required String appId,
required String branchName,
required String jobId,
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/${Uri.encodeComponent(jobId)}/artifacts',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListArtifactsResult.fromJson(response);
}