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

// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc.  All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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 your 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 ProtobufUnittest_Message2 {
  // 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 optionalInt32: Int32 {
    get {return _storage._optionalInt32 ?? 0}
    set {_uniqueStorage()._optionalInt32 = newValue}
  }
  /// Returns true if `optionalInt32` has been explicitly set.
  var hasOptionalInt32: Bool {return _storage._optionalInt32 != nil}
  /// Clears the value of `optionalInt32`. Subsequent reads from it will return its default value.
  mutating func clearOptionalInt32() {_uniqueStorage()._optionalInt32 = nil}

  var optionalInt64: Int64 {
    get {return _storage._optionalInt64 ?? 0}
    set {_uniqueStorage()._optionalInt64 = newValue}
  }
  /// Returns true if `optionalInt64` has been explicitly set.
  var hasOptionalInt64: Bool {return _storage._optionalInt64 != nil}
  /// Clears the value of `optionalInt64`. Subsequent reads from it will return its default value.
  mutating func clearOptionalInt64() {_uniqueStorage()._optionalInt64 = nil}

  var optionalUint32: UInt32 {
    get {return _storage._optionalUint32 ?? 0}
    set {_uniqueStorage()._optionalUint32 = newValue}
  }
  /// Returns true if `optionalUint32` has been explicitly set.
  var hasOptionalUint32: Bool {return _storage._optionalUint32 != nil}
  /// Clears the value of `optionalUint32`. Subsequent reads from it will return its default value.
  mutating func clearOptionalUint32() {_uniqueStorage()._optionalUint32 = nil}

  var optionalUint64: UInt64 {
    get {return _storage._optionalUint64 ?? 0}
    set {_uniqueStorage()._optionalUint64 = newValue}
  }
  /// Returns true if `optionalUint64` has been explicitly set.
  var hasOptionalUint64: Bool {return _storage._optionalUint64 != nil}
  /// Clears the value of `optionalUint64`. Subsequent reads from it will return its default value.
  mutating func clearOptionalUint64() {_uniqueStorage()._optionalUint64 = nil}

  var optionalSint32: Int32 {
    get {return _storage._optionalSint32 ?? 0}
    set {_uniqueStorage()._optionalSint32 = newValue}
  }
  /// Returns true if `optionalSint32` has been explicitly set.
  var hasOptionalSint32: Bool {return _storage._optionalSint32 != nil}
  /// Clears the value of `optionalSint32`. Subsequent reads from it will return its default value.
  mutating func clearOptionalSint32() {_uniqueStorage()._optionalSint32 = nil}

  var optionalSint64: Int64 {
    get {return _storage._optionalSint64 ?? 0}
    set {_uniqueStorage()._optionalSint64 = newValue}
  }
  /// Returns true if `optionalSint64` has been explicitly set.
  var hasOptionalSint64: Bool {return _storage._optionalSint64 != nil}
  /// Clears the value of `optionalSint64`. Subsequent reads from it will return its default value.
  mutating func clearOptionalSint64() {_uniqueStorage()._optionalSint64 = nil}

  var optionalFixed32: UInt32 {
    get {return _storage._optionalFixed32 ?? 0}
    set {_uniqueStorage()._optionalFixed32 = newValue}
  }
  /// Returns true if `optionalFixed32` has been explicitly set.
  var hasOptionalFixed32: Bool {return _storage._optionalFixed32 != nil}
  /// Clears the value of `optionalFixed32`. Subsequent reads from it will return its default value.
  mutating func clearOptionalFixed32() {_uniqueStorage()._optionalFixed32 = nil}

  var optionalFixed64: UInt64 {
    get {return _storage._optionalFixed64 ?? 0}
    set {_uniqueStorage()._optionalFixed64 = newValue}
  }
  /// Returns true if `optionalFixed64` has been explicitly set.
  var hasOptionalFixed64: Bool {return _storage._optionalFixed64 != nil}
  /// Clears the value of `optionalFixed64`. Subsequent reads from it will return its default value.
  mutating func clearOptionalFixed64() {_uniqueStorage()._optionalFixed64 = nil}

  var optionalSfixed32: Int32 {
    get {return _storage._optionalSfixed32 ?? 0}
    set {_uniqueStorage()._optionalSfixed32 = newValue}
  }
  /// Returns true if `optionalSfixed32` has been explicitly set.
  var hasOptionalSfixed32: Bool {return _storage._optionalSfixed32 != nil}
  /// Clears the value of `optionalSfixed32`. Subsequent reads from it will return its default value.
  mutating func clearOptionalSfixed32() {_uniqueStorage()._optionalSfixed32 = nil}

  var optionalSfixed64: Int64 {
    get {return _storage._optionalSfixed64 ?? 0}
    set {_uniqueStorage()._optionalSfixed64 = newValue}
  }
  /// Returns true if `optionalSfixed64` has been explicitly set.
  var hasOptionalSfixed64: Bool {return _storage._optionalSfixed64 != nil}
  /// Clears the value of `optionalSfixed64`. Subsequent reads from it will return its default value.
  mutating func clearOptionalSfixed64() {_uniqueStorage()._optionalSfixed64 = nil}

  var optionalFloat: Float {
    get {return _storage._optionalFloat ?? 0}
    set {_uniqueStorage()._optionalFloat = newValue}
  }
  /// Returns true if `optionalFloat` has been explicitly set.
  var hasOptionalFloat: Bool {return _storage._optionalFloat != nil}
  /// Clears the value of `optionalFloat`. Subsequent reads from it will return its default value.
  mutating func clearOptionalFloat() {_uniqueStorage()._optionalFloat = nil}

  var optionalDouble: Double {
    get {return _storage._optionalDouble ?? 0}
    set {_uniqueStorage()._optionalDouble = newValue}
  }
  /// Returns true if `optionalDouble` has been explicitly set.
  var hasOptionalDouble: Bool {return _storage._optionalDouble != nil}
  /// Clears the value of `optionalDouble`. Subsequent reads from it will return its default value.
  mutating func clearOptionalDouble() {_uniqueStorage()._optionalDouble = nil}

  var optionalBool: Bool {
    get {return _storage._optionalBool ?? false}
    set {_uniqueStorage()._optionalBool = newValue}
  }
  /// Returns true if `optionalBool` has been explicitly set.
  var hasOptionalBool: Bool {return _storage._optionalBool != nil}
  /// Clears the value of `optionalBool`. Subsequent reads from it will return its default value.
  mutating func clearOptionalBool() {_uniqueStorage()._optionalBool = nil}

  var optionalString: String {
    get {return _storage._optionalString ?? String()}
    set {_uniqueStorage()._optionalString = newValue}
  }
  /// Returns true if `optionalString` has been explicitly set.
  var hasOptionalString: Bool {return _storage._optionalString != nil}
  /// Clears the value of `optionalString`. Subsequent reads from it will return its default value.
  mutating func clearOptionalString() {_uniqueStorage()._optionalString = nil}

  var optionalBytes: Data {
    get {return _storage._optionalBytes ?? SwiftProtobuf.Internal.emptyData}
    set {_uniqueStorage()._optionalBytes = newValue}
  }
  /// Returns true if `optionalBytes` has been explicitly set.
  var hasOptionalBytes: Bool {return _storage._optionalBytes != nil}
  /// Clears the value of `optionalBytes`. Subsequent reads from it will return its default value.
  mutating func clearOptionalBytes() {_uniqueStorage()._optionalBytes = nil}

  var optionalGroup: ProtobufUnittest_Message2.OptionalGroup {
    get {return _storage._optionalGroup ?? ProtobufUnittest_Message2.OptionalGroup()}
    set {_uniqueStorage()._optionalGroup = newValue}
  }
  /// Returns true if `optionalGroup` has been explicitly set.
  var hasOptionalGroup: Bool {return _storage._optionalGroup != nil}
  /// Clears the value of `optionalGroup`. Subsequent reads from it will return its default value.
  mutating func clearOptionalGroup() {_uniqueStorage()._optionalGroup = nil}

  var optionalMessage: ProtobufUnittest_Message2 {
    get {return _storage._optionalMessage ?? ProtobufUnittest_Message2()}
    set {_uniqueStorage()._optionalMessage = newValue}
  }
  /// Returns true if `optionalMessage` has been explicitly set.
  var hasOptionalMessage: Bool {return _storage._optionalMessage != nil}
  /// Clears the value of `optionalMessage`. Subsequent reads from it will return its default value.
  mutating func clearOptionalMessage() {_uniqueStorage()._optionalMessage = nil}

  var optionalEnum: ProtobufUnittest_Message2.Enum {
    get {return _storage._optionalEnum ?? .foo}
    set {_uniqueStorage()._optionalEnum = newValue}
  }
  /// Returns true if `optionalEnum` has been explicitly set.
  var hasOptionalEnum: Bool {return _storage._optionalEnum != nil}
  /// Clears the value of `optionalEnum`. Subsequent reads from it will return its default value.
  mutating func clearOptionalEnum() {_uniqueStorage()._optionalEnum = nil}

  var repeatedInt32: [Int32] {
    get {return _storage._repeatedInt32}
    set {_uniqueStorage()._repeatedInt32 = newValue}
  }

  var repeatedInt64: [Int64] {
    get {return _storage._repeatedInt64}
    set {_uniqueStorage()._repeatedInt64 = newValue}
  }

  var repeatedUint32: [UInt32] {
    get {return _storage._repeatedUint32}
    set {_uniqueStorage()._repeatedUint32 = newValue}
  }

  var repeatedUint64: [UInt64] {
    get {return _storage._repeatedUint64}
    set {_uniqueStorage()._repeatedUint64 = newValue}
  }

  var repeatedSint32: [Int32] {
    get {return _storage._repeatedSint32}
    set {_uniqueStorage()._repeatedSint32 = newValue}
  }

  var repeatedSint64: [Int64] {
    get {return _storage._repeatedSint64}
    set {_uniqueStorage()._repeatedSint64 = newValue}
  }

  var repeatedFixed32: [UInt32] {
    get {return _storage._repeatedFixed32}
    set {_uniqueStorage()._repeatedFixed32 = newValue}
  }

  var repeatedFixed64: [UInt64] {
    get {return _storage._repeatedFixed64}
    set {_uniqueStorage()._repeatedFixed64 = newValue}
  }

  var repeatedSfixed32: [Int32] {
    get {return _storage._repeatedSfixed32}
    set {_uniqueStorage()._repeatedSfixed32 = newValue}
  }

  var repeatedSfixed64: [Int64] {
    get {return _storage._repeatedSfixed64}
    set {_uniqueStorage()._repeatedSfixed64 = newValue}
  }

  var repeatedFloat: [Float] {
    get {return _storage._repeatedFloat}
    set {_uniqueStorage()._repeatedFloat = newValue}
  }

  var repeatedDouble: [Double] {
    get {return _storage._repeatedDouble}
    set {_uniqueStorage()._repeatedDouble = newValue}
  }

  var repeatedBool: [Bool] {
    get {return _storage._repeatedBool}
    set {_uniqueStorage()._repeatedBool = newValue}
  }

  var repeatedString: [String] {
    get {return _storage._repeatedString}
    set {_uniqueStorage()._repeatedString = newValue}
  }

  var repeatedBytes: [Data] {
    get {return _storage._repeatedBytes}
    set {_uniqueStorage()._repeatedBytes = newValue}
  }

  var repeatedGroup: [ProtobufUnittest_Message2.RepeatedGroup] {
    get {return _storage._repeatedGroup}
    set {_uniqueStorage()._repeatedGroup = newValue}
  }

  var repeatedMessage: [ProtobufUnittest_Message2] {
    get {return _storage._repeatedMessage}
    set {_uniqueStorage()._repeatedMessage = newValue}
  }

  var repeatedEnum: [ProtobufUnittest_Message2.Enum] {
    get {return _storage._repeatedEnum}
    set {_uniqueStorage()._repeatedEnum = newValue}
  }

  var o: OneOf_O? {
    get {return _storage._o}
    set {_uniqueStorage()._o = newValue}
  }

  var oneofInt32: Int32 {
    get {
      if case .oneofInt32(let v)? = _storage._o {return v}
      return 100
    }
    set {_uniqueStorage()._o = .oneofInt32(newValue)}
  }

  var oneofInt64: Int64 {
    get {
      if case .oneofInt64(let v)? = _storage._o {return v}
      return 101
    }
    set {_uniqueStorage()._o = .oneofInt64(newValue)}
  }

  var oneofUint32: UInt32 {
    get {
      if case .oneofUint32(let v)? = _storage._o {return v}
      return 102
    }
    set {_uniqueStorage()._o = .oneofUint32(newValue)}
  }

  var oneofUint64: UInt64 {
    get {
      if case .oneofUint64(let v)? = _storage._o {return v}
      return 103
    }
    set {_uniqueStorage()._o = .oneofUint64(newValue)}
  }

  var oneofSint32: Int32 {
    get {
      if case .oneofSint32(let v)? = _storage._o {return v}
      return 104
    }
    set {_uniqueStorage()._o = .oneofSint32(newValue)}
  }

  var oneofSint64: Int64 {
    get {
      if case .oneofSint64(let v)? = _storage._o {return v}
      return 105
    }
    set {_uniqueStorage()._o = .oneofSint64(newValue)}
  }

  var oneofFixed32: UInt32 {
    get {
      if case .oneofFixed32(let v)? = _storage._o {return v}
      return 106
    }
    set {_uniqueStorage()._o = .oneofFixed32(newValue)}
  }

  var oneofFixed64: UInt64 {
    get {
      if case .oneofFixed64(let v)? = _storage._o {return v}
      return 107
    }
    set {_uniqueStorage()._o = .oneofFixed64(newValue)}
  }

  var oneofSfixed32: Int32 {
    get {
      if case .oneofSfixed32(let v)? = _storage._o {return v}
      return 108
    }
    set {_uniqueStorage()._o = .oneofSfixed32(newValue)}
  }

  var oneofSfixed64: Int64 {
    get {
      if case .oneofSfixed64(let v)? = _storage._o {return v}
      return 109
    }
    set {_uniqueStorage()._o = .oneofSfixed64(newValue)}
  }

  var oneofFloat: Float {
    get {
      if case .oneofFloat(let v)? = _storage._o {return v}
      return 110
    }
    set {_uniqueStorage()._o = .oneofFloat(newValue)}
  }

  var oneofDouble: Double {
    get {
      if case .oneofDouble(let v)? = _storage._o {return v}
      return 111
    }
    set {_uniqueStorage()._o = .oneofDouble(newValue)}
  }

  var oneofBool: Bool {
    get {
      if case .oneofBool(let v)? = _storage._o {return v}
      return true
    }
    set {_uniqueStorage()._o = .oneofBool(newValue)}
  }

  var oneofString: String {
    get {
      if case .oneofString(let v)? = _storage._o {return v}
      return "string"
    }
    set {_uniqueStorage()._o = .oneofString(newValue)}
  }

  var oneofBytes: Data {
    get {
      if case .oneofBytes(let v)? = _storage._o {return v}
      return Data([100, 97, 116, 97])
    }
    set {_uniqueStorage()._o = .oneofBytes(newValue)}
  }

  var oneofGroup: ProtobufUnittest_Message2.OneofGroup {
    get {
      if case .oneofGroup(let v)? = _storage._o {return v}
      return ProtobufUnittest_Message2.OneofGroup()
    }
    set {_uniqueStorage()._o = .oneofGroup(newValue)}
  }

  var oneofMessage: ProtobufUnittest_Message2 {
    get {
      if case .oneofMessage(let v)? = _storage._o {return v}
      return ProtobufUnittest_Message2()
    }
    set {_uniqueStorage()._o = .oneofMessage(newValue)}
  }

  var oneofEnum: ProtobufUnittest_Message2.Enum {
    get {
      if case .oneofEnum(let v)? = _storage._o {return v}
      return .baz
    }
    set {_uniqueStorage()._o = .oneofEnum(newValue)}
  }

  /// Some token map cases, too many combinations to list them all.
  var mapInt32Int32: Dictionary<Int32,Int32> {
    get {return _storage._mapInt32Int32}
    set {_uniqueStorage()._mapInt32Int32 = newValue}
  }

  var mapInt64Int64: Dictionary<Int64,Int64> {
    get {return _storage._mapInt64Int64}
    set {_uniqueStorage()._mapInt64Int64 = newValue}
  }

  var mapUint32Uint32: Dictionary<UInt32,UInt32> {
    get {return _storage._mapUint32Uint32}
    set {_uniqueStorage()._mapUint32Uint32 = newValue}
  }

  var mapUint64Uint64: Dictionary<UInt64,UInt64> {
    get {return _storage._mapUint64Uint64}
    set {_uniqueStorage()._mapUint64Uint64 = newValue}
  }

  var mapSint32Sint32: Dictionary<Int32,Int32> {
    get {return _storage._mapSint32Sint32}
    set {_uniqueStorage()._mapSint32Sint32 = newValue}
  }

  var mapSint64Sint64: Dictionary<Int64,Int64> {
    get {return _storage._mapSint64Sint64}
    set {_uniqueStorage()._mapSint64Sint64 = newValue}
  }

  var mapFixed32Fixed32: Dictionary<UInt32,UInt32> {
    get {return _storage._mapFixed32Fixed32}
    set {_uniqueStorage()._mapFixed32Fixed32 = newValue}
  }

  var mapFixed64Fixed64: Dictionary<UInt64,UInt64> {
    get {return _storage._mapFixed64Fixed64}
    set {_uniqueStorage()._mapFixed64Fixed64 = newValue}
  }

  var mapSfixed32Sfixed32: Dictionary<Int32,Int32> {
    get {return _storage._mapSfixed32Sfixed32}
    set {_uniqueStorage()._mapSfixed32Sfixed32 = newValue}
  }

  var mapSfixed64Sfixed64: Dictionary<Int64,Int64> {
    get {return _storage._mapSfixed64Sfixed64}
    set {_uniqueStorage()._mapSfixed64Sfixed64 = newValue}
  }

  var mapInt32Float: Dictionary<Int32,Float> {
    get {return _storage._mapInt32Float}
    set {_uniqueStorage()._mapInt32Float = newValue}
  }

  var mapInt32Double: Dictionary<Int32,Double> {
    get {return _storage._mapInt32Double}
    set {_uniqueStorage()._mapInt32Double = newValue}
  }

  var mapBoolBool: Dictionary<Bool,Bool> {
    get {return _storage._mapBoolBool}
    set {_uniqueStorage()._mapBoolBool = newValue}
  }

  var mapStringString: Dictionary<String,String> {
    get {return _storage._mapStringString}
    set {_uniqueStorage()._mapStringString = newValue}
  }

  var mapStringBytes: Dictionary<String,Data> {
    get {return _storage._mapStringBytes}
    set {_uniqueStorage()._mapStringBytes = newValue}
  }

  var mapStringMessage: Dictionary<String,ProtobufUnittest_Message2> {
    get {return _storage._mapStringMessage}
    set {_uniqueStorage()._mapStringMessage = newValue}
  }

  var mapInt32Bytes: Dictionary<Int32,Data> {
    get {return _storage._mapInt32Bytes}
    set {_uniqueStorage()._mapInt32Bytes = newValue}
  }

  var mapInt32Enum: Dictionary<Int32,ProtobufUnittest_Message2.Enum> {
    get {return _storage._mapInt32Enum}
    set {_uniqueStorage()._mapInt32Enum = newValue}
  }

  var mapInt32Message: Dictionary<Int32,ProtobufUnittest_Message2> {
    get {return _storage._mapInt32Message}
    set {_uniqueStorage()._mapInt32Message = newValue}
  }

  var unknownFields = SwiftProtobuf.UnknownStorage()

  enum OneOf_O: Equatable {
    case oneofInt32(Int32)
    case oneofInt64(Int64)
    case oneofUint32(UInt32)
    case oneofUint64(UInt64)
    case oneofSint32(Int32)
    case oneofSint64(Int64)
    case oneofFixed32(UInt32)
    case oneofFixed64(UInt64)
    case oneofSfixed32(Int32)
    case oneofSfixed64(Int64)
    case oneofFloat(Float)
    case oneofDouble(Double)
    case oneofBool(Bool)
    case oneofString(String)
    case oneofBytes(Data)
    case oneofGroup(ProtobufUnittest_Message2.OneofGroup)
    case oneofMessage(ProtobufUnittest_Message2)
    case oneofEnum(ProtobufUnittest_Message2.Enum)

  #if !swift(>=4.1)
    static func ==(lhs: ProtobufUnittest_Message2.OneOf_O, rhs: ProtobufUnittest_Message2.OneOf_O) -> Bool {
      switch (lhs, rhs) {
      case (.oneofInt32(let l), .oneofInt32(let r)): return l == r
      case (.oneofInt64(let l), .oneofInt64(let r)): return l == r
      case (.oneofUint32(let l), .oneofUint32(let r)): return l == r
      case (.oneofUint64(let l), .oneofUint64(let r)): return l == r
      case (.oneofSint32(let l), .oneofSint32(let r)): return l == r
      case (.oneofSint64(let l), .oneofSint64(let r)): return l == r
      case (.oneofFixed32(let l), .oneofFixed32(let r)): return l == r
      case (.oneofFixed64(let l), .oneofFixed64(let r)): return l == r
      case (.oneofSfixed32(let l), .oneofSfixed32(let r)): return l == r
      case (.oneofSfixed64(let l), .oneofSfixed64(let r)): return l == r
      case (.oneofFloat(let l), .oneofFloat(let r)): return l == r
      case (.oneofDouble(let l), .oneofDouble(let r)): return l == r
      case (.oneofBool(let l), .oneofBool(let r)): return l == r
      case (.oneofString(let l), .oneofString(let r)): return l == r
      case (.oneofBytes(let l), .oneofBytes(let r)): return l == r
      case (.oneofGroup(let l), .oneofGroup(let r)): return l == r
      case (.oneofMessage(let l), .oneofMessage(let r)): return l == r
      case (.oneofEnum(let l), .oneofEnum(let r)): return l == r
      default: return false
      }
    }
  #endif
  }

  enum Enum: SwiftProtobuf.Enum {
    typealias RawValue = Int
    case foo // = 0
    case bar // = 1
    case baz // = 2
    case extra2 // = 20

    init() {
      self = .foo
    }

    init?(rawValue: Int) {
      switch rawValue {
      case 0: self = .foo
      case 1: self = .bar
      case 2: self = .baz
      case 20: self = .extra2
      default: return nil
      }
    }

    var rawValue: Int {
      switch self {
      case .foo: return 0
      case .bar: return 1
      case .baz: return 2
      case .extra2: return 20
      }
    }

  }

  struct OptionalGroup {
    // 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 a: Int32 {
      get {return _a ?? 0}
      set {_a = newValue}
    }
    /// Returns true if `a` has been explicitly set.
    var hasA: Bool {return self._a != nil}
    /// Clears the value of `a`. Subsequent reads from it will return its default value.
    mutating func clearA() {self._a = nil}

    var unknownFields = SwiftProtobuf.UnknownStorage()

    init() {}

    fileprivate var _a: Int32? = nil
  }

  struct RepeatedGroup {
    // 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 a: Int32 {
      get {return _a ?? 0}
      set {_a = newValue}
    }
    /// Returns true if `a` has been explicitly set.
    var hasA: Bool {return self._a != nil}
    /// Clears the value of `a`. Subsequent reads from it will return its default value.
    mutating func clearA() {self._a = nil}

    var unknownFields = SwiftProtobuf.UnknownStorage()

    init() {}

    fileprivate var _a: Int32? = nil
  }

  struct OneofGroup {
    // 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 a: Int32 {
      get {return _a ?? 116}
      set {_a = newValue}
    }
    /// Returns true if `a` has been explicitly set.
    var hasA: Bool {return self._a != nil}
    /// Clears the value of `a`. Subsequent reads from it will return its default value.
    mutating func clearA() {self._a = nil}

    var b: Int32 {
      get {return _b ?? 0}
      set {_b = newValue}
    }
    /// Returns true if `b` has been explicitly set.
    var hasB: Bool {return self._b != nil}
    /// Clears the value of `b`. Subsequent reads from it will return its default value.
    mutating func clearB() {self._b = nil}

    var unknownFields = SwiftProtobuf.UnknownStorage()

    init() {}

    fileprivate var _a: Int32? = nil
    fileprivate var _b: Int32? = nil
  }

  init() {}

  fileprivate var _storage = _StorageClass.defaultInstance
}

