invoicesrpc.AddHoldInvoiceRequest.scala Maven / Gradle / Ivy
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package invoicesrpc
/** @param memo
*
* An optional memo to attach along with the invoice. Used for record keeping
* purposes for the invoice's creator, and will also be set in the description
* field of the encoded payment request if the description_hash field is not
* being used.
* @param hash
* The hash of the preimage
* @param value
*
* The value of this invoice in satoshis
*
* The fields value and value_msat are mutually exclusive.
* @param valueMsat
*
* The value of this invoice in millisatoshis
*
* The fields value and value_msat are mutually exclusive.
* @param descriptionHash
*
* Hash (SHA-256) of a description of the payment. Used if the description of
* payment (memo) is too long to naturally fit within the description field
* of an encoded payment request.
* @param expiry
* Payment request expiry time in seconds. Default is 86400 (24 hours).
* @param fallbackAddr
* Fallback on-chain address.
* @param cltvExpiry
* Delta to use for the time-lock of the CLTV extended to the final hop.
* @param routeHints
*
* Route hints that can each be individually used to assist in reaching the
* invoice's destination.
* @param private
* Whether this invoice should include routing hints for private channels.
*/
@SerialVersionUID(0L)
final case class AddHoldInvoiceRequest(
memo: _root_.scala.Predef.String = "",
hash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
value: _root_.scala.Long = 0L,
valueMsat: _root_.scala.Long = 0L,
descriptionHash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
expiry: _root_.scala.Long = 0L,
fallbackAddr: _root_.scala.Predef.String = "",
cltvExpiry: _root_.scala.Long = 0L,
routeHints: _root_.scala.Seq[lnrpc.RouteHint] = _root_.scala.Seq.empty,
`private`: _root_.scala.Boolean = false,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[AddHoldInvoiceRequest] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = memo
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(1, __value)
}
};
{
val __value = hash
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(2, __value)
}
};
{
val __value = value
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(3, __value)
}
};
{
val __value = valueMsat
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(10, __value)
}
};
{
val __value = descriptionHash
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(4, __value)
}
};
{
val __value = expiry
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(5, __value)
}
};
{
val __value = fallbackAddr
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeStringSize(6, __value)
}
};
{
val __value = cltvExpiry
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(7, __value)
}
};
routeHints.foreach { __item =>
val __value = __item
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
}
{
val __value = `private`
if (__value != false) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(9, __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 = memo
if (!__v.isEmpty) {
_output__.writeString(1, __v)
}
};
{
val __v = hash
if (!__v.isEmpty) {
_output__.writeBytes(2, __v)
}
};
{
val __v = value
if (__v != 0L) {
_output__.writeInt64(3, __v)
}
};
{
val __v = descriptionHash
if (!__v.isEmpty) {
_output__.writeBytes(4, __v)
}
};
{
val __v = expiry
if (__v != 0L) {
_output__.writeInt64(5, __v)
}
};
{
val __v = fallbackAddr
if (!__v.isEmpty) {
_output__.writeString(6, __v)
}
};
{
val __v = cltvExpiry
if (__v != 0L) {
_output__.writeUInt64(7, __v)
}
};
routeHints.foreach { __v =>
val __m = __v
_output__.writeTag(8, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
{
val __v = `private`
if (__v != false) {
_output__.writeBool(9, __v)
}
};
{
val __v = valueMsat
if (__v != 0L) {
_output__.writeInt64(10, __v)
}
};
unknownFields.writeTo(_output__)
}
def withMemo(__v: _root_.scala.Predef.String): AddHoldInvoiceRequest = copy(memo = __v)
def withHash(__v: _root_.com.google.protobuf.ByteString): AddHoldInvoiceRequest = copy(hash = __v)
def withValue(__v: _root_.scala.Long): AddHoldInvoiceRequest = copy(value = __v)
def withValueMsat(__v: _root_.scala.Long): AddHoldInvoiceRequest = copy(valueMsat = __v)
def withDescriptionHash(__v: _root_.com.google.protobuf.ByteString): AddHoldInvoiceRequest = copy(descriptionHash = __v)
def withExpiry(__v: _root_.scala.Long): AddHoldInvoiceRequest = copy(expiry = __v)
def withFallbackAddr(__v: _root_.scala.Predef.String): AddHoldInvoiceRequest = copy(fallbackAddr = __v)
def withCltvExpiry(__v: _root_.scala.Long): AddHoldInvoiceRequest = copy(cltvExpiry = __v)
def clearRouteHints = copy(routeHints = _root_.scala.Seq.empty)
def addRouteHints(__vs: lnrpc.RouteHint *): AddHoldInvoiceRequest = addAllRouteHints(__vs)
def addAllRouteHints(__vs: Iterable[lnrpc.RouteHint]): AddHoldInvoiceRequest = copy(routeHints = routeHints ++ __vs)
def withRouteHints(__v: _root_.scala.Seq[lnrpc.RouteHint]): AddHoldInvoiceRequest = copy(routeHints = __v)
def withPrivate(__v: _root_.scala.Boolean): AddHoldInvoiceRequest = copy(`private` = __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 = memo
if (__t != "") __t else null
}
case 2 => {
val __t = hash
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 3 => {
val __t = value
if (__t != 0L) __t else null
}
case 10 => {
val __t = valueMsat
if (__t != 0L) __t else null
}
case 4 => {
val __t = descriptionHash
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 5 => {
val __t = expiry
if (__t != 0L) __t else null
}
case 6 => {
val __t = fallbackAddr
if (__t != "") __t else null
}
case 7 => {
val __t = cltvExpiry
if (__t != 0L) __t else null
}
case 8 => routeHints
case 9 => {
val __t = `private`
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.PString(memo)
case 2 => _root_.scalapb.descriptors.PByteString(hash)
case 3 => _root_.scalapb.descriptors.PLong(value)
case 10 => _root_.scalapb.descriptors.PLong(valueMsat)
case 4 => _root_.scalapb.descriptors.PByteString(descriptionHash)
case 5 => _root_.scalapb.descriptors.PLong(expiry)
case 6 => _root_.scalapb.descriptors.PString(fallbackAddr)
case 7 => _root_.scalapb.descriptors.PLong(cltvExpiry)
case 8 => _root_.scalapb.descriptors.PRepeated(routeHints.iterator.map(_.toPMessage).toVector)
case 9 => _root_.scalapb.descriptors.PBoolean(`private`)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: invoicesrpc.AddHoldInvoiceRequest.type = invoicesrpc.AddHoldInvoiceRequest
// @@protoc_insertion_point(GeneratedMessage[invoicesrpc.AddHoldInvoiceRequest])
}
object AddHoldInvoiceRequest extends scalapb.GeneratedMessageCompanion[invoicesrpc.AddHoldInvoiceRequest] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[invoicesrpc.AddHoldInvoiceRequest] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): invoicesrpc.AddHoldInvoiceRequest = {
var __memo: _root_.scala.Predef.String = ""
var __hash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __value: _root_.scala.Long = 0L
var __valueMsat: _root_.scala.Long = 0L
var __descriptionHash: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __expiry: _root_.scala.Long = 0L
var __fallbackAddr: _root_.scala.Predef.String = ""
var __cltvExpiry: _root_.scala.Long = 0L
val __routeHints: _root_.scala.collection.immutable.VectorBuilder[lnrpc.RouteHint] = new _root_.scala.collection.immutable.VectorBuilder[lnrpc.RouteHint]
var __private: _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 =>
__memo = _input__.readStringRequireUtf8()
case 18 =>
__hash = _input__.readBytes()
case 24 =>
__value = _input__.readInt64()
case 80 =>
__valueMsat = _input__.readInt64()
case 34 =>
__descriptionHash = _input__.readBytes()
case 40 =>
__expiry = _input__.readInt64()
case 50 =>
__fallbackAddr = _input__.readStringRequireUtf8()
case 56 =>
__cltvExpiry = _input__.readUInt64()
case 66 =>
__routeHints += _root_.scalapb.LiteParser.readMessage[lnrpc.RouteHint](_input__)
case 72 =>
__private = _input__.readBool()
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
invoicesrpc.AddHoldInvoiceRequest(
memo = __memo,
hash = __hash,
value = __value,
valueMsat = __valueMsat,
descriptionHash = __descriptionHash,
expiry = __expiry,
fallbackAddr = __fallbackAddr,
cltvExpiry = __cltvExpiry,
routeHints = __routeHints.result(),
`private` = __private,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[invoicesrpc.AddHoldInvoiceRequest] = _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.")
invoicesrpc.AddHoldInvoiceRequest(
memo = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
hash = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
value = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
valueMsat = __fieldsMap.get(scalaDescriptor.findFieldByNumber(10).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
descriptionHash = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
expiry = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
fallbackAddr = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Predef.String]).getOrElse(""),
cltvExpiry = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
routeHints = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).map(_.as[_root_.scala.Seq[lnrpc.RouteHint]]).getOrElse(_root_.scala.Seq.empty),
`private` = __fieldsMap.get(scalaDescriptor.findFieldByNumber(9).get).map(_.as[_root_.scala.Boolean]).getOrElse(false)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = InvoicesProto.javaDescriptor.getMessageTypes().get(2)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = InvoicesProto.scalaDescriptor.messages(2)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 8 => __out = lnrpc.RouteHint
}
__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 = invoicesrpc.AddHoldInvoiceRequest(
memo = "",
hash = _root_.com.google.protobuf.ByteString.EMPTY,
value = 0L,
valueMsat = 0L,
descriptionHash = _root_.com.google.protobuf.ByteString.EMPTY,
expiry = 0L,
fallbackAddr = "",
cltvExpiry = 0L,
routeHints = _root_.scala.Seq.empty,
`private` = false
)
implicit class AddHoldInvoiceRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, invoicesrpc.AddHoldInvoiceRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, invoicesrpc.AddHoldInvoiceRequest](_l) {
def memo: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.memo)((c_, f_) => c_.copy(memo = f_))
def hash: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.hash)((c_, f_) => c_.copy(hash = f_))
def value: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.value)((c_, f_) => c_.copy(value = f_))
def valueMsat: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.valueMsat)((c_, f_) => c_.copy(valueMsat = f_))
def descriptionHash: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.descriptionHash)((c_, f_) => c_.copy(descriptionHash = f_))
def expiry: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.expiry)((c_, f_) => c_.copy(expiry = f_))
def fallbackAddr: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Predef.String] = field(_.fallbackAddr)((c_, f_) => c_.copy(fallbackAddr = f_))
def cltvExpiry: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.cltvExpiry)((c_, f_) => c_.copy(cltvExpiry = f_))
def routeHints: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[lnrpc.RouteHint]] = field(_.routeHints)((c_, f_) => c_.copy(routeHints = f_))
def `private`: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.`private`)((c_, f_) => c_.copy(`private` = f_))
}
final val MEMO_FIELD_NUMBER = 1
final val HASH_FIELD_NUMBER = 2
final val VALUE_FIELD_NUMBER = 3
final val VALUE_MSAT_FIELD_NUMBER = 10
final val DESCRIPTION_HASH_FIELD_NUMBER = 4
final val EXPIRY_FIELD_NUMBER = 5
final val FALLBACK_ADDR_FIELD_NUMBER = 6
final val CLTV_EXPIRY_FIELD_NUMBER = 7
final val ROUTE_HINTS_FIELD_NUMBER = 8
final val PRIVATE_FIELD_NUMBER = 9
def of(
memo: _root_.scala.Predef.String,
hash: _root_.com.google.protobuf.ByteString,
value: _root_.scala.Long,
valueMsat: _root_.scala.Long,
descriptionHash: _root_.com.google.protobuf.ByteString,
expiry: _root_.scala.Long,
fallbackAddr: _root_.scala.Predef.String,
cltvExpiry: _root_.scala.Long,
routeHints: _root_.scala.Seq[lnrpc.RouteHint],
`private`: _root_.scala.Boolean
): _root_.invoicesrpc.AddHoldInvoiceRequest = _root_.invoicesrpc.AddHoldInvoiceRequest(
memo,
hash,
value,
valueMsat,
descriptionHash,
expiry,
fallbackAddr,
cltvExpiry,
routeHints,
`private`
)
// @@protoc_insertion_point(GeneratedMessageCompanion[invoicesrpc.AddHoldInvoiceRequest])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy