PROTOCOL
HaapiRepresentation
public protocol HaapiRepresentation: Codable
A representation of a successful HAAPI response. This representation is associated with the content-type application/vnd.auth+json
.
This interface is the root of a sealed class hierarchy that includes the different possible outcomes of an HAAPI request. Clients are expected to use the classes in this hierarchy in order to decide which action to take, as those classes model higher-level concepts. However, clients may choose a generic approach to handle representations based on this interface only.
Clients should display all actions provided by the server, as well as any messages and links, to let the user decide how to better proceed to the next step.
Properties
metadata
var metadata: Metadata?
An optional object with additional information about the response. A client may ignore the information present in this object.
type
var type: RepresentationType
The type of the step, which defines the schema for the representation.
Note that the classes in the HaapiRepresentation
hierarchy model additional concepts. For example, the class for
a given client operation step may be used with both RepresentationType.authenticationStep
and RepresentationType.registrationStep
.
properties
var properties: Properties?
Additional properties for this representation. Representation types may override this property to a more specific type.
links
var links: [Link]
Links that may be used for alternative flows, such as diverting the user to register an account.
messages
var messages: [UserMessage]
Messages that should be displayed to users to help them understand the context of an interaction.