#if swift(>=4.2)

extension ProtobufUnittest_Message2.Enum: CaseIterable {
  // Support synthesized by the compiler.
}

#endif  // swift(>=4.2)

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

  /// Recursive class (i.e. - can build a graph), forces _StorageClass.
  var y: ProtobufUnittest_Msg2UsesStorage {
    get {return _storage._y ?? ProtobufUnittest_Msg2UsesStorage()}
    set {_uniqueStorage()._y = newValue}
  }
  /// Returns true if `y` has been explicitly set.
  var hasY: Bool {return _storage._y != nil}
  /// Clears the value of `y`. Subsequent reads from it will return its default value.
  mutating func clearY() {_uniqueStorage()._y = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _storage = _StorageClass.defaultInstance
}

/// Names that match protocols - No Storage
struct ProtobufUnittest_Msg2NamesNoStorage {
  // 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 isInitialized_p: Int32 {
    get {return _isInitialized_p ?? 0}
    set {_isInitialized_p = newValue}
  }
  /// Returns true if `isInitialized_p` has been explicitly set.
  var hasIsInitialized_p: Bool {return self._isInitialized_p != nil}
  /// Clears the value of `isInitialized_p`. Subsequent reads from it will return its default value.
  mutating func clearIsInitialized_p() {self._isInitialized_p = nil}

  var debugDescription_p: Int32 {
    get {return _debugDescription_p ?? 0}
    set {_debugDescription_p = newValue}
  }
  /// Returns true if `debugDescription_p` has been explicitly set.
  var hasDebugDescription_p: Bool {return self._debugDescription_p != nil}
  /// Clears the value of `debugDescription_p`. Subsequent reads from it will return its default value.
  mutating func clearDebugDescription_p() {self._debugDescription_p = nil}

  var value: Int32 {
    get {return _value ?? 0}
    set {_value = newValue}
  }
  /// Returns true if `value` has been explicitly set.
  var hasValue: Bool {return self._value != nil}
  /// Clears the value of `value`. Subsequent reads from it will return its default value.
  mutating func clearValue() {self._value = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _isInitialized_p: Int32? = nil
  fileprivate var _debugDescription_p: Int32? = nil
  fileprivate var _value: Int32? = nil
}

/// Names that match protocols - Storage
struct ProtobufUnittest_Msg2NamesUsesStorage {
  // 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 isInitialized_p: Int32 {
    get {return _storage._isInitialized_p ?? 0}
    set {_uniqueStorage()._isInitialized_p = newValue}
  }
  /// Returns true if `isInitialized_p` has been explicitly set.
  var hasIsInitialized_p: Bool {return _storage._isInitialized_p != nil}
  /// Clears the value of `isInitialized_p`. Subsequent reads from it will return its default value.
  mutating func clearIsInitialized_p() {_uniqueStorage()._isInitialized_p = nil}

  var debugDescription_p: Int32 {
    get {return _storage._debugDescription_p ?? 0}
    set {_uniqueStorage()._debugDescription_p = newValue}
  }
  /// Returns true if `debugDescription_p` has been explicitly set.
  var hasDebugDescription_p: Bool {return _storage._debugDescription_p != nil}
  /// Clears the value of `debugDescription_p`. Subsequent reads from it will return its default value.
  mutating func clearDebugDescription_p() {_uniqueStorage()._debugDescription_p = nil}

  /// Recursive class, forces _StorageClass
  var value: ProtobufUnittest_Msg2UsesStorage {
    get {return _storage._value ?? ProtobufUnittest_Msg2UsesStorage()}
    set {_uniqueStorage()._value = newValue}
  }
  /// Returns true if `value` has been explicitly set.
  var hasValue: Bool {return _storage._value != nil}
  /// Clears the value of `value`. Subsequent reads from it will return its default value.
  mutating func clearValue() {_uniqueStorage()._value = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _storage = _StorageClass.defaultInstance
}

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

