@@ -14,8 +14,7 @@ public struct Summary: Decodable {
14
14
public let uniqueClients , dnsQueriesAllTypes , replyNODATA , replyNXDOMAIN : Int
15
15
public let replyCNAME , replyIP , privacyLevel : Int
16
16
public let status : String
17
- public let gravityLastUpdated : GravityLastUpdated
18
-
17
+
19
18
public var isEnabled : Bool {
20
19
return status. lowercased ( ) == " enabled "
21
20
}
@@ -37,21 +36,6 @@ public struct Summary: Decodable {
37
36
case replyIP = " reply_IP "
38
37
case privacyLevel = " privacy_level "
39
38
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
55
39
}
56
40
}
57
41
@@ -96,15 +80,10 @@ public struct Relative: Decodable {
96
80
97
81
extension Summary : Mockable {
98
82
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 " )
100
84
}
101
85
}
102
86
103
- extension GravityLastUpdated : Mockable {
104
- public static func mockData( ) -> GravityLastUpdated {
105
- GravityLastUpdated ( fileExists: true , absolute: 1 , relative: Relative . mockData ( ) )
106
- }
107
- }
108
87
109
88
extension Relative : Mockable {
110
89
public static func mockData( ) -> Relative {
0 commit comments