associateSbomWithPackageVersion method
Associates the selected software bill of materials (SBOM) with a specific software package version.
Requires permission to access the AssociateSbomWithPackageVersion action.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter packageName :
The name of the new software package.
Parameter versionName :
The name of the new package version.
Parameter clientToken :
A unique case-sensitive identifier that you can provide to ensure the
idempotency of the request. Don't reuse this client token if a new
idempotent request is required.
Implementation
Future<AssociateSbomWithPackageVersionResponse>
associateSbomWithPackageVersion({
required String packageName,
required Sbom sbom,
required String versionName,
String? clientToken,
}) async {
final $query = <String, List<String>>{
if (clientToken != null) 'clientToken': [clientToken],
};
final $payload = <String, dynamic>{
'sbom': sbom,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/packages/${Uri.encodeComponent(packageName)}/versions/${Uri.encodeComponent(versionName)}/sbom',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return AssociateSbomWithPackageVersionResponse.fromJson(response);
}