STRUCT
PollingStep
Contents
- Properties
mainActioncancelActionactionspollingPropertiesmessagesmetadatalinkspropertiesrawJsonStringtype
- Methods
init(from:)encode(to:)==(_:_:)
public struct PollingStep: HaapiRepresentation
A step that requires a client to poll while an operation is completed out-of-band.
The client may use a polling interval of its choosing, usually a few seconds. While polling, the client should display any links or messages provided in the response from the server, as well as a visual indicator to make it clear that it is waiting for some external action to be completed.
The status of the polling can be obtained via the pollingProperties. The mainAction always allows the client to progress:
if the polling is pending, the action polls again; otherwise, it continues the flow.
Properties
mainAction
public let mainAction: FormAction
The action to poll or to move forward in the flow.
cancelAction
public let cancelAction: FormAction?
An action to cancel the ongoing operation, when supported. Only applicable if the polling is pending.
actions
public let actions: [Action]
Possible actions a user or the client may choose to take to continue the flow.
pollingProperties
public let pollingProperties: PollingProperties
The polling properties.
messages
public let messages: [UserMessage]
metadata
public let metadata: Metadata?
links
public let links: [Link]
properties
public var properties: (any Properties)?
rawJsonString
public let rawJsonString: String?
type
public let type: RepresentationType = .pollingStep
Methods
init(from:)
public init(from decoder: Decoder) throws
Parameters
| Name | Description |
|---|---|
| decoder | The decoder to read data from. |
encode(to:)
public func encode(to encoder: Encoder) throws
Parameters
| Name | Description |
|---|---|
| encoder | The encoder to write data to. |
==(::)
public static func == (lhs: PollingStep, rhs: PollingStep) -> Bool
Parameters
| Name | Description |
|---|---|
| lhs | A value to compare. |
| rhs | Another value to compare. |