UpstreamDataSendable

public protocol UpstreamDataSendable : AnyObject

A protocol for sending Upstream data to the server.

  • Sends an event.

    Declaration

    Swift

    func sendEvent(_ event: Upstream.Event, completion: ((StreamDataState) -> Void)?)

    Parameters

    event

    The event to send.

    completion

    The completion handler to call when the request is complete.

  • Sends an event and keep the stream for future attachment

    Declaration

    Swift

    func sendStream(_ event: Upstream.Event, completion: ((StreamDataState) -> Void)?)

    Parameters

    event

    The event to send.

    completion

    The completion handler to call when the request is complete.

  • Sends an attachment using the stream set before.

    Every event and attachment have DialogRequestId and this method finds the suitable stream using that id.

    Declaration

    Swift

    func sendStream(_ attachment: Upstream.Attachment, completion: ((StreamDataState) -> Void)?)

    Parameters

    attachment

    The attachmen to send.

    completion

    The completion handler to call when the request is complete.

  • Cancels an event.

    Declaration

    Swift

    func cancelEvent(dialogRequestId: String)

    Parameters

    dialogRequestId

    The event’s dialogRequestId to cancel.

  • sendEvent(_:) Extension method

    Sends an event.

    Declaration

    Swift

    func sendEvent(_ event: Upstream.Event)

    Parameters

    event

    The event to send.

  • sendStream(_:) Extension method

    Sends an attachment using the stream set before.

    Every event and attachment have DialogRequestId and this method finds the suitable stream using that id.

    Declaration

    Swift

    func sendStream(_ attachment: Upstream.Attachment)

    Parameters

    attachment

    The attachmen to send.