Associates the selected software bill of materials (SBOM) with a specific software package version.
Requires permission to access the AssociateSbomWithPackageVersion action.
Parameters:
-
package_name
(PackageName)
–
The name of the new software package.
-
version_name
(VersionName)
–
The name of the new package version.
-
client_token
(Optional[ClientToken], default:
None
)
–
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.
Raises:
Source code in docs_src/capo_iot/_services/io_t.py
| def associate_sbom_with_package_version(
self,
package_name: "capo_iot.types.package_name.PackageName",
version_name: "capo_iot.types.version_name.VersionName",
sbom: "capo_iot.types.sbom.Sbom",
*,
config_overrides: Optional[IoTClientConfig] = None,
client_token: Optional["capo_iot.types.client_token.ClientToken"] = None,
) -> "capo_iot.types.associate_sbom_with_package_version_response.AssociateSbomWithPackageVersionResponse":
"""<p>Associates the selected software bill of materials (SBOM) with a specific software package version.</p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">AssociateSbomWithPackageVersion</a> action.</p>
Args:
package_name: <p>The name of the new software package.</p>
version_name: <p>The name of the new package version.</p>
client_token: <p>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.</p>
Raises:
capo_iot.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
capo_iot.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
capo_iot.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_iot.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Service quota has been exceeded.</p>
capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
capo_iot.errors.validation_exception.ValidationException: <p>The request is not valid.</p>
capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iot.types.associate_sbom_with_package_version_request.AssociateSbomWithPackageVersionRequest]",
) -> OperationResponse[
"capo_iot.types.associate_sbom_with_package_version_response.AssociateSbomWithPackageVersionResponse"
]:
import capo_iot._operations.aws_iot_service.associate_sbom_with_package_version
output, http_response = (
capo_iot._operations.aws_iot_service.associate_sbom_with_package_version.associate_sbom_with_package_version(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateSbomWithPackageVersion")
)
input_: capo_iot.types.associate_sbom_with_package_version_request.AssociateSbomWithPackageVersionRequest = {
"package_name": package_name,
"version_name": version_name,
"sbom": sbom,
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|