//
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//

// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: svr2.proto
//
// For information on using the generated types, please see the documentation:
//   https://github.com/apple/swift-protobuf/

//
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only

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
}

struct SVR2Proto_Request {
  // 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.

  /// oneof inner {
  var backup: SVR2Proto_BackupRequest {
    get {return _backup ?? SVR2Proto_BackupRequest()}
    set {_backup = newValue}
  }
  /// Returns true if `backup` has been explicitly set.
  var hasBackup: Bool {return self._backup != nil}
  /// Clears the value of `backup`. Subsequent reads from it will return its default value.
  mutating func clearBackup() {self._backup = nil}

  var expose: SVR2Proto_ExposeRequest {
    get {return _expose ?? SVR2Proto_ExposeRequest()}
    set {_expose = newValue}
  }
  /// Returns true if `expose` has been explicitly set.
  var hasExpose: Bool {return self._expose != nil}
  /// Clears the value of `expose`. Subsequent reads from it will return its default value.
  mutating func clearExpose() {self._expose = nil}

  var restore: SVR2Proto_RestoreRequest {
    get {return _restore ?? SVR2Proto_RestoreRequest()}
    set {_restore = newValue}
  }
  /// Returns true if `restore` has been explicitly set.
  var hasRestore: Bool {return self._restore != nil}
  /// Clears the value of `restore`. Subsequent reads from it will return its default value.
  mutating func clearRestore() {self._restore = nil}

  /// }
  var delete: SVR2Proto_DeleteRequest {
    get {return _delete ?? SVR2Proto_DeleteRequest()}
    set {_delete = newValue}
  }
  /// Returns true if `delete` has been explicitly set.
  var hasDelete: Bool {return self._delete != nil}
  /// Clears the value of `delete`. Subsequent reads from it will return its default value.
  mutating func clearDelete() {self._delete = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _backup: SVR2Proto_BackupRequest? = nil
  fileprivate var _expose: SVR2Proto_ExposeRequest? = nil
  fileprivate var _restore: SVR2Proto_RestoreRequest? = nil
  fileprivate var _delete: SVR2Proto_DeleteRequest? = nil
}

struct SVR2Proto_Response {
  // 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.

  /// oneof inner {
  var backup: SVR2Proto_BackupResponse {
    get {return _backup ?? SVR2Proto_BackupResponse()}
    set {_backup = newValue}
  }
  /// Returns true if `backup` has been explicitly set.
  var hasBackup: Bool {return self._backup != nil}
  /// Clears the value of `backup`. Subsequent reads from it will return its default value.
  mutating func clearBackup() {self._backup = nil}

  var expose: SVR2Proto_ExposeResponse {
    get {return _expose ?? SVR2Proto_ExposeResponse()}
    set {_expose = newValue}
  }
  /// Returns true if `expose` has been explicitly set.
  var hasExpose: Bool {return self._expose != nil}
  /// Clears the value of `expose`. Subsequent reads from it will return its default value.
  mutating func clearExpose() {self._expose = nil}

  var restore: SVR2Proto_RestoreResponse {
    get {return _restore ?? SVR2Proto_RestoreResponse()}
    set {_restore = newValue}
  }
  /// Returns true if `restore` has been explicitly set.
  var hasRestore: Bool {return self._restore != nil}
  /// Clears the value of `restore`. Subsequent reads from it will return its default value.
  mutating func clearRestore() {self._restore = nil}

  /// }
  var delete: SVR2Proto_DeleteResponse {
    get {return _delete ?? SVR2Proto_DeleteResponse()}
    set {_delete = newValue}
  }
  /// Returns true if `delete` has been explicitly set.
  var hasDelete: Bool {return self._delete != nil}
  /// Clears the value of `delete`. Subsequent reads from it will return its default value.
  mutating func clearDelete() {self._delete = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _backup: SVR2Proto_BackupResponse? = nil
  fileprivate var _expose: SVR2Proto_ExposeResponse? = nil
  fileprivate var _restore: SVR2Proto_RestoreResponse? = nil
  fileprivate var _delete: SVR2Proto_DeleteResponse? = nil
}

struct SVR2Proto_BackupRequest {
  // 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.

  /// If the backup_id does not already exist, a new backup will be created
  ///
  /// If a backup already exists, it will be overwritten and response will have 
  /// status=OK.
  var data: Data = Data()

  /// 32 bytes
  var pin: Data = Data()

  /// in range [1,255]
  var maxTries: UInt32 = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct SVR2Proto_BackupResponse {
  // 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 status: SVR2Proto_BackupResponse.Status = .unset

  var unknownFields = SwiftProtobuf.UnknownStorage()

  enum Status: SwiftProtobuf.Enum {
    typealias RawValue = Int

    /// never returned
    case unset // = 0

    /// successfully set db[backup_id]=data
    case ok // = 1
    case UNRECOGNIZED(Int)

    init() {
      self = .unset
    }

    init?(rawValue: Int) {
      switch rawValue {
      case 0: self = .unset
      case 1: self = .ok
      default: self = .UNRECOGNIZED(rawValue)
      }
    }

    var rawValue: Int {
      switch self {
      case .unset: return 0
      case .ok: return 1
      case .UNRECOGNIZED(let i): return i
      }
    }

  }

  init() {}
}

#if swift(>=4.2)

extension SVR2Proto_BackupResponse.Status: CaseIterable {
  // The compiler won't synthesize support with the UNRECOGNIZED case.
  static let allCases: [SVR2Proto_BackupResponse.Status] = [
    .unset,
    .ok,
  ]
}

#endif  // swift(>=4.2)

struct SVR2Proto_RestoreRequest {
  // 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.

  /// 32 bytes
  var pin: Data = Data()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct SVR2Proto_RestoreResponse {
  // 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 status: SVR2Proto_RestoreResponse.Status = .unset

  /// between 16 and 48 bytes, if set
  var data: Data = Data()

  /// in range [0,255]
  var tries: UInt32 = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  enum Status: SwiftProtobuf.Enum {
    typealias RawValue = Int

    /// never returned
    case unset // = 0

    /// successfully restored, [data] will be set
    case ok // = 1

    /// db[backup_id] does not exist
    case missing // = 2

    /// pin did not match, tries were decremented
    case pinMismatch // = 3
    case UNRECOGNIZED(Int)

    init() {
      self = .unset
    }

    init?(rawValue: Int) {
      switch rawValue {
      case 0: self = .unset
      case 1: self = .ok
      case 2: self = .missing
      case 3: self = .pinMismatch
      default: self = .UNRECOGNIZED(rawValue)
      }
    }

    var rawValue: Int {
      switch self {
      case .unset: return 0
      case .ok: return 1
      case .missing: return 2
      case .pinMismatch: return 3
      case .UNRECOGNIZED(let i): return i
      }
    }

  }

  init() {}
}

#if swift(>=4.2)

extension SVR2Proto_RestoreResponse.Status: CaseIterable {
  // The compiler won't synthesize support with the UNRECOGNIZED case.
  static let allCases: [SVR2Proto_RestoreResponse.Status] = [
    .unset,
    .ok,
    .missing,
    .pinMismatch,
  ]
}

#endif  // swift(>=4.2)

struct SVR2Proto_DeleteRequest {
  // 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 unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct SVR2Proto_DeleteResponse {
  // 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 unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct SVR2Proto_ExposeRequest {
  // 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 data: Data = Data()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct SVR2Proto_ExposeResponse {
  // 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 status: SVR2Proto_ExposeResponse.Status = .unset

  var unknownFields = SwiftProtobuf.UnknownStorage()

  enum Status: SwiftProtobuf.Enum {
    typealias RawValue = Int

    /// never returned
    case unset // = 0

    /// successfully restored, [data] will be set
    case ok // = 1

    /// If this status comes back after a successful Backup() call,
    /// this should be cause for concern.
    /// It means that someone has either reset, deleted, or tried to brute-force
    /// the backup since it was created.
    case error // = 2
    case UNRECOGNIZED(Int)

    init() {
      self = .unset
    }

    init?(rawValue: Int) {
      switch rawValue {
      case 0: self = .unset
      case 1: self = .ok
      case 2: self = .error
      default: self = .UNRECOGNIZED(rawValue)
      }
    }

