Meshtastic-Apple/MeshtasticClient/Protobufs/admin.pb.swift
2022-01-23 10:34:30 -08:00

1018 lines
40 KiB
Swift

// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: admin.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
}
///
/// This message is handled by the Admin plugin and is responsible for all settings/channel read/write operations.
/// This message is used to do settings operations to both remote AND local nodes.
/// (Prior to 1.2 these operations were done via special ToRadio operations)
struct AdminMessage {
// 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.
var variant: AdminMessage.OneOf_Variant? = nil
///
/// Set the radio provisioning for this node
var setRadio: RadioConfig {
get {
if case .setRadio(let v)? = variant {return v}
return RadioConfig()
}
set {variant = .setRadio(newValue)}
}
///
/// Set the owner for this node
var setOwner: User {
get {
if case .setOwner(let v)? = variant {return v}
return User()
}
set {variant = .setOwner(newValue)}
}
///
/// Set channels (using the new API).
/// A special channel is the "primary channel".
/// The other records are secondary channels.
/// Note: only one channel can be marked as primary.
/// If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically.
var setChannel: Channel {
get {
if case .setChannel(let v)? = variant {return v}
return Channel()
}
set {variant = .setChannel(newValue)}
}
///
/// Send the current RadioConfig in the response to this message.
var getRadioRequest: Bool {
get {
if case .getRadioRequest(let v)? = variant {return v}
return false
}
set {variant = .getRadioRequest(newValue)}
}
var getRadioResponse: RadioConfig {
get {
if case .getRadioResponse(let v)? = variant {return v}
return RadioConfig()
}
set {variant = .getRadioResponse(newValue)}
}
///
/// Send the specified channel in the response to this message
/// NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
var getChannelRequest: UInt32 {
get {
if case .getChannelRequest(let v)? = variant {return v}
return 0
}
set {variant = .getChannelRequest(newValue)}
}
var getChannelResponse: Channel {
get {
if case .getChannelResponse(let v)? = variant {return v}
return Channel()
}
set {variant = .getChannelResponse(newValue)}
}
///
/// Send the current owner data in the response to this message.
var getOwnerRequest: Bool {
get {
if case .getOwnerRequest(let v)? = variant {return v}
return false
}
set {variant = .getOwnerRequest(newValue)}
}
var getOwnerResponse: User {
get {
if case .getOwnerResponse(let v)? = variant {return v}
return User()
}
set {variant = .getOwnerResponse(newValue)}
}
///
/// Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again.
/// Therefore if setting either of these properties remotely, you must send a confirm_xxx message within 10 minutes.
/// If you fail to do so, the radio will assume loss of comms and revert your changes.
/// These messages are optional when changing the local node.
var confirmSetChannel: Bool {
get {
if case .confirmSetChannel(let v)? = variant {return v}
return false
}
set {variant = .confirmSetChannel(newValue)}
}
var confirmSetRadio: Bool {
get {
if case .confirmSetRadio(let v)? = variant {return v}
return false
}
set {variant = .confirmSetRadio(newValue)}
}
///
/// This message is only supported for the simulator porduino build.
/// If received the simulator will exit successfully.
var exitSimulator: Bool {
get {
if case .exitSimulator(let v)? = variant {return v}
return false
}
set {variant = .exitSimulator(newValue)}
}
///
/// Tell the node to reboot in this many seconds (or <0 to cancel reboot)
var rebootSeconds: Int32 {
get {
if case .rebootSeconds(let v)? = variant {return v}
return 0
}
set {variant = .rebootSeconds(newValue)}
}
///
/// Get the Canned Message Plugin message part1 in the response to this message.
var getCannedMessagePluginPart1Request: Bool {
get {
if case .getCannedMessagePluginPart1Request(let v)? = variant {return v}
return false
}
set {variant = .getCannedMessagePluginPart1Request(newValue)}
}
var getCannedMessagePluginPart1Response: CannedMessagePluginMessagePart1 {
get {
if case .getCannedMessagePluginPart1Response(let v)? = variant {return v}
return CannedMessagePluginMessagePart1()
}
set {variant = .getCannedMessagePluginPart1Response(newValue)}
}
///
/// Get the Canned Message Plugin message part2 in the response to this message.
var getCannedMessagePluginPart2Request: Bool {
get {
if case .getCannedMessagePluginPart2Request(let v)? = variant {return v}
return false
}
set {variant = .getCannedMessagePluginPart2Request(newValue)}
}
var getCannedMessagePluginPart2Response: CannedMessagePluginMessagePart2 {
get {
if case .getCannedMessagePluginPart2Response(let v)? = variant {return v}
return CannedMessagePluginMessagePart2()
}
set {variant = .getCannedMessagePluginPart2Response(newValue)}
}
///
/// Get the Canned Message Plugin message part3 in the response to this message.
var getCannedMessagePluginPart3Request: Bool {
get {
if case .getCannedMessagePluginPart3Request(let v)? = variant {return v}
return false
}
set {variant = .getCannedMessagePluginPart3Request(newValue)}
}
var getCannedMessagePluginPart3Response: CannedMessagePluginMessagePart3 {
get {
if case .getCannedMessagePluginPart3Response(let v)? = variant {return v}
return CannedMessagePluginMessagePart3()
}
set {variant = .getCannedMessagePluginPart3Response(newValue)}
}
///
/// Get the Canned Message Plugin message part4 in the response to this message.
var getCannedMessagePluginPart4Request: Bool {
get {
if case .getCannedMessagePluginPart4Request(let v)? = variant {return v}
return false
}
set {variant = .getCannedMessagePluginPart4Request(newValue)}
}
var getCannedMessagePluginPart4Response: CannedMessagePluginMessagePart4 {
get {
if case .getCannedMessagePluginPart4Response(let v)? = variant {return v}
return CannedMessagePluginMessagePart4()
}
set {variant = .getCannedMessagePluginPart4Response(newValue)}
}
///
/// Get the Canned Message Plugin message part5 in the response to this message.
var getCannedMessagePluginPart5Request: Bool {
get {
if case .getCannedMessagePluginPart5Request(let v)? = variant {return v}
return false
}
set {variant = .getCannedMessagePluginPart5Request(newValue)}
}
var getCannedMessagePluginPart5Response: CannedMessagePluginMessagePart5 {
get {
if case .getCannedMessagePluginPart5Response(let v)? = variant {return v}
return CannedMessagePluginMessagePart5()
}
set {variant = .getCannedMessagePluginPart5Response(newValue)}
}
///
/// Set the canned message plugin part 1 text.
var setCannedMessagePluginPart1: CannedMessagePluginMessagePart1 {
get {
if case .setCannedMessagePluginPart1(let v)? = variant {return v}
return CannedMessagePluginMessagePart1()
}
set {variant = .setCannedMessagePluginPart1(newValue)}
}
///
/// Set the canned message plugin part 2 text.
var setCannedMessagePluginPart2: CannedMessagePluginMessagePart2 {
get {
if case .setCannedMessagePluginPart2(let v)? = variant {return v}
return CannedMessagePluginMessagePart2()
}
set {variant = .setCannedMessagePluginPart2(newValue)}
}
///
/// Set the canned message plugin part 3 text.
var setCannedMessagePluginPart3: CannedMessagePluginMessagePart3 {
get {
if case .setCannedMessagePluginPart3(let v)? = variant {return v}
return CannedMessagePluginMessagePart3()
}
set {variant = .setCannedMessagePluginPart3(newValue)}
}
///
/// Set the canned message plugin part 4 text.
var setCannedMessagePluginPart4: CannedMessagePluginMessagePart4 {
get {
if case .setCannedMessagePluginPart4(let v)? = variant {return v}
return CannedMessagePluginMessagePart4()
}
set {variant = .setCannedMessagePluginPart4(newValue)}
}
///
/// Set the canned message plugin part 5 text.
var setCannedMessagePluginPart5: CannedMessagePluginMessagePart5 {
get {
if case .setCannedMessagePluginPart5(let v)? = variant {return v}
return CannedMessagePluginMessagePart5()
}
set {variant = .setCannedMessagePluginPart5(newValue)}
}
///
/// Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
var shutdownSeconds: Int32 {
get {
if case .shutdownSeconds(let v)? = variant {return v}
return 0
}
set {variant = .shutdownSeconds(newValue)}
}
var unknownFields = SwiftProtobuf.UnknownStorage()
enum OneOf_Variant: Equatable {
///
/// Set the radio provisioning for this node
case setRadio(RadioConfig)
///
/// Set the owner for this node
case setOwner(User)
///
/// Set channels (using the new API).
/// A special channel is the "primary channel".
/// The other records are secondary channels.
/// Note: only one channel can be marked as primary.
/// If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically.
case setChannel(Channel)
///
/// Send the current RadioConfig in the response to this message.
case getRadioRequest(Bool)
case getRadioResponse(RadioConfig)
///
/// Send the specified channel in the response to this message
/// NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present)
case getChannelRequest(UInt32)
case getChannelResponse(Channel)
///
/// Send the current owner data in the response to this message.
case getOwnerRequest(Bool)
case getOwnerResponse(User)
///
/// Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again.
/// Therefore if setting either of these properties remotely, you must send a confirm_xxx message within 10 minutes.
/// If you fail to do so, the radio will assume loss of comms and revert your changes.
/// These messages are optional when changing the local node.
case confirmSetChannel(Bool)
case confirmSetRadio(Bool)
///
/// This message is only supported for the simulator porduino build.
/// If received the simulator will exit successfully.
case exitSimulator(Bool)
///
/// Tell the node to reboot in this many seconds (or <0 to cancel reboot)
case rebootSeconds(Int32)
///
/// Get the Canned Message Plugin message part1 in the response to this message.
case getCannedMessagePluginPart1Request(Bool)
case getCannedMessagePluginPart1Response(CannedMessagePluginMessagePart1)
///
/// Get the Canned Message Plugin message part2 in the response to this message.
case getCannedMessagePluginPart2Request(Bool)
case getCannedMessagePluginPart2Response(CannedMessagePluginMessagePart2)
///
/// Get the Canned Message Plugin message part3 in the response to this message.
case getCannedMessagePluginPart3Request(Bool)
case getCannedMessagePluginPart3Response(CannedMessagePluginMessagePart3)
///
/// Get the Canned Message Plugin message part4 in the response to this message.
case getCannedMessagePluginPart4Request(Bool)
case getCannedMessagePluginPart4Response(CannedMessagePluginMessagePart4)
///
/// Get the Canned Message Plugin message part5 in the response to this message.
case getCannedMessagePluginPart5Request(Bool)
case getCannedMessagePluginPart5Response(CannedMessagePluginMessagePart5)
///
/// Set the canned message plugin part 1 text.
case setCannedMessagePluginPart1(CannedMessagePluginMessagePart1)
///
/// Set the canned message plugin part 2 text.
case setCannedMessagePluginPart2(CannedMessagePluginMessagePart2)
///
/// Set the canned message plugin part 3 text.
case setCannedMessagePluginPart3(CannedMessagePluginMessagePart3)
///
/// Set the canned message plugin part 4 text.
case setCannedMessagePluginPart4(CannedMessagePluginMessagePart4)
///
/// Set the canned message plugin part 5 text.
case setCannedMessagePluginPart5(CannedMessagePluginMessagePart5)
///
/// Tell the node to shutdown in this many seconds (or <0 to cancel shutdown)
case shutdownSeconds(Int32)
#if !swift(>=4.1)
static func ==(lhs: AdminMessage.OneOf_Variant, rhs: AdminMessage.OneOf_Variant) -> Bool {
// 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 (lhs, rhs) {
case (.setRadio, .setRadio): return {
guard case .setRadio(let l) = lhs, case .setRadio(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setOwner, .setOwner): return {
guard case .setOwner(let l) = lhs, case .setOwner(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setChannel, .setChannel): return {
guard case .setChannel(let l) = lhs, case .setChannel(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getRadioRequest, .getRadioRequest): return {
guard case .getRadioRequest(let l) = lhs, case .getRadioRequest(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getRadioResponse, .getRadioResponse): return {
guard case .getRadioResponse(let l) = lhs, case .getRadioResponse(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getChannelRequest, .getChannelRequest): return {
guard case .getChannelRequest(let l) = lhs, case .getChannelRequest(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getChannelResponse, .getChannelResponse): return {
guard case .getChannelResponse(let l) = lhs, case .getChannelResponse(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getOwnerRequest, .getOwnerRequest): return {
guard case .getOwnerRequest(let l) = lhs, case .getOwnerRequest(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getOwnerResponse, .getOwnerResponse): return {
guard case .getOwnerResponse(let l) = lhs, case .getOwnerResponse(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.confirmSetChannel, .confirmSetChannel): return {
guard case .confirmSetChannel(let l) = lhs, case .confirmSetChannel(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.confirmSetRadio, .confirmSetRadio): return {
guard case .confirmSetRadio(let l) = lhs, case .confirmSetRadio(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.exitSimulator, .exitSimulator): return {
guard case .exitSimulator(let l) = lhs, case .exitSimulator(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.rebootSeconds, .rebootSeconds): return {
guard case .rebootSeconds(let l) = lhs, case .rebootSeconds(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart1Request, .getCannedMessagePluginPart1Request): return {
guard case .getCannedMessagePluginPart1Request(let l) = lhs, case .getCannedMessagePluginPart1Request(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart1Response, .getCannedMessagePluginPart1Response): return {
guard case .getCannedMessagePluginPart1Response(let l) = lhs, case .getCannedMessagePluginPart1Response(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart2Request, .getCannedMessagePluginPart2Request): return {
guard case .getCannedMessagePluginPart2Request(let l) = lhs, case .getCannedMessagePluginPart2Request(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart2Response, .getCannedMessagePluginPart2Response): return {
guard case .getCannedMessagePluginPart2Response(let l) = lhs, case .getCannedMessagePluginPart2Response(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart3Request, .getCannedMessagePluginPart3Request): return {
guard case .getCannedMessagePluginPart3Request(let l) = lhs, case .getCannedMessagePluginPart3Request(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart3Response, .getCannedMessagePluginPart3Response): return {
guard case .getCannedMessagePluginPart3Response(let l) = lhs, case .getCannedMessagePluginPart3Response(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart4Request, .getCannedMessagePluginPart4Request): return {
guard case .getCannedMessagePluginPart4Request(let l) = lhs, case .getCannedMessagePluginPart4Request(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart4Response, .getCannedMessagePluginPart4Response): return {
guard case .getCannedMessagePluginPart4Response(let l) = lhs, case .getCannedMessagePluginPart4Response(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart5Request, .getCannedMessagePluginPart5Request): return {
guard case .getCannedMessagePluginPart5Request(let l) = lhs, case .getCannedMessagePluginPart5Request(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.getCannedMessagePluginPart5Response, .getCannedMessagePluginPart5Response): return {
guard case .getCannedMessagePluginPart5Response(let l) = lhs, case .getCannedMessagePluginPart5Response(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setCannedMessagePluginPart1, .setCannedMessagePluginPart1): return {
guard case .setCannedMessagePluginPart1(let l) = lhs, case .setCannedMessagePluginPart1(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setCannedMessagePluginPart2, .setCannedMessagePluginPart2): return {
guard case .setCannedMessagePluginPart2(let l) = lhs, case .setCannedMessagePluginPart2(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setCannedMessagePluginPart3, .setCannedMessagePluginPart3): return {
guard case .setCannedMessagePluginPart3(let l) = lhs, case .setCannedMessagePluginPart3(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setCannedMessagePluginPart4, .setCannedMessagePluginPart4): return {
guard case .setCannedMessagePluginPart4(let l) = lhs, case .setCannedMessagePluginPart4(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.setCannedMessagePluginPart5, .setCannedMessagePluginPart5): return {
guard case .setCannedMessagePluginPart5(let l) = lhs, case .setCannedMessagePluginPart5(let r) = rhs else { preconditionFailure() }
return l == r
}()
case (.shutdownSeconds, .shutdownSeconds): return {
guard case .shutdownSeconds(let l) = lhs, case .shutdownSeconds(let r) = rhs else { preconditionFailure() }
return l == r
}()
default: return false
}
}
#endif
}
init() {}
}
// MARK: - Code below here is support for the SwiftProtobuf runtime.
extension AdminMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = "AdminMessage"
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "set_radio"),
2: .standard(proto: "set_owner"),
3: .standard(proto: "set_channel"),
4: .standard(proto: "get_radio_request"),
5: .standard(proto: "get_radio_response"),
6: .standard(proto: "get_channel_request"),
7: .standard(proto: "get_channel_response"),
8: .standard(proto: "get_owner_request"),
9: .standard(proto: "get_owner_response"),
32: .standard(proto: "confirm_set_channel"),
33: .standard(proto: "confirm_set_radio"),
34: .standard(proto: "exit_simulator"),
35: .standard(proto: "reboot_seconds"),
36: .standard(proto: "get_canned_message_plugin_part1_request"),
37: .standard(proto: "get_canned_message_plugin_part1_response"),
38: .standard(proto: "get_canned_message_plugin_part2_request"),
39: .standard(proto: "get_canned_message_plugin_part2_response"),
40: .standard(proto: "get_canned_message_plugin_part3_request"),
41: .standard(proto: "get_canned_message_plugin_part3_response"),
42: .standard(proto: "get_canned_message_plugin_part4_request"),
43: .standard(proto: "get_canned_message_plugin_part4_response"),
44: .standard(proto: "get_canned_message_plugin_part5_request"),
45: .standard(proto: "get_canned_message_plugin_part5_response"),
46: .standard(proto: "set_canned_message_plugin_part1"),
47: .standard(proto: "set_canned_message_plugin_part2"),
48: .standard(proto: "set_canned_message_plugin_part3"),
49: .standard(proto: "set_canned_message_plugin_part4"),
50: .standard(proto: "set_canned_message_plugin_part5"),
51: .standard(proto: "shutdown_seconds"),
]
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 {
var v: RadioConfig?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setRadio(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setRadio(v)
}
}()
case 2: try {
var v: User?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setOwner(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setOwner(v)
}
}()
case 3: try {
var v: Channel?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setChannel(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setChannel(v)
}
}()
case 4: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getRadioRequest(v)
}
}()
case 5: try {
var v: RadioConfig?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getRadioResponse(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getRadioResponse(v)
}
}()
case 6: try {
var v: UInt32?
try decoder.decodeSingularUInt32Field(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getChannelRequest(v)
}
}()
case 7: try {
var v: Channel?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getChannelResponse(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getChannelResponse(v)
}
}()
case 8: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getOwnerRequest(v)
}
}()
case 9: try {
var v: User?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getOwnerResponse(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getOwnerResponse(v)
}
}()
case 32: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .confirmSetChannel(v)
}
}()
case 33: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .confirmSetRadio(v)
}
}()
case 34: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .exitSimulator(v)
}
}()
case 35: try {
var v: Int32?
try decoder.decodeSingularInt32Field(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .rebootSeconds(v)
}
}()
case 36: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart1Request(v)
}
}()
case 37: try {
var v: CannedMessagePluginMessagePart1?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getCannedMessagePluginPart1Response(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart1Response(v)
}
}()
case 38: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart2Request(v)
}
}()
case 39: try {
var v: CannedMessagePluginMessagePart2?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getCannedMessagePluginPart2Response(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart2Response(v)
}
}()
case 40: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart3Request(v)
}
}()
case 41: try {
var v: CannedMessagePluginMessagePart3?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getCannedMessagePluginPart3Response(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart3Response(v)
}
}()
case 42: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart4Request(v)
}
}()
case 43: try {
var v: CannedMessagePluginMessagePart4?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getCannedMessagePluginPart4Response(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart4Response(v)
}
}()
case 44: try {
var v: Bool?
try decoder.decodeSingularBoolField(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart5Request(v)
}
}()
case 45: try {
var v: CannedMessagePluginMessagePart5?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .getCannedMessagePluginPart5Response(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .getCannedMessagePluginPart5Response(v)
}
}()
case 46: try {
var v: CannedMessagePluginMessagePart1?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setCannedMessagePluginPart1(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setCannedMessagePluginPart1(v)
}
}()
case 47: try {
var v: CannedMessagePluginMessagePart2?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setCannedMessagePluginPart2(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setCannedMessagePluginPart2(v)
}
}()
case 48: try {
var v: CannedMessagePluginMessagePart3?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setCannedMessagePluginPart3(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setCannedMessagePluginPart3(v)
}
}()
case 49: try {
var v: CannedMessagePluginMessagePart4?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setCannedMessagePluginPart4(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setCannedMessagePluginPart4(v)
}
}()
case 50: try {
var v: CannedMessagePluginMessagePart5?
var hadOneofValue = false
if let current = self.variant {
hadOneofValue = true
if case .setCannedMessagePluginPart5(let m) = current {v = m}
}
try decoder.decodeSingularMessageField(value: &v)
if let v = v {
if hadOneofValue {try decoder.handleConflictingOneOf()}
self.variant = .setCannedMessagePluginPart5(v)
}
}()
case 51: try {
var v: Int32?
try decoder.decodeSingularInt32Field(value: &v)
if let v = v {
if self.variant != nil {try decoder.handleConflictingOneOf()}
self.variant = .shutdownSeconds(v)
}
}()
default: break
}
}
}
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
// 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 self.variant {
case .setRadio?: try {
guard case .setRadio(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
}()
case .setOwner?: try {
guard case .setOwner(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
}()
case .setChannel?: try {
guard case .setChannel(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
}()
case .getRadioRequest?: try {
guard case .getRadioRequest(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 4)
}()
case .getRadioResponse?: try {
guard case .getRadioResponse(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
}()
case .getChannelRequest?: try {
guard case .getChannelRequest(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 6)
}()
case .getChannelResponse?: try {
guard case .getChannelResponse(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
}()
case .getOwnerRequest?: try {
guard case .getOwnerRequest(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 8)
}()
case .getOwnerResponse?: try {
guard case .getOwnerResponse(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 9)
}()
case .confirmSetChannel?: try {
guard case .confirmSetChannel(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 32)
}()
case .confirmSetRadio?: try {
guard case .confirmSetRadio(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 33)
}()
case .exitSimulator?: try {
guard case .exitSimulator(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 34)
}()
case .rebootSeconds?: try {
guard case .rebootSeconds(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularInt32Field(value: v, fieldNumber: 35)
}()
case .getCannedMessagePluginPart1Request?: try {
guard case .getCannedMessagePluginPart1Request(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 36)
}()
case .getCannedMessagePluginPart1Response?: try {
guard case .getCannedMessagePluginPart1Response(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 37)
}()
case .getCannedMessagePluginPart2Request?: try {
guard case .getCannedMessagePluginPart2Request(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 38)
}()
case .getCannedMessagePluginPart2Response?: try {
guard case .getCannedMessagePluginPart2Response(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 39)
}()
case .getCannedMessagePluginPart3Request?: try {
guard case .getCannedMessagePluginPart3Request(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 40)
}()
case .getCannedMessagePluginPart3Response?: try {
guard case .getCannedMessagePluginPart3Response(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 41)
}()
case .getCannedMessagePluginPart4Request?: try {
guard case .getCannedMessagePluginPart4Request(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 42)
}()
case .getCannedMessagePluginPart4Response?: try {
guard case .getCannedMessagePluginPart4Response(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 43)
}()
case .getCannedMessagePluginPart5Request?: try {
guard case .getCannedMessagePluginPart5Request(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularBoolField(value: v, fieldNumber: 44)
}()
case .getCannedMessagePluginPart5Response?: try {
guard case .getCannedMessagePluginPart5Response(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 45)
}()
case .setCannedMessagePluginPart1?: try {
guard case .setCannedMessagePluginPart1(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 46)
}()
case .setCannedMessagePluginPart2?: try {
guard case .setCannedMessagePluginPart2(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 47)
}()
case .setCannedMessagePluginPart3?: try {
guard case .setCannedMessagePluginPart3(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 48)
}()
case .setCannedMessagePluginPart4?: try {
guard case .setCannedMessagePluginPart4(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 49)
}()
case .setCannedMessagePluginPart5?: try {
guard case .setCannedMessagePluginPart5(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularMessageField(value: v, fieldNumber: 50)
}()
case .shutdownSeconds?: try {
guard case .shutdownSeconds(let v)? = self.variant else { preconditionFailure() }
try visitor.visitSingularInt32Field(value: v, fieldNumber: 51)
}()
case nil: break
}
try unknownFields.traverse(visitor: &visitor)
}
static func ==(lhs: AdminMessage, rhs: AdminMessage) -> Bool {
if lhs.variant != rhs.variant {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}