Skip to content

list_api_destinations

list_api_destinations(
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    name_prefix: Optional[ApiDestinationName] = None,
    connection_arn: Optional[ConnectionArn] = None,
    next_token: Optional[NextToken] = None,
    limit: Optional[LimitMax100] = None,
) -> ListApiDestinationsResponse

Retrieves a list of API destination in the account in the current Region.

Parameters:

  • name_prefix (Optional[ApiDestinationName], default: None ) –

    A name prefix to filter results returned. Only API destinations with a name that starts with the prefix are returned.

  • connection_arn (Optional[ConnectionArn], default: None ) –

    The ARN of the connection specified for the API destination.

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

    The token returned by a previous call to retrieve the next set of results.

  • limit (Optional[LimitMax100], default: None ) –

    The maximum number of API destinations to include in the response.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/cloud_watch_events.py
def list_api_destinations(
    self,
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    name_prefix: Optional[
        "capo_cloudwatch_events.types.api_destination_name.ApiDestinationName"
    ] = None,
    connection_arn: Optional[
        "capo_cloudwatch_events.types.connection_arn.ConnectionArn"
    ] = None,
    next_token: Optional[
        "capo_cloudwatch_events.types.next_token.NextToken"
    ] = None,
    limit: Optional["capo_cloudwatch_events.types.limit_max100.LimitMax100"] = None,
) -> "capo_cloudwatch_events.types.list_api_destinations_response.ListApiDestinationsResponse":
    """<p>Retrieves a list of API destination in the account in the current Region.</p>

    Args:
        name_prefix: <p>A name prefix to filter results returned. Only API destinations with a name that starts with the prefix are returned.</p>
        connection_arn: <p>The ARN of the connection specified for the API destination.</p>
        next_token: <p>The token returned by a previous call to retrieve the next set of results.</p>
        limit: <p>The maximum number of API destinations to include in the response.</p>

    Raises:
        capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_cloudwatch_events.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_events.types.list_api_destinations_request.ListApiDestinationsRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_events.types.list_api_destinations_response.ListApiDestinationsResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.list_api_destinations

        output, http_response = (
            capo_cloudwatch_events._operations.aws_events.list_api_destinations.list_api_destinations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListApiDestinations")
    )
    input_: capo_cloudwatch_events.types.list_api_destinations_request.ListApiDestinationsRequest = {}
    if name_prefix is not None:
        input_["name_prefix"] = name_prefix
    if connection_arn is not None:
        input_["connection_arn"] = connection_arn
    if next_token is not None:
        input_["next_token"] = next_token
    if limit is not None:
        input_["limit"] = limit

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output