All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalapb.com.eventstore.dbclient.proto.streams.AppendResp.scala Maven / Gradle / Ivy

The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3

package com.eventstore.dbclient.proto.streams

@SerialVersionUID(0L)
final case class AppendResp(
    result: com.eventstore.dbclient.proto.streams.AppendResp.Result = com.eventstore.dbclient.proto.streams.AppendResp.Result.Empty,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage {
    @transient
    private var __serializedSizeMemoized: _root_.scala.Int = 0
    private def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      if (result.success.isDefined) {
        val __value = result.success.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (result.wrongExpectedVersion.isDefined) {
        val __value = result.wrongExpectedVersion.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      __size += unknownFields.serializedSize
      __size
    }
    override def serializedSize: _root_.scala.Int = {
      var __size = __serializedSizeMemoized
      if (__size == 0) {
        __size = __computeSerializedSize() + 1
        __serializedSizeMemoized = __size
      }
      __size - 1
      
    }
    def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
      result.success.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      result.wrongExpectedVersion.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def getSuccess: com.eventstore.dbclient.proto.streams.AppendResp.Success = result.success.getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.Success.defaultInstance)
    def withSuccess(__v: com.eventstore.dbclient.proto.streams.AppendResp.Success): AppendResp = copy(result = com.eventstore.dbclient.proto.streams.AppendResp.Result.Success(__v))
    def getWrongExpectedVersion: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion = result.wrongExpectedVersion.getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.defaultInstance)
    def withWrongExpectedVersion(__v: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion): AppendResp = copy(result = com.eventstore.dbclient.proto.streams.AppendResp.Result.WrongExpectedVersion(__v))
    def clearResult: AppendResp = copy(result = com.eventstore.dbclient.proto.streams.AppendResp.Result.Empty)
    def withResult(__v: com.eventstore.dbclient.proto.streams.AppendResp.Result): AppendResp = copy(result = __v)
    def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
    def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
    def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
      (__fieldNumber: @_root_.scala.unchecked) match {
        case 1 => result.success.orNull
        case 2 => result.wrongExpectedVersion.orNull
      }
    }
    def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
      _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
      (__field.number: @_root_.scala.unchecked) match {
        case 1 => result.success.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => result.wrongExpectedVersion.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: com.eventstore.dbclient.proto.streams.AppendResp.type = com.eventstore.dbclient.proto.streams.AppendResp
    // @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.AppendResp])
}

@scala.annotation.nowarn
object AppendResp extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.AppendResp = {
    var __result: com.eventstore.dbclient.proto.streams.AppendResp.Result = com.eventstore.dbclient.proto.streams.AppendResp.Result.Empty
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __result = com.eventstore.dbclient.proto.streams.AppendResp.Result.Success(__result.success.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.streams.AppendResp.Success](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 18 =>
          __result = com.eventstore.dbclient.proto.streams.AppendResp.Result.WrongExpectedVersion(__result.wrongExpectedVersion.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    com.eventstore.dbclient.proto.streams.AppendResp(
        result = __result,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[com.eventstore.dbclient.proto.streams.AppendResp] = _root_.scalapb.descriptors.Reads{
    case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
      _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
      com.eventstore.dbclient.proto.streams.AppendResp(
        result = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.Success]]).map(com.eventstore.dbclient.proto.streams.AppendResp.Result.Success(_))
            .orElse[com.eventstore.dbclient.proto.streams.AppendResp.Result](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion]]).map(com.eventstore.dbclient.proto.streams.AppendResp.Result.WrongExpectedVersion(_)))
            .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.Result.Empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = StreamsProto.javaDescriptor.getMessageTypes().get(3)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = StreamsProto.scalaDescriptor.messages(3)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[?] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[?] = null
    (__number: @_root_.scala.unchecked) match {
      case 1 => __out = com.eventstore.dbclient.proto.streams.AppendResp.Success
      case 2 => __out = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion
    }
    __out
  }
  lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]] =
    Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]](
      _root_.com.eventstore.dbclient.proto.streams.AppendResp.Position,
      _root_.com.eventstore.dbclient.proto.streams.AppendResp.Success,
      _root_.com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion
    )
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[?] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = com.eventstore.dbclient.proto.streams.AppendResp(
    result = com.eventstore.dbclient.proto.streams.AppendResp.Result.Empty
  )
  sealed trait Result extends _root_.scalapb.GeneratedOneof {
    def isEmpty: _root_.scala.Boolean = false
    def isDefined: _root_.scala.Boolean = true
    def isSuccess: _root_.scala.Boolean = false
    def isWrongExpectedVersion: _root_.scala.Boolean = false
    def success: _root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.Success] = _root_.scala.None
    def wrongExpectedVersion: _root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion] = _root_.scala.None
  }
  object Result {
    @SerialVersionUID(0L)
    case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.Result {
      type ValueType = _root_.scala.Nothing
      override def isEmpty: _root_.scala.Boolean = true
      override def isDefined: _root_.scala.Boolean = false
      override def number: _root_.scala.Int = 0
      override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
    }
  
    @SerialVersionUID(0L)
    final case class Success(value: com.eventstore.dbclient.proto.streams.AppendResp.Success) extends com.eventstore.dbclient.proto.streams.AppendResp.Result {
      type ValueType = com.eventstore.dbclient.proto.streams.AppendResp.Success
      override def isSuccess: _root_.scala.Boolean = true
      override def success: _root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.Success] = Some(value)
      override def number: _root_.scala.Int = 1
    }
    @SerialVersionUID(0L)
    final case class WrongExpectedVersion(value: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion) extends com.eventstore.dbclient.proto.streams.AppendResp.Result {
      type ValueType = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion
      override def isWrongExpectedVersion: _root_.scala.Boolean = true
      override def wrongExpectedVersion: _root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion] = Some(value)
      override def number: _root_.scala.Int = 2
    }
  }
  @SerialVersionUID(0L)
  final case class Position(
      commitPosition: _root_.scala.Long = 0L,
      preparePosition: _root_.scala.Long = 0L,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage {
      @transient
      private var __serializedSizeMemoized: _root_.scala.Int = 0
      private def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        
        {
          val __value = commitPosition
          if (__value != 0L) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
          }
        };
        
        {
          val __value = preparePosition
          if (__value != 0L) {
            __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(2, __value)
          }
        };
        __size += unknownFields.serializedSize
        __size
      }
      override def serializedSize: _root_.scala.Int = {
        var __size = __serializedSizeMemoized
        if (__size == 0) {
          __size = __computeSerializedSize() + 1
          __serializedSizeMemoized = __size
        }
        __size - 1
        
      }
      def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
        {
          val __v = commitPosition
          if (__v != 0L) {
            _output__.writeUInt64(1, __v)
          }
        };
        {
          val __v = preparePosition
          if (__v != 0L) {
            _output__.writeUInt64(2, __v)
          }
        };
        unknownFields.writeTo(_output__)
      }
      def withCommitPosition(__v: _root_.scala.Long): Position = copy(commitPosition = __v)
      def withPreparePosition(__v: _root_.scala.Long): Position = copy(preparePosition = __v)
      def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
      def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
      def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
        (__fieldNumber: @_root_.scala.unchecked) match {
          case 1 => {
            val __t = commitPosition
            if (__t != 0L) __t else null
          }
          case 2 => {
            val __t = preparePosition
            if (__t != 0L) __t else null
          }
        }
      }
      def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
        _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
        (__field.number: @_root_.scala.unchecked) match {
          case 1 => _root_.scalapb.descriptors.PLong(commitPosition)
          case 2 => _root_.scalapb.descriptors.PLong(preparePosition)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: com.eventstore.dbclient.proto.streams.AppendResp.Position.type = com.eventstore.dbclient.proto.streams.AppendResp.Position
      // @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.AppendResp.Position])
  }
  
  object Position extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp.Position] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp.Position] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.AppendResp.Position = {
      var __commitPosition: _root_.scala.Long = 0L
      var __preparePosition: _root_.scala.Long = 0L
      var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
      var _done__ = false
      while (!_done__) {
        val _tag__ = _input__.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 8 =>
            __commitPosition = _input__.readUInt64()
          case 16 =>
            __preparePosition = _input__.readUInt64()
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      com.eventstore.dbclient.proto.streams.AppendResp.Position(
          commitPosition = __commitPosition,
          preparePosition = __preparePosition,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[com.eventstore.dbclient.proto.streams.AppendResp.Position] = _root_.scalapb.descriptors.Reads{
      case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
        _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
        com.eventstore.dbclient.proto.streams.AppendResp.Position(
          commitPosition = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
          preparePosition = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = com.eventstore.dbclient.proto.streams.AppendResp.javaDescriptor.getNestedTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = com.eventstore.dbclient.proto.streams.AppendResp.scalaDescriptor.nestedMessages(0)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[?] = throw new MatchError(__number)
    lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]] = Seq.empty
    def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[?] = throw new MatchError(__fieldNumber)
    lazy val defaultInstance = com.eventstore.dbclient.proto.streams.AppendResp.Position(
      commitPosition = 0L,
      preparePosition = 0L
    )
    final val COMMIT_POSITION_FIELD_NUMBER = 1
    final val PREPARE_POSITION_FIELD_NUMBER = 2
    def of(
      commitPosition: _root_.scala.Long,
      preparePosition: _root_.scala.Long
    ): _root_.com.eventstore.dbclient.proto.streams.AppendResp.Position = _root_.com.eventstore.dbclient.proto.streams.AppendResp.Position(
      commitPosition,
      preparePosition
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.AppendResp.Position])
  }
  
  @SerialVersionUID(0L)
  final case class Success(
      currentRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.Empty,
      positionOption: com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Empty,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage {
      @transient
      private var __serializedSizeMemoized: _root_.scala.Int = 0
      private def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        if (currentRevisionOption.currentRevision.isDefined) {
          val __value = currentRevisionOption.currentRevision.get
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
        };
        if (currentRevisionOption.noStream.isDefined) {
          val __value = currentRevisionOption.noStream.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (positionOption.position.isDefined) {
          val __value = positionOption.position.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (positionOption.noPosition.isDefined) {
          val __value = positionOption.noPosition.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        __size += unknownFields.serializedSize
        __size
      }
      override def serializedSize: _root_.scala.Int = {
        var __size = __serializedSizeMemoized
        if (__size == 0) {
          __size = __computeSerializedSize() + 1
          __serializedSizeMemoized = __size
        }
        __size - 1
        
      }
      def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
        currentRevisionOption.currentRevision.foreach { __v =>
          val __m = __v
          _output__.writeUInt64(1, __m)
        };
        currentRevisionOption.noStream.foreach { __v =>
          val __m = __v
          _output__.writeTag(2, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        positionOption.position.foreach { __v =>
          val __m = __v
          _output__.writeTag(3, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        positionOption.noPosition.foreach { __v =>
          val __m = __v
          _output__.writeTag(4, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def getCurrentRevision: _root_.scala.Long = currentRevisionOption.currentRevision.getOrElse(0L)
      def withCurrentRevision(__v: _root_.scala.Long): Success = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.CurrentRevision(__v))
      def getNoStream: com.eventstore.dbclient.proto.shared.Empty = currentRevisionOption.noStream.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withNoStream(__v: com.eventstore.dbclient.proto.shared.Empty): Success = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.NoStream(__v))
      def getPosition: com.eventstore.dbclient.proto.streams.AppendResp.Position = positionOption.position.getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.Position.defaultInstance)
      def withPosition(__v: com.eventstore.dbclient.proto.streams.AppendResp.Position): Success = copy(positionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Position(__v))
      def getNoPosition: com.eventstore.dbclient.proto.shared.Empty = positionOption.noPosition.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withNoPosition(__v: com.eventstore.dbclient.proto.shared.Empty): Success = copy(positionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.NoPosition(__v))
      def clearCurrentRevisionOption: Success = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.Empty)
      def withCurrentRevisionOption(__v: com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption): Success = copy(currentRevisionOption = __v)
      def clearPositionOption: Success = copy(positionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Empty)
      def withPositionOption(__v: com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption): Success = copy(positionOption = __v)
      def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
      def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
      def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
        (__fieldNumber: @_root_.scala.unchecked) match {
          case 1 => currentRevisionOption.currentRevision.orNull
          case 2 => currentRevisionOption.noStream.orNull
          case 3 => positionOption.position.orNull
          case 4 => positionOption.noPosition.orNull
        }
      }
      def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
        _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
        (__field.number: @_root_.scala.unchecked) match {
          case 1 => currentRevisionOption.currentRevision.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 2 => currentRevisionOption.noStream.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 3 => positionOption.position.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 4 => positionOption.noPosition.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: com.eventstore.dbclient.proto.streams.AppendResp.Success.type = com.eventstore.dbclient.proto.streams.AppendResp.Success
      // @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.AppendResp.Success])
  }
  
  object Success extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp.Success] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp.Success] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.AppendResp.Success = {
      var __currentRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.Empty
      var __positionOption: com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Empty
      var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
      var _done__ = false
      while (!_done__) {
        val _tag__ = _input__.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 8 =>
            __currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.CurrentRevision(_input__.readUInt64())
          case 18 =>
            __currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.NoStream(__currentRevisionOption.noStream.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 26 =>
            __positionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Position(__positionOption.position.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.streams.AppendResp.Position](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 34 =>
            __positionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.NoPosition(__positionOption.noPosition.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      com.eventstore.dbclient.proto.streams.AppendResp.Success(
          currentRevisionOption = __currentRevisionOption,
          positionOption = __positionOption,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[com.eventstore.dbclient.proto.streams.AppendResp.Success] = _root_.scalapb.descriptors.Reads{
      case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
        _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
        com.eventstore.dbclient.proto.streams.AppendResp.Success(
          currentRevisionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.CurrentRevision(_))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.NoStream(_)))
              .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.Empty),
          positionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.Position]]).map(com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Position(_))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.NoPosition(_)))
              .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Empty)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = com.eventstore.dbclient.proto.streams.AppendResp.javaDescriptor.getNestedTypes().get(1)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = com.eventstore.dbclient.proto.streams.AppendResp.scalaDescriptor.nestedMessages(1)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[?] = {
      var __out: _root_.scalapb.GeneratedMessageCompanion[?] = null
      (__number: @_root_.scala.unchecked) match {
        case 2 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 3 => __out = com.eventstore.dbclient.proto.streams.AppendResp.Position
        case 4 => __out = com.eventstore.dbclient.proto.shared.Empty
      }
      __out
    }
    lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]] = Seq.empty
    def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[?] = throw new MatchError(__fieldNumber)
    lazy val defaultInstance = com.eventstore.dbclient.proto.streams.AppendResp.Success(
      currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption.Empty,
      positionOption = com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption.Empty
    )
    sealed trait CurrentRevisionOption extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isCurrentRevision: _root_.scala.Boolean = false
      def isNoStream: _root_.scala.Boolean = false
      def currentRevision: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
      def noStream: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
    }
    object CurrentRevisionOption {
      @SerialVersionUID(0L)
      case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption {
        type ValueType = _root_.scala.Nothing
        override def isEmpty: _root_.scala.Boolean = true
        override def isDefined: _root_.scala.Boolean = false
        override def number: _root_.scala.Int = 0
        override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
      }
    
      @SerialVersionUID(0L)
      final case class CurrentRevision(value: _root_.scala.Long) extends com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption {
        type ValueType = _root_.scala.Long
        override def isCurrentRevision: _root_.scala.Boolean = true
        override def currentRevision: _root_.scala.Option[_root_.scala.Long] = Some(value)
        override def number: _root_.scala.Int = 1
      }
      @SerialVersionUID(0L)
      final case class NoStream(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isNoStream: _root_.scala.Boolean = true
        override def noStream: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 2
      }
    }
    sealed trait PositionOption extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isPosition: _root_.scala.Boolean = false
      def isNoPosition: _root_.scala.Boolean = false
      def position: _root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.Position] = _root_.scala.None
      def noPosition: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
    }
    object PositionOption {
      @SerialVersionUID(0L)
      case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption {
        type ValueType = _root_.scala.Nothing
        override def isEmpty: _root_.scala.Boolean = true
        override def isDefined: _root_.scala.Boolean = false
        override def number: _root_.scala.Int = 0
        override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
      }
    
      @SerialVersionUID(0L)
      final case class Position(value: com.eventstore.dbclient.proto.streams.AppendResp.Position) extends com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption {
        type ValueType = com.eventstore.dbclient.proto.streams.AppendResp.Position
        override def isPosition: _root_.scala.Boolean = true
        override def position: _root_.scala.Option[com.eventstore.dbclient.proto.streams.AppendResp.Position] = Some(value)
        override def number: _root_.scala.Int = 3
      }
      @SerialVersionUID(0L)
      final case class NoPosition(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isNoPosition: _root_.scala.Boolean = true
        override def noPosition: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 4
      }
    }
    final val CURRENT_REVISION_FIELD_NUMBER = 1
    final val NO_STREAM_FIELD_NUMBER = 2
    final val POSITION_FIELD_NUMBER = 3
    final val NO_POSITION_FIELD_NUMBER = 4
    def of(
      currentRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.Success.CurrentRevisionOption,
      positionOption: com.eventstore.dbclient.proto.streams.AppendResp.Success.PositionOption
    ): _root_.com.eventstore.dbclient.proto.streams.AppendResp.Success = _root_.com.eventstore.dbclient.proto.streams.AppendResp.Success(
      currentRevisionOption,
      positionOption
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.AppendResp.Success])
  }
  
  @SerialVersionUID(0L)
  final case class WrongExpectedVersion(
      currentRevisionOption2060: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.Empty,
      expectedRevisionOption2060: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Empty,
      currentRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.Empty,
      expectedRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.Empty,
      unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
      ) extends scalapb.GeneratedMessage {
      @transient
      private var __serializedSizeMemoized: _root_.scala.Int = 0
      private def __computeSerializedSize(): _root_.scala.Int = {
        var __size = 0
        if (currentRevisionOption2060.currentRevision2060.isDefined) {
          val __value = currentRevisionOption2060.currentRevision2060.get
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
        };
        if (currentRevisionOption2060.noStream2060.isDefined) {
          val __value = currentRevisionOption2060.noStream2060.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (expectedRevisionOption2060.expectedRevision2060.isDefined) {
          val __value = expectedRevisionOption2060.expectedRevision2060.get
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(3, __value)
        };
        if (expectedRevisionOption2060.any2060.isDefined) {
          val __value = expectedRevisionOption2060.any2060.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (expectedRevisionOption2060.streamExists2060.isDefined) {
          val __value = expectedRevisionOption2060.streamExists2060.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (currentRevisionOption.currentRevision.isDefined) {
          val __value = currentRevisionOption.currentRevision.get
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(6, __value)
        };
        if (currentRevisionOption.currentNoStream.isDefined) {
          val __value = currentRevisionOption.currentNoStream.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (expectedRevisionOption.expectedRevision.isDefined) {
          val __value = expectedRevisionOption.expectedRevision.get
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(8, __value)
        };
        if (expectedRevisionOption.expectedAny.isDefined) {
          val __value = expectedRevisionOption.expectedAny.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (expectedRevisionOption.expectedStreamExists.isDefined) {
          val __value = expectedRevisionOption.expectedStreamExists.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        if (expectedRevisionOption.expectedNoStream.isDefined) {
          val __value = expectedRevisionOption.expectedNoStream.get
          __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
        };
        __size += unknownFields.serializedSize
        __size
      }
      override def serializedSize: _root_.scala.Int = {
        var __size = __serializedSizeMemoized
        if (__size == 0) {
          __size = __computeSerializedSize() + 1
          __serializedSizeMemoized = __size
        }
        __size - 1
        
      }
      def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
        currentRevisionOption2060.currentRevision2060.foreach { __v =>
          val __m = __v
          _output__.writeUInt64(1, __m)
        };
        currentRevisionOption2060.noStream2060.foreach { __v =>
          val __m = __v
          _output__.writeTag(2, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        expectedRevisionOption2060.expectedRevision2060.foreach { __v =>
          val __m = __v
          _output__.writeUInt64(3, __m)
        };
        expectedRevisionOption2060.any2060.foreach { __v =>
          val __m = __v
          _output__.writeTag(4, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        expectedRevisionOption2060.streamExists2060.foreach { __v =>
          val __m = __v
          _output__.writeTag(5, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        currentRevisionOption.currentRevision.foreach { __v =>
          val __m = __v
          _output__.writeUInt64(6, __m)
        };
        currentRevisionOption.currentNoStream.foreach { __v =>
          val __m = __v
          _output__.writeTag(7, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        expectedRevisionOption.expectedRevision.foreach { __v =>
          val __m = __v
          _output__.writeUInt64(8, __m)
        };
        expectedRevisionOption.expectedAny.foreach { __v =>
          val __m = __v
          _output__.writeTag(9, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        expectedRevisionOption.expectedStreamExists.foreach { __v =>
          val __m = __v
          _output__.writeTag(10, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        expectedRevisionOption.expectedNoStream.foreach { __v =>
          val __m = __v
          _output__.writeTag(11, 2)
          _output__.writeUInt32NoTag(__m.serializedSize)
          __m.writeTo(_output__)
        };
        unknownFields.writeTo(_output__)
      }
      def getCurrentRevision2060: _root_.scala.Long = currentRevisionOption2060.currentRevision2060.getOrElse(0L)
      def withCurrentRevision2060(__v: _root_.scala.Long): WrongExpectedVersion = copy(currentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.CurrentRevision2060(__v))
      def getNoStream2060: com.eventstore.dbclient.proto.shared.Empty = currentRevisionOption2060.noStream2060.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withNoStream2060(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(currentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.NoStream2060(__v))
      def getExpectedRevision2060: _root_.scala.Long = expectedRevisionOption2060.expectedRevision2060.getOrElse(0L)
      def withExpectedRevision2060(__v: _root_.scala.Long): WrongExpectedVersion = copy(expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.ExpectedRevision2060(__v))
      def getAny2060: com.eventstore.dbclient.proto.shared.Empty = expectedRevisionOption2060.any2060.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withAny2060(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Any2060(__v))
      def getStreamExists2060: com.eventstore.dbclient.proto.shared.Empty = expectedRevisionOption2060.streamExists2060.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withStreamExists2060(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.StreamExists2060(__v))
      def getCurrentRevision: _root_.scala.Long = currentRevisionOption.currentRevision.getOrElse(0L)
      def withCurrentRevision(__v: _root_.scala.Long): WrongExpectedVersion = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.CurrentRevision(__v))
      def getCurrentNoStream: com.eventstore.dbclient.proto.shared.Empty = currentRevisionOption.currentNoStream.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withCurrentNoStream(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.CurrentNoStream(__v))
      def getExpectedRevision: _root_.scala.Long = expectedRevisionOption.expectedRevision.getOrElse(0L)
      def withExpectedRevision(__v: _root_.scala.Long): WrongExpectedVersion = copy(expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedRevision(__v))
      def getExpectedAny: com.eventstore.dbclient.proto.shared.Empty = expectedRevisionOption.expectedAny.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withExpectedAny(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedAny(__v))
      def getExpectedStreamExists: com.eventstore.dbclient.proto.shared.Empty = expectedRevisionOption.expectedStreamExists.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withExpectedStreamExists(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedStreamExists(__v))
      def getExpectedNoStream: com.eventstore.dbclient.proto.shared.Empty = expectedRevisionOption.expectedNoStream.getOrElse(com.eventstore.dbclient.proto.shared.Empty.defaultInstance)
      def withExpectedNoStream(__v: com.eventstore.dbclient.proto.shared.Empty): WrongExpectedVersion = copy(expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedNoStream(__v))
      def clearCurrentRevisionOption2060: WrongExpectedVersion = copy(currentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.Empty)
      def withCurrentRevisionOption2060(__v: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060): WrongExpectedVersion = copy(currentRevisionOption2060 = __v)
      def clearExpectedRevisionOption2060: WrongExpectedVersion = copy(expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Empty)
      def withExpectedRevisionOption2060(__v: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060): WrongExpectedVersion = copy(expectedRevisionOption2060 = __v)
      def clearCurrentRevisionOption: WrongExpectedVersion = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.Empty)
      def withCurrentRevisionOption(__v: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption): WrongExpectedVersion = copy(currentRevisionOption = __v)
      def clearExpectedRevisionOption: WrongExpectedVersion = copy(expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.Empty)
      def withExpectedRevisionOption(__v: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption): WrongExpectedVersion = copy(expectedRevisionOption = __v)
      def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
      def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
      def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
        (__fieldNumber: @_root_.scala.unchecked) match {
          case 1 => currentRevisionOption2060.currentRevision2060.orNull
          case 2 => currentRevisionOption2060.noStream2060.orNull
          case 3 => expectedRevisionOption2060.expectedRevision2060.orNull
          case 4 => expectedRevisionOption2060.any2060.orNull
          case 5 => expectedRevisionOption2060.streamExists2060.orNull
          case 6 => currentRevisionOption.currentRevision.orNull
          case 7 => currentRevisionOption.currentNoStream.orNull
          case 8 => expectedRevisionOption.expectedRevision.orNull
          case 9 => expectedRevisionOption.expectedAny.orNull
          case 10 => expectedRevisionOption.expectedStreamExists.orNull
          case 11 => expectedRevisionOption.expectedNoStream.orNull
        }
      }
      def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
        _root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
        (__field.number: @_root_.scala.unchecked) match {
          case 1 => currentRevisionOption2060.currentRevision2060.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 2 => currentRevisionOption2060.noStream2060.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 3 => expectedRevisionOption2060.expectedRevision2060.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 4 => expectedRevisionOption2060.any2060.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 5 => expectedRevisionOption2060.streamExists2060.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 6 => currentRevisionOption.currentRevision.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 7 => currentRevisionOption.currentNoStream.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 8 => expectedRevisionOption.expectedRevision.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 9 => expectedRevisionOption.expectedAny.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 10 => expectedRevisionOption.expectedStreamExists.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
          case 11 => expectedRevisionOption.expectedNoStream.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        }
      }
      def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
      def companion: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.type = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion
      // @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.AppendResp.WrongExpectedVersion])
  }
  
  object WrongExpectedVersion extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion = {
      var __currentRevisionOption2060: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.Empty
      var __expectedRevisionOption2060: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Empty
      var __currentRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.Empty
      var __expectedRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.Empty
      var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
      var _done__ = false
      while (!_done__) {
        val _tag__ = _input__.readTag()
        _tag__ match {
          case 0 => _done__ = true
          case 8 =>
            __currentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.CurrentRevision2060(_input__.readUInt64())
          case 18 =>
            __currentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.NoStream2060(__currentRevisionOption2060.noStream2060.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 24 =>
            __expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.ExpectedRevision2060(_input__.readUInt64())
          case 34 =>
            __expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Any2060(__expectedRevisionOption2060.any2060.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 42 =>
            __expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.StreamExists2060(__expectedRevisionOption2060.streamExists2060.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 48 =>
            __currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.CurrentRevision(_input__.readUInt64())
          case 58 =>
            __currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.CurrentNoStream(__currentRevisionOption.currentNoStream.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 64 =>
            __expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedRevision(_input__.readUInt64())
          case 74 =>
            __expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedAny(__expectedRevisionOption.expectedAny.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 82 =>
            __expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedStreamExists(__expectedRevisionOption.expectedStreamExists.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case 90 =>
            __expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedNoStream(__expectedRevisionOption.expectedNoStream.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
          case tag =>
            if (_unknownFields__ == null) {
              _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
            }
            _unknownFields__.parseField(tag, _input__)
        }
      }
      com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion(
          currentRevisionOption2060 = __currentRevisionOption2060,
          expectedRevisionOption2060 = __expectedRevisionOption2060,
          currentRevisionOption = __currentRevisionOption,
          expectedRevisionOption = __expectedRevisionOption,
          unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
      )
    }
    implicit def messageReads: _root_.scalapb.descriptors.Reads[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion] = _root_.scalapb.descriptors.Reads{
      case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
        _root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
        com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion(
          currentRevisionOption2060 = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.CurrentRevision2060(_))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.NoStream2060(_)))
              .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.Empty),
          expectedRevisionOption2060 = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.ExpectedRevision2060(_))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060](__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Any2060(_)))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060](__fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.StreamExists2060(_)))
              .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Empty),
          currentRevisionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.CurrentRevision(_))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.CurrentNoStream(_)))
              .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.Empty),
          expectedRevisionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedRevision(_))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedAny(_)))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedStreamExists(_)))
              .orElse[com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(11).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.ExpectedNoStream(_)))
              .getOrElse(com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.Empty)
        )
      case _ => throw new RuntimeException("Expected PMessage")
    }
    def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = com.eventstore.dbclient.proto.streams.AppendResp.javaDescriptor.getNestedTypes().get(2)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = com.eventstore.dbclient.proto.streams.AppendResp.scalaDescriptor.nestedMessages(2)
    def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[?] = {
      var __out: _root_.scalapb.GeneratedMessageCompanion[?] = null
      (__number: @_root_.scala.unchecked) match {
        case 2 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 4 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 5 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 7 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 9 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 10 => __out = com.eventstore.dbclient.proto.shared.Empty
        case 11 => __out = com.eventstore.dbclient.proto.shared.Empty
      }
      __out
    }
    lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]] = Seq.empty
    def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[?] = throw new MatchError(__fieldNumber)
    lazy val defaultInstance = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion(
      currentRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060.Empty,
      expectedRevisionOption2060 = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060.Empty,
      currentRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption.Empty,
      expectedRevisionOption = com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption.Empty
    )
    sealed trait CurrentRevisionOption2060 extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isCurrentRevision2060: _root_.scala.Boolean = false
      def isNoStream2060: _root_.scala.Boolean = false
      def currentRevision2060: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
      def noStream2060: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
    }
    object CurrentRevisionOption2060 {
      @SerialVersionUID(0L)
      case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060 {
        type ValueType = _root_.scala.Nothing
        override def isEmpty: _root_.scala.Boolean = true
        override def isDefined: _root_.scala.Boolean = false
        override def number: _root_.scala.Int = 0
        override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
      }
    
      @SerialVersionUID(0L)
      final case class CurrentRevision2060(value: _root_.scala.Long) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060 {
        type ValueType = _root_.scala.Long
        override def isCurrentRevision2060: _root_.scala.Boolean = true
        override def currentRevision2060: _root_.scala.Option[_root_.scala.Long] = Some(value)
        override def number: _root_.scala.Int = 1
      }
      @SerialVersionUID(0L)
      final case class NoStream2060(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060 {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isNoStream2060: _root_.scala.Boolean = true
        override def noStream2060: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 2
      }
    }
    sealed trait ExpectedRevisionOption2060 extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isExpectedRevision2060: _root_.scala.Boolean = false
      def isAny2060: _root_.scala.Boolean = false
      def isStreamExists2060: _root_.scala.Boolean = false
      def expectedRevision2060: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
      def any2060: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
      def streamExists2060: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
    }
    object ExpectedRevisionOption2060 {
      @SerialVersionUID(0L)
      case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060 {
        type ValueType = _root_.scala.Nothing
        override def isEmpty: _root_.scala.Boolean = true
        override def isDefined: _root_.scala.Boolean = false
        override def number: _root_.scala.Int = 0
        override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
      }
    
      @SerialVersionUID(0L)
      final case class ExpectedRevision2060(value: _root_.scala.Long) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060 {
        type ValueType = _root_.scala.Long
        override def isExpectedRevision2060: _root_.scala.Boolean = true
        override def expectedRevision2060: _root_.scala.Option[_root_.scala.Long] = Some(value)
        override def number: _root_.scala.Int = 3
      }
      @SerialVersionUID(0L)
      final case class Any2060(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060 {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isAny2060: _root_.scala.Boolean = true
        override def any2060: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 4
      }
      @SerialVersionUID(0L)
      final case class StreamExists2060(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060 {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isStreamExists2060: _root_.scala.Boolean = true
        override def streamExists2060: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 5
      }
    }
    sealed trait CurrentRevisionOption extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isCurrentRevision: _root_.scala.Boolean = false
      def isCurrentNoStream: _root_.scala.Boolean = false
      def currentRevision: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
      def currentNoStream: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
    }
    object CurrentRevisionOption {
      @SerialVersionUID(0L)
      case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption {
        type ValueType = _root_.scala.Nothing
        override def isEmpty: _root_.scala.Boolean = true
        override def isDefined: _root_.scala.Boolean = false
        override def number: _root_.scala.Int = 0
        override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
      }
    
      @SerialVersionUID(0L)
      final case class CurrentRevision(value: _root_.scala.Long) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption {
        type ValueType = _root_.scala.Long
        override def isCurrentRevision: _root_.scala.Boolean = true
        override def currentRevision: _root_.scala.Option[_root_.scala.Long] = Some(value)
        override def number: _root_.scala.Int = 6
      }
      @SerialVersionUID(0L)
      final case class CurrentNoStream(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isCurrentNoStream: _root_.scala.Boolean = true
        override def currentNoStream: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 7
      }
    }
    sealed trait ExpectedRevisionOption extends _root_.scalapb.GeneratedOneof {
      def isEmpty: _root_.scala.Boolean = false
      def isDefined: _root_.scala.Boolean = true
      def isExpectedRevision: _root_.scala.Boolean = false
      def isExpectedAny: _root_.scala.Boolean = false
      def isExpectedStreamExists: _root_.scala.Boolean = false
      def isExpectedNoStream: _root_.scala.Boolean = false
      def expectedRevision: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
      def expectedAny: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
      def expectedStreamExists: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
      def expectedNoStream: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = _root_.scala.None
    }
    object ExpectedRevisionOption {
      @SerialVersionUID(0L)
      case object Empty extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption {
        type ValueType = _root_.scala.Nothing
        override def isEmpty: _root_.scala.Boolean = true
        override def isDefined: _root_.scala.Boolean = false
        override def number: _root_.scala.Int = 0
        override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
      }
    
      @SerialVersionUID(0L)
      final case class ExpectedRevision(value: _root_.scala.Long) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption {
        type ValueType = _root_.scala.Long
        override def isExpectedRevision: _root_.scala.Boolean = true
        override def expectedRevision: _root_.scala.Option[_root_.scala.Long] = Some(value)
        override def number: _root_.scala.Int = 8
      }
      @SerialVersionUID(0L)
      final case class ExpectedAny(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isExpectedAny: _root_.scala.Boolean = true
        override def expectedAny: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 9
      }
      @SerialVersionUID(0L)
      final case class ExpectedStreamExists(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isExpectedStreamExists: _root_.scala.Boolean = true
        override def expectedStreamExists: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 10
      }
      @SerialVersionUID(0L)
      final case class ExpectedNoStream(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption {
        type ValueType = com.eventstore.dbclient.proto.shared.Empty
        override def isExpectedNoStream: _root_.scala.Boolean = true
        override def expectedNoStream: _root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty] = Some(value)
        override def number: _root_.scala.Int = 11
      }
    }
    final val CURRENT_REVISION_20_6_0_FIELD_NUMBER = 1
    final val NO_STREAM_20_6_0_FIELD_NUMBER = 2
    final val EXPECTED_REVISION_20_6_0_FIELD_NUMBER = 3
    final val ANY_20_6_0_FIELD_NUMBER = 4
    final val STREAM_EXISTS_20_6_0_FIELD_NUMBER = 5
    final val CURRENT_REVISION_FIELD_NUMBER = 6
    final val CURRENT_NO_STREAM_FIELD_NUMBER = 7
    final val EXPECTED_REVISION_FIELD_NUMBER = 8
    final val EXPECTED_ANY_FIELD_NUMBER = 9
    final val EXPECTED_STREAM_EXISTS_FIELD_NUMBER = 10
    final val EXPECTED_NO_STREAM_FIELD_NUMBER = 11
    def of(
      currentRevisionOption2060: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption2060,
      expectedRevisionOption2060: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption2060,
      currentRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.CurrentRevisionOption,
      expectedRevisionOption: com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion.ExpectedRevisionOption
    ): _root_.com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion = _root_.com.eventstore.dbclient.proto.streams.AppendResp.WrongExpectedVersion(
      currentRevisionOption2060,
      expectedRevisionOption2060,
      currentRevisionOption,
      expectedRevisionOption
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.AppendResp.WrongExpectedVersion])
  }
  
  final val SUCCESS_FIELD_NUMBER = 1
  final val WRONG_EXPECTED_VERSION_FIELD_NUMBER = 2
  def of(
    result: com.eventstore.dbclient.proto.streams.AppendResp.Result
  ): _root_.com.eventstore.dbclient.proto.streams.AppendResp = _root_.com.eventstore.dbclient.proto.streams.AppendResp(
    result
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.AppendResp])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy