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

chainrpc.ConfDetails.scala Maven / Gradle / Ivy

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

package chainrpc

/** @param rawTx
  *   The raw bytes of the confirmed transaction.
  * @param blockHash
  *   The hash of the block in which the confirmed transaction was included in.
  * @param blockHeight
  *   The height of the block in which the confirmed transaction was included
  *   in.
  * @param txIndex
  *   The index of the confirmed transaction within the block.
  * @param rawBlock
  *  
  *  The raw bytes of the block that mined the transaction. Only included if
  *  include_block was set in the request.
  */
@SerialVersionUID(0L)
final case class ConfDetails(
    rawTx: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    blockHash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    blockHeight: _root_.scala.Int = 0,
    txIndex: _root_.scala.Int = 0,
    rawBlock: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ConfDetails] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = rawTx
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(1, __value)
        }
      };
      
      {
        val __value = blockHash
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value)
        }
      };
      
      {
        val __value = blockHeight
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(3, __value)
        }
      };
      
      {
        val __value = txIndex
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(4, __value)
        }
      };
      
      {
        val __value = rawBlock
        if (!__value.isEmpty) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(5, __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 = rawTx
        if (!__v.isEmpty) {
          _output__.writeBytes(1, __v)
        }
      };
      {
        val __v = blockHash
        if (!__v.isEmpty) {
          _output__.writeBytes(2, __v)
        }
      };
      {
        val __v = blockHeight
        if (__v != 0) {
          _output__.writeUInt32(3, __v)
        }
      };
      {
        val __v = txIndex
        if (__v != 0) {
          _output__.writeUInt32(4, __v)
        }
      };
      {
        val __v = rawBlock
        if (!__v.isEmpty) {
          _output__.writeBytes(5, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withRawTx(__v: _root_.com.google.protobuf.ByteString): ConfDetails = copy(rawTx = __v)
    def withBlockHash(__v: _root_.com.google.protobuf.ByteString): ConfDetails = copy(blockHash = __v)
    def withBlockHeight(__v: _root_.scala.Int): ConfDetails = copy(blockHeight = __v)
    def withTxIndex(__v: _root_.scala.Int): ConfDetails = copy(txIndex = __v)
    def withRawBlock(__v: _root_.com.google.protobuf.ByteString): ConfDetails = copy(rawBlock = __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 = rawTx
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 2 => {
          val __t = blockHash
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
        }
        case 3 => {
          val __t = blockHeight
          if (__t != 0) __t else null
        }
        case 4 => {
          val __t = txIndex
          if (__t != 0) __t else null
        }
        case 5 => {
          val __t = rawBlock
          if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __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.PByteString(rawTx)
        case 2 => _root_.scalapb.descriptors.PByteString(blockHash)
        case 3 => _root_.scalapb.descriptors.PInt(blockHeight)
        case 4 => _root_.scalapb.descriptors.PInt(txIndex)
        case 5 => _root_.scalapb.descriptors.PByteString(rawBlock)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: chainrpc.ConfDetails.type = chainrpc.ConfDetails
    // @@protoc_insertion_point(GeneratedMessage[chainrpc.ConfDetails])
}

object ConfDetails extends scalapb.GeneratedMessageCompanion[chainrpc.ConfDetails] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[chainrpc.ConfDetails] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): chainrpc.ConfDetails = {
    var __rawTx: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var __blockHash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
    var __blockHeight: _root_.scala.Int = 0
    var __txIndex: _root_.scala.Int = 0
    var __rawBlock: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.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 =>
          __rawTx = _input__.readBytes()
        case 18 =>
          __blockHash = _input__.readBytes()
        case 24 =>
          __blockHeight = _input__.readUInt32()
        case 32 =>
          __txIndex = _input__.readUInt32()
        case 42 =>
          __rawBlock = _input__.readBytes()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    chainrpc.ConfDetails(
        rawTx = __rawTx,
        blockHash = __blockHash,
        blockHeight = __blockHeight,
        txIndex = __txIndex,
        rawBlock = __rawBlock,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[chainrpc.ConfDetails] = _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.")
      chainrpc.ConfDetails(
        rawTx = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        blockHash = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
        blockHeight = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        txIndex = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        rawBlock = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY)
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ChainnotifierProto.javaDescriptor.getMessageTypes().get(1)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ChainnotifierProto.scalaDescriptor.messages(1)
  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 = chainrpc.ConfDetails(
    rawTx = _root_.com.google.protobuf.ByteString.EMPTY,
    blockHash = _root_.com.google.protobuf.ByteString.EMPTY,
    blockHeight = 0,
    txIndex = 0,
    rawBlock = _root_.com.google.protobuf.ByteString.EMPTY
  )
  implicit class ConfDetailsLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, chainrpc.ConfDetails]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, chainrpc.ConfDetails](_l) {
    def rawTx: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.rawTx)((c_, f_) => c_.copy(rawTx = f_))
    def blockHash: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.blockHash)((c_, f_) => c_.copy(blockHash = f_))
    def blockHeight: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.blockHeight)((c_, f_) => c_.copy(blockHeight = f_))
    def txIndex: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.txIndex)((c_, f_) => c_.copy(txIndex = f_))
    def rawBlock: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.rawBlock)((c_, f_) => c_.copy(rawBlock = f_))
  }
  final val RAW_TX_FIELD_NUMBER = 1
  final val BLOCK_HASH_FIELD_NUMBER = 2
  final val BLOCK_HEIGHT_FIELD_NUMBER = 3
  final val TX_INDEX_FIELD_NUMBER = 4
  final val RAW_BLOCK_FIELD_NUMBER = 5
  def of(
    rawTx: _root_.com.google.protobuf.ByteString,
    blockHash: _root_.com.google.protobuf.ByteString,
    blockHeight: _root_.scala.Int,
    txIndex: _root_.scala.Int,
    rawBlock: _root_.com.google.protobuf.ByteString
  ): _root_.chainrpc.ConfDetails = _root_.chainrpc.ConfDetails(
    rawTx,
    blockHash,
    blockHeight,
    txIndex,
    rawBlock
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[chainrpc.ConfDetails])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy