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

scalapb.com.eventstore.dbclient.proto.streams.DeleteResp.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 DeleteResp(
    positionOption: com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption = com.eventstore.dbclient.proto.streams.DeleteResp.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 (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 = {
      positionOption.position.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      positionOption.noPosition.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def getPosition: com.eventstore.dbclient.proto.streams.DeleteResp.Position = positionOption.position.getOrElse(com.eventstore.dbclient.proto.streams.DeleteResp.Position.defaultInstance)
    def withPosition(__v: com.eventstore.dbclient.proto.streams.DeleteResp.Position): DeleteResp = copy(positionOption = com.eventstore.dbclient.proto.streams.DeleteResp.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): DeleteResp = copy(positionOption = com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.NoPosition(__v))
    def clearPositionOption: DeleteResp = copy(positionOption = com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.Empty)
    def withPositionOption(__v: com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption): DeleteResp = 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 => positionOption.position.orNull
        case 2 => 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 => positionOption.position.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 2 => 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.DeleteResp.type = com.eventstore.dbclient.proto.streams.DeleteResp
    // @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.DeleteResp])
}

@scala.annotation.nowarn
object DeleteResp extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.DeleteResp] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.DeleteResp] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.DeleteResp = {
    var __positionOption: com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption = com.eventstore.dbclient.proto.streams.DeleteResp.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 10 =>
          __positionOption = com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.Position(__positionOption.position.fold(_root_.scalapb.LiteParser.readMessage[com.eventstore.dbclient.proto.streams.DeleteResp.Position](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 18 =>
          __positionOption = com.eventstore.dbclient.proto.streams.DeleteResp.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.DeleteResp(
        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.DeleteResp] = _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.DeleteResp(
        positionOption = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.streams.DeleteResp.Position]]).map(com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.Position(_))
            .orElse[com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption](__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[com.eventstore.dbclient.proto.shared.Empty]]).map(com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.NoPosition(_)))
            .getOrElse(com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.Empty)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = StreamsProto.javaDescriptor.getMessageTypes().get(7)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = StreamsProto.scalaDescriptor.messages(7)
  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.DeleteResp.Position
      case 2 => __out = com.eventstore.dbclient.proto.shared.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.DeleteResp.Position
    )
  def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[?] = throw new MatchError(__fieldNumber)
  lazy val defaultInstance = com.eventstore.dbclient.proto.streams.DeleteResp(
    positionOption = com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption.Empty
  )
  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.DeleteResp.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.DeleteResp.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.DeleteResp.Position) extends com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption {
      type ValueType = com.eventstore.dbclient.proto.streams.DeleteResp.Position
      override def isPosition: _root_.scala.Boolean = true
      override def position: _root_.scala.Option[com.eventstore.dbclient.proto.streams.DeleteResp.Position] = Some(value)
      override def number: _root_.scala.Int = 1
    }
    @SerialVersionUID(0L)
    final case class NoPosition(value: com.eventstore.dbclient.proto.shared.Empty) extends com.eventstore.dbclient.proto.streams.DeleteResp.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 = 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.DeleteResp.Position.type = com.eventstore.dbclient.proto.streams.DeleteResp.Position
      // @@protoc_insertion_point(GeneratedMessage[event_store.client.streams.DeleteResp.Position])
  }
  
  object Position extends scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.DeleteResp.Position] {
    implicit def messageCompanion: scalapb.GeneratedMessageCompanion[com.eventstore.dbclient.proto.streams.DeleteResp.Position] = this
    def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): com.eventstore.dbclient.proto.streams.DeleteResp.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.DeleteResp.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.DeleteResp.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.DeleteResp.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.DeleteResp.javaDescriptor.getNestedTypes().get(0)
    def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = com.eventstore.dbclient.proto.streams.DeleteResp.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.DeleteResp.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.DeleteResp.Position = _root_.com.eventstore.dbclient.proto.streams.DeleteResp.Position(
      commitPosition,
      preparePosition
    )
    // @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.DeleteResp.Position])
  }
  
  final val POSITION_FIELD_NUMBER = 1
  final val NO_POSITION_FIELD_NUMBER = 2
  def of(
    positionOption: com.eventstore.dbclient.proto.streams.DeleteResp.PositionOption
  ): _root_.com.eventstore.dbclient.proto.streams.DeleteResp = _root_.com.eventstore.dbclient.proto.streams.DeleteResp(
    positionOption
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[event_store.client.streams.DeleteResp])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy