Skip to content

Commit

Permalink
De-smurf naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Nov 14, 2024
1 parent bca714b commit 4774824
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Sources/XyoClient/Witness/Basic/BasicWitness.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

open class XyoBasicWitness: AbstractWitness {
open class BasicWitness: AbstractWitness {

public typealias TPayloadOut = Payload

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CoreTelephony
import Foundation

struct XyoSystemInfoCellularProviderPayloadStruct: Encodable {
struct SystemInfoCellularProviderPayloadStruct: Encodable {
var allowVoip: Bool?
var icc: String?
var name: String?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct XyoSystemInfoDevicePayloadStruct: Encodable {
struct SystemInfoDevicePayloadStruct: Encodable {
var model: String?
var nodename: String?
var release: String?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import CoreTelephony
import Foundation

struct XyoSystemInfoNetworkCellularPayloadStruct: Encodable {
struct SystemInfoNetworkCellularPayloadStruct: Encodable {
var ip: String?
var provider = XyoSystemInfoCellularProviderPayloadStruct()
var provider = SystemInfoCellularProviderPayloadStruct()
var radio: String?
init(_ wifiInfo: WifiInformation?) {
#if os(iOS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Foundation

struct XyoSystemInfoNetworkPayloadStruct: Encodable {
var cellular: XyoSystemInfoNetworkCellularPayloadStruct?
var wifi: XyoSystemInfoNetworkWifiPayloadStruct?
var wired: XyoSystemInfoNetworkWiredPayloadStruct?
struct SystemInfoNetworkPayloadStruct: Encodable {
var cellular: SystemInfoNetworkCellularPayloadStruct?
var wifi: SystemInfoNetworkWifiPayloadStruct?
var wired: SystemInfoNetworkWiredPayloadStruct?

init(_ wifiInfo: WifiInformation) {
cellular = wifiInfo.isCellular() ? XyoSystemInfoNetworkCellularPayloadStruct(wifiInfo) : nil
wifi = wifiInfo.isWifi() ? XyoSystemInfoNetworkWifiPayloadStruct(wifiInfo) : nil
wired = wifiInfo.isWired() ? XyoSystemInfoNetworkWiredPayloadStruct(wifiInfo) : nil
cellular = wifiInfo.isCellular() ? SystemInfoNetworkCellularPayloadStruct(wifiInfo) : nil
wifi = wifiInfo.isWifi() ? SystemInfoNetworkWifiPayloadStruct(wifiInfo) : nil
wired = wifiInfo.isWired() ? SystemInfoNetworkWiredPayloadStruct(wifiInfo) : nil
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct XyoSystemInfoNetworkWifiPayloadStruct: Encodable {
struct SystemInfoNetworkWifiPayloadStruct: Encodable {
var ip: String?
var mac: String?
var rssi: Int?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct XyoSystemInfoNetworkWiredPayloadStruct: Encodable {
struct SystemInfoNetworkWiredPayloadStruct: Encodable {
var ip: String?
init(_ wifiInfo: WifiInformation?) {
ip = wifiInfo?.pathMonitor?.ip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation

struct XyoSystemInfoOsPayloadStruct: Encodable {
struct SystemInfoOsPayloadStruct: Encodable {
var name: String
var version = XyoSystemInfoOsVersionPayloadStruct()
var version = SystemInfoOsVersionPayloadStruct()
init() {
name = osName()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct XyoSystemInfoOsVersionPayloadStruct: Encodable {
struct SystemInfoOsVersionPayloadStruct: Encodable {
var major: Int
var minor: Int
var patch: Int
Expand Down
8 changes: 4 additions & 4 deletions Sources/XyoClient/Witness/SystemInfo/SystemInfoPayload.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

open class XyoSystemInfoPayload: Payload {
open class SystemInfoPayload: Payload {

var wifiInfo: WifiInformation

Expand All @@ -18,9 +18,9 @@ open class XyoSystemInfoPayload: Payload {
}
override open func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(XyoSystemInfoDevicePayloadStruct(), forKey: .device)
try container.encode(XyoSystemInfoNetworkPayloadStruct(wifiInfo), forKey: .network)
try container.encode(XyoSystemInfoOsPayloadStruct(), forKey: .os)
try container.encode(SystemInfoDevicePayloadStruct(), forKey: .device)
try container.encode(SystemInfoNetworkPayloadStruct(wifiInfo), forKey: .network)
try container.encode(SystemInfoOsPayloadStruct(), forKey: .os)
try container.encode(self.schema, forKey: .schema)
}
}
4 changes: 2 additions & 2 deletions Sources/XyoClient/Witness/SystemInfo/SystemInfoWitness.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

open class XyoSystemInfoWitness: AbstractWitness {
open class SystemInfoWitness: AbstractWitness {

var allowPathMonitor: Bool

Expand All @@ -9,7 +9,7 @@ open class XyoSystemInfoWitness: AbstractWitness {
}

public override func observe() -> [Payload] {
let payload = XyoSystemInfoPayload(WifiInformation(allowPathMonitor))
let payload = SystemInfoPayload(WifiInformation(allowPathMonitor))
return [payload]
}
}
6 changes: 3 additions & 3 deletions Tests/XyoClientTests/Panel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class PanelTests: XCTestCase {
archive: archive,
apiDomain: apiDomain,
witnesses: [
XyoBasicWitness(observer: {
BasicWitness(observer: {
return Payload("network.xyo.basic")
})
]
Expand All @@ -64,10 +64,10 @@ final class PanelTests: XCTestCase {
archive: archive,
apiDomain: apiDomain,
witnesses: [
XyoBasicWitness(observer: {
BasicWitness(observer: {
return Payload("network.xyo.basic")
}),
XyoSystemInfoWitness(),
SystemInfoWitness(),
]
)
do {
Expand Down

0 comments on commit 4774824

Please sign in to comment.