Skip to content

send_event

send_event(
    room_identifier: RoomIdentifier,
    event_name: EventName,
    *,
    config_overrides: Optional[ivschatClientConfig] = None,
    attributes: Optional[EventAttributes] = None,
) -> SendEventResponse

Sends an event to a room. Use this within your application’s business logic to send events to clients of a room; e.g., to notify clients to change the way the chat UI is rendered.

Parameters:

  • room_identifier (RoomIdentifier) –

    Identifier of the room to which the event will be sent. Currently this must be an ARN.

  • event_name (EventName) –

    Application-defined name of the event to send to clients.

  • attributes (Optional[EventAttributes], default: None ) –

    Application-defined metadata to attach to the event sent to clients. The maximum length of the metadata is 1 KB total.

Raises:

Source code in docs_src/capo_ivschat/_services/ivschat.py
def send_event(
    self,
    room_identifier: "capo_ivschat.types.room_identifier.RoomIdentifier",
    event_name: "capo_ivschat.types.event_name.EventName",
    *,
    config_overrides: Optional[ivschatClientConfig] = None,
    attributes: Optional[
        "capo_ivschat.types.event_attributes.EventAttributes"
    ] = None,
) -> "capo_ivschat.types.send_event_response.SendEventResponse":
    """<p>Sends an event to a room. Use this within your application’s business logic to send events to clients of a room; e.g., to notify clients to change the way the chat UI is rendered.</p>

    Args:
        room_identifier: <p>Identifier of the room to which the event will be sent. Currently this must be an ARN.</p>
        event_name: <p>Application-defined name of the event to send to clients.</p>
        attributes: <p>Application-defined metadata to attach to the event sent to clients. The maximum length of the metadata is 1 KB total.</p>

    Raises:
        capo_ivschat.errors.access_denied_exception.AccessDeniedException: <p/>
        capo_ivschat.errors.pending_verification.PendingVerification: <p/>
        capo_ivschat.errors.resource_not_found_exception.ResourceNotFoundException: <p/>
        capo_ivschat.errors.throttling_exception.ThrottlingException: <p/>
        capo_ivschat.errors.validation_exception.ValidationException: <p/>
        capo_ivschat.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ivschat.types.send_event_request.SendEventRequest]",
    ) -> OperationResponse[
        "capo_ivschat.types.send_event_response.SendEventResponse"
    ]:
        import capo_ivschat._operations.amazon_interactive_video_service_chat.send_event

        output, http_response = (
            capo_ivschat._operations.amazon_interactive_video_service_chat.send_event.send_event(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SendEvent")
    )
    input_: capo_ivschat.types.send_event_request.SendEventRequest = {
        "room_identifier": room_identifier,
        "event_name": event_name,
    }
    if attributes is not None:
        input_["attributes"] = attributes

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