OutOfBandPayload
public struct OutOfBandPayload : Codable
The OutOfBandPayload
contains the data necessary to start an out-of-band operation.
-
The list of supported content types for the encoded data.
See moreDeclaration
Swift
public enum ContentType : String, Codable
-
Encoded string containing information relative to the operation.
In case of JOSE content type, the value must represent a JWE compact serialization. For a JSON content type, the value must represent a stringified JSON serialization.
Declaration
Swift
public let content: String
-
The type of content.
Declaration
Swift
public let contentType: ContentType
-
The version of the payload.
Declaration
Swift
public let version: String
-
The channel used to send the payload. This value is needed in case of encrypted content (i.e. content type is
jose
).Declaration
Swift
public var channel: DispatchChannel?
-
Creates an
OutOfBandPayload
object.Declaration
Swift
public init(content: String, contentType: ContentType, version: String, channel: DispatchChannel? = nil)
Parameters
content
The information relative to the operation, encoded to the given
contentType
.contentType
The type of content.
version
The version of the payload.
channel
The channel used to send the payload. This value is needed in case of encrypted content (i.e.
jose
content type). -
The keys used for encoding and decoding
OutOfBandPayload
objects.Declaration
Swift
public enum CodingKeys : String, CodingKey
-
Creates a new instance from the values in the given dictionary.
In case of JSON content type, the content will be automatically stringified so it can be decoded to any JSON object by the SDK.
Throws
ADecodingError
error if the data read from the dictionary is invalid.Declaration
Swift
init(from dictionary: [AnyHashable : Any]) throws
Parameters
dictionary
A dictionary containing the keys and values with which to initialize the payload.
-
Creates a new instance by decoding from the given JSON data.
Throws
ADecodingError
error if the data read is invalid.Declaration
Swift
init(from data: Data) throws
Parameters
data
Data that contains a JSON representation of the payload.
-
Creates a new instance by decoding from the given Base64url encoded string.
Throws
ADecodingError
error if the data read is invalid.Declaration
Swift
init(base64urlEncoded content: String) throws
Parameters
content
A Base64url encoded string that contains a JSON representation of the payload.