chainrpc.ConfRequest.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 txid
*
* The transaction hash for which we should request a confirmation notification
* for. If set to a hash of all zeros, then the confirmation notification will
* be requested for the script instead.
* @param script
*
* An output script within a transaction with the hash above which will be used
* by light clients to match block filters. If the transaction hash is set to a
* hash of all zeros, then a confirmation notification will be requested for
* this script instead.
* @param numConfs
*
* The number of desired confirmations the transaction/output script should
* reach before dispatching a confirmation notification.
* @param heightHint
*
* The earliest height in the chain for which the transaction/output script
* could have been included in a block. This should in most cases be set to the
* broadcast height of the transaction/output script.
* @param includeBlock
*
* If true, then the block that mines the specified txid/script will be
* included in eventual the notification event.
*/
@SerialVersionUID(0L)
final case class ConfRequest(
txid: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
script: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
numConfs: _root_.scala.Int = 0,
heightHint: _root_.scala.Int = 0,
includeBlock: _root_.scala.Boolean = false,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ConfRequest] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = txid
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(1, __value)
}
};
{
val __value = script
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value)
}
};
{
val __value = numConfs
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(3, __value)
}
};
{
val __value = heightHint
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(4, __value)
}
};
{
val __value = includeBlock
if (__value != false) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(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 = txid
if (!__v.isEmpty) {
_output__.writeBytes(1, __v)
}
};
{
val __v = script
if (!__v.isEmpty) {
_output__.writeBytes(2, __v)
}
};
{
val __v = numConfs
if (__v != 0) {
_output__.writeUInt32(3, __v)
}
};
{
val __v = heightHint
if (__v != 0) {
_output__.writeUInt32(4, __v)
}
};
{
val __v = includeBlock
if (__v != false) {
_output__.writeBool(5, __v)
}
};
unknownFields.writeTo(_output__)
}
def withTxid(__v: _root_.com.google.protobuf.ByteString): ConfRequest = copy(txid = __v)
def withScript(__v: _root_.com.google.protobuf.ByteString): ConfRequest = copy(script = __v)
def withNumConfs(__v: _root_.scala.Int): ConfRequest = copy(numConfs = __v)
def withHeightHint(__v: _root_.scala.Int): ConfRequest = copy(heightHint = __v)
def withIncludeBlock(__v: _root_.scala.Boolean): ConfRequest = copy(includeBlock = __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 = txid
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 2 => {
val __t = script
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 3 => {
val __t = numConfs
if (__t != 0) __t else null
}
case 4 => {
val __t = heightHint
if (__t != 0) __t else null
}
case 5 => {
val __t = includeBlock
if (__t != false) __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(txid)
case 2 => _root_.scalapb.descriptors.PByteString(script)
case 3 => _root_.scalapb.descriptors.PInt(numConfs)
case 4 => _root_.scalapb.descriptors.PInt(heightHint)
case 5 => _root_.scalapb.descriptors.PBoolean(includeBlock)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: chainrpc.ConfRequest.type = chainrpc.ConfRequest
// @@protoc_insertion_point(GeneratedMessage[chainrpc.ConfRequest])
}
object ConfRequest extends scalapb.GeneratedMessageCompanion[chainrpc.ConfRequest] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[chainrpc.ConfRequest] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): chainrpc.ConfRequest = {
var __txid: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __script: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __numConfs: _root_.scala.Int = 0
var __heightHint: _root_.scala.Int = 0
var __includeBlock: _root_.scala.Boolean = false
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 10 =>
__txid = _input__.readBytes()
case 18 =>
__script = _input__.readBytes()
case 24 =>
__numConfs = _input__.readUInt32()
case 32 =>
__heightHint = _input__.readUInt32()
case 40 =>
__includeBlock = _input__.readBool()
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
chainrpc.ConfRequest(
txid = __txid,
script = __script,
numConfs = __numConfs,
heightHint = __heightHint,
includeBlock = __includeBlock,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[chainrpc.ConfRequest] = _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.ConfRequest(
txid = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
script = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
numConfs = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Int]).getOrElse(0),
heightHint = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Int]).getOrElse(0),
includeBlock = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Boolean]).getOrElse(false)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = ChainnotifierProto.javaDescriptor.getMessageTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = ChainnotifierProto.scalaDescriptor.messages(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 = chainrpc.ConfRequest(
txid = _root_.com.google.protobuf.ByteString.EMPTY,
script = _root_.com.google.protobuf.ByteString.EMPTY,
numConfs = 0,
heightHint = 0,
includeBlock = false
)
implicit class ConfRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, chainrpc.ConfRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, chainrpc.ConfRequest](_l) {
def txid: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.txid)((c_, f_) => c_.copy(txid = f_))
def script: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.script)((c_, f_) => c_.copy(script = f_))
def numConfs: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.numConfs)((c_, f_) => c_.copy(numConfs = f_))
def heightHint: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.heightHint)((c_, f_) => c_.copy(heightHint = f_))
def includeBlock: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.includeBlock)((c_, f_) => c_.copy(includeBlock = f_))
}
final val TXID_FIELD_NUMBER = 1
final val SCRIPT_FIELD_NUMBER = 2
final val NUM_CONFS_FIELD_NUMBER = 3
final val HEIGHT_HINT_FIELD_NUMBER = 4
final val INCLUDE_BLOCK_FIELD_NUMBER = 5
def of(
txid: _root_.com.google.protobuf.ByteString,
script: _root_.com.google.protobuf.ByteString,
numConfs: _root_.scala.Int,
heightHint: _root_.scala.Int,
includeBlock: _root_.scala.Boolean
): _root_.chainrpc.ConfRequest = _root_.chainrpc.ConfRequest(
txid,
script,
numConfs,
heightHint,
includeBlock
)
// @@protoc_insertion_point(GeneratedMessageCompanion[chainrpc.ConfRequest])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy