resolveComponentCandidates method

Future<ResolveComponentCandidatesResponse> resolveComponentCandidates({
  1. required List<ComponentCandidate> componentCandidates,
  2. required ComponentPlatform platform,
})

Retrieves a list of components that meet the component, version, and platform requirements of a deployment. AWS IoT Greengrass core devices call this operation when they receive a deployment to identify the components to install.

This operation identifies components that meet all dependency requirements for a deployment. If the requirements conflict, then this operation returns an error and the deployment fails. For example, this occurs if component A requires version >2.0.0 and component B requires version <2.0.0 of a component dependency.

When you specify the component candidates to resolve, AWS IoT Greengrass compares each component's digest from the core device with the component's digest in the AWS Cloud. If the digests don't match, then AWS IoT Greengrass specifies to use the version from the AWS Cloud.

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

Parameter componentCandidates : The list of components to resolve.

Parameter platform : The platform to use to resolve compatible components.

Implementation

Future<ResolveComponentCandidatesResponse> resolveComponentCandidates({
  required List<ComponentCandidate> componentCandidates,
  required ComponentPlatform platform,
}) async {
  ArgumentError.checkNotNull(componentCandidates, 'componentCandidates');
  ArgumentError.checkNotNull(platform, 'platform');
  final $payload = <String, dynamic>{
    'componentCandidates': componentCandidates,
    'platform': platform,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/greengrass/v2/resolveComponentCandidates',
    exceptionFnMap: _exceptionFns,
  );
  return ResolveComponentCandidatesResponse.fromJson(response);
}