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
AbstractCallbackwith 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
valueValue of the input to be updated
keyThe 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]
View on GitHub