AbstractCallback

open class AbstractCallback : Callback, @unchecked Sendable

A base class for callbacks that provides a JSON payload and methods to manipulate input values. This class is designed to be subclassed for specific callback implementations.

  • The JSON payload for the callback, containing input and output data.

    Declaration

    Swift

    public var json: [String : Any]
  • initialize(with:) Asynchronous

    Initializes a new instance of AbstractCallback with the provided JSON.

    Declaration

    Swift

    open func initialize(with json: [String : Any]) async -> any Callback
  • Abstract method – must be implemented by subclass

    Declaration

    Swift

    open func initValue(name: String, value: Any)
  • Generates an updated payload with input values inserted

    Declaration

    Swift

    public func input(_ values: Any...) -> [String : Any]
  • Update input value with specified key

    Declaration

    Swift

    public func input(_ value: Any, forKey key: String) -> [String : Any]

    Parameters

    value

    Value of the input to be updated

    key

    The name/key of the input to be updated

    Return Value

    The updated json dictionary

  • Returns the full JSON payload

    Declaration

    Swift

    open func payload() -> [String : Any]

Required Protocol Stubs

  • id

    A unique identifier for the callback instance.

    Declaration

    Swift

    public var id: String { get }
  • Initializer for the callback.

    Declaration

    Swift

    required public init()