lnrpc.LightningNode.scala Maven / Gradle / Ivy
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package lnrpc
import org.bitcoins.lnd.rpc.LndUtils._
/**
* An individual vertex/node within the channel graph. A node is
* connected to other nodes by one or more channel edges emanating from it. As the
* graph is directed, a node will also have an incoming edge attached to it for
* each outgoing edge.
*
* @param customRecords
* Custom node announcement tlv records.
*/
@SerialVersionUID(0L)
final case class LightningNode(
lastUpdate: org.bitcoins.core.number.UInt32 = lnrpc.LightningNode._typemapper_lastUpdate.toCustom(0),
pubKey: _root_.scala.Predef.String = "",
alias: _root_.scala.Predef.String = "",
addresses: _root_.scala.Seq[lnrpc.NodeAddress] = _root_.scala.Seq.empty,
color: _root_.scala.Predef.String = "",
features: _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt32, lnrpc.Feature] = _root_.scala.collection.immutable.Map.empty,
customRecords: _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString] = _root_.scala.collection.immutable.Map.empty,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[LightningNode] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = lnrpc.LightningNode._typemapper_lastUpdate.toBase(lastUpdate)
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(1, __value)
}
};
{
val __value = pubKey
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(2, __value)
}
};
{
val __value = alias
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(3, __value)
}
};
addresses.foreach { __item =>
val __value = __item
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
}
{
val __value = color
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(5, __value)
}
};
features.foreach { __item =>
val __value = lnrpc.LightningNode._typemapper_features.toBase(__item)
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
}
customRecords.foreach { __item =>
val __value = lnrpc.LightningNode._typemapper_customRecords.toBase(__item)
__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 = {
{
val __v = lnrpc.LightningNode._typemapper_lastUpdate.toBase(lastUpdate)
if (__v != 0) {
_output__.writeUInt32(1, __v)
}
};
{
val __v = pubKey
if (!__v.isEmpty) {
_output__.writeString(2, __v)
}
};
{
val __v = alias
if (!__v.isEmpty) {
_output__.writeString(3, __v)
}
};
addresses.foreach { __v =>
val __m = __v
_output__.writeTag(4, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
{
val __v = color
if (!__v.isEmpty) {
_output__.writeString(5, __v)
}
};
features.foreach { __v =>
val __m = lnrpc.LightningNode._typemapper_features.toBase(__v)
_output__.writeTag(6, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
customRecords.foreach { __v =>
val __m = lnrpc.LightningNode._typemapper_customRecords.toBase(__v)
_output__.writeTag(7, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def withLastUpdate(__v: org.bitcoins.core.number.UInt32): LightningNode = copy(lastUpdate = __v)
def withPubKey(__v: _root_.scala.Predef.String): LightningNode = copy(pubKey = __v)
def withAlias(__v: _root_.scala.Predef.String): LightningNode = copy(alias = __v)
def clearAddresses = copy(addresses = _root_.scala.Seq.empty)
def addAddresses(__vs: lnrpc.NodeAddress *): LightningNode = addAllAddresses(__vs)
def addAllAddresses(__vs: Iterable[lnrpc.NodeAddress]): LightningNode = copy(addresses = addresses ++ __vs)
def withAddresses(__v: _root_.scala.Seq[lnrpc.NodeAddress]): LightningNode = copy(addresses = __v)
def withColor(__v: _root_.scala.Predef.String): LightningNode = copy(color = __v)
def clearFeatures = copy(features = _root_.scala.collection.immutable.Map.empty)
def addFeatures(__vs: (org.bitcoins.core.number.UInt32, lnrpc.Feature) *): LightningNode = addAllFeatures(__vs)
def addAllFeatures(__vs: Iterable[(org.bitcoins.core.number.UInt32, lnrpc.Feature)]): LightningNode = copy(features = features ++ __vs)
def withFeatures(__v: _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt32, lnrpc.Feature]): LightningNode = copy(features = __v)
def clearCustomRecords = copy(customRecords = _root_.scala.collection.immutable.Map.empty)
def addCustomRecords(__vs: (org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString) *): LightningNode = addAllCustomRecords(__vs)
def addAllCustomRecords(__vs: Iterable[(org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString)]): LightningNode = copy(customRecords = customRecords ++ __vs)
def withCustomRecords(__v: _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString]): LightningNode = copy(customRecords = __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 = lnrpc.LightningNode._typemapper_lastUpdate.toBase(lastUpdate)
if (__t != 0) __t else null
}
case 2 => {
val __t = pubKey
if (__t != "") __t else null
}
case 3 => {
val __t = alias
if (__t != "") __t else null
}
case 4 => addresses
case 5 => {
val __t = color
if (__t != "") __t else null
}
case 6 => features.iterator.map(lnrpc.LightningNode._typemapper_features.toBase(_)).toSeq
case 7 => customRecords.iterator.map(lnrpc.LightningNode._typemapper_customRecords.toBase(_)).toSeq
}
}
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.PInt(lnrpc.LightningNode._typemapper_lastUpdate.toBase(lastUpdate))
case 2 => _root_.scalapb.descriptors.PString(pubKey)
case 3 => _root_.scalapb.descriptors.PString(alias)
case 4 => _root_.scalapb.descriptors.PRepeated(addresses.iterator.map(_.toPMessage).toVector)
case 5 => _root_.scalapb.descriptors.PString(color)
case 6 => _root_.scalapb.descriptors.PRepeated(features.iterator.map(lnrpc.LightningNode._typemapper_features.toBase(_).toPMessage).toVector)
case 7 => _root_.scalapb.descriptors.PRepeated(customRecords.iterator.map(lnrpc.LightningNode._typemapper_customRecords.toBase(_).toPMessage).toVector)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: lnrpc.LightningNode.type = lnrpc.LightningNode
// @@protoc_insertion_point(GeneratedMessage[lnrpc.LightningNode])
}
object LightningNode extends scalapb.GeneratedMessageCompanion[lnrpc.LightningNode] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.LightningNode] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.LightningNode = {
var __lastUpdate: _root_.scala.Int = 0
var __pubKey: _root_.scala.Predef.String = ""
var __alias: _root_.scala.Predef.String = ""
val __addresses: _root_.scala.collection.immutable.VectorBuilder[lnrpc.NodeAddress] = new _root_.scala.collection.immutable.VectorBuilder[lnrpc.NodeAddress]
var __color: _root_.scala.Predef.String = ""
val __features: _root_.scala.collection.mutable.Builder[(org.bitcoins.core.number.UInt32, lnrpc.Feature), _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt32, lnrpc.Feature]] = _root_.scala.collection.immutable.Map.newBuilder[org.bitcoins.core.number.UInt32, lnrpc.Feature]
val __customRecords: _root_.scala.collection.mutable.Builder[(org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString), _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString]] = _root_.scala.collection.immutable.Map.newBuilder[org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString]
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 8 =>
__lastUpdate = _input__.readUInt32()
case 18 =>
__pubKey = _input__.readStringRequireUtf8()
case 26 =>
__alias = _input__.readStringRequireUtf8()
case 34 =>
__addresses += _root_.scalapb.LiteParser.readMessage[lnrpc.NodeAddress](_input__)
case 42 =>
__color = _input__.readStringRequireUtf8()
case 50 =>
__features += lnrpc.LightningNode._typemapper_features.toCustom(_root_.scalapb.LiteParser.readMessage[lnrpc.LightningNode.FeaturesEntry](_input__))
case 58 =>
__customRecords += lnrpc.LightningNode._typemapper_customRecords.toCustom(_root_.scalapb.LiteParser.readMessage[lnrpc.LightningNode.CustomRecordsEntry](_input__))
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
lnrpc.LightningNode(
lastUpdate = lnrpc.LightningNode._typemapper_lastUpdate.toCustom(__lastUpdate),
pubKey = __pubKey,
alias = __alias,
addresses = __addresses.result(),
color = __color,
features = __features.result(),
customRecords = __customRecords.result(),
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.LightningNode] = _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.")
lnrpc.LightningNode(
lastUpdate = lnrpc.LightningNode._typemapper_lastUpdate.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
pubKey = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
alias = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
addresses = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Seq[lnrpc.NodeAddress]]).getOrElse(_root_.scala.Seq.empty),
color = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
features = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Seq[lnrpc.LightningNode.FeaturesEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(lnrpc.LightningNode._typemapper_features.toCustom(_)).toMap,
customRecords = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Seq[lnrpc.LightningNode.CustomRecordsEntry]]).getOrElse(_root_.scala.Seq.empty).iterator.map(lnrpc.LightningNode._typemapper_customRecords.toCustom(_)).toMap
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(105)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(105)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 4 => __out = lnrpc.NodeAddress
case 6 => __out = lnrpc.LightningNode.FeaturesEntry
case 7 => __out = lnrpc.LightningNode.CustomRecordsEntry
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] =
Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]](
_root_.lnrpc.LightningNode.FeaturesEntry,
_root_.lnrpc.LightningNode.CustomRecordsEntry
)
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = throw new MatchError(__fieldNumber)
lazy val defaultInstance = lnrpc.LightningNode(
lastUpdate = lnrpc.LightningNode._typemapper_lastUpdate.toCustom(0),
pubKey = "",
alias = "",
addresses = _root_.scala.Seq.empty,
color = "",
features = _root_.scala.collection.immutable.Map.empty,
customRecords = _root_.scala.collection.immutable.Map.empty
)
@SerialVersionUID(0L)
final case class FeaturesEntry(
key: org.bitcoins.core.number.UInt32 = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toCustom(0),
value: _root_.scala.Option[lnrpc.Feature] = _root_.scala.None,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[FeaturesEntry] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toBase(key)
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(1, __value)
}
};
if (value.isDefined) {
val __value = value.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 = {
{
val __v = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toBase(key)
if (__v != 0) {
_output__.writeUInt32(1, __v)
}
};
value.foreach { __v =>
val __m = __v
_output__.writeTag(2, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def withKey(__v: org.bitcoins.core.number.UInt32): FeaturesEntry = copy(key = __v)
def getValue: lnrpc.Feature = value.getOrElse(lnrpc.Feature.defaultInstance)
def clearValue: FeaturesEntry = copy(value = _root_.scala.None)
def withValue(__v: lnrpc.Feature): FeaturesEntry = copy(value = Option(__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 = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toBase(key)
if (__t != 0) __t else null
}
case 2 => value.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 => _root_.scalapb.descriptors.PInt(lnrpc.LightningNode.FeaturesEntry._typemapper_key.toBase(key))
case 2 => value.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: lnrpc.LightningNode.FeaturesEntry.type = lnrpc.LightningNode.FeaturesEntry
// @@protoc_insertion_point(GeneratedMessage[lnrpc.LightningNode.FeaturesEntry])
}
object FeaturesEntry extends scalapb.GeneratedMessageCompanion[lnrpc.LightningNode.FeaturesEntry] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.LightningNode.FeaturesEntry] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.LightningNode.FeaturesEntry = {
var __key: _root_.scala.Int = 0
var __value: _root_.scala.Option[lnrpc.Feature] = _root_.scala.None
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 8 =>
__key = _input__.readUInt32()
case 18 =>
__value = Option(__value.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Feature](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
lnrpc.LightningNode.FeaturesEntry(
key = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toCustom(__key),
value = __value,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.LightningNode.FeaturesEntry] = _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.")
lnrpc.LightningNode.FeaturesEntry(
key = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Int]).getOrElse(0)),
value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).flatMap(_.as[_root_.scala.Option[lnrpc.Feature]])
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = lnrpc.LightningNode.javaDescriptor.getNestedTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = lnrpc.LightningNode.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 = lnrpc.Feature
}
__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 = lnrpc.LightningNode.FeaturesEntry(
key = lnrpc.LightningNode.FeaturesEntry._typemapper_key.toCustom(0),
value = _root_.scala.None
)
implicit class FeaturesEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.LightningNode.FeaturesEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.LightningNode.FeaturesEntry](_l) {
def key: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.key)((c_, f_) => c_.copy(key = f_))
def value: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Feature] = field(_.getValue)((c_, f_) => c_.copy(value = Option(f_)))
def optionalValue: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Feature]] = field(_.value)((c_, f_) => c_.copy(value = f_))
}
final val KEY_FIELD_NUMBER = 1
final val VALUE_FIELD_NUMBER = 2
@transient
private[lnrpc] val _typemapper_key: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
@transient
implicit val keyValueMapper: _root_.scalapb.TypeMapper[lnrpc.LightningNode.FeaturesEntry, (org.bitcoins.core.number.UInt32, lnrpc.Feature)] =
_root_.scalapb.TypeMapper[lnrpc.LightningNode.FeaturesEntry, (org.bitcoins.core.number.UInt32, lnrpc.Feature)](__m => (__m.key, __m.getValue))(__p => lnrpc.LightningNode.FeaturesEntry(__p._1, Some(__p._2)))
def of(
key: org.bitcoins.core.number.UInt32,
value: _root_.scala.Option[lnrpc.Feature]
): _root_.lnrpc.LightningNode.FeaturesEntry = _root_.lnrpc.LightningNode.FeaturesEntry(
key,
value
)
// @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.LightningNode.FeaturesEntry])
}
@SerialVersionUID(0L)
final case class CustomRecordsEntry(
key: org.bitcoins.core.number.UInt64 = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toCustom(0L),
value: _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[CustomRecordsEntry] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toBase(key)
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
}
};
{
val __value = value
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(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 = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toBase(key)
if (__v != 0L) {
_output__.writeUInt64(1, __v)
}
};
{
val __v = value
if (!__v.isEmpty) {
_output__.writeBytes(2, __v)
}
};
unknownFields.writeTo(_output__)
}
def withKey(__v: org.bitcoins.core.number.UInt64): CustomRecordsEntry = copy(key = __v)
def withValue(__v: _root_.com.google.protobuf.ByteString): CustomRecordsEntry = copy(value = __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 = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toBase(key)
if (__t != 0L) __t else null
}
case 2 => {
val __t = value
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.PLong(lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toBase(key))
case 2 => _root_.scalapb.descriptors.PByteString(value)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: lnrpc.LightningNode.CustomRecordsEntry.type = lnrpc.LightningNode.CustomRecordsEntry
// @@protoc_insertion_point(GeneratedMessage[lnrpc.LightningNode.CustomRecordsEntry])
}
object CustomRecordsEntry extends scalapb.GeneratedMessageCompanion[lnrpc.LightningNode.CustomRecordsEntry] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.LightningNode.CustomRecordsEntry] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.LightningNode.CustomRecordsEntry = {
var __key: _root_.scala.Long = 0L
var __value: _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 8 =>
__key = _input__.readUInt64()
case 18 =>
__value = _input__.readBytes()
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
lnrpc.LightningNode.CustomRecordsEntry(
key = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toCustom(__key),
value = __value,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.LightningNode.CustomRecordsEntry] = _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.")
lnrpc.LightningNode.CustomRecordsEntry(
key = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).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 = lnrpc.LightningNode.javaDescriptor.getNestedTypes().get(1)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = lnrpc.LightningNode.scalaDescriptor.nestedMessages(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 = lnrpc.LightningNode.CustomRecordsEntry(
key = lnrpc.LightningNode.CustomRecordsEntry._typemapper_key.toCustom(0L),
value = _root_.com.google.protobuf.ByteString.EMPTY
)
implicit class CustomRecordsEntryLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.LightningNode.CustomRecordsEntry]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.LightningNode.CustomRecordsEntry](_l) {
def key: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.key)((c_, f_) => c_.copy(key = f_))
def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.value)((c_, f_) => c_.copy(value = f_))
}
final val KEY_FIELD_NUMBER = 1
final val VALUE_FIELD_NUMBER = 2
@transient
private[lnrpc] val _typemapper_key: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
@transient
implicit val keyValueMapper: _root_.scalapb.TypeMapper[lnrpc.LightningNode.CustomRecordsEntry, (org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString)] =
_root_.scalapb.TypeMapper[lnrpc.LightningNode.CustomRecordsEntry, (org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString)](__m => (__m.key, __m.value))(__p => lnrpc.LightningNode.CustomRecordsEntry(__p._1, __p._2))
def of(
key: org.bitcoins.core.number.UInt64,
value: _root_.com.google.protobuf.ByteString
): _root_.lnrpc.LightningNode.CustomRecordsEntry = _root_.lnrpc.LightningNode.CustomRecordsEntry(
key,
value
)
// @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.LightningNode.CustomRecordsEntry])
}
implicit class LightningNodeLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.LightningNode]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.LightningNode](_l) {
def lastUpdate: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt32] = field(_.lastUpdate)((c_, f_) => c_.copy(lastUpdate = f_))
def pubKey: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.pubKey)((c_, f_) => c_.copy(pubKey = f_))
def alias: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.alias)((c_, f_) => c_.copy(alias = f_))
def addresses: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[lnrpc.NodeAddress]] = field(_.addresses)((c_, f_) => c_.copy(addresses = f_))
def color: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.color)((c_, f_) => c_.copy(color = f_))
def features: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt32, lnrpc.Feature]] = field(_.features)((c_, f_) => c_.copy(features = f_))
def customRecords: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString]] = field(_.customRecords)((c_, f_) => c_.copy(customRecords = f_))
}
final val LAST_UPDATE_FIELD_NUMBER = 1
final val PUB_KEY_FIELD_NUMBER = 2
final val ALIAS_FIELD_NUMBER = 3
final val ADDRESSES_FIELD_NUMBER = 4
final val COLOR_FIELD_NUMBER = 5
final val FEATURES_FIELD_NUMBER = 6
final val CUSTOM_RECORDS_FIELD_NUMBER = 7
@transient
private[lnrpc] val _typemapper_lastUpdate: _root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Int, org.bitcoins.core.number.UInt32]]
@transient
private[lnrpc] val _typemapper_features: _root_.scalapb.TypeMapper[lnrpc.LightningNode.FeaturesEntry, (org.bitcoins.core.number.UInt32, lnrpc.Feature)] = implicitly[_root_.scalapb.TypeMapper[lnrpc.LightningNode.FeaturesEntry, (org.bitcoins.core.number.UInt32, lnrpc.Feature)]]
@transient
private[lnrpc] val _typemapper_customRecords: _root_.scalapb.TypeMapper[lnrpc.LightningNode.CustomRecordsEntry, (org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString)] = implicitly[_root_.scalapb.TypeMapper[lnrpc.LightningNode.CustomRecordsEntry, (org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString)]]
def of(
lastUpdate: org.bitcoins.core.number.UInt32,
pubKey: _root_.scala.Predef.String,
alias: _root_.scala.Predef.String,
addresses: _root_.scala.Seq[lnrpc.NodeAddress],
color: _root_.scala.Predef.String,
features: _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt32, lnrpc.Feature],
customRecords: _root_.scala.collection.immutable.Map[org.bitcoins.core.number.UInt64, _root_.com.google.protobuf.ByteString]
): _root_.lnrpc.LightningNode = _root_.lnrpc.LightningNode(
lastUpdate,
pubKey,
alias,
addresses,
color,
features,
customRecords
)
// @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.LightningNode])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy