scalapb.com.eventstore.dbclient.proto.streams.BatchAppendResp.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 BatchAppendResp(
correlationId: _root_.scala.Option[com.eventstore.dbclient.proto.shared.UUID] = _root_.scala.None,
result: com.eventstore.dbclient.proto.streams.BatchAppendResp.Result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Empty,
streamIdentifier: _root_.scala.Option[com.eventstore.dbclient.proto.shared.StreamIdentifier] = _root_.scala.None,
expectedStreamPosition: com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.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 (correlationId.isDefined) {
val __value = correlationId.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (result.error.isDefined) {
val __value = result.error.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (result.success.isDefined) {
val __value = result.success.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (streamIdentifier.isDefined) {
val __value = streamIdentifier.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (expectedStreamPosition.streamPosition.isDefined) {
val __value = expectedStreamPosition.streamPosition.get
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(5, __value)
};
if (expectedStreamPosition.noStream.isDefined) {
val __value = expectedStreamPosition.noStream.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (expectedStreamPosition.any.isDefined) {
val __value = expectedStreamPosition.any.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (expectedStreamPosition.streamExists.isDefined) {
val __value = expectedStreamPosition.streamExists.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 = {
correlationId.foreach { __v =>
val __m = __v
_output__.writeTag(1, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
result.error.foreach { __v =>
val __m = __v
_output__.writeTag(2, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
result.success.foreach { __v =>
val __m = __v
_output__.writeTag(3, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
streamIdentifier.foreach { __v =>
val __m = __v
_output__.writeTag(4, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
expectedStreamPosition.streamPosition.foreach { __v =>
val __m = __v
_output__.writeUInt64(5, __m)
};
expectedStreamPosition.noStream.foreach { __v =>
val __m = __v
_output__.writeTag(6, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
expectedStreamPosition.any.foreach { __v =>
val __m = __v
_output__.writeTag(7, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
expectedStreamPosition.streamExists.foreach { __v =>
val __m = __v
_output__.writeTag(8, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def getCorrelationId: com.eventstore.dbclient.proto.shared.UUID = correlationId.getOrElse(com.eventstore.dbclient.proto.shared.UUID.defaultInstance)
def clearCorrelationId: BatchAppendResp = copy(correlationId = _root_.scala.None)
def withCorrelationId(__v: com.eventstore.dbclient.proto.shared.UUID): BatchAppendResp = copy(correlationId = Option(__v))
def getError: com.google.rpc.Status = result.error.getOrElse(com.google.rpc.Status.defaultInstance)
def withError(__v: com.google.rpc.Status): BatchAppendResp = copy(result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Error(__v))
def getSuccess: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success = result.success.getOrElse(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.defaultInstance)
def withSuccess(__v: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success): BatchAppendResp = copy(result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Success(__v))
def getStreamIdentifier: com.eventstore.dbclient.proto.shared.StreamIdentifier = streamIdentifier.getOrElse(com.eventstore.dbclient.proto.shared.StreamIdentifier.defaultInstance)
def clearStreamIdentifier: BatchAppendResp = copy(streamIdentifier = _root_.scala.None)
def withStreamIdentifier(__v: com.eventstore.dbclient.proto.shared.StreamIdentifier): BatchAppendResp = copy(streamIdentifier = Option(__v))
def getStreamPosition: _root_.scala.Long = expectedStreamPosition.streamPosition.getOrElse(0L)
def withStreamPosition(__v: _root_.scala.Long): BatchAppendResp = copy(expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.StreamPosition(__v))
def getNoStream: com.google.protobuf.empty.Empty = expectedStreamPosition.noStream.getOrElse(com.google.protobuf.empty.Empty.defaultInstance)
def withNoStream(__v: com.google.protobuf.empty.Empty): BatchAppendResp = copy(expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.NoStream(__v))
def getAny: com.google.protobuf.empty.Empty = expectedStreamPosition.any.getOrElse(com.google.protobuf.empty.Empty.defaultInstance)
def withAny(__v: com.google.protobuf.empty.Empty): BatchAppendResp = copy(expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.Any(__v))
def getStreamExists: com.google.protobuf.empty.Empty = expectedStreamPosition.streamExists.getOrElse(com.google.protobuf.empty.Empty.defaultInstance)
def withStreamExists(__v: com.google.protobuf.empty.Empty): BatchAppendResp = copy(expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.StreamExists(__v))
def clearResult: BatchAppendResp = copy(result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Empty)
def withResult(__v: com.eventstore.dbclient.proto.streams.BatchAppendResp.Result): BatchAppendResp = copy(result = __v)
def clearExpectedStreamPosition: BatchAppendResp = copy(expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.Empty)
def withExpectedStreamPosition(__v: com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition): BatchAppendResp = copy(expectedStreamPosition = __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 => correlationId.orNull
case 2 => result.error.orNull
case 3 => result.success.orNull
case 4 => streamIdentifier.orNull
case 5 => expectedStreamPosition.streamPosition.orNull
case 6 => expectedStreamPosition.noStream.orNull
case 7 => expectedStreamPosition.any.orNull
case 8 => expectedStreamPosition.streamExists.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 => correlationId.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 2 => result.error.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 3 => result.success.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 4 => streamIdentifier.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 5 => expectedStreamPosition.streamPosition.map(_root_.scalapb.descriptors.PLong(_)).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 6 => expectedStreamPosition.noStream.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 7 => expectedStreamPosition.any.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 8 => expectedStreamPosition.streamExists.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.BatchAppendResp.type = com.eventstore.dbclient.proto.streams.BatchAppendResp
// @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.BatchAppendResp])
}
@scala.annotation.nowarn
object BatchAppendResp extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.BatchAppendResp] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.BatchAppendResp] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.BatchAppendResp = {
var __correlationId: _root_.scala.Option[com.eventstore.dbclient.proto.shared.UUID] = _root_.scala.None
var __streamIdentifier: _root_.scala.Option[com.eventstore.dbclient.proto.shared.StreamIdentifier] = _root_.scala.None
var __result: com.eventstore.dbclient.proto.streams.BatchAppendResp.Result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Empty
var __expectedStreamPosition: com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.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 =>
__correlationId = _root_.scala.Option(__correlationId.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.UUID](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 18 =>
__result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Error(__result.error.fold(_root_.scalapb.LiteParser.readMessage[com.google.rpc.Status](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 26 =>
__result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Success(__result.success.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 34 =>
__streamIdentifier = _root_.scala.Option(__streamIdentifier.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.StreamIdentifier](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 40 =>
__expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.StreamPosition(_input__.readUInt64())
case 50 =>
__expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.NoStream(__expectedStreamPosition.noStream.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.empty.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 58 =>
__expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.Any(__expectedStreamPosition.any.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.empty.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 66 =>
__expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.StreamExists(__expectedStreamPosition.streamExists.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.empty.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.BatchAppendResp(
correlationId = __correlationId,
streamIdentifier = __streamIdentifier,
result = __result,
expectedStreamPosition = __expectedStreamPosition,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[com.eventstore.dbclient.proto.streams.BatchAppendResp] = _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.BatchAppendResp(
correlationId = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.UUID]]),
streamIdentifier = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.StreamIdentifier]]),
result = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.google.rpc.Status]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Error(_))
.orElse[com.eventstore.dbclient.proto.streams.BatchAppendResp.Result](__fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Success(_)))
.getOrElse(com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Empty),
expectedStreamPosition = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.StreamPosition(_))
.orElse[com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition](__fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.empty.Empty]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.NoStream(_)))
.orElse[com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition](__fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.empty.Empty]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.Any(_)))
.orElse[com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition](__fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.empty.Empty]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.StreamExists(_)))
.getOrElse(com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.Empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = StreamsProto.javaDescriptor.getMessageTypes().get(5)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = StreamsProto.scalaDescriptor.messages(5)
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.shared.UUID
case 2 => __out = com.google.rpc.Status
case 3 => __out = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success
case 4 => __out = com.eventstore.dbclient.proto.shared.StreamIdentifier
case 6 => __out = com.google.protobuf.empty.Empty
case 7 => __out = com.google.protobuf.empty.Empty
case 8 => __out = com.google.protobuf.empty.Empty
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]] =
Seq[_root_.scalapb.GeneratedMessageCompanion[? <: _root_.scalapb.GeneratedMessage]](
_root_.com.eventstore.dbclient.proto.streams.BatchAppendResp.Success
)
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[?] = throw new MatchError(__fieldNumber)
lazy val defaultInstance = com.eventstore.dbclient.proto.streams.BatchAppendResp(
correlationId = _root_.scala.None,
streamIdentifier = _root_.scala.None,
result = com.eventstore.dbclient.proto.streams.BatchAppendResp.Result.Empty,
expectedStreamPosition = com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition.Empty
)
sealed trait Result extends _root_.scalapb.GeneratedOneof {
def isEmpty: _root_.scala.Boolean = false
def isDefined: _root_.scala.Boolean = true
def isError: _root_.scala.Boolean = false
def isSuccess: _root_.scala.Boolean = false
def error: _root_.scala.Option[com.google.rpc.Status] = _root_.scala.None
def success: _root_.scala.Option[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success] = _root_.scala.None
}
object Result {
@SerialVersionUID(0L)
case object Empty extends com.eventstore.dbclient.proto.streams.BatchAppendResp.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 Error(value: com.google.rpc.Status) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.Result {
type ValueType = com.google.rpc.Status
override def isError: _root_.scala.Boolean = true
override def error: _root_.scala.Option[com.google.rpc.Status] = Some(value)
override def number: _root_.scala.Int = 2
}
@SerialVersionUID(0L)
final case class Success(value: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.Result {
type ValueType = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success
override def isSuccess: _root_.scala.Boolean = true
override def success: _root_.scala.Option[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success] = Some(value)
override def number: _root_.scala.Int = 3
}
}
sealed trait ExpectedStreamPosition extends _root_.scalapb.GeneratedOneof {
def isEmpty: _root_.scala.Boolean = false
def isDefined: _root_.scala.Boolean = true
def isStreamPosition: _root_.scala.Boolean = false
def isNoStream: _root_.scala.Boolean = false
def isAny: _root_.scala.Boolean = false
def isStreamExists: _root_.scala.Boolean = false
def streamPosition: _root_.scala.Option[_root_.scala.Long] = _root_.scala.None
def noStream: _root_.scala.Option[com.google.protobuf.empty.Empty] = _root_.scala.None
def any: _root_.scala.Option[com.google.protobuf.empty.Empty] = _root_.scala.None
def streamExists: _root_.scala.Option[com.google.protobuf.empty.Empty] = _root_.scala.None
}
object ExpectedStreamPosition {
@SerialVersionUID(0L)
case object Empty extends com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition {
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 StreamPosition(value: _root_.scala.Long) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition {
type ValueType = _root_.scala.Long
override def isStreamPosition: _root_.scala.Boolean = true
override def streamPosition: _root_.scala.Option[_root_.scala.Long] = Some(value)
override def number: _root_.scala.Int = 5
}
@SerialVersionUID(0L)
final case class NoStream(value: com.google.protobuf.empty.Empty) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition {
type ValueType = com.google.protobuf.empty.Empty
override def isNoStream: _root_.scala.Boolean = true
override def noStream: _root_.scala.Option[com.google.protobuf.empty.Empty] = Some(value)
override def number: _root_.scala.Int = 6
}
@SerialVersionUID(0L)
final case class Any(value: com.google.protobuf.empty.Empty) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition {
type ValueType = com.google.protobuf.empty.Empty
override def isAny: _root_.scala.Boolean = true
override def any: _root_.scala.Option[com.google.protobuf.empty.Empty] = Some(value)
override def number: _root_.scala.Int = 7
}
@SerialVersionUID(0L)
final case class StreamExists(value: com.google.protobuf.empty.Empty) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition {
type ValueType = com.google.protobuf.empty.Empty
override def isStreamExists: _root_.scala.Boolean = true
override def streamExists: _root_.scala.Option[com.google.protobuf.empty.Empty] = Some(value)
override def number: _root_.scala.Int = 8
}
}
@SerialVersionUID(0L)
final case class Success(
currentRevisionOption: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.Empty,
positionOption: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.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.BatchAppendResp.Success.CurrentRevisionOption.CurrentRevision(__v))
def getNoStream: com.google.protobuf.empty.Empty = currentRevisionOption.noStream.getOrElse(com.google.protobuf.empty.Empty.defaultInstance)
def withNoStream(__v: com.google.protobuf.empty.Empty): Success = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.NoStream(__v))
def getPosition: com.eventstore.dbclient.proto.shared.AllStreamPosition = positionOption.position.getOrElse(com.eventstore.dbclient.proto.shared.AllStreamPosition.defaultInstance)
def withPosition(__v: com.eventstore.dbclient.proto.shared.AllStreamPosition): Success = copy(positionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.Position(__v))
def getNoPosition: com.google.protobuf.empty.Empty = positionOption.noPosition.getOrElse(com.google.protobuf.empty.Empty.defaultInstance)
def withNoPosition(__v: com.google.protobuf.empty.Empty): Success = copy(positionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.NoPosition(__v))
def clearCurrentRevisionOption: Success = copy(currentRevisionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.Empty)
def withCurrentRevisionOption(__v: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption): Success = copy(currentRevisionOption = __v)
def clearPositionOption: Success = copy(positionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.Empty)
def withPositionOption(__v: com.eventstore.dbclient.proto.streams.BatchAppendResp.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.BatchAppendResp.Success.type = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success
// @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.BatchAppendResp.Success])
}
object Success extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.BatchAppendResp.Success = {
var __currentRevisionOption: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.Empty
var __positionOption: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.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.BatchAppendResp.Success.CurrentRevisionOption.CurrentRevision(_input__.readUInt64())
case 18 =>
__currentRevisionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.NoStream(__currentRevisionOption.noStream.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.empty.Empty](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 26 =>
__positionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.Position(__positionOption.position.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.shared.AllStreamPosition](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 34 =>
__positionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.NoPosition(__positionOption.noPosition.fold(_root_.scalapb.LiteParser.readMessage[com.google.protobuf.empty.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.BatchAppendResp.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.BatchAppendResp.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.BatchAppendResp.Success(
currentRevisionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[_root_.scala.Long]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.CurrentRevision(_))
.orElse[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.empty.Empty]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.NoStream(_)))
.getOrElse(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.Empty),
positionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.AllStreamPosition]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.Position(_))
.orElse[com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[com.google.protobuf.empty.Empty]]).map(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.NoPosition(_)))
.getOrElse(com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption.Empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = com.eventstore.dbclient.proto.streams.BatchAppendResp.javaDescriptor.getNestedTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = com.eventstore.dbclient.proto.streams.BatchAppendResp.scalaDescriptor.nestedMessages(0)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[?] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[?] = null
(__number: @_root_.scala.unchecked) match {
case 2 => __out = com.google.protobuf.empty.Empty
case 3 => __out = com.eventstore.dbclient.proto.shared.AllStreamPosition
case 4 => __out = com.google.protobuf.empty.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.BatchAppendResp.Success(
currentRevisionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption.Empty,
positionOption = com.eventstore.dbclient.proto.streams.BatchAppendResp.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.google.protobuf.empty.Empty] = _root_.scala.None
}
object CurrentRevisionOption {
@SerialVersionUID(0L)
case object Empty extends com.eventstore.dbclient.proto.streams.BatchAppendResp.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.BatchAppendResp.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.google.protobuf.empty.Empty) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.CurrentRevisionOption {
type ValueType = com.google.protobuf.empty.Empty
override def isNoStream: _root_.scala.Boolean = true
override def noStream: _root_.scala.Option[com.google.protobuf.empty.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.shared.AllStreamPosition] = _root_.scala.None
def noPosition: _root_.scala.Option[com.google.protobuf.empty.Empty] = _root_.scala.None
}
object PositionOption {
@SerialVersionUID(0L)
case object Empty extends com.eventstore.dbclient.proto.streams.BatchAppendResp.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.shared.AllStreamPosition) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption {
type ValueType = com.eventstore.dbclient.proto.shared.AllStreamPosition
override def isPosition: _root_.scala.Boolean = true
override def position: _root_.scala.Option[com.eventstore.dbclient.proto.shared.AllStreamPosition] = Some(value)
override def number: _root_.scala.Int = 3
}
@SerialVersionUID(0L)
final case class NoPosition(value: com.google.protobuf.empty.Empty) extends com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption {
type ValueType = com.google.protobuf.empty.Empty
override def isNoPosition: _root_.scala.Boolean = true
override def noPosition: _root_.scala.Option[com.google.protobuf.empty.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.BatchAppendResp.Success.CurrentRevisionOption,
positionOption: com.eventstore.dbclient.proto.streams.BatchAppendResp.Success.PositionOption
): _root_.com.eventstore.dbclient.proto.streams.BatchAppendResp.Success = _root_.com.eventstore.dbclient.proto.streams.BatchAppendResp.Success(
currentRevisionOption,
positionOption
)
// @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.BatchAppendResp.Success])
}
final val CORRELATION_ID_FIELD_NUMBER = 1
final val ERROR_FIELD_NUMBER = 2
final val SUCCESS_FIELD_NUMBER = 3
final val STREAM_IDENTIFIER_FIELD_NUMBER = 4
final val STREAM_POSITION_FIELD_NUMBER = 5
final val NO_STREAM_FIELD_NUMBER = 6
final val ANY_FIELD_NUMBER = 7
final val STREAM_EXISTS_FIELD_NUMBER = 8
def of(
correlationId: _root_.scala.Option[com.eventstore.dbclient.proto.shared.UUID],
result: com.eventstore.dbclient.proto.streams.BatchAppendResp.Result,
streamIdentifier: _root_.scala.Option[com.eventstore.dbclient.proto.shared.StreamIdentifier],
expectedStreamPosition: com.eventstore.dbclient.proto.streams.BatchAppendResp.ExpectedStreamPosition
): _root_.com.eventstore.dbclient.proto.streams.BatchAppendResp = _root_.com.eventstore.dbclient.proto.streams.BatchAppendResp(
correlationId,
result,
streamIdentifier,
expectedStreamPosition
)
// @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.BatchAppendResp])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy