STRUCT
PollingStep
Contents
- Properties
mainAction
cancelAction
metadata
actions
messages
links
pollingProperties
type
properties
- Methods
init(from:)
encode(to:)
==(_:_:)
public struct PollingStep: HaapiRepresentation, Equatable
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
.
metadata
public let metadata: Metadata?
actions
public let actions: [Action]
Possible actions a user or the client may choose to take to continue the flow.
messages
public let messages: [UserMessage]
links
public let links: [Link]
pollingProperties
public let pollingProperties: PollingProperties
The polling properties.
type
public let type: RepresentationType = .pollingStep
properties
public var properties: Properties?
The properties of the polling step.
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. |