routerrpc.ForwardHtlcInterceptResponse.scala Maven / Gradle / Ivy
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package routerrpc
/** *
* ForwardHtlcInterceptResponse enables the caller to resolve a previously hold
* forward. The caller can choose either to:
* - `Resume`: Execute the default behavior (usually forward).
* - `Reject`: Fail the htlc backwards.
* - `Settle`: Settle this htlc with a given preimage.
*
* @param incomingCircuitKey
* *
* The key of this forwarded htlc. It defines the incoming channel id and
* the index in this channel.
* @param action
* The resolve action for this intercepted htlc.
* @param preimage
* The preimage in case the resolve action is Settle.
* @param failureMessage
* Encrypted failure message in case the resolve action is Fail.
*
* If failure_message is specified, the failure_code field must be set
* to zero.
* @param failureCode
* Return the specified failure code in case the resolve action is Fail. The
* message data fields are populated automatically.
*
* If a non-zero failure_code is specified, failure_message must not be set.
*
* For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the
* default value for this field.
*/
@SerialVersionUID(0L)
final case class ForwardHtlcInterceptResponse(
incomingCircuitKey: _root_.scala.Option[routerrpc.CircuitKey] = _root_.scala.None,
action: routerrpc.ResolveHoldForwardAction = routerrpc.ResolveHoldForwardAction.SETTLE,
preimage: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
failureMessage: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY,
failureCode: lnrpc.Failure.FailureCode = lnrpc.Failure.FailureCode.RESERVED,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ForwardHtlcInterceptResponse] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
if (incomingCircuitKey.isDefined) {
val __value = incomingCircuitKey.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
{
val __value = action.value
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(2, __value)
}
};
{
val __value = preimage
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(3, __value)
}
};
{
val __value = failureMessage
if (!__value.isEmpty) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(4, __value)
}
};
{
val __value = failureCode.value
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(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 = {
incomingCircuitKey.foreach { __v =>
val __m = __v
_output__.writeTag(1, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
{
val __v = action.value
if (__v != 0) {
_output__.writeEnum(2, __v)
}
};
{
val __v = preimage
if (!__v.isEmpty) {
_output__.writeBytes(3, __v)
}
};
{
val __v = failureMessage
if (!__v.isEmpty) {
_output__.writeBytes(4, __v)
}
};
{
val __v = failureCode.value
if (__v != 0) {
_output__.writeEnum(5, __v)
}
};
unknownFields.writeTo(_output__)
}
def getIncomingCircuitKey: routerrpc.CircuitKey = incomingCircuitKey.getOrElse(routerrpc.CircuitKey.defaultInstance)
def clearIncomingCircuitKey: ForwardHtlcInterceptResponse = copy(incomingCircuitKey = _root_.scala.None)
def withIncomingCircuitKey(__v: routerrpc.CircuitKey): ForwardHtlcInterceptResponse = copy(incomingCircuitKey = Option(__v))
def withAction(__v: routerrpc.ResolveHoldForwardAction): ForwardHtlcInterceptResponse = copy(action = __v)
def withPreimage(__v: _root_.com.google.protobuf.ByteString): ForwardHtlcInterceptResponse = copy(preimage = __v)
def withFailureMessage(__v: _root_.com.google.protobuf.ByteString): ForwardHtlcInterceptResponse = copy(failureMessage = __v)
def withFailureCode(__v: lnrpc.Failure.FailureCode): ForwardHtlcInterceptResponse = copy(failureCode = __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 => incomingCircuitKey.orNull
case 2 => {
val __t = action.javaValueDescriptor
if (__t.getNumber() != 0) __t else null
}
case 3 => {
val __t = preimage
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 4 => {
val __t = failureMessage
if (__t != _root_.com.google.protobuf.ByteString.EMPTY) __t else null
}
case 5 => {
val __t = failureCode.javaValueDescriptor
if (__t.getNumber() != 0) __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 => incomingCircuitKey.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 2 => _root_.scalapb.descriptors.PEnum(action.scalaValueDescriptor)
case 3 => _root_.scalapb.descriptors.PByteString(preimage)
case 4 => _root_.scalapb.descriptors.PByteString(failureMessage)
case 5 => _root_.scalapb.descriptors.PEnum(failureCode.scalaValueDescriptor)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: routerrpc.ForwardHtlcInterceptResponse.type = routerrpc.ForwardHtlcInterceptResponse
// @@protoc_insertion_point(GeneratedMessage[routerrpc.ForwardHtlcInterceptResponse])
}
object ForwardHtlcInterceptResponse extends scalapb.GeneratedMessageCompanion[routerrpc.ForwardHtlcInterceptResponse] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[routerrpc.ForwardHtlcInterceptResponse] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): routerrpc.ForwardHtlcInterceptResponse = {
var __incomingCircuitKey: _root_.scala.Option[routerrpc.CircuitKey] = _root_.scala.None
var __action: routerrpc.ResolveHoldForwardAction = routerrpc.ResolveHoldForwardAction.SETTLE
var __preimage: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __failureMessage: _root_.com.google.protobuf.ByteString = _root_.com.google.protobuf.ByteString.EMPTY
var __failureCode: lnrpc.Failure.FailureCode = lnrpc.Failure.FailureCode.RESERVED
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 10 =>
__incomingCircuitKey = Option(__incomingCircuitKey.fold(_root_.scalapb.LiteParser.readMessage[routerrpc.CircuitKey](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 16 =>
__action = routerrpc.ResolveHoldForwardAction.fromValue(_input__.readEnum())
case 26 =>
__preimage = _input__.readBytes()
case 34 =>
__failureMessage = _input__.readBytes()
case 40 =>
__failureCode = lnrpc.Failure.FailureCode.fromValue(_input__.readEnum())
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
routerrpc.ForwardHtlcInterceptResponse(
incomingCircuitKey = __incomingCircuitKey,
action = __action,
preimage = __preimage,
failureMessage = __failureMessage,
failureCode = __failureCode,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[routerrpc.ForwardHtlcInterceptResponse] = _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.")
routerrpc.ForwardHtlcInterceptResponse(
incomingCircuitKey = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).flatMap(_.as[_root_.scala.Option[routerrpc.CircuitKey]]),
action = routerrpc.ResolveHoldForwardAction.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(routerrpc.ResolveHoldForwardAction.SETTLE.scalaValueDescriptor).number),
preimage = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
failureMessage = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.com.google.protobuf.ByteString]).getOrElse(_root_.com.google.protobuf.ByteString.EMPTY),
failureCode = lnrpc.Failure.FailureCode.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(lnrpc.Failure.FailureCode.RESERVED.scalaValueDescriptor).number)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = RouterProto.javaDescriptor.getMessageTypes().get(38)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = RouterProto.scalaDescriptor.messages(38)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 1 => __out = routerrpc.CircuitKey
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 2 => routerrpc.ResolveHoldForwardAction
case 5 => lnrpc.Failure.FailureCode
}
}
lazy val defaultInstance = routerrpc.ForwardHtlcInterceptResponse(
incomingCircuitKey = _root_.scala.None,
action = routerrpc.ResolveHoldForwardAction.SETTLE,
preimage = _root_.com.google.protobuf.ByteString.EMPTY,
failureMessage = _root_.com.google.protobuf.ByteString.EMPTY,
failureCode = lnrpc.Failure.FailureCode.RESERVED
)
implicit class ForwardHtlcInterceptResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.ForwardHtlcInterceptResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, routerrpc.ForwardHtlcInterceptResponse](_l) {
def incomingCircuitKey: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.CircuitKey] = field(_.getIncomingCircuitKey)((c_, f_) => c_.copy(incomingCircuitKey = Option(f_)))
def optionalIncomingCircuitKey: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[routerrpc.CircuitKey]] = field(_.incomingCircuitKey)((c_, f_) => c_.copy(incomingCircuitKey = f_))
def action: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.ResolveHoldForwardAction] = field(_.action)((c_, f_) => c_.copy(action = f_))
def preimage: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.preimage)((c_, f_) => c_.copy(preimage = f_))
def failureMessage: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.failureMessage)((c_, f_) => c_.copy(failureMessage = f_))
def failureCode: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Failure.FailureCode] = field(_.failureCode)((c_, f_) => c_.copy(failureCode = f_))
}
final val INCOMING_CIRCUIT_KEY_FIELD_NUMBER = 1
final val ACTION_FIELD_NUMBER = 2
final val PREIMAGE_FIELD_NUMBER = 3
final val FAILURE_MESSAGE_FIELD_NUMBER = 4
final val FAILURE_CODE_FIELD_NUMBER = 5
def of(
incomingCircuitKey: _root_.scala.Option[routerrpc.CircuitKey],
action: routerrpc.ResolveHoldForwardAction,
preimage: _root_.com.google.protobuf.ByteString,
failureMessage: _root_.com.google.protobuf.ByteString,
failureCode: lnrpc.Failure.FailureCode
): _root_.routerrpc.ForwardHtlcInterceptResponse = _root_.routerrpc.ForwardHtlcInterceptResponse(
incomingCircuitKey,
action,
preimage,
failureMessage,
failureCode
)
// @@protoc_insertion_point(GeneratedMessageCompanion[routerrpc.ForwardHtlcInterceptResponse])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy