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

xyz.stratalab.indexer.services.GetIndexedTransactionsRequest.scala Maven / Gradle / Ivy

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

package xyz.stratalab.indexer.services

/** Request the use of a named index to find transactions containing data that matches specified values.
  *
  * @param indexName
  *   The name of the index to search
  * @param value
  *   The index value(s) to search for.
  * @param maxResults
  *   The maximum number of transactions to be returned
  * @param skipResults
  *   A number of transactions to be skipped. This is useful for paging results.
  */
@SerialVersionUID(0L)
final case class GetIndexedTransactionsRequest(
    indexName: _root_.scala.Predef.String = "",
    value: _root_.scala.Seq[xyz.stratalab.indexer.services.IndexMatchValue] = _root_.scala.Seq.empty,
    maxResults: _root_.scala.Int = 0,
    skipResults: _root_.scala.Long = 0L,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[GetIndexedTransactionsRequest] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = indexName
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
        }
      };
      value.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      
      {
        val __value = maxResults
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(3, __value)
        }
      };
      
      {
        val __value = skipResults
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(4, __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 = indexName
        if (!__v.isEmpty) {
          _output__.writeString(1, __v)
        }
      };
      value.foreach { __v =>
        val __m = __v
        _output__.writeTag(2, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = maxResults
        if (__v != 0) {
          _output__.writeUInt32(3, __v)
        }
      };
      {
        val __v = skipResults
        if (__v != 0L) {
          _output__.writeUInt64(4, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withIndexName(__v: _root_.scala.Predef.String): GetIndexedTransactionsRequest = copy(indexName = __v)
    def clearValue = copy(value = _root_.scala.Seq.empty)
    def addValue(__vs: xyz.stratalab.indexer.services.IndexMatchValue *): GetIndexedTransactionsRequest = addAllValue(__vs)
    def addAllValue(__vs: Iterable[xyz.stratalab.indexer.services.IndexMatchValue]): GetIndexedTransactionsRequest = copy(value = value ++ __vs)
    def withValue(__v: _root_.scala.Seq[xyz.stratalab.indexer.services.IndexMatchValue]): GetIndexedTransactionsRequest = copy(value = __v)
    def withMaxResults(__v: _root_.scala.Int): GetIndexedTransactionsRequest = copy(maxResults = __v)
    def withSkipResults(__v: _root_.scala.Long): GetIndexedTransactionsRequest = copy(skipResults = __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 = indexName
          if (__t != "") __t else null
        }
        case 2 => value
        case 3 => {
          val __t = maxResults
          if (__t != 0) __t else null
        }
        case 4 => {
          val __t = skipResults
          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.PString(indexName)
        case 2 => _root_.scalapb.descriptors.PRepeated(value.iterator.map(_.toPMessage).toVector)
        case 3 => _root_.scalapb.descriptors.PInt(maxResults)
        case 4 => _root_.scalapb.descriptors.PLong(skipResults)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: xyz.stratalab.indexer.services.GetIndexedTransactionsRequest.type = xyz.stratalab.indexer.services.GetIndexedTransactionsRequest
    _root_.scalapb.validate.Validator.assertValid(this)(xyz.stratalab.indexer.services.GetIndexedTransactionsRequestValidator)
    // @@protoc_insertion_point(GeneratedMessage[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest])
}

object GetIndexedTransactionsRequest extends scalapb.GeneratedMessageCompanion[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): xyz.stratalab.indexer.services.GetIndexedTransactionsRequest = {
    var __indexName: _root_.scala.Predef.String = ""
    val __value: _root_.scala.collection.immutable.VectorBuilder[xyz.stratalab.indexer.services.IndexMatchValue] = new _root_.scala.collection.immutable.VectorBuilder[xyz.stratalab.indexer.services.IndexMatchValue]
    var __maxResults: _root_.scala.Int = 0
    var __skipResults: _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 10 =>
          __indexName = _input__.readStringRequireUtf8()
        case 18 =>
          __value += _root_.scalapb.LiteParser.readMessage[xyz.stratalab.indexer.services.IndexMatchValue](_input__)
        case 24 =>
          __maxResults = _input__.readUInt32()
        case 32 =>
          __skipResults = _input__.readUInt64()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    xyz.stratalab.indexer.services.GetIndexedTransactionsRequest(
        indexName = __indexName,
        value = __value.result(),
        maxResults = __maxResults,
        skipResults = __skipResults,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest] = _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.")
      xyz.stratalab.indexer.services.GetIndexedTransactionsRequest(
        indexName = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
        value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Seq[xyz.stratalab.indexer.services.IndexMatchValue]]).getOrElse(_root_.scala.Seq.empty),
        maxResults = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        skipResults = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = IndexerRpcProto.javaDescriptor.getMessageTypes().get(28)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = IndexerRpcProto.scalaDescriptor.messages(28)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 2 => __out = xyz.stratalab.indexer.services.IndexMatchValue
    }
    __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 = xyz.stratalab.indexer.services.GetIndexedTransactionsRequest(
    indexName = "",
    value = _root_.scala.Seq.empty,
    maxResults = 0,
    skipResults = 0L
  )
  implicit class GetIndexedTransactionsRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, xyz.stratalab.indexer.services.GetIndexedTransactionsRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, xyz.stratalab.indexer.services.GetIndexedTransactionsRequest](_l) {
    def indexName: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.indexName)((c_, f_) => c_.copy(indexName = f_))
    def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[xyz.stratalab.indexer.services.IndexMatchValue]] = field(_.value)((c_, f_) => c_.copy(value = f_))
    def maxResults: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.maxResults)((c_, f_) => c_.copy(maxResults = f_))
    def skipResults: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.skipResults)((c_, f_) => c_.copy(skipResults = f_))
  }
  final val INDEXNAME_FIELD_NUMBER = 1
  final val VALUE_FIELD_NUMBER = 2
  final val MAXRESULTS_FIELD_NUMBER = 3
  final val SKIPRESULTS_FIELD_NUMBER = 4
  def of(
    indexName: _root_.scala.Predef.String,
    value: _root_.scala.Seq[xyz.stratalab.indexer.services.IndexMatchValue],
    maxResults: _root_.scala.Int,
    skipResults: _root_.scala.Long
  ): _root_.xyz.stratalab.indexer.services.GetIndexedTransactionsRequest = _root_.xyz.stratalab.indexer.services.GetIndexedTransactionsRequest(
    indexName,
    value,
    maxResults,
    skipResults
  )
  implicit def validator: scalapb.validate.Validator[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest] = xyz.stratalab.indexer.services.GetIndexedTransactionsRequestValidator
  // @@protoc_insertion_point(GeneratedMessageCompanion[xyz.stratalab.indexer.services.GetIndexedTransactionsRequest])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy