Skip to content

list_notification_hubs async

list_notification_hubs(
    *,
    config_overrides: Optional[AsyncNotificationsClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[NextToken] = None,
) -> ListNotificationHubsResponse

Returns a list of NotificationHubs.

Parameters:

  • max_results (Optional[int], default: None ) –

    The maximum number of records to list in a single response.

  • next_token (Optional[NextToken], default: None ) –

    A pagination token. Set to null to start listing notification hubs from the start.

Raises:

Source code in docs_src/capo_notifications/_services/async_notifications.py
async def list_notification_hubs(
    self,
    *,
    config_overrides: Optional[AsyncNotificationsClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional["capo_notifications.types.next_token.NextToken"] = None,
) -> "capo_notifications.types.list_notification_hubs_response.ListNotificationHubsResponse":
    """<p>Returns a list of <code>NotificationHubs</code>.</p>

    Args:
        max_results: <p>The maximum number of records to list in a single response.</p>
        next_token: <p>A pagination token. Set to null to start listing notification hubs from the start.</p>

    Raises:
        capo_notifications.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_notifications.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_notifications.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling. </p>
        capo_notifications.errors.validation_exception.ValidationException: <p>This exception is thrown when the notification event fails validation.</p>
        capo_notifications.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_notifications.types.list_notification_hubs_request.ListNotificationHubsRequest]",
    ) -> AsyncOperationResponse[
        "capo_notifications.types.list_notification_hubs_response.ListNotificationHubsResponse"
    ]:
        import capo_notifications._operations.notifications.list_notification_hubs

        (
            output,
            http_response,
        ) = await capo_notifications._operations.notifications.list_notification_hubs.async_list_notification_hubs(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListNotificationHubs")
    )
    input_: capo_notifications.types.list_notification_hubs_request.ListNotificationHubsRequest = {}
    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