fileprivate let _protobuf_package = "protobuf_unittest"

extension ProtobufUnittest_Message2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Message2"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "optional_int32"),
    2: .standard(proto: "optional_int64"),
    3: .standard(proto: "optional_uint32"),
    4: .standard(proto: "optional_uint64"),
    5: .standard(proto: "optional_sint32"),
    6: .standard(proto: "optional_sint64"),
    7: .standard(proto: "optional_fixed32"),
    8: .standard(proto: "optional_fixed64"),
    9: .standard(proto: "optional_sfixed32"),
    10: .standard(proto: "optional_sfixed64"),
    11: .standard(proto: "optional_float"),
    12: .standard(proto: "optional_double"),
    13: .standard(proto: "optional_bool"),
    14: .standard(proto: "optional_string"),
    15: .standard(proto: "optional_bytes"),
    16: .unique(proto: "OptionalGroup", json: "optionalgroup"),
    18: .standard(proto: "optional_message"),
    19: .standard(proto: "optional_enum"),
    31: .standard(proto: "repeated_int32"),
    32: .standard(proto: "repeated_int64"),
    33: .standard(proto: "repeated_uint32"),
    34: .standard(proto: "repeated_uint64"),
    35: .standard(proto: "repeated_sint32"),
    36: .standard(proto: "repeated_sint64"),
    37: .standard(proto: "repeated_fixed32"),
    38: .standard(proto: "repeated_fixed64"),
    39: .standard(proto: "repeated_sfixed32"),
    40: .standard(proto: "repeated_sfixed64"),
    41: .standard(proto: "repeated_float"),
    42: .standard(proto: "repeated_double"),
    43: .standard(proto: "repeated_bool"),
    44: .standard(proto: "repeated_string"),
    45: .standard(proto: "repeated_bytes"),
    46: .unique(proto: "RepeatedGroup", json: "repeatedgroup"),
    48: .standard(proto: "repeated_message"),
    49: .standard(proto: "repeated_enum"),
    51: .standard(proto: "oneof_int32"),
    52: .standard(proto: "oneof_int64"),
    53: .standard(proto: "oneof_uint32"),
    54: .standard(proto: "oneof_uint64"),
    55: .standard(proto: "oneof_sint32"),
    56: .standard(proto: "oneof_sint64"),
    57: .standard(proto: "oneof_fixed32"),
    58: .standard(proto: "oneof_fixed64"),
    59: .standard(proto: "oneof_sfixed32"),
    60: .standard(proto: "oneof_sfixed64"),
    61: .standard(proto: "oneof_float"),
    62: .standard(proto: "oneof_double"),
    63: .standard(proto: "oneof_bool"),
    64: .standard(proto: "oneof_string"),
    65: .standard(proto: "oneof_bytes"),
    66: .unique(proto: "OneofGroup", json: "oneofgroup"),
    68: .standard(proto: "oneof_message"),
    69: .standard(proto: "oneof_enum"),
    70: .standard(proto: "map_int32_int32"),
    71: .standard(proto: "map_int64_int64"),
    72: .standard(proto: "map_uint32_uint32"),
    73: .standard(proto: "map_uint64_uint64"),
    74: .standard(proto: "map_sint32_sint32"),
    75: .standard(proto: "map_sint64_sint64"),
    76: .standard(proto: "map_fixed32_fixed32"),
    77: .standard(proto: "map_fixed64_fixed64"),
    78: .standard(proto: "map_sfixed32_sfixed32"),
    79: .standard(proto: "map_sfixed64_sfixed64"),
    80: .standard(proto: "map_int32_float"),
    81: .standard(proto: "map_int32_double"),
    82: .standard(proto: "map_bool_bool"),
    83: .standard(proto: "map_string_string"),
    84: .standard(proto: "map_string_bytes"),
    85: .standard(proto: "map_string_message"),
    86: .standard(proto: "map_int32_bytes"),
    87: .standard(proto: "map_int32_enum"),
    88: .standard(proto: "map_int32_message"),
  ]

  fileprivate class _StorageClass {
    var _optionalInt32: Int32? = nil
    var _optionalInt64: Int64? = nil
    var _optionalUint32: UInt32? = nil
    var _optionalUint64: UInt64? = nil
    var _optionalSint32: Int32? = nil
    var _optionalSint64: Int64? = nil
    var _optionalFixed32: UInt32? = nil
    var _optionalFixed64: UInt64? = nil
    var _optionalSfixed32: Int32? = nil
    var _optionalSfixed64: Int64? = nil
    var _optionalFloat: Float? = nil
    var _optionalDouble: Double? = nil
    var _optionalBool: Bool? = nil
    var _optionalString: String? = nil
    var _optionalBytes: Data? = nil
    var _optionalGroup: ProtobufUnittest_Message2.OptionalGroup? = nil
    var _optionalMessage: ProtobufUnittest_Message2? = nil
    var _optionalEnum: ProtobufUnittest_Message2.Enum? = nil
    var _repeatedInt32: [Int32] = []
    var _repeatedInt64: [Int64] = []
    var _repeatedUint32: [UInt32] = []
    var _repeatedUint64: [UInt64] = []
    var _repeatedSint32: [Int32] = []
    var _repeatedSint64: [Int64] = []
    var _repeatedFixed32: [UInt32] = []
    var _repeatedFixed64: [UInt64] = []
    var _repeatedSfixed32: [Int32] = []
    var _repeatedSfixed64: [Int64] = []
    var _repeatedFloat: [Float] = []
    var _repeatedDouble: [Double] = []
    var _repeatedBool: [Bool] = []
    var _repeatedString: [String] = []
    var _repeatedBytes: [Data] = []
    var _repeatedGroup: [ProtobufUnittest_Message2.RepeatedGroup] = []
    var _repeatedMessage: [ProtobufUnittest_Message2] = []
    var _repeatedEnum: [ProtobufUnittest_Message2.Enum] = []
    var _o: ProtobufUnittest_Message2.OneOf_O?
    var _mapInt32Int32: Dictionary<Int32,Int32> = [:]
    var _mapInt64Int64: Dictionary<Int64,Int64> = [:]
    var _mapUint32Uint32: Dictionary<UInt32,UInt32> = [:]
    var _mapUint64Uint64: Dictionary<UInt64,UInt64> = [:]
    var _mapSint32Sint32: Dictionary<Int32,Int32> = [:]
    var _mapSint64Sint64: Dictionary<Int64,Int64> = [:]
    var _mapFixed32Fixed32: Dictionary<UInt32,UInt32> = [:]
    var _mapFixed64Fixed64: Dictionary<UInt64,UInt64> = [:]
    var _mapSfixed32Sfixed32: Dictionary<Int32,Int32> = [:]
    var _mapSfixed64Sfixed64: Dictionary<Int64,Int64> = [:]
    var _mapInt32Float: Dictionary<Int32,Float> = [:]
    var _mapInt32Double: Dictionary<Int32,Double> = [:]
    var _mapBoolBool: Dictionary<Bool,Bool> = [:]
    var _mapStringString: Dictionary<String,String> = [:]
    var _mapStringBytes: Dictionary<String,Data> = [:]
    var _mapStringMessage: Dictionary<String,ProtobufUnittest_Message2> = [:]
    var _mapInt32Bytes: Dictionary<Int32,Data> = [:]
    var _mapInt32Enum: Dictionary<Int32,ProtobufUnittest_Message2.Enum> = [:]
    var _mapInt32Message: Dictionary<Int32,ProtobufUnittest_Message2> = [:]

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _optionalInt32 = source._optionalInt32
      _optionalInt64 = source._optionalInt64
      _optionalUint32 = source._optionalUint32
      _optionalUint64 = source._optionalUint64
      _optionalSint32 = source._optionalSint32
      _optionalSint64 = source._optionalSint64
      _optionalFixed32 = source._optionalFixed32
      _optionalFixed64 = source._optionalFixed64
      _optionalSfixed32 = source._optionalSfixed32
      _optionalSfixed64 = source._optionalSfixed64
      _optionalFloat = source._optionalFloat
      _optionalDouble = source._optionalDouble
      _optionalBool = source._optionalBool
      _optionalString = source._optionalString
      _optionalBytes = source._optionalBytes
      _optionalGroup = source._optionalGroup
      _optionalMessage = source._optionalMessage
      _optionalEnum = source._optionalEnum
      _repeatedInt32 = source._repeatedInt32
      _repeatedInt64 = source._repeatedInt64
      _repeatedUint32 = source._repeatedUint32
      _repeatedUint64 = source._repeatedUint64
      _repeatedSint32 = source._repeatedSint32
      _repeatedSint64 = source._repeatedSint64
      _repeatedFixed32 = source._repeatedFixed32
      _repeatedFixed64 = source._repeatedFixed64
      _repeatedSfixed32 = source._repeatedSfixed32
      _repeatedSfixed64 = source._repeatedSfixed64
      _repeatedFloat = source._repeatedFloat
      _repeatedDouble = source._repeatedDouble
      _repeatedBool = source._repeatedBool
      _repeatedString = source._repeatedString
      _repeatedBytes = source._repeatedBytes
      _repeatedGroup = source._repeatedGroup
      _repeatedMessage = source._repeatedMessage
      _repeatedEnum = source._repeatedEnum
      _o = source._o
      _mapInt32Int32 = source._mapInt32Int32
      _mapInt64Int64 = source._mapInt64Int64
      _mapUint32Uint32 = source._mapUint32Uint32
      _mapUint64Uint64 = source._mapUint64Uint64
      _mapSint32Sint32 = source._mapSint32Sint32
      _mapSint64Sint64 = source._mapSint64Sint64
      _mapFixed32Fixed32 = source._mapFixed32Fixed32
      _mapFixed64Fixed64 = source._mapFixed64Fixed64
      _mapSfixed32Sfixed32 = source._mapSfixed32Sfixed32
      _mapSfixed64Sfixed64 = source._mapSfixed64Sfixed64
      _mapInt32Float = source._mapInt32Float
      _mapInt32Double = source._mapInt32Double
      _mapBoolBool = source._mapBoolBool
      _mapStringString = source._mapStringString
      _mapStringBytes = source._mapStringBytes
      _mapStringMessage = source._mapStringMessage
      _mapInt32Bytes = source._mapInt32Bytes
      _mapInt32Enum = source._mapInt32Enum
      _mapInt32Message = source._mapInt32Message
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeSingularInt32Field(value: &_storage._optionalInt32)
        case 2: try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64)
        case 3: try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32)
        case 4: try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64)
        case 5: try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32)
        case 6: try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64)
        case 7: try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32)
        case 8: try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64)
        case 9: try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32)
        case 10: try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64)
        case 11: try decoder.decodeSingularFloatField(value: &_storage._optionalFloat)
        case 12: try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble)
        case 13: try decoder.decodeSingularBoolField(value: &_storage._optionalBool)
        case 14: try decoder.decodeSingularStringField(value: &_storage._optionalString)
        case 15: try decoder.decodeSingularBytesField(value: &_storage._optionalBytes)
        case 16: try decoder.decodeSingularGroupField(value: &_storage._optionalGroup)
        case 18: try decoder.decodeSingularMessageField(value: &_storage._optionalMessage)
        case 19: try decoder.decodeSingularEnumField(value: &_storage._optionalEnum)
        case 31: try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32)
        case 32: try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64)
        case 33: try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32)
        case 34: try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64)
        case 35: try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32)
        case 36: try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64)
        case 37: try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32)
        case 38: try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64)
        case 39: try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32)
        case 40: try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64)
        case 41: try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat)
        case 42: try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble)
        case 43: try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool)
        case 44: try decoder.decodeRepeatedStringField(value: &_storage._repeatedString)
        case 45: try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes)
        case 46: try decoder.decodeRepeatedGroupField(value: &_storage._repeatedGroup)
        case 48: try decoder.decodeRepeatedMessageField(value: &_storage._repeatedMessage)
        case 49: try decoder.decodeRepeatedEnumField(value: &_storage._repeatedEnum)
        case 51:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Int32?
          try decoder.decodeSingularInt32Field(value: &v)
          if let v = v {_storage._o = .oneofInt32(v)}
        case 52:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Int64?
          try decoder.decodeSingularInt64Field(value: &v)
          if let v = v {_storage._o = .oneofInt64(v)}
        case 53:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: UInt32?
          try decoder.decodeSingularUInt32Field(value: &v)
          if let v = v {_storage._o = .oneofUint32(v)}
        case 54:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: UInt64?
          try decoder.decodeSingularUInt64Field(value: &v)
          if let v = v {_storage._o = .oneofUint64(v)}
        case 55:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Int32?
          try decoder.decodeSingularSInt32Field(value: &v)
          if let v = v {_storage._o = .oneofSint32(v)}
        case 56:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Int64?
          try decoder.decodeSingularSInt64Field(value: &v)
          if let v = v {_storage._o = .oneofSint64(v)}
        case 57:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: UInt32?
          try decoder.decodeSingularFixed32Field(value: &v)
          if let v = v {_storage._o = .oneofFixed32(v)}
        case 58:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: UInt64?
          try decoder.decodeSingularFixed64Field(value: &v)
          if let v = v {_storage._o = .oneofFixed64(v)}
        case 59:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Int32?
          try decoder.decodeSingularSFixed32Field(value: &v)
          if let v = v {_storage._o = .oneofSfixed32(v)}
        case 60:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Int64?
          try decoder.decodeSingularSFixed64Field(value: &v)
          if let v = v {_storage._o = .oneofSfixed64(v)}
        case 61:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Float?
          try decoder.decodeSingularFloatField(value: &v)
          if let v = v {_storage._o = .oneofFloat(v)}
        case 62:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Double?
          try decoder.decodeSingularDoubleField(value: &v)
          if let v = v {_storage._o = .oneofDouble(v)}
        case 63:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Bool?
          try decoder.decodeSingularBoolField(value: &v)
          if let v = v {_storage._o = .oneofBool(v)}
        case 64:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: String?
          try decoder.decodeSingularStringField(value: &v)
          if let v = v {_storage._o = .oneofString(v)}
        case 65:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: Data?
          try decoder.decodeSingularBytesField(value: &v)
          if let v = v {_storage._o = .oneofBytes(v)}
        case 66:
          var v: ProtobufUnittest_Message2.OneofGroup?
          if let current = _storage._o {
            try decoder.handleConflictingOneOf()
            if case .oneofGroup(let m) = current {v = m}
          }
          try decoder.decodeSingularGroupField(value: &v)
          if let v = v {_storage._o = .oneofGroup(v)}
        case 68:
          var v: ProtobufUnittest_Message2?
          if let current = _storage._o {
            try decoder.handleConflictingOneOf()
            if case .oneofMessage(let m) = current {v = m}
          }
          try decoder.decodeSingularMessageField(value: &v)
          if let v = v {_storage._o = .oneofMessage(v)}
        case 69:
          if _storage._o != nil {try decoder.handleConflictingOneOf()}
          var v: ProtobufUnittest_Message2.Enum?
          try decoder.decodeSingularEnumField(value: &v)
          if let v = v {_storage._o = .oneofEnum(v)}
        case 70: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: &_storage._mapInt32Int32)
        case 71: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: &_storage._mapInt64Int64)
        case 72: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: &_storage._mapUint32Uint32)
        case 73: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: &_storage._mapUint64Uint64)
        case 74: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: &_storage._mapSint32Sint32)
        case 75: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: &_storage._mapSint64Sint64)
        case 76: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: &_storage._mapFixed32Fixed32)
        case 77: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: &_storage._mapFixed64Fixed64)
        case 78: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: &_storage._mapSfixed32Sfixed32)
        case 79: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: &_storage._mapSfixed64Sfixed64)
        case 80: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: &_storage._mapInt32Float)
        case 81: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: &_storage._mapInt32Double)
        case 82: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: &_storage._mapBoolBool)
        case 83: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &_storage._mapStringString)
        case 84: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapStringBytes)
        case 85: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,ProtobufUnittest_Message2>.self, value: &_storage._mapStringMessage)
        case 86: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: &_storage._mapInt32Bytes)
        case 87: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,ProtobufUnittest_Message2.Enum>.self, value: &_storage._mapInt32Enum)
        case 88: try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,ProtobufUnittest_Message2>.self, value: &_storage._mapInt32Message)
        default: break
        }
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if let v = _storage._optionalInt32 {
        try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
      }
      if let v = _storage._optionalInt64 {
        try visitor.visitSingularInt64Field(value: v, fieldNumber: 2)
      }
      if let v = _storage._optionalUint32 {
        try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3)
      }
      if let v = _storage._optionalUint64 {
        try visitor.visitSingularUInt64Field(value: v, fieldNumber: 4)
      }
      if let v = _storage._optionalSint32 {
        try visitor.visitSingularSInt32Field(value: v, fieldNumber: 5)
      }
      if let v = _storage._optionalSint64 {
        try visitor.visitSingularSInt64Field(value: v, fieldNumber: 6)
      }
      if let v = _storage._optionalFixed32 {
        try visitor.visitSingularFixed32Field(value: v, fieldNumber: 7)
      }
      if let v = _storage._optionalFixed64 {
        try visitor.visitSingularFixed64Field(value: v, fieldNumber: 8)
      }
      if let v = _storage._optionalSfixed32 {
        try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 9)
      }
      if let v = _storage._optionalSfixed64 {
        try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 10)
      }
      if let v = _storage._optionalFloat {
        try visitor.visitSingularFloatField(value: v, fieldNumber: 11)
      }
      if let v = _storage._optionalDouble {
        try visitor.visitSingularDoubleField(value: v, fieldNumber: 12)
      }
      if let v = _storage._optionalBool {
        try visitor.visitSingularBoolField(value: v, fieldNumber: 13)
      }
      if let v = _storage._optionalString {
        try visitor.visitSingularStringField(value: v, fieldNumber: 14)
      }
      if let v = _storage._optionalBytes {
        try visitor.visitSingularBytesField(value: v, fieldNumber: 15)
      }
      if let v = _storage._optionalGroup {
        try visitor.visitSingularGroupField(value: v, fieldNumber: 16)
      }
      if let v = _storage._optionalMessage {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
      }
      if let v = _storage._optionalEnum {
        try visitor.visitSingularEnumField(value: v, fieldNumber: 19)
      }
      if !_storage._repeatedInt32.isEmpty {
        try visitor.visitRepeatedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31)
      }
      if !_storage._repeatedInt64.isEmpty {
        try visitor.visitRepeatedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32)
      }
      if !_storage._repeatedUint32.isEmpty {
        try visitor.visitRepeatedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33)
      }
      if !_storage._repeatedUint64.isEmpty {
        try visitor.visitRepeatedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34)
      }
      if !_storage._repeatedSint32.isEmpty {
        try visitor.visitRepeatedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35)
      }
      if !_storage._repeatedSint64.isEmpty {
        try visitor.visitRepeatedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36)
      }
      if !_storage._repeatedFixed32.isEmpty {
        try visitor.visitRepeatedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37)
      }
      if !_storage._repeatedFixed64.isEmpty {
        try visitor.visitRepeatedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38)
      }
      if !_storage._repeatedSfixed32.isEmpty {
        try visitor.visitRepeatedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39)
      }
      if !_storage._repeatedSfixed64.isEmpty {
        try visitor.visitRepeatedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40)
      }
      if !_storage._repeatedFloat.isEmpty {
        try visitor.visitRepeatedFloatField(value: _storage._repeatedFloat, fieldNumber: 41)
      }
      if !_storage._repeatedDouble.isEmpty {
        try visitor.visitRepeatedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42)
      }
      if !_storage._repeatedBool.isEmpty {
        try visitor.visitRepeatedBoolField(value: _storage._repeatedBool, fieldNumber: 43)
      }
      if !_storage._repeatedString.isEmpty {
        try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44)
      }
      if !_storage._repeatedBytes.isEmpty {
        try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45)
      }
      if !_storage._repeatedGroup.isEmpty {
        try visitor.visitRepeatedGroupField(value: _storage._repeatedGroup, fieldNumber: 46)
      }
      if !_storage._repeatedMessage.isEmpty {
        try visitor.visitRepeatedMessageField(value: _storage._repeatedMessage, fieldNumber: 48)
      }
      if !_storage._repeatedEnum.isEmpty {
        try visitor.visitRepeatedEnumField(value: _storage._repeatedEnum, fieldNumber: 49)
      }
      switch _storage._o {
      case .oneofInt32(let v)?:
        try visitor.visitSingularInt32Field(value: v, fieldNumber: 51)
      case .oneofInt64(let v)?:
        try visitor.visitSingularInt64Field(value: v, fieldNumber: 52)
      case .oneofUint32(let v)?:
        try visitor.visitSingularUInt32Field(value: v, fieldNumber: 53)
      case .oneofUint64(let v)?:
        try visitor.visitSingularUInt64Field(value: v, fieldNumber: 54)
      case .oneofSint32(let v)?:
        try visitor.visitSingularSInt32Field(value: v, fieldNumber: 55)
      case .oneofSint64(let v)?:
        try visitor.visitSingularSInt64Field(value: v, fieldNumber: 56)
      case .oneofFixed32(let v)?:
        try visitor.visitSingularFixed32Field(value: v, fieldNumber: 57)
      case .oneofFixed64(let v)?:
        try visitor.visitSingularFixed64Field(value: v, fieldNumber: 58)
      case .oneofSfixed32(let v)?:
        try visitor.visitSingularSFixed32Field(value: v, fieldNumber: 59)
      case .oneofSfixed64(let v)?:
        try visitor.visitSingularSFixed64Field(value: v, fieldNumber: 60)
      case .oneofFloat(let v)?:
        try visitor.visitSingularFloatField(value: v, fieldNumber: 61)
      case .oneofDouble(let v)?:
        try visitor.visitSingularDoubleField(value: v, fieldNumber: 62)
      case .oneofBool(let v)?:
        try visitor.visitSingularBoolField(value: v, fieldNumber: 63)
      case .oneofString(let v)?:
        try visitor.visitSingularStringField(value: v, fieldNumber: 64)
      case .oneofBytes(let v)?:
        try visitor.visitSingularBytesField(value: v, fieldNumber: 65)
      case .oneofGroup(let v)?:
        try visitor.visitSingularGroupField(value: v, fieldNumber: 66)
      case .oneofMessage(let v)?:
        try visitor.visitSingularMessageField(value: v, fieldNumber: 68)
      case .oneofEnum(let v)?:
        try visitor.visitSingularEnumField(value: v, fieldNumber: 69)
      case nil: break
      }
      if !_storage._mapInt32Int32.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufInt32>.self, value: _storage._mapInt32Int32, fieldNumber: 70)
      }
      if !_storage._mapInt64Int64.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt64,SwiftProtobuf.ProtobufInt64>.self, value: _storage._mapInt64Int64, fieldNumber: 71)
      }
      if !_storage._mapUint32Uint32.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt32,SwiftProtobuf.ProtobufUInt32>.self, value: _storage._mapUint32Uint32, fieldNumber: 72)
      }
      if !_storage._mapUint64Uint64.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufUInt64,SwiftProtobuf.ProtobufUInt64>.self, value: _storage._mapUint64Uint64, fieldNumber: 73)
      }
      if !_storage._mapSint32Sint32.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt32,SwiftProtobuf.ProtobufSInt32>.self, value: _storage._mapSint32Sint32, fieldNumber: 74)
      }
      if !_storage._mapSint64Sint64.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSInt64,SwiftProtobuf.ProtobufSInt64>.self, value: _storage._mapSint64Sint64, fieldNumber: 75)
      }
      if !_storage._mapFixed32Fixed32.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed32,SwiftProtobuf.ProtobufFixed32>.self, value: _storage._mapFixed32Fixed32, fieldNumber: 76)
      }
      if !_storage._mapFixed64Fixed64.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufFixed64,SwiftProtobuf.ProtobufFixed64>.self, value: _storage._mapFixed64Fixed64, fieldNumber: 77)
      }
      if !_storage._mapSfixed32Sfixed32.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed32,SwiftProtobuf.ProtobufSFixed32>.self, value: _storage._mapSfixed32Sfixed32, fieldNumber: 78)
      }
      if !_storage._mapSfixed64Sfixed64.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufSFixed64,SwiftProtobuf.ProtobufSFixed64>.self, value: _storage._mapSfixed64Sfixed64, fieldNumber: 79)
      }
      if !_storage._mapInt32Float.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufFloat>.self, value: _storage._mapInt32Float, fieldNumber: 80)
      }
      if !_storage._mapInt32Double.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufDouble>.self, value: _storage._mapInt32Double, fieldNumber: 81)
      }
      if !_storage._mapBoolBool.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufBool,SwiftProtobuf.ProtobufBool>.self, value: _storage._mapBoolBool, fieldNumber: 82)
      }
      if !_storage._mapStringString.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: _storage._mapStringString, fieldNumber: 83)
      }
      if !_storage._mapStringBytes.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapStringBytes, fieldNumber: 84)
      }
      if !_storage._mapStringMessage.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufString,ProtobufUnittest_Message2>.self, value: _storage._mapStringMessage, fieldNumber: 85)
      }
      if !_storage._mapInt32Bytes.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufInt32,SwiftProtobuf.ProtobufBytes>.self, value: _storage._mapInt32Bytes, fieldNumber: 86)
      }
      if !_storage._mapInt32Enum.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufEnumMap<SwiftProtobuf.ProtobufInt32,ProtobufUnittest_Message2.Enum>.self, value: _storage._mapInt32Enum, fieldNumber: 87)
      }
      if !_storage._mapInt32Message.isEmpty {
        try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,ProtobufUnittest_Message2>.self, value: _storage._mapInt32Message, fieldNumber: 88)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: ProtobufUnittest_Message2, rhs: ProtobufUnittest_Message2) -> Bool {
    if lhs._storage !== rhs._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let rhs_storage = _args.1
        if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false}
        if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false}
        if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false}
        if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false}
        if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false}
        if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false}
        if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false}
        if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false}
        if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false}
        if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false}
        if _storage._optionalFloat != rhs_storage._optionalFloat {return false}
        if _storage._optionalDouble != rhs_storage._optionalDouble {return false}
        if _storage._optionalBool != rhs_storage._optionalBool {return false}
        if _storage._optionalString != rhs_storage._optionalString {return false}
        if _storage._optionalBytes != rhs_storage._optionalBytes {return false}
        if _storage._optionalGroup != rhs_storage._optionalGroup {return false}
        if _storage._optionalMessage != rhs_storage._optionalMessage {return false}
        if _storage._optionalEnum != rhs_storage._optionalEnum {return false}
        if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false}
        if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false}
        if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false}
        if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false}
        if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false}
        if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false}
        if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false}
        if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false}
        if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false}
        if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false}
        if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false}
        if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false}
        if _storage._repeatedBool != rhs_storage._repeatedBool {return false}
        if _storage._repeatedString != rhs_storage._repeatedString {return false}
        if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false}
        if _storage._repeatedGroup != rhs_storage._repeatedGroup {return false}
        if _storage._repeatedMessage != rhs_storage._repeatedMessage {return false}
        if _storage._repeatedEnum != rhs_storage._repeatedEnum {return false}
        if _storage._o != rhs_storage._o {return false}
        if _storage._mapInt32Int32 != rhs_storage._mapInt32Int32 {return false}
        if _storage._mapInt64Int64 != rhs_storage._mapInt64Int64 {return false}
        if _storage._mapUint32Uint32 != rhs_storage._mapUint32Uint32 {return false}
        if _storage._mapUint64Uint64 != rhs_storage._mapUint64Uint64 {return false}
        if _storage._mapSint32Sint32 != rhs_storage._mapSint32Sint32 {return false}
        if _storage._mapSint64Sint64 != rhs_storage._mapSint64Sint64 {return false}
        if _storage._mapFixed32Fixed32 != rhs_storage._mapFixed32Fixed32 {return false}
        if _storage._mapFixed64Fixed64 != rhs_storage._mapFixed64Fixed64 {return false}
        if _storage._mapSfixed32Sfixed32 != rhs_storage._mapSfixed32Sfixed32 {return false}
        if _storage._mapSfixed64Sfixed64 != rhs_storage._mapSfixed64Sfixed64 {return false}
        if _storage._mapInt32Float != rhs_storage._mapInt32Float {return false}
        if _storage._mapInt32Double != rhs_storage._mapInt32Double {return false}
        if _storage._mapBoolBool != rhs_storage._mapBoolBool {return false}
        if _storage._mapStringString != rhs_storage._mapStringString {return false}
        if _storage._mapStringBytes != rhs_storage._mapStringBytes {return false}
        if _storage._mapStringMessage != rhs_storage._mapStringMessage {return false}
        if _storage._mapInt32Bytes != rhs_storage._mapInt32Bytes {return false}
        if _storage._mapInt32Enum != rhs_storage._mapInt32Enum {return false}
        if _storage._mapInt32Message != rhs_storage._mapInt32Message {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension ProtobufUnittest_Message2.Enum: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "FOO"),
    1: .same(proto: "BAR"),
    2: .same(proto: "BAZ"),
    20: .same(proto: "EXTRA_2"),
  ]
}

