// DO NOT EDIT. // swift-format-ignore-file // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: device_metadata.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. // Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// /// Device metadata response struct DeviceMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. /// /// Device firmware version string var firmwareVersion: String = String() /// /// Device state version var deviceStateVersion: UInt32 = 0 /// /// Indicates whether the device can shutdown CPU natively or via power management chip var canShutdown: Bool = false /// /// Indicates that the device has native wifi capability var hasWifi_p: Bool = false /// /// Indicates that the device has native bluetooth capability var hasBluetooth_p: Bool = false /// /// Indicates that the device has an ethernet peripheral var hasEthernet_p: Bool = false var unknownFields = SwiftProtobuf.UnknownStorage() init() {} } #if swift(>=5.5) && canImport(_Concurrency) extension DeviceMetadata: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. extension DeviceMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = "DeviceMetadata" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "firmware_version"), 2: .standard(proto: "device_state_version"), 3: .same(proto: "canShutdown"), 4: .same(proto: "hasWifi"), 5: .same(proto: "hasBluetooth"), 6: .same(proto: "hasEthernet"), ] mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self.firmwareVersion) }() case 2: try { try decoder.decodeSingularUInt32Field(value: &self.deviceStateVersion) }() case 3: try { try decoder.decodeSingularBoolField(value: &self.canShutdown) }() case 4: try { try decoder.decodeSingularBoolField(value: &self.hasWifi_p) }() case 5: try { try decoder.decodeSingularBoolField(value: &self.hasBluetooth_p) }() case 6: try { try decoder.decodeSingularBoolField(value: &self.hasEthernet_p) }() default: break } } } func traverse(visitor: inout V) throws { if !self.firmwareVersion.isEmpty { try visitor.visitSingularStringField(value: self.firmwareVersion, fieldNumber: 1) } if self.deviceStateVersion != 0 { try visitor.visitSingularUInt32Field(value: self.deviceStateVersion, fieldNumber: 2) } if self.canShutdown != false { try visitor.visitSingularBoolField(value: self.canShutdown, fieldNumber: 3) } if self.hasWifi_p != false { try visitor.visitSingularBoolField(value: self.hasWifi_p, fieldNumber: 4) } if self.hasBluetooth_p != false { try visitor.visitSingularBoolField(value: self.hasBluetooth_p, fieldNumber: 5) } if self.hasEthernet_p != false { try visitor.visitSingularBoolField(value: self.hasEthernet_p, fieldNumber: 6) } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: DeviceMetadata, rhs: DeviceMetadata) -> Bool { if lhs.firmwareVersion != rhs.firmwareVersion {return false} if lhs.deviceStateVersion != rhs.deviceStateVersion {return false} if lhs.canShutdown != rhs.canShutdown {return false} if lhs.hasWifi_p != rhs.hasWifi_p {return false} if lhs.hasBluetooth_p != rhs.hasBluetooth_p {return false} if lhs.hasEthernet_p != rhs.hasEthernet_p {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } }