ENUM
HaapiModel.ActionModelFactory
Contents
- Methods
form(actionTitle:continueActions:errorActions:fields:type:method:href:)
selector(options:)
clientOperation(arguments:name:continueActions:errorActions:)
externalBrowserClientOperation(arguments:name:continueActions:errorActions:)
bankIdClientOperation(arguments:name:continueActions:errorActions:)
encapClientOperation(arguments:name:continueActions:errorActions:)
webAuthnRegistrationClientOperation(arguments:name:continueActions:errorActions:)
webauthnAuthenticationClientOperation(arguments:name:continueActions:errorActions:)
genericClientOperation(arguments:name:continueActions:errorActions:)
link(href:rel:title:type:)
enum ActionModelFactory
Provides functionality to build instances of RepresentationActionModel
.
Methods
form(actionTitle:continueActions:errorActions:fields:type:method:href:)
public static func form(actionTitle: Message?, // swiftlint:disable:this function_parameter_count
continueActions: [Action],
errorActions: [Action],
fields: [FormField],
type: String?,
method: String,
href: String) -> FormActionModel
Creates an instance of FormActionModel
model.
-
Parameters:
- actionTitle: The title for the action model.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
- fields: An array of
FormField
that are relevant for the actions and continuing the flow. - type: The
media-type
used to represent the form's action content. - method: The
HTTP
method for the action's target. - href: A string representing the target's
URI
.
-
Returns: A built instance of
FormActionModel
.
Parameters
Name | Description |
---|---|
actionTitle | The title for the action model. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
fields | An array of FormField that are relevant for the actions and continuing the flow. |
type | The media-type used to represent the form’s action content. |
method | The HTTP method for the action’s target. |
href | A string representing the target’s URI . |
selector(options:)
public static func selector(options: [Action]) -> SelectorActionModel
Creates an instance of SelectorActionModel
model.
-
Parameters:
- options: An array of actions that allows the user selecting one to proceed the flow.
-
Returns: A built instance of
SelectorActionModel
.
Parameters
Name | Description |
---|---|
options | An array of actions that allows the user selecting one to proceed the flow. |
clientOperation(arguments:name:continueActions:errorActions:)
public static func clientOperation(arguments: [String: Any],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) -> ClientOperationActionModel
Creates an instance of ClientOperationActionModel
model.
-
Parameters:
- arguments: The action's arguments properties JSON representation.
- name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
-
Returns: A built instance of
ClientOperationActionModel
.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
externalBrowserClientOperation(arguments:name:continueActions:errorActions:)
public static func externalBrowserClientOperation(arguments: [String: String],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) throws -> ExternalBrowserClientOperationActionModel // swiftlint:disable:this line_length
Creates an instance of ExternalBrowserClientOperationActionModel
model.
-
Parameters:
- arguments: The action's arguments properties JSON representation.
- name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
-
Returns: A built instance of
ExternalBrowserClientOperationActionModel
. -
Throws:
HaapiSdkError.invalidModel
if any error occurs when parsing required arguments.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
bankIdClientOperation(arguments:name:continueActions:errorActions:)
public static func bankIdClientOperation(arguments: [String: String],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) throws -> BankIdClientOperationActionModel
Creates an instance of BankIdClientOperationActionModel
model.
-
Parameters:
- arguments: The action's arguments properties JSON representation.
- name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
-
Returns: A built instance of
BankIdClientOperationActionModel
. -
Throws:
HaapiSdkError.invalidModel
if any error occurs when parsing required arguments.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
encapClientOperation(arguments:name:continueActions:errorActions:)
public static func encapClientOperation(arguments: [String: String],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) throws -> EncapAutoActivationClientOperationActionModel // swiftlint:disable:this line_length
Creates an instance of EncapAutoActivationClientOperationActionModel
model.
-
Parameters:
- arguments: The action's arguments properties JSON representation.
- name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
-
Returns: A built instance of
EncapAutoActivationClientOperationActionModel
. -
Throws:
HaapiSdkError.invalidModel
if any error occurs when parsing required arguments.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
webAuthnRegistrationClientOperation(arguments:name:continueActions:errorActions:)
public static func webAuthnRegistrationClientOperation(arguments: [String: Any],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) throws -> WebAuthnRegistrationClientOperationActionModel // swiftlint:disable:this line_length
Creates an instance of WebAuthnRegistrationClientOperationActionModel
model.
-
Note: Refer to WebAuthn Registration Data Model documentation
-
Parameters:
- arguments: The action's arguments properties JSON representation. It must model the
WebAuthn
Registration credential model. - name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
- arguments: The action's arguments properties JSON representation. It must model the
-
Returns: A built instance of
WebAuthnRegistrationClientOperationActionModel
. -
Throws:
HaapiSdkError.invalidModel
if any error occurs when parsing required arguments.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. It must model the WebAuthn Registration credential model. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
webauthnAuthenticationClientOperation(arguments:name:continueActions:errorActions:)
public static func webauthnAuthenticationClientOperation(arguments: [String: Any],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) throws -> WebAuthnAuthenticationClientOperationActionModel // swiftlint:disable:this line_length
Creates an instance of WebAuthnAuthenticationClientOperationActionModel
model.
-
Note: Refer to WebAuthn Authentication Data Model documentation
-
Parameters:
- arguments: The action's arguments properties JSON representation. It must model the
WebAuthn
Authentication credential model. - name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
- arguments: The action's arguments properties JSON representation. It must model the
-
Returns: A built instance of
WebAuthnAuthenticationClientOperationActionModel
. -
Throws:
HaapiSdkError.invalidModel
if any error occurs when parsing required arguments.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. It must model the WebAuthn Authentication credential model. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
genericClientOperation(arguments:name:continueActions:errorActions:)
public static func genericClientOperation(arguments: [String: Any],
name: ClientOperationName,
continueActions: [Action],
errorActions: [Action]) -> GenericClientOperationActionModel
Creates an instance of GenericClientOperationActionModel
model.
-
Parameters:
- arguments: The action's arguments properties JSON representation.
- name: The action's operation name identifier.
- continueActions: An array of actions that can be used to move the flow forward.
- errorActions: An array of actions that can be used if an error happens.
-
Returns: A built instance of
GenericClientOperationActionModel
.
Parameters
Name | Description |
---|---|
arguments | The action’s arguments properties JSON representation. |
name | The action’s operation name identifier. |
continueActions | An array of actions that can be used to move the flow forward. |
errorActions | An array of actions that can be used if an error happens. |
link(href:rel:title:type:)
public static func link(href: String, rel: String, title: Message?, type: String?) -> Link
Creates an instance of Link
model.
-
Parameters:
- href: A string representing the target's
URI
. - rel: The value for the link relation.
- title: The title of the link.
- type: A hint for the link
media-type
.
- href: A string representing the target's
-
Returns: A built instance of
Link
.
Parameters
Name | Description |
---|---|
href | A string representing the target’s URI . |
rel | The value for the link relation. |
title | The title of the link. |
type | A hint for the link media-type . |