f512d94c74
git-subtree-dir: clients/ds-app git-subtree-mainline:a24e3e6f22git-subtree-split:5206cf3b0c
29 lines
782 B
Swift
29 lines
782 B
Swift
import Foundation
|
|
|
|
public struct AccessTokenResponse: Codable, Sendable, Equatable {
|
|
public let accessToken: String
|
|
public let tokenType: String
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case accessToken = "access_token"
|
|
case tokenType = "token_type"
|
|
}
|
|
}
|
|
|
|
public struct UserResponse: Codable, Sendable, Equatable, Identifiable {
|
|
public let id: Int
|
|
public let username: String
|
|
public let isActive: Bool
|
|
public let totpEnabled: Bool
|
|
public let lastLoginAtRaw: String?
|
|
|
|
public var lastLoginAt: Date? { DSDate.parse(lastLoginAtRaw) }
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
case id, username
|
|
case isActive = "is_active"
|
|
case totpEnabled = "totp_enabled"
|
|
case lastLoginAtRaw = "last_login_at"
|
|
}
|
|
}
|