Skip to content

create_event_action async

create_event_action(
    action: Action,
    event: Event,
    *,
    config_overrides: Optional[AsyncDataExchangeClientConfig] = None,
    tags: Optional[MapOf__string] = None,
) -> CreateEventActionResponse

This operation creates an event action.

Parameters:

  • action (Action) –

    What occurs after a certain event.

  • event (Event) –

    What occurs to start an action.

  • tags (Optional[MapOf__string], default: None ) –

    Key-value pairs that you can associate with the event action.

Raises:

Source code in docs_src/capo_dataexchange/_services/async_data_exchange.py
async def create_event_action(
    self,
    action: "capo_dataexchange.types.action.Action",
    event: "capo_dataexchange.types.event.Event",
    *,
    config_overrides: Optional[AsyncDataExchangeClientConfig] = None,
    tags: Optional["capo_dataexchange.types.map_of__string.MapOf__string"] = None,
) -> (
    "capo_dataexchange.types.create_event_action_response.CreateEventActionResponse"
):
    """<p>This operation creates an event action.</p>

    Args:
        action: <p>What occurs after a certain event.</p>
        event: <p>What occurs to start an action.</p>
        tags: <p>Key-value pairs that you can associate with the event action.</p>

    Raises:
        capo_dataexchange.errors.access_denied_exception.AccessDeniedException: <p>Access to the resource is denied.</p>
        capo_dataexchange.errors.internal_server_exception.InternalServerException: <p>An exception occurred with the service.</p>
        capo_dataexchange.errors.service_limit_exceeded_exception.ServiceLimitExceededException: <p>The request has exceeded the quotas imposed by the service.</p>
        capo_dataexchange.errors.throttling_exception.ThrottlingException: <p>The limit on the number of requests per second was exceeded.</p>
        capo_dataexchange.errors.validation_exception.ValidationException: <p>The request was invalid.</p>
        capo_dataexchange.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_dataexchange.types.create_event_action_request.CreateEventActionRequest]",
    ) -> AsyncOperationResponse[
        "capo_dataexchange.types.create_event_action_response.CreateEventActionResponse"
    ]:
        import capo_dataexchange._operations.data_exchange.create_event_action

        (
            output,
            http_response,
        ) = await capo_dataexchange._operations.data_exchange.create_event_action.async_create_event_action(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEventAction")
    )
    input_: capo_dataexchange.types.create_event_action_request.CreateEventActionRequest = {
        "action": action,
        "event": event,
    }
    if tags is not None:
        input_["tags"] = tags

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