Skip to content

update_api_destination

update_api_destination(
    name: ApiDestinationName,
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    description: Optional[ApiDestinationDescription] = None,
    connection_arn: Optional[ConnectionArn] = None,
    invocation_endpoint: Optional[HttpsEndpoint] = None,
    http_method: Optional[ApiDestinationHttpMethod] = None,
    invocation_rate_limit_per_second: Optional[
        ApiDestinationInvocationRateLimitPerSecond
    ] = None,
) -> UpdateApiDestinationResponse

Updates an API destination.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/cloud_watch_events.py
def update_api_destination(
    self,
    name: "capo_cloudwatch_events.types.api_destination_name.ApiDestinationName",
    *,
    config_overrides: Optional[CloudWatchEventsClientConfig] = None,
    description: Optional[
        "capo_cloudwatch_events.types.api_destination_description.ApiDestinationDescription"
    ] = None,
    connection_arn: Optional[
        "capo_cloudwatch_events.types.connection_arn.ConnectionArn"
    ] = None,
    invocation_endpoint: Optional[
        "capo_cloudwatch_events.types.https_endpoint.HttpsEndpoint"
    ] = None,
    http_method: Optional[
        "capo_cloudwatch_events.types.api_destination_http_method.ApiDestinationHttpMethod"
    ] = None,
    invocation_rate_limit_per_second: Optional[
        "capo_cloudwatch_events.types.api_destination_invocation_rate_limit_per_second.ApiDestinationInvocationRateLimitPerSecond"
    ] = None,
) -> "capo_cloudwatch_events.types.update_api_destination_response.UpdateApiDestinationResponse":
    """<p>Updates an API destination.</p>

    Args:
        name: <p>The name of the API destination to update.</p>
        description: <p>The name of the API destination to update.</p>
        connection_arn: <p>The ARN of the connection to use for the API destination.</p>
        invocation_endpoint: <p>The URL to the endpoint to use for the API destination.</p>
        http_method: <p>The method to use for the API destination.</p>
        invocation_rate_limit_per_second: <p>The maximum number of invocations per second to send to the API destination.</p>

    Raises:
        capo_cloudwatch_events.errors.concurrent_modification_exception.ConcurrentModificationException: <p>There is concurrent modification on a rule, target, archive, or replay.</p>
        capo_cloudwatch_events.errors.internal_exception.InternalException: <p>This exception occurs due to unexpected causes.</p>
        capo_cloudwatch_events.errors.limit_exceeded_exception.LimitExceededException: <p>The request failed because it attempted to create resource beyond the allowed service quota.</p>
        capo_cloudwatch_events.errors.resource_not_found_exception.ResourceNotFoundException: <p>An entity that you specified does not exist.</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.update_api_destination_request.UpdateApiDestinationRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_events.types.update_api_destination_response.UpdateApiDestinationResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.update_api_destination

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateApiDestination")
    )
    input_: capo_cloudwatch_events.types.update_api_destination_request.UpdateApiDestinationRequest = {
        "name": name
    }
    if description is not None:
        input_["description"] = description
    if connection_arn is not None:
        input_["connection_arn"] = connection_arn
    if invocation_endpoint is not None:
        input_["invocation_endpoint"] = invocation_endpoint
    if http_method is not None:
        input_["http_method"] = http_method
    if invocation_rate_limit_per_second is not None:
        input_["invocation_rate_limit_per_second"] = (
            invocation_rate_limit_per_second
        )

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