Add OS metadata, preference hooks, and slider polish
This commit is contained in:
@@ -292,6 +292,13 @@ private extension APIv2_12 {
|
||||
case securityUpdateCount = "security_update_count"
|
||||
case rebootRequired = "reboot_required"
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
updateCount = try container.decodeIfPresent(Int.self, forKey: .updateCount) ?? 0
|
||||
securityUpdateCount = try container.decodeIfPresent(Int.self, forKey: .securityUpdateCount) ?? 0
|
||||
rebootRequired = try container.decodeIfPresent(Bool.self, forKey: .rebootRequired) ?? false
|
||||
}
|
||||
}
|
||||
|
||||
let label: String
|
||||
@@ -309,6 +316,16 @@ private extension APIv2_12 {
|
||||
case endOfLife = "end_of_life"
|
||||
case updates
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
label = try container.decodeIfPresent(String.self, forKey: .label) ?? ""
|
||||
distribution = try container.decodeIfPresent(String.self, forKey: .distribution) ?? ""
|
||||
version = try container.decodeIfPresent(String.self, forKey: .version) ?? ""
|
||||
architecture = try container.decodeIfPresent(String.self, forKey: .architecture) ?? ""
|
||||
endOfLife = try container.decodeIfPresent(Bool.self, forKey: .endOfLife) ?? false
|
||||
updates = try container.decodeIfPresent(Updates.self, forKey: .updates)
|
||||
}
|
||||
}
|
||||
|
||||
func toDomain() -> ServerInfo {
|
||||
|
||||
Reference in New Issue
Block a user