ActionRequest
public final class ActionRequest
extension ActionRequest: CustomStringConvertible
extension ActionRequest: ObservableObject
extension ActionRequest: Codable
extension ActionRequest: Equatable
Represent a mobile action sent 4D server.
-
The action to request.
Declaration
Swift
public var action: Action
-
All parameters
Declaration
Swift
@StringDictContainer public var parameters: ActionParameters { get set }
-
The request state.
Declaration
Swift
public var state: ActionRequest.State
-
Creation of request.
Declaration
Swift
public var creationDate: Date
-
Final execution date.
Declaration
Swift
public var lastDate: Date?
-
The result, when has been executed
Declaration
Swift
public var result: Result<ActionResult, ActionRequest.Error>? { get set }
-
Try count
Declaration
Swift
public var tryCount: Int
-
Unique id.
Declaration
Swift
public var id: String { get }
-
Parameters value for the actions.
Declaration
Swift
public var actionParameters: ActionParameters? { get set }
-
Set an action parameter value.
Declaration
Swift
public func setActionParameters(key: String, value: Any)
-
Remove an action parameter value.
Declaration
Swift
public func removeActionParameters(key: String)
-
Context of action executions (ie. record, table, …)
Declaration
Swift
public var contextParameters: ActionParameters? { get }
-
Meta data of action (for instance to ask server to convert JSON data to Date or Picture)
Declaration
Swift
public var metadataParameters: ActionParameters? { get }
-
Return the result status text if task finish and have status text from server.
Declaration
Swift
public var statusText: String? { get }
-
Return the table name from context.
Declaration
Swift
public var tableName: String { get }
-
Compute a summary information of record (ie. primary id)
Declaration
Swift
public var recordSummary: String { get }
-
Return true if the action has been executed and is success.
Declaration
Swift
public var isSuccess: Bool { get }
-
Return true if action has been executed without error.
Declaration
Swift
public var isCompleted: Bool { get }
-
Has receive result.
Declaration
Swift
public var hasResult: Bool { get }
-
The action result if any (ie. have result and no error.
Declaration
Swift
public var actionResult: ActionResult? { get }
-
Generate an ir for action.
Declaration
Swift
public static func generateID(_ action: Action) -> String
-
Create a new action request with action and context parameters
Declaration
Swift
public convenience init( action: Action, actionParameters: ActionParameters? = nil, contextParameters: ActionParameters? = nil, id: String, state: ActionRequest.State? = nil, result: Result<ActionResult, APIError>? = nil)
-
Create a new action request with raw attributes
Declaration
Swift
public init(action: Action, parameters: ActionParameters? = nil, state: ActionRequest.State? = nil, result: Result<ActionResult, APIError>? = nil)
-
Reset result ie. set no nil.
Declaration
Swift
public func resetResult()
-
Encode current parmeters for request.
Declaration
Swift
public func encodeParameters()
-
Decode current parametes for request.
Declaration
Swift
public func decodeParameters()
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public convenience init(from decoder: Decoder) throws
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Declaration
Swift
public static func == (lhs: ActionRequest, rhs: ActionRequest) -> Bool
-
Undocumented
Declaration
Swift
public func hash(into hasher: inout Hasher)