getComponentVersionArtifact method

Future<GetComponentVersionArtifactResponse> getComponentVersionArtifact({
  1. required String arn,
  2. required String artifactName,
})

Gets the pre-signed URL to a component artifact in an S3 bucket. Core devices can call this operation to identify the URL that they can use to download an artifact to install.

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

Parameter arn : The ARN of the component version.

Parameter artifactName : The name of the artifact.

Implementation

Future<GetComponentVersionArtifactResponse> getComponentVersionArtifact({
  required String arn,
  required String artifactName,
}) async {
  ArgumentError.checkNotNull(arn, 'arn');
  ArgumentError.checkNotNull(artifactName, 'artifactName');
  _s.validateStringLength(
    'artifactName',
    artifactName,
    1,
    1152921504606846976,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/greengrass/v2/components/${Uri.encodeComponent(arn)}/artifacts/${artifactName.split('/').map(Uri.encodeComponent).join('/')}',
    exceptionFnMap: _exceptionFns,
  );
  return GetComponentVersionArtifactResponse.fromJson(response);
}