Skip to content

Commit 554d797

Browse files
committed
Remove GravityLastUpdated model
1 parent a2f35ea commit 554d797

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

Sources/SwiftHole/Model/Summary.swift

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public struct Summary: Decodable {
1414
public let uniqueClients, dnsQueriesAllTypes, replyNODATA, replyNXDOMAIN: Int
1515
public let replyCNAME, replyIP, privacyLevel: Int
1616
public let status: String
17-
public let gravityLastUpdated: GravityLastUpdated
18-
17+
1918
public var isEnabled: Bool {
2019
return status.lowercased() == "enabled"
2120
}
@@ -37,21 +36,6 @@ public struct Summary: Decodable {
3736
case replyIP = "reply_IP"
3837
case privacyLevel = "privacy_level"
3938
case status
40-
case gravityLastUpdated = "gravity_last_updated"
41-
}
42-
}
43-
44-
45-
// MARK: - GravityLastUpdated
46-
47-
public struct GravityLastUpdated: Decodable {
48-
public let fileExists: Bool
49-
public let absolute: Int
50-
public let relative: Relative
51-
52-
enum CodingKeys: String, CodingKey {
53-
case fileExists = "file_exists"
54-
case absolute, relative
5539
}
5640
}
5741

@@ -96,15 +80,10 @@ public struct Relative: Decodable {
9680

9781
extension Summary: Mockable {
9882
public static func mockData() -> Summary {
99-
Summary(domainsBeingBlocked: 100, dnsQueriesToday: 2, adsBlockedToday: 3, adsPercentageToday: 4, uniqueDomains: 5, queriesForwarded: 6, queriesCached: 7, clientsEverSeen: 8, uniqueClients: 9, dnsQueriesAllTypes: 10, replyNODATA: 11, replyNXDOMAIN: 12, replyCNAME: 13, replyIP: 14, privacyLevel: 15, status: "enabled", gravityLastUpdated: GravityLastUpdated.mockData())
83+
Summary(domainsBeingBlocked: 100, dnsQueriesToday: 2, adsBlockedToday: 3, adsPercentageToday: 4, uniqueDomains: 5, queriesForwarded: 6, queriesCached: 7, clientsEverSeen: 8, uniqueClients: 9, dnsQueriesAllTypes: 10, replyNODATA: 11, replyNXDOMAIN: 12, replyCNAME: 13, replyIP: 14, privacyLevel: 15, status: "enabled")
10084
}
10185
}
10286

103-
extension GravityLastUpdated: Mockable {
104-
public static func mockData() -> GravityLastUpdated {
105-
GravityLastUpdated(fileExists: true, absolute: 1, relative: Relative.mockData())
106-
}
107-
}
10887

10988
extension Relative: Mockable {
11089
public static func mockData() -> Relative {

0 commit comments

Comments
 (0)