STRUCT
ExternalBrowserClientOperationStep
Contents
- Properties
actionModel
metadata
type
actions
properties
links
messages
actionsToPresent
continueFormActionModel
- Methods
init(from:)
encode(to:)
==(_:_:)
urlToLaunch(redirectTo:)
formattedParametersFromURL(_:)
public struct ExternalBrowserClientOperationStep: ClientOperationStep, Equatable
A step that instructs a client that an external browser needs to be used to continue the flow.
The uriToLaunch
method can be used to obtain the URI that should be opened in the browser. The browser will navigate
to the redirect URI provided to that method when the external browser flow is completed. This redirect URI is usually
a "deep link" that allows the client application to resume execution. At this point, the client application should
invoke formattedParametersFromURL
to extract the resulting parameters, which can then be used with continueFormActionModel
to proceed with the flow.
For more information, refer to the HAAPI Data Model documentation.
Properties
actionModel
public let actionModel: ExternalBrowserClientOperationActionModel
The external browser action details.
metadata
public let metadata: Metadata?
type
public let type: RepresentationType
actions
public let actions: [Action]
An array of Action
that contains possible actions a user or the client may choose to take to continue the flow.
properties
public let properties: Properties?
links
public let links: [Link] = []
messages
public let messages: [UserMessage] = []
actionsToPresent
public var actionsToPresent: [Action]
Returns the actions that should be displayed when the browser has been opened.
continueFormActionModel
public var continueFormActionModel: FormActionModel
Returns the form action that has to be submitted alongside the result of formattedParametersFromURL
after receiving the callback from the external browser.
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: ExternalBrowserClientOperationStep, rhs: ExternalBrowserClientOperationStep) -> Bool
Parameters
Name | Description |
---|---|
lhs | A value to compare. |
rhs | Another value to compare. |
urlToLaunch(redirectTo:)
public func urlToLaunch(redirectTo: String) -> URL?
Returns the URL
that should be used to open an external browser.
- Parameters:
- redirectTo: The URI to which the browser should redirect after the external browser flow is complete (deep link).
Parameters
Name | Description |
---|---|
redirectTo | The URI to which the browser should redirect after the external browser flow is complete (deep link). |
formattedParametersFromURL(_:)
public func formattedParametersFromURL(_ url: URL) throws -> [String: String]
Extract the resulting parameters from the query string of the final redirect of the external browser flow.