mirror of
https://github.com/appwrite/sdk-for-apple.git
synced 2026-11-18 20:53:33 +00:00
* chore: update Apple SDK to 18.3.0 * chore: update Apple SDK to 18.3.0 * chore: update Apple SDK to 19.0.0 * docs: state the SDK targets Appwrite server version 2.0.x * fix: regenerate with the latest sdk-generator and add auto image gravity
44 lines
1.1 KiB
Swift
44 lines
1.1 KiB
Swift
import Foundation
|
|
import JSONCodable
|
|
|
|
/// MFA Recovery Codes
|
|
open class MfaRecoveryCodes: Codable {
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case recoveryCodes = "recoveryCodes"
|
|
}
|
|
|
|
/// Recovery codes.
|
|
public let recoveryCodes: [String]
|
|
|
|
init(
|
|
recoveryCodes: [String]
|
|
) {
|
|
self.recoveryCodes = recoveryCodes
|
|
}
|
|
|
|
public required init(from decoder: Decoder) throws {
|
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
|
|
self.recoveryCodes = try container.decode([String].self, forKey: .recoveryCodes)
|
|
}
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
|
|
try container.encode(recoveryCodes, forKey: .recoveryCodes)
|
|
}
|
|
|
|
public func toMap() -> [String: Any] {
|
|
return [
|
|
"recoveryCodes": recoveryCodes as Any
|
|
]
|
|
}
|
|
|
|
public static func from(map: [String: Any]) -> MfaRecoveryCodes {
|
|
return MfaRecoveryCodes(
|
|
recoveryCodes: map["recoveryCodes"] as! [String]
|
|
)
|
|
}
|
|
}
|