    var rawValue: Int {
      switch self {
      case .unset: return 0
      case .ok: return 1
      case .error: return 2
      case .UNRECOGNIZED(let i): return i
      }
    }

  }

  init() {}
}

#if swift(>=4.2)

extension SVR2Proto_ExposeResponse.Status: CaseIterable {
  // The compiler won't synthesize support with the UNRECOGNIZED case.
  static let allCases: [SVR2Proto_ExposeResponse.Status] = [
    .unset,
    .ok,
    .error,
  ]
}

#endif  // swift(>=4.2)

struct SVR2Proto_ClientHandshakeStart {
  // 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.

  /// Public key associated with this server's enclave. For use in test-only
  /// contexts where attestation is not available
  var testOnlyPubkey: Data = Data()

  /// Remote-attestation evidence associated with the public key
  var evidence: Data = Data()

  /// Endorsements of remote-attestation evidence.
  var endorsement: Data = Data()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

/// RaftGroupConfig is a configuration shared by members of a Raft group.
/// It's created only once, on creation of the Raft group.  From that
/// point forward, it's shared between replicas as they're added to the
/// group, and it's not possible to modify it externally.
///
/// An attested RaftGroupConfig will be returned as part of the evidence.
/// Clients must validate that the attested configuration matches their
/// expected configuration.
struct SVR2Proto_RaftGroupConfig {
  // 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.

  /// The unique group id for the raft group
  var groupID: UInt64 = 0

  /// This raft group will refuse to serve client request with
  /// <min_voting_replicas, and will refuse to add new voting members
  /// when max_voting_replicas has been reached.
  var minVotingReplicas: UInt32 = 0

  var maxVotingReplicas: UInt32 = 0

