Skip to content

list_relays async

list_relays(
    *,
    config_overrides: Optional[AsyncMailManagerClientConfig] = None,
    page_size: Optional[int] = None,
    next_token: Optional[PaginationToken] = None,
) -> ListRelaysResponse

Lists all the existing relay resources.

Parameters:

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

    The number of relays to be returned in one request.

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

    If you received a pagination token from a previous call to this API, you can provide it here to continue paginating through the next page of results.

Raises:

  • ValidationException –

    The request validation has failed. For details, see the accompanying error message.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mailmanager/_services/async_mail_manager.py
async def list_relays(
    self,
    *,
    config_overrides: Optional[AsyncMailManagerClientConfig] = None,
    page_size: Optional[int] = None,
    next_token: Optional[
        "capo_mailmanager.types.pagination_token.PaginationToken"
    ] = None,
) -> "capo_mailmanager.types.list_relays_response.ListRelaysResponse":
    """<p>Lists all the existing relay resources.</p>

    Args:
        page_size: <p>The number of relays to be returned in one request.</p>
        next_token: <p>If you received a pagination token from a previous call to this API, you can provide it here to continue paginating through the next page of results.</p>

    Raises:
        capo_mailmanager.errors.validation_exception.ValidationException: <p>The request validation has failed. For details, see the accompanying error message.</p>
        capo_mailmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mailmanager.types.list_relays_request.ListRelaysRequest]",
    ) -> AsyncOperationResponse[
        "capo_mailmanager.types.list_relays_response.ListRelaysResponse"
    ]:
        import capo_mailmanager._operations.mail_manager_svc.list_relays

        (
            output,
            http_response,
        ) = await capo_mailmanager._operations.mail_manager_svc.list_relays.async_list_relays(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRelays")
    )
    input_: capo_mailmanager.types.list_relays_request.ListRelaysRequest = {}
    if page_size is not None:
        input_["page_size"] = page_size
    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