Skip to content

list_packages async

list_packages(
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = None,
    max_results: Optional[PackageCatalogMaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListPackagesResponse

Lists the software packages associated to the account.

Requires permission to access the ListPackages action.

Parameters:

Raises:

Source code in docs_src/capo_iot/_services/async_io_t.py
async def list_packages(
    self,
    *,
    config_overrides: Optional[AsyncIoTClientConfig] = 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_packages_response.ListPackagesResponse":
    """<p>Lists the software packages 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">ListPackages</a> action.</p>

    Args:
        max_results: <p>The maximum number of results returned 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_packages_request.ListPackagesRequest]",
    ) -> AsyncOperationResponse[
        "capo_iot.types.list_packages_response.ListPackagesResponse"
    ]:
        import capo_iot._operations.aws_iot_service.list_packages

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListPackages")
    )
    input_: capo_iot.types.list_packages_request.ListPackagesRequest = {}
    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