Skip to content

update_package_version async

update_package_version(
    package_name: PackageName,
    version_name: VersionName,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    description: Optional[ResourceDescription] = None,
    attributes: Optional[ResourceAttributes] = None,
    artifact: Optional[PackageVersionArtifact] = None,
    action: Optional[PackageVersionAction] = None,
    recipe: Optional[PackageVersionRecipe] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdatePackageVersionResponse

Updates the supported fields for a specific package version.

Requires permission to access the UpdatePackageVersion and GetIndexingConfiguration actions.

Parameters:

  • package_name (PackageName) –

    The name of the associated software package.

  • version_name (VersionName) –

    The name of the target package version.

  • description (Optional[ResourceDescription], default: None ) –

    The package version description.

  • attributes (Optional[ResourceAttributes], default: None ) –

    Metadata that can be used to define a package version’s configuration. For example, the Amazon S3 file location, configuration options that are being sent to the device or fleet.

    Note: Attributes can be updated only when the package version is in a draft state.

    The combined size of all the attributes on a package version is limited to 3KB.

  • artifact (Optional[PackageVersionArtifact], default: None ) –

    The various components that make up a software package version.

  • action (Optional[PackageVersionAction], default: None ) –

    The status that the package version should be assigned. For more information, see Package version lifecycle.

  • recipe (Optional[PackageVersionRecipe], default: None ) –

    The inline job document associated with a software package version used for a quick job deployment.

  • 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 update_package_version(
    self,
    package_name: "capo_iot.types.package_name.PackageName",
    version_name: "capo_iot.types.version_name.VersionName",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    description: Optional[
        "capo_iot.types.resource_description.ResourceDescription"
    ] = None,
    attributes: Optional[
        "capo_iot.types.resource_attributes.ResourceAttributes"
    ] = None,
    artifact: Optional[
        "capo_iot.types.package_version_artifact.PackageVersionArtifact"
    ] = None,
    action: Optional[
        "capo_iot.types.package_version_action.PackageVersionAction"
    ] = None,
    recipe: Optional[
        "capo_iot.types.package_version_recipe.PackageVersionRecipe"
    ] = None,
    client_token: Optional["capo_iot.types.client_token.ClientToken"] = None,
) -> "capo_iot.types.update_package_version_response.UpdatePackageVersionResponse":
    """<p>Updates the supported fields for a specific 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">UpdatePackageVersion</a> and <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">GetIndexingConfiguration</a> actions.</p>

    Args:
        package_name: <p>The name of the associated software package.</p>
        version_name: <p>The name of the target package version.</p>
        description: <p>The package version description.</p>
        attributes: <p>Metadata that can be used to define a package version’s configuration. For example, the Amazon S3 file location, configuration options that are being sent to the device or fleet. </p> <p> <b>Note:</b> Attributes can be updated only when the package version is in a draft state.</p> <p>The combined size of all the attributes on a package version is limited to 3KB.</p>
        artifact: <p>The various components that make up a software package version.</p>
        action: <p>The status that the package version should be assigned. For more information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/preparing-to-use-software-package-catalog.html#package-version-lifecycle">Package version lifecycle</a>.</p>
        recipe: <p>The inline job document associated with a software package version used for a quick job deployment.</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.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.update_package_version_request.UpdatePackageVersionRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.update_package_version_response.UpdatePackageVersionResponse"
    ]:
        import capo_iot._operations.aws_iot_service.update_package_version

        (
            output,
            http_response,
        ) = await capo_iot._operations.aws_iot_service.update_package_version.async_update_package_version(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iot.types.update_package_version_request.UpdatePackageVersionRequest",
    ) -> dict[str, Any]:
        import capo_iot.types.update_package_version_request

        return capo_iot.types.update_package_version_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdatePackageVersion", redact_input=_redact_input),
    )
    input_: capo_iot.types.update_package_version_request.UpdatePackageVersionRequest = {
        "package_name": package_name,
        "version_name": version_name,
    }
    if description is not None:
        input_["description"] = description
    if attributes is not None:
        input_["attributes"] = attributes
    if artifact is not None:
        input_["artifact"] = artifact
    if action is not None:
        input_["action"] = action
    if recipe is not None:
        input_["recipe"] = recipe
    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