XYOracleNetwork/sdk-xyo-client-swift

View on GitHub
Sources/XyoClient/XyoWitness/SystemInfo/SystemInfoNetworkPayloadStruct.swift

Summary

Maintainability
A
0 mins
Test Coverage
import Foundation

struct XyoSystemInfoNetworkPayloadStruct: Encodable {
    var cellular: XyoSystemInfoNetworkCellularPayloadStruct?
    var wifi: XyoSystemInfoNetworkWifiPayloadStruct?
    var wired: XyoSystemInfoNetworkWiredPayloadStruct?
    
    init(_ wifiInfo: WifiInformation) {
        cellular = wifiInfo.isCellular() ? XyoSystemInfoNetworkCellularPayloadStruct(wifiInfo) : nil
        wifi = wifiInfo.isWifi() ? XyoSystemInfoNetworkWifiPayloadStruct(wifiInfo) : nil
        wired = wifiInfo.isWired() ? XyoSystemInfoNetworkWiredPayloadStruct(wifiInfo) : nil
    }
}