Skip to content

put_events async

put_events(
    entries: PutEventsRequestEntryList,
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
) -> PutEventsResponse

Sends custom events to Amazon EventBridge so that they can be matched to rules.

Parameters:

  • entries (PutEventsRequestEntryList) –

    The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.

Raises:

Source code in docs_src/capo_cloudwatch_events/_services/async_cloud_watch_events.py
async def put_events(
    self,
    entries: "capo_cloudwatch_events.types.put_events_request_entry_list.PutEventsRequestEntryList",
    *,
    config_overrides: Optional[AsyncCloudWatchEventsClientConfig] = None,
) -> "capo_cloudwatch_events.types.put_events_response.PutEventsResponse":
    """<p>Sends custom events to Amazon EventBridge so that they can be matched to rules.</p>

    Args:
        entries: <p>The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_events.types.put_events_request.PutEventsRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_events.types.put_events_response.PutEventsResponse"
    ]:
        import capo_cloudwatch_events._operations.aws_events.put_events

        (
            output,
            http_response,
        ) = await capo_cloudwatch_events._operations.aws_events.put_events.async_put_events(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutEvents")
    )
    input_: capo_cloudwatch_events.types.put_events_request.PutEventsRequest = {
        "entries": entries
    }

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