Skip to content

update_event_source async

update_event_source(
    event_source_arn: EventSourceArn,
    *,
    config_overrides: Optional[AsyncEventBridgeV2ClientConfig] = None,
    configuration: Optional[EventSourceConfiguration] = None,
    description: Optional[Description] = None,
) -> UpdateEventSourceResponse

Updates an EventSource. Fields omitted from the request are left unchanged.

Parameters:

  • event_source_arn (EventSourceArn) –

    EventSource ARN: event-sourcev2/<type>/<name>/<id>. The type segment is set by the service (aws.service for AWS service events, aws.partner for partner events, webhook for webhook events) and is not part of the resource's name. The id segment is a 25-character identifier generated by the service.

  • configuration (Optional[EventSourceConfiguration], default: None ) –

    Discriminated EventSource configuration. Exactly one variant must be set.

  • description (Optional[Description], default: None ) –

    Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.

Raises:

  • AccessDeniedException –

    The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.

  • InternalException –

    The request failed because of an internal service error. Retry the request.

  • InvalidInputException –

    A request parameter is missing or not valid.

  • ThrottlingException –

    The request was throttled because it exceeds a request rate limit. Retry the request with backoff.

  • ConcurrentModificationException –

    Another change to the resource is already in progress. Retry the request.

  • InvalidStateException –

    The resource is not in a state that allows the operation. For example, an event bus that is still being created cannot accept events.

  • LimitExceededException –

    The request would exceed a service quota for the account.

  • ResourceNotFoundException –

    The resource does not exist.

  • UnknownServiceError –

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

Source code in docs_src/capo_eventbridgev2/_services/async_event_bridge_v2.py
async def update_event_source(
    self,
    event_source_arn: "capo_eventbridgev2.types.event_source_arn.EventSourceArn",
    *,
    config_overrides: Optional[AsyncEventBridgeV2ClientConfig] = None,
    configuration: Optional[
        "capo_eventbridgev2.types.event_source_configuration.EventSourceConfiguration"
    ] = None,
    description: Optional[
        "capo_eventbridgev2.types.description.Description"
    ] = None,
) -> "capo_eventbridgev2.types.update_event_source_response.UpdateEventSourceResponse":
    """<p>Updates an EventSource. Fields omitted from the request are left unchanged.</p>

    Args:
        event_source_arn: <p>EventSource ARN: event-sourcev2/&lt;type&gt;/&lt;name&gt;/&lt;id&gt;. The type segment is set by the service (aws.service for AWS service events, aws.partner for partner events, webhook for webhook events) and is not part of the resource's name. The id segment is a 25-character identifier generated by the service.</p>
        configuration: <p>Discriminated EventSource configuration. Exactly one variant must be set.</p>
        description: <p>Free-text description. Used by every resource type that has one: event buses, subscribers, and event sources.</p>

    Raises:
        capo_eventbridgev2.errors.access_denied_exception.AccessDeniedException: <p>The caller does not have the permissions required to perform the operation. This error is also returned when the operation cannot use the AWS KMS key for the event bus.</p>
        capo_eventbridgev2.errors.internal_exception.InternalException: <p>The request failed because of an internal service error. Retry the request.</p>
        capo_eventbridgev2.errors.invalid_input_exception.InvalidInputException: <p>A request parameter is missing or not valid.</p>
        capo_eventbridgev2.errors.throttling_exception.ThrottlingException: <p>The request was throttled because it exceeds a request rate limit. Retry the request with backoff.</p>
        capo_eventbridgev2.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Another change to the resource is already in progress. Retry the request.</p>
        capo_eventbridgev2.errors.invalid_state_exception.InvalidStateException: <p>The resource is not in a state that allows the operation. For example, an event bus that is still being created cannot accept events.</p>
        capo_eventbridgev2.errors.limit_exceeded_exception.LimitExceededException: <p>The request would exceed a service quota for the account.</p>
        capo_eventbridgev2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource does not exist.</p>
        capo_eventbridgev2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_eventbridgev2.types.update_event_source_request.UpdateEventSourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_eventbridgev2.types.update_event_source_response.UpdateEventSourceResponse"
    ]:
        import capo_eventbridgev2._operations.aws_events_v2.update_event_source

        (
            output,
            http_response,
        ) = await capo_eventbridgev2._operations.aws_events_v2.update_event_source.async_update_event_source(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_eventbridgev2.types.update_event_source_request.UpdateEventSourceRequest",
    ) -> dict[str, Any]:
        import capo_eventbridgev2.types.update_event_source_request

        return (
            capo_eventbridgev2.types.update_event_source_request.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateEventSource", redact_input=_redact_input),
    )
    input_: capo_eventbridgev2.types.update_event_source_request.UpdateEventSourceRequest = {
        "event_source_arn": event_source_arn
    }
    if configuration is not None:
        input_["configuration"] = configuration
    if description is not None:
        input_["description"] = description

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