Skip to content

list_distributions_by_connection_mode async

list_distributions_by_connection_mode(
    connection_mode: ConnectionMode,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    marker: Optional[string] = None,
    max_items: Optional[integer] = None,
) -> ListDistributionsByConnectionModeResult

Lists the distributions by the connection mode that you specify.

Parameters:

  • marker (Optional[string], default: None ) –

    The marker for the next set of distributions to retrieve.

  • max_items (Optional[integer], default: None ) –

    The maximum number of distributions to return.

  • connection_mode (ConnectionMode) –

    This field specifies whether the connection mode is through a standard distribution (direct) or a multi-tenant distribution with distribution tenants (tenant-only).

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def list_distributions_by_connection_mode(
    self,
    connection_mode: "capo_cloudfront.types.connection_mode.ConnectionMode",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    marker: Optional["capo_cloudfront.types.string.string"] = None,
    max_items: Optional["capo_cloudfront.types.integer.integer"] = None,
) -> "capo_cloudfront.types.list_distributions_by_connection_mode_result.ListDistributionsByConnectionModeResult":
    """<p>Lists the distributions by the connection mode that you specify.</p>

    Args:
        marker: <p> The marker for the next set of distributions to retrieve.</p>
        max_items: <p>The maximum number of distributions to return.</p>
        connection_mode: <p>This field specifies whether the connection mode is through a standard distribution (direct) or a multi-tenant distribution with distribution tenants (tenant-only).</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.list_distributions_by_connection_mode_request.ListDistributionsByConnectionModeRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.list_distributions_by_connection_mode_result.ListDistributionsByConnectionModeResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.list_distributions_by_connection_mode

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.list_distributions_by_connection_mode.async_list_distributions_by_connection_mode(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_cloudfront.types.list_distributions_by_connection_mode_result.ListDistributionsByConnectionModeResult",
    ) -> dict[str, Any]:
        import capo_cloudfront.types.list_distributions_by_connection_mode_result

        return capo_cloudfront.types.list_distributions_by_connection_mode_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListDistributionsByConnectionMode", redact_output=_redact_output
        ),
    )
    input_: capo_cloudfront.types.list_distributions_by_connection_mode_request.ListDistributionsByConnectionModeRequest = {
        "connection_mode": connection_mode
    }
    if marker is not None:
        input_["marker"] = marker
    if max_items is not None:
        input_["max_items"] = max_items

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