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

import Foundation
import SwiftProtobuf

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that 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
}

public struct Iroha_Protocol_GetAccount: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetAccount"

  public var accountID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.accountID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.accountID.isEmpty {
      try visitor.visitSingularStringField(value: self.accountID, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetSignatories: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetSignatories"

  public var accountID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.accountID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.accountID.isEmpty {
      try visitor.visitSingularStringField(value: self.accountID, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetAccountTransactions: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetAccountTransactions"

  public var accountID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.accountID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.accountID.isEmpty {
      try visitor.visitSingularStringField(value: self.accountID, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetAccountAssetTransactions: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetAccountAssetTransactions"

  public var accountID: String = String()

  public var assetID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.accountID)
      case 2: try decoder.decodeSingularStringField(value: &self.assetID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.accountID.isEmpty {
      try visitor.visitSingularStringField(value: self.accountID, fieldNumber: 1)
    }
    if !self.assetID.isEmpty {
      try visitor.visitSingularStringField(value: self.assetID, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetTransactions: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetTransactions"

  public var txHashes: [Data] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeRepeatedBytesField(value: &self.txHashes)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.txHashes.isEmpty {
      try visitor.visitRepeatedBytesField(value: self.txHashes, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetAccountAssets: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetAccountAssets"

  public var accountID: String = String()

  public var assetID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.accountID)
      case 2: try decoder.decodeSingularStringField(value: &self.assetID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.accountID.isEmpty {
      try visitor.visitSingularStringField(value: self.accountID, fieldNumber: 1)
    }
    if !self.assetID.isEmpty {
      try visitor.visitSingularStringField(value: self.assetID, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetAccountDetail: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetAccountDetail"

  public var accountID: String = String()

  public var detail: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.accountID)
      case 2: try decoder.decodeSingularStringField(value: &self.detail)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.accountID.isEmpty {
      try visitor.visitSingularStringField(value: self.accountID, fieldNumber: 1)
    }
    if !self.detail.isEmpty {
      try visitor.visitSingularStringField(value: self.detail, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetAssetInfo: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetAssetInfo"

  public var assetID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.assetID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.assetID.isEmpty {
      try visitor.visitSingularStringField(value: self.assetID, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetRoles: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetRoles"

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let _ = try decoder.nextFieldNumber() {
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_GetRolePermissions: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".GetRolePermissions"

  public var roleID: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      switch fieldNumber {
      case 1: try decoder.decodeSingularStringField(value: &self.roleID)
      default: break
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.roleID.isEmpty {
      try visitor.visitSingularStringField(value: self.roleID, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }
}

public struct Iroha_Protocol_Query: SwiftProtobuf.Message {
  public static let protoMessageName: String = _protobuf_package + ".Query"

  public var payload: Iroha_Protocol_Query.Payload {
    get {return _storage._payload ?? Iroha_Protocol_Query.Payload()}
    set {_uniqueStorage()._payload = newValue}
  }
  /// Returns true if `payload` has been explicitly set.
  public var hasPayload: Bool {return _storage._payload != nil}
  /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  public mutating func clearPayload() {_storage._payload = nil}

  public var signature: Iroha_Protocol_Signature {
    get {return _storage._signature ?? Iroha_Protocol_Signature()}
    set {_uniqueStorage()._signature = newValue}
  }
  /// Returns true if `signature` has been explicitly set.
  public var hasSignature: Bool {return _storage._signature != nil}
  /// Clears the value of `signature`. Subsequent reads from it will return its default value.
  public mutating func clearSignature() {_storage._signature = nil}

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public struct Payload: SwiftProtobuf.Message {
    public static let protoMessageName: String = Iroha_Protocol_Query.protoMessageName + ".Payload"

    public var createdTime: UInt64 {
      get {return _storage._createdTime}
      set {_uniqueStorage()._createdTime = newValue}
    }

    public var creatorAccountID: String {
      get {return _storage._creatorAccountID}
      set {_uniqueStorage()._creatorAccountID = newValue}
    }

    public var query: OneOf_Query? {
      get {return _storage._query}
      set {_uniqueStorage()._query = newValue}
    }

    public var getAccount: Iroha_Protocol_GetAccount {
      get {
        if case .getAccount(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetAccount()
      }
      set {_uniqueStorage()._query = .getAccount(newValue)}
    }

    public var getAccountSignatories: Iroha_Protocol_GetSignatories {
      get {
        if case .getAccountSignatories(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetSignatories()
      }
      set {_uniqueStorage()._query = .getAccountSignatories(newValue)}
    }

    public var getAccountTransactions: Iroha_Protocol_GetAccountTransactions {
      get {
        if case .getAccountTransactions(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetAccountTransactions()
      }
      set {_uniqueStorage()._query = .getAccountTransactions(newValue)}
    }

    public var getAccountAssetTransactions: Iroha_Protocol_GetAccountAssetTransactions {
      get {
        if case .getAccountAssetTransactions(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetAccountAssetTransactions()
      }
      set {_uniqueStorage()._query = .getAccountAssetTransactions(newValue)}
    }

    public var getTransactions: Iroha_Protocol_GetTransactions {
      get {
        if case .getTransactions(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetTransactions()
      }
      set {_uniqueStorage()._query = .getTransactions(newValue)}
    }

    public var getAccountAssets: Iroha_Protocol_GetAccountAssets {
      get {
        if case .getAccountAssets(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetAccountAssets()
      }
      set {_uniqueStorage()._query = .getAccountAssets(newValue)}
    }

    public var getAccountDetail: Iroha_Protocol_GetAccountDetail {
      get {
        if case .getAccountDetail(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetAccountDetail()
      }
      set {_uniqueStorage()._query = .getAccountDetail(newValue)}
    }

    public var getRoles: Iroha_Protocol_GetRoles {
      get {
        if case .getRoles(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetRoles()
      }
      set {_uniqueStorage()._query = .getRoles(newValue)}
    }

    public var getRolePermissions: Iroha_Protocol_GetRolePermissions {
      get {
        if case .getRolePermissions(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetRolePermissions()
      }
      set {_uniqueStorage()._query = .getRolePermissions(newValue)}
    }

    public var getAssetInfo: Iroha_Protocol_GetAssetInfo {
      get {
        if case .getAssetInfo(let v)? = _storage._query {return v}
        return Iroha_Protocol_GetAssetInfo()
      }
      set {_uniqueStorage()._query = .getAssetInfo(newValue)}
    }

    /// used to prevent replay attacks.
    public var queryCounter: UInt64 {
      get {return _storage._queryCounter}
      set {_uniqueStorage()._queryCounter = newValue}
    }

    public var unknownFields = SwiftProtobuf.UnknownStorage()

    public enum OneOf_Query: Equatable {
      case getAccount(Iroha_Protocol_GetAccount)
      case getAccountSignatories(Iroha_Protocol_GetSignatories)
      case getAccountTransactions(Iroha_Protocol_GetAccountTransactions)
      case getAccountAssetTransactions(Iroha_Protocol_GetAccountAssetTransactions)
      case getTransactions(Iroha_Protocol_GetTransactions)
      case getAccountAssets(Iroha_Protocol_GetAccountAssets)
      case getAccountDetail(Iroha_Protocol_GetAccountDetail)
      case getRoles(Iroha_Protocol_GetRoles)
      case getRolePermissions(Iroha_Protocol_GetRolePermissions)
      case getAssetInfo(Iroha_Protocol_GetAssetInfo)

      public static func ==(lhs: Iroha_Protocol_Query.Payload.OneOf_Query, rhs: Iroha_Protocol_Query.Payload.OneOf_Query) -> Bool {
        switch (lhs, rhs) {
        case (.getAccount(let l), .getAccount(let r)): return l == r
        case (.getAccountSignatories(let l), .getAccountSignatories(let r)): return l == r
        case (.getAccountTransactions(let l), .getAccountTransactions(let r)): return l == r
        case (.getAccountAssetTransactions(let l), .getAccountAssetTransactions(let r)): return l == r
        case (.getTransactions(let l), .getTransactions(let r)): return l == r
        case (.getAccountAssets(let l), .getAccountAssets(let r)): return l == r
        case (.getAccountDetail(let l), .getAccountDetail(let r)): return l == r
        case (.getRoles(let l), .getRoles(let r)): return l == r
        case (.getRolePermissions(let l), .getRolePermissions(let r)): return l == r
        case (.getAssetInfo(let l), .getAssetInfo(let r)): return l == r
        default: return false
        }
      }
    }

    public init() {}

    /// Used by the decoding initializers in the SwiftProtobuf library, not generally
    /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
    /// initializers are defined in the SwiftProtobuf library. See the Message and
    /// Message+*Additions` files.
    public 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.decodeSingularUInt64Field(value: &_storage._createdTime)
          case 2: try decoder.decodeSingularStringField(value: &_storage._creatorAccountID)
          case 3:
            var v: Iroha_Protocol_GetAccount?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAccount(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAccount(v)}
          case 4:
            var v: Iroha_Protocol_GetSignatories?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAccountSignatories(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAccountSignatories(v)}
          case 5:
            var v: Iroha_Protocol_GetAccountTransactions?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAccountTransactions(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAccountTransactions(v)}
          case 6:
            var v: Iroha_Protocol_GetAccountAssetTransactions?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAccountAssetTransactions(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAccountAssetTransactions(v)}
          case 7:
            var v: Iroha_Protocol_GetTransactions?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getTransactions(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getTransactions(v)}
          case 8:
            var v: Iroha_Protocol_GetAccountAssets?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAccountAssets(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAccountAssets(v)}
          case 9:
            var v: Iroha_Protocol_GetAccountDetail?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAccountDetail(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAccountDetail(v)}
          case 10:
            var v: Iroha_Protocol_GetRoles?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getRoles(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getRoles(v)}
          case 11:
            var v: Iroha_Protocol_GetRolePermissions?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getRolePermissions(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getRolePermissions(v)}
          case 12:
            var v: Iroha_Protocol_GetAssetInfo?
            if let current = _storage._query {
              try decoder.handleConflictingOneOf()
              if case .getAssetInfo(let m) = current {v = m}
            }
            try decoder.decodeSingularMessageField(value: &v)
            if let v = v {_storage._query = .getAssetInfo(v)}
          case 13: try decoder.decodeSingularUInt64Field(value: &_storage._queryCounter)
          default: break
          }
        }
      }
    }

    /// Used by the encoding methods of the SwiftProtobuf library, not generally
    /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
    /// other serializer methods are defined in the SwiftProtobuf library. See the
    /// `Message` and `Message+*Additions` files.
    public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
      try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
        if _storage._createdTime != 0 {
          try visitor.visitSingularUInt64Field(value: _storage._createdTime, fieldNumber: 1)
        }
        if !_storage._creatorAccountID.isEmpty {
          try visitor.visitSingularStringField(value: _storage._creatorAccountID, fieldNumber: 2)
        }
        switch _storage._query {
        case .getAccount(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
        case .getAccountSignatories(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
        case .getAccountTransactions(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
        case .getAccountAssetTransactions(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
        case .getTransactions(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
        case .getAccountAssets(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
        case .getAccountDetail(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 9)
        case .getRoles(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 10)
        case .getRolePermissions(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 11)
        case .getAssetInfo(let v)?:
          try visitor.visitSingularMessageField(value: v, fieldNumber: 12)
        case nil: break
        }
        if _storage._queryCounter != 0 {
          try visitor.visitSingularUInt64Field(value: _storage._queryCounter, fieldNumber: 13)
        }
      }
      try unknownFields.traverse(visitor: &visitor)
    }

    fileprivate var _storage = _StorageClass.defaultInstance
  }

  public init() {}

  /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  /// initializers are defined in the SwiftProtobuf library. See the Message and
  /// Message+*Additions` files.
  public 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.decodeSingularMessageField(value: &_storage._payload)
        case 2: try decoder.decodeSingularMessageField(value: &_storage._signature)
        default: break
        }
      }
    }
  }

  /// Used by the encoding methods of the SwiftProtobuf library, not generally
  /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  /// other serializer methods are defined in the SwiftProtobuf library. See the
  /// `Message` and `Message+*Additions` files.
  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
      if let v = _storage._payload {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
      }
      if let v = _storage._signature {
        try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
      }
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  fileprivate var _storage = _StorageClass.defaultInstance
}

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

fileprivate let _protobuf_package = "iroha.protocol"

extension Iroha_Protocol_GetAccount: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetAccount) -> Bool {
    if self.accountID != other.accountID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetSignatories: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetSignatories) -> Bool {
    if self.accountID != other.accountID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetAccountTransactions: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetAccountTransactions) -> Bool {
    if self.accountID != other.accountID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetAccountAssetTransactions: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_id"),
    2: .standard(proto: "asset_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetAccountAssetTransactions) -> Bool {
    if self.accountID != other.accountID {return false}
    if self.assetID != other.assetID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetTransactions: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "tx_hashes"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetTransactions) -> Bool {
    if self.txHashes != other.txHashes {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetAccountAssets: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_id"),
    2: .standard(proto: "asset_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetAccountAssets) -> Bool {
    if self.accountID != other.accountID {return false}
    if self.assetID != other.assetID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetAccountDetail: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "account_id"),
    2: .same(proto: "detail"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetAccountDetail) -> Bool {
    if self.accountID != other.accountID {return false}
    if self.detail != other.detail {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetAssetInfo: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "asset_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetAssetInfo) -> Bool {
    if self.assetID != other.assetID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetRoles: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap = SwiftProtobuf._NameMap()

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetRoles) -> Bool {
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_GetRolePermissions: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "role_id"),
  ]

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_GetRolePermissions) -> Bool {
    if self.roleID != other.roleID {return false}
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_Query: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "payload"),
    2: .same(proto: "signature"),
  ]

  fileprivate class _StorageClass {
    var _payload: Iroha_Protocol_Query.Payload? = nil
    var _signature: Iroha_Protocol_Signature? = nil

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _payload = source._payload
      _signature = source._signature
    }
  }

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

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_Query) -> Bool {
    if _storage !== other._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let other_storage = _args.1
        if _storage._payload != other_storage._payload {return false}
        if _storage._signature != other_storage._signature {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if unknownFields != other.unknownFields {return false}
    return true
  }
}

extension Iroha_Protocol_Query.Payload: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "created_time"),
    2: .standard(proto: "creator_account_id"),
    3: .standard(proto: "get_account"),
    4: .standard(proto: "get_account_signatories"),
    5: .standard(proto: "get_account_transactions"),
    6: .standard(proto: "get_account_asset_transactions"),
    7: .standard(proto: "get_transactions"),
    8: .standard(proto: "get_account_assets"),
    9: .standard(proto: "get_account_detail"),
    10: .standard(proto: "get_roles"),
    11: .standard(proto: "get_role_permissions"),
    12: .standard(proto: "get_asset_info"),
    13: .standard(proto: "query_counter"),
  ]

  fileprivate class _StorageClass {
    var _createdTime: UInt64 = 0
    var _creatorAccountID: String = String()
    var _query: Iroha_Protocol_Query.Payload.OneOf_Query?
    var _queryCounter: UInt64 = 0

    static let defaultInstance = _StorageClass()

    private init() {}

    init(copying source: _StorageClass) {
      _createdTime = source._createdTime
      _creatorAccountID = source._creatorAccountID
      _query = source._query
      _queryCounter = source._queryCounter
    }
  }

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

  public func _protobuf_generated_isEqualTo(other: Iroha_Protocol_Query.Payload) -> Bool {
    if _storage !== other._storage {
      let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_args: (_StorageClass, _StorageClass)) in
        let _storage = _args.0
        let other_storage = _args.1
        if _storage._createdTime != other_storage._createdTime {return false}
        if _storage._creatorAccountID != other_storage._creatorAccountID {return false}
        if _storage._query != other_storage._query {return false}
        if _storage._queryCounter != other_storage._queryCounter {return false}
        return true
      }
      if !storagesAreEqual {return false}
    }
    if unknownFields != other.unknownFields {return false}
    return true
  }
}
