Skip to content

associate_sbom_with_package_version async

associate_sbom_with_package_version(
    package_name: PackageName,
    version_name: VersionName,
    sbom: Sbom,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> AssociateSbomWithPackageVersionResponse

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/async_io_t.py
async 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[AsyncIoTClientConfig] = 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iot.types.associate_sbom_with_package_version_request.AssociateSbomWithPackageVersionRequest]",
    ) -> AsyncOperationResponse[
        "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,
        ) = await capo_iot._operations.aws_iot_service.associate_sbom_with_package_version.async_associate_sbom_with_package_version(
            req.options, req.input
        )
        return AsyncOperationResponse(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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output