Skip to content

list_package_versions async

list_package_versions(
    package_name: PackageName,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    status: Optional[PackageVersionStatus] = None,
    max_results: Optional[PackageCatalogMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListPackageVersionsResponse

Lists the software package versions associated to the account.

Requires permission to access the ListPackageVersions action.

Parameters:

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def list_package_versions(
    self,
    package_name: "capo_iot.types.package_name.PackageName",
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    status: Optional[
        "capo_iot.types.package_version_status.PackageVersionStatus"
    ] = None,
    max_results: Optional[
        "capo_iot.types.package_catalog_max_results.PackageCatalogMaxResults"
    ] = None,
    next_token: Optional["capo_iot.types.next_token.NextToken"] = None,
) -> "capo_iot.types.list_package_versions_response.ListPackageVersionsResponse":
    """<p>Lists the software package versions associated to the account.</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">ListPackageVersions</a> action.</p>

    Args:
        package_name: <p>The name of the target software package.</p>
        status: <p>The status of the package version. 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>
        max_results: <p>The maximum number of results to return at one time.</p>
        next_token: <p>The token for the next set of results.</p>

    Raises:
        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.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.list_package_versions_request.ListPackageVersionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.list_package_versions_response.ListPackageVersionsResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_package_versions

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPackageVersions")
    )
    input_: capo_iot.types.list_package_versions_request.ListPackageVersionsRequest = {
        "package_name": package_name
    }
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output