  /// Anything which, in normal Raft, would require quorum() participants
  /// to push forward will instead require quorum() + super_majority.  Should
  /// there be fewer than super_majority total nodes in the Raft, all Raft
  /// nodes will be required.
  var superMajority: UInt32 = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

#if swift(>=5.5) && canImport(_Concurrency)
extension SVR2Proto_Request: @unchecked Sendable {}
extension SVR2Proto_Response: @unchecked Sendable {}
extension SVR2Proto_BackupRequest: @unchecked Sendable {}
extension SVR2Proto_BackupResponse: @unchecked Sendable {}
extension SVR2Proto_BackupResponse.Status: @unchecked Sendable {}
extension SVR2Proto_RestoreRequest: @unchecked Sendable {}
extension SVR2Proto_RestoreResponse: @unchecked Sendable {}
extension SVR2Proto_RestoreResponse.Status: @unchecked Sendable {}
extension SVR2Proto_DeleteRequest: @unchecked Sendable {}
extension SVR2Proto_DeleteResponse: @unchecked Sendable {}
extension SVR2Proto_ExposeRequest: @unchecked Sendable {}
extension SVR2Proto_ExposeResponse: @unchecked Sendable {}
extension SVR2Proto_ExposeResponse.Status: @unchecked Sendable {}
extension SVR2Proto_ClientHandshakeStart: @unchecked Sendable {}
extension SVR2Proto_RaftGroupConfig: @unchecked Sendable {}
#endif  // swift(>=5.5) && canImport(_Concurrency)

// MARK: - Code below here is support for the SwiftProtobuf runtime.

fileprivate let _protobuf_package = "SVR2Proto"

extension SVR2Proto_Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Request"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    2: .same(proto: "backup"),
    5: .same(proto: "expose"),
    3: .same(proto: "restore"),
    4: .same(proto: "delete"),
  ]

  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 2: try { try decoder.decodeSingularMessageField(value: &self._backup) }()
      case 3: try { try decoder.decodeSingularMessageField(value: &self._restore) }()
      case 4: try { try decoder.decodeSingularMessageField(value: &self._delete) }()
      case 5: try { try decoder.decodeSingularMessageField(value: &self._expose) }()
      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 if/case branch local when no optimizations
    // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
    // https://github.com/apple/swift-protobuf/issues/1182
    try { if let v = self._backup {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
    } }()
    try { if let v = self._restore {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
    } }()
    try { if let v = self._delete {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
    } }()
    try { if let v = self._expose {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
    } }()
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_Request, rhs: SVR2Proto_Request) -> Bool {
    if lhs._backup != rhs._backup {return false}
    if lhs._expose != rhs._expose {return false}
    if lhs._restore != rhs._restore {return false}
    if lhs._delete != rhs._delete {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Response"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "backup"),
    4: .same(proto: "expose"),
    2: .same(proto: "restore"),
    3: .same(proto: "delete"),
  ]

  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 { try decoder.decodeSingularMessageField(value: &self._backup) }()
      case 2: try { try decoder.decodeSingularMessageField(value: &self._restore) }()
      case 3: try { try decoder.decodeSingularMessageField(value: &self._delete) }()
      case 4: try { try decoder.decodeSingularMessageField(value: &self._expose) }()
      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 if/case branch local when no optimizations
    // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
    // https://github.com/apple/swift-protobuf/issues/1182
    try { if let v = self._backup {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
    } }()
    try { if let v = self._restore {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
    } }()
    try { if let v = self._delete {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
    } }()
    try { if let v = self._expose {
      try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
    } }()
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_Response, rhs: SVR2Proto_Response) -> Bool {
    if lhs._backup != rhs._backup {return false}
    if lhs._expose != rhs._expose {return false}
    if lhs._restore != rhs._restore {return false}
    if lhs._delete != rhs._delete {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_BackupRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".BackupRequest"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "data"),
    2: .same(proto: "pin"),
    3: .standard(proto: "max_tries"),
  ]

  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 { try decoder.decodeSingularBytesField(value: &self.data) }()
      case 2: try { try decoder.decodeSingularBytesField(value: &self.pin) }()
      case 3: try { try decoder.decodeSingularUInt32Field(value: &self.maxTries) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.data.isEmpty {
      try visitor.visitSingularBytesField(value: self.data, fieldNumber: 1)
    }
    if !self.pin.isEmpty {
      try visitor.visitSingularBytesField(value: self.pin, fieldNumber: 2)
    }
    if self.maxTries != 0 {
      try visitor.visitSingularUInt32Field(value: self.maxTries, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_BackupRequest, rhs: SVR2Proto_BackupRequest) -> Bool {
    if lhs.data != rhs.data {return false}
    if lhs.pin != rhs.pin {return false}
    if lhs.maxTries != rhs.maxTries {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_BackupResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".BackupResponse"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "status"),
  ]

  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 { try decoder.decodeSingularEnumField(value: &self.status) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.status != .unset {
      try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_BackupResponse, rhs: SVR2Proto_BackupResponse) -> Bool {
    if lhs.status != rhs.status {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_BackupResponse.Status: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "UNSET"),
    1: .same(proto: "OK"),
  ]
}

extension SVR2Proto_RestoreRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".RestoreRequest"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "pin"),
  ]

  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 { try decoder.decodeSingularBytesField(value: &self.pin) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.pin.isEmpty {
      try visitor.visitSingularBytesField(value: self.pin, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_RestoreRequest, rhs: SVR2Proto_RestoreRequest) -> Bool {
    if lhs.pin != rhs.pin {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_RestoreResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".RestoreResponse"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "status"),
    2: .same(proto: "data"),
    3: .same(proto: "tries"),
  ]

  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 { try decoder.decodeSingularEnumField(value: &self.status) }()
      case 2: try { try decoder.decodeSingularBytesField(value: &self.data) }()
      case 3: try { try decoder.decodeSingularUInt32Field(value: &self.tries) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.status != .unset {
      try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1)
    }
    if !self.data.isEmpty {
      try visitor.visitSingularBytesField(value: self.data, fieldNumber: 2)
    }
    if self.tries != 0 {
      try visitor.visitSingularUInt32Field(value: self.tries, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_RestoreResponse, rhs: SVR2Proto_RestoreResponse) -> Bool {
    if lhs.status != rhs.status {return false}
    if lhs.data != rhs.data {return false}
    if lhs.tries != rhs.tries {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_RestoreResponse.Status: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "UNSET"),
    1: .same(proto: "OK"),
    2: .same(proto: "MISSING"),
    3: .same(proto: "PIN_MISMATCH"),
  ]
}

extension SVR2Proto_DeleteRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".DeleteRequest"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap()

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let _ = try decoder.nextFieldNumber() {
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_DeleteRequest, rhs: SVR2Proto_DeleteRequest) -> Bool {
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_DeleteResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".DeleteResponse"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap()

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let _ = try decoder.nextFieldNumber() {
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_DeleteResponse, rhs: SVR2Proto_DeleteResponse) -> Bool {
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_ExposeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".ExposeRequest"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "data"),
  ]

  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 { try decoder.decodeSingularBytesField(value: &self.data) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.data.isEmpty {
      try visitor.visitSingularBytesField(value: self.data, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_ExposeRequest, rhs: SVR2Proto_ExposeRequest) -> Bool {
    if lhs.data != rhs.data {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_ExposeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".ExposeResponse"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "status"),
  ]

  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 { try decoder.decodeSingularEnumField(value: &self.status) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.status != .unset {
      try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_ExposeResponse, rhs: SVR2Proto_ExposeResponse) -> Bool {
    if lhs.status != rhs.status {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_ExposeResponse.Status: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "UNSET"),
    1: .same(proto: "OK"),
    2: .same(proto: "ERROR"),
  ]
}

extension SVR2Proto_ClientHandshakeStart: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".ClientHandshakeStart"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "test_only_pubkey"),
    2: .same(proto: "evidence"),
    3: .same(proto: "endorsement"),
  ]

  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 { try decoder.decodeSingularBytesField(value: &self.testOnlyPubkey) }()
      case 2: try { try decoder.decodeSingularBytesField(value: &self.evidence) }()
      case 3: try { try decoder.decodeSingularBytesField(value: &self.endorsement) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.testOnlyPubkey.isEmpty {
      try visitor.visitSingularBytesField(value: self.testOnlyPubkey, fieldNumber: 1)
    }
    if !self.evidence.isEmpty {
      try visitor.visitSingularBytesField(value: self.evidence, fieldNumber: 2)
    }
    if !self.endorsement.isEmpty {
      try visitor.visitSingularBytesField(value: self.endorsement, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_ClientHandshakeStart, rhs: SVR2Proto_ClientHandshakeStart) -> Bool {
    if lhs.testOnlyPubkey != rhs.testOnlyPubkey {return false}
    if lhs.evidence != rhs.evidence {return false}
    if lhs.endorsement != rhs.endorsement {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension SVR2Proto_RaftGroupConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".RaftGroupConfig"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "group_id"),
    2: .standard(proto: "min_voting_replicas"),
    3: .standard(proto: "max_voting_replicas"),
    4: .standard(proto: "super_majority"),
  ]

  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 { try decoder.decodeSingularFixed64Field(value: &self.groupID) }()
      case 2: try { try decoder.decodeSingularUInt32Field(value: &self.minVotingReplicas) }()
      case 3: try { try decoder.decodeSingularUInt32Field(value: &self.maxVotingReplicas) }()
      case 4: try { try decoder.decodeSingularUInt32Field(value: &self.superMajority) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.groupID != 0 {
      try visitor.visitSingularFixed64Field(value: self.groupID, fieldNumber: 1)
    }
    if self.minVotingReplicas != 0 {
      try visitor.visitSingularUInt32Field(value: self.minVotingReplicas, fieldNumber: 2)
    }
    if self.maxVotingReplicas != 0 {
      try visitor.visitSingularUInt32Field(value: self.maxVotingReplicas, fieldNumber: 3)
    }
    if self.superMajority != 0 {
      try visitor.visitSingularUInt32Field(value: self.superMajority, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: SVR2Proto_RaftGroupConfig, rhs: SVR2Proto_RaftGroupConfig) -> Bool {
    if lhs.groupID != rhs.groupID {return false}
    if lhs.minVotingReplicas != rhs.minVotingReplicas {return false}
    if lhs.maxVotingReplicas != rhs.maxVotingReplicas {return false}
    if lhs.superMajority != rhs.superMajority {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
