file-attachment-payload-properties
type
An attachment type all FileAttachmentPayload
instances conform to. Is set to .file
.
public static let type: AttachmentType = .file
title
A title, usually the name of the file.
public var title: String?
assetURL
A link to the file.
public var assetURL: URL
file
The file itself.
public var file: AttachmentFile
extraData
An extra data.
public var extraData: [String: RawJSON]?
Methods
extraData(ofType:)
Decodes extra data as an instance of the given type.
public func extraData<T: Decodable>(ofType: T.Type = T.self) -> T?
Parameters
ofType
: The type an extra data should be decoded as.
Returns
Extra data of the given type or nil
if decoding fails.
encode(to:)
public func encode(to encoder: Encoder) throws