extension ProtobufUnittest_Message2.OptionalGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = ProtobufUnittest_Message2.protoMessageName + ".OptionalGroup"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    17: .same(proto: "a"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 17: try decoder.decodeSingularInt32Field(value: &self._a)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._a {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 17)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

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

extension ProtobufUnittest_Message2.RepeatedGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = ProtobufUnittest_Message2.protoMessageName + ".RepeatedGroup"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    47: .same(proto: "a"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 47: try decoder.decodeSingularInt32Field(value: &self._a)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._a {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 47)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

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

extension ProtobufUnittest_Message2.OneofGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = ProtobufUnittest_Message2.protoMessageName + ".OneofGroup"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    67: .same(proto: "a"),
    167: .same(proto: "b"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 67: try decoder.decodeSingularInt32Field(value: &self._a)
      case 167: try decoder.decodeSingularInt32Field(value: &self._b)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._a {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 67)
    }
    if let v = self._b {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 167)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

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

extension ProtobufUnittest_Msg2NoStorage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Msg2NoStorage"
  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: ProtobufUnittest_Msg2NoStorage, rhs: ProtobufUnittest_Msg2NoStorage) -> Bool {
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension ProtobufUnittest_Msg2UsesStorage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Msg2UsesStorage"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    999: .same(proto: "y"),
  ]

  fileprivate class _StorageClass {
    var _y: ProtobufUnittest_Msg2UsesStorage? = nil

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _y = source._y
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 999: try decoder.decodeSingularMessageField(value: &_storage._y)
        default: break
        }
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if let v = _storage._y {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 999)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: ProtobufUnittest_Msg2UsesStorage, rhs: ProtobufUnittest_Msg2UsesStorage) -> Bool {
    if lhs._storage !== rhs._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let rhs_storage = _args.1
        if _storage._y != rhs_storage._y {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension ProtobufUnittest_Msg2NamesNoStorage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Msg2NamesNoStorage"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "is_initialized"),
    2: .standard(proto: "debug_description"),
    3: .same(proto: "value"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularInt32Field(value: &self._isInitialized_p)
      case 2: try decoder.decodeSingularInt32Field(value: &self._debugDescription_p)
      case 3: try decoder.decodeSingularInt32Field(value: &self._value)
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if let v = self._isInitialized_p {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
    }
    if let v = self._debugDescription_p {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
    }
    if let v = self._value {
      try visitor.visitSingularInt32Field(value: v, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

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

extension ProtobufUnittest_Msg2NamesUsesStorage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = _protobuf_package + ".Msg2NamesUsesStorage"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "is_initialized"),
    2: .standard(proto: "debug_description"),
    3: .same(proto: "value"),
  ]

  fileprivate class _StorageClass {
    var _isInitialized_p: Int32? = nil
    var _debugDescription_p: Int32? = nil
    var _value: ProtobufUnittest_Msg2UsesStorage? = nil

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _isInitialized_p = source._isInitialized_p
      _debugDescription_p = source._debugDescription_p
      _value = source._value
    }
  }

  fileprivate mutating func _uniqueStorage() -> _StorageClass {
    if !isKnownUniquelyReferenced(&_storage) {
      _storage = _StorageClass(copying: _storage)
    }
    return _storage
  }

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    _ = _uniqueStorage()
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      while let fieldNumber = try decoder.nextFieldNumber() {
        switch fieldNumber {
        case 1: try decoder.decodeSingularInt32Field(value: &_storage._isInitialized_p)
        case 2: try decoder.decodeSingularInt32Field(value: &_storage._debugDescription_p)
        case 3: try decoder.decodeSingularMessageField(value: &_storage._value)
        default: break
        }
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if let v = _storage._isInitialized_p {
        try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
      }
      if let v = _storage._debugDescription_p {
        try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
      }
      if let v = _storage._value {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: ProtobufUnittest_Msg2NamesUsesStorage, rhs: ProtobufUnittest_Msg2NamesUsesStorage) -> Bool {
    if lhs._storage !== rhs._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let rhs_storage = _args.1
        if _storage._isInitialized_p != rhs_storage._isInitialized_p {return false}
        if _storage._debugDescription_p != rhs_storage._debugDescription_p {return false}
        if _storage._value != rhs_storage._value {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
