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

routerrpc.BuildRouteRequest.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

/** @param amtMsat
  *  
  *  The amount to send expressed in msat. If set to zero, the minimum routable
  *  amount is used.
  * @param finalCltvDelta
  *  
  *  CLTV delta from the current height that should be used for the timelock
  *  of the final hop
  * @param outgoingChanId
  *  
  *  The channel id of the channel that must be taken to the first hop. If zero,
  *  any channel may be used.
  * @param hopPubkeys
  *  
  *  A list of hops that defines the route. This does not include the source hop
  *  pubkey.
  * @param paymentAddr
  *   An optional payment addr to be included within the last hop of the route.
  */
@SerialVersionUID(0L)
final case class BuildRouteRequest(
    amtMsat: _root_.scala.Long = 0L,
    finalCltvDelta: _root_.scala.Int = 0,
    outgoingChanId: _root_.scala.Long = 0L,
    hopPubkeys: _root_.scala.Seq[_root_.com.google.protobuf.ByteString] = _root_.scala.Seq.empty,
    paymentAddr: _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[BuildRouteRequest] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = amtMsat
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(1, __value)
        }
      };
      
      {
        val __value = finalCltvDelta
        if (__value != 0) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt32Size(2, __value)
        }
      };
      
      {
        val __value = outgoingChanId
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(3, __value)
        }
      };
      hopPubkeys.foreach { __item =>
        val __value = __item
        __size += _root_.com.google.protobuf.CodedOutputStream.computeBytesSize(4, __value)
      }
      
      {
        val __value = paymentAddr
        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 = amtMsat
        if (__v != 0L) {
          _output__.writeInt64(1, __v)
        }
      };
      {
        val __v = finalCltvDelta
        if (__v != 0) {
          _output__.writeInt32(2, __v)
        }
      };
      {
        val __v = outgoingChanId
        if (__v != 0L) {
          _output__.writeUInt64(3, __v)
        }
      };
      hopPubkeys.foreach { __v =>
        val __m = __v
        _output__.writeBytes(4, __m)
      };
      {
        val __v = paymentAddr
        if (!__v.isEmpty) {
          _output__.writeBytes(5, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withAmtMsat(__v: _root_.scala.Long): BuildRouteRequest = copy(amtMsat = __v)
    def withFinalCltvDelta(__v: _root_.scala.Int): BuildRouteRequest = copy(finalCltvDelta = __v)
    def withOutgoingChanId(__v: _root_.scala.Long): BuildRouteRequest = copy(outgoingChanId = __v)
    def clearHopPubkeys = copy(hopPubkeys = _root_.scala.Seq.empty)
    def addHopPubkeys(__vs: _root_.com.google.protobuf.ByteString *): BuildRouteRequest = addAllHopPubkeys(__vs)
    def addAllHopPubkeys(__vs: Iterable[_root_.com.google.protobuf.ByteString]): BuildRouteRequest = copy(hopPubkeys = hopPubkeys ++ __vs)
    def withHopPubkeys(__v: _root_.scala.Seq[_root_.com.google.protobuf.ByteString]): BuildRouteRequest = copy(hopPubkeys = __v)
    def withPaymentAddr(__v: _root_.com.google.protobuf.ByteString): BuildRouteRequest = copy(paymentAddr = __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 = amtMsat
          if (__t != 0L) __t else null
        }
        case 2 => {
          val __t = finalCltvDelta
          if (__t != 0) __t else null
        }
        case 3 => {
          val __t = outgoingChanId
          if (__t != 0L) __t else null
        }
        case 4 => hopPubkeys
        case 5 => {
          val __t = paymentAddr
          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(amtMsat)
        case 2 => _root_.scalapb.descriptors.PInt(finalCltvDelta)
        case 3 => _root_.scalapb.descriptors.PLong(outgoingChanId)
        case 4 => _root_.scalapb.descriptors.PRepeated(hopPubkeys.iterator.map(_root_.scalapb.descriptors.PByteString(_)).toVector)
        case 5 => _root_.scalapb.descriptors.PByteString(paymentAddr)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: routerrpc.BuildRouteRequest.type = routerrpc.BuildRouteRequest
    // @@protoc_insertion_point(GeneratedMessage[routerrpc.BuildRouteRequest])
}

object BuildRouteRequest extends scalapb.GeneratedMessageCompanion[routerrpc.BuildRouteRequest] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[routerrpc.BuildRouteRequest] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): routerrpc.BuildRouteRequest = {
    var __amtMsat: _root_.scala.Long = 0L
    var __finalCltvDelta: _root_.scala.Int = 0
    var __outgoingChanId: _root_.scala.Long = 0L
    val __hopPubkeys: _root_.scala.collection.immutable.VectorBuilder[_root_.com.google.protobuf.ByteString] = new _root_.scala.collection.immutable.VectorBuilder[_root_.com.google.protobuf.ByteString]
    var __paymentAddr: _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 =>
          __amtMsat = _input__.readInt64()
        case 16 =>
          __finalCltvDelta = _input__.readInt32()
        case 24 =>
          __outgoingChanId = _input__.readUInt64()
        case 34 =>
          __hopPubkeys += _input__.readBytes()
        case 42 =>
          __paymentAddr = _input__.readBytes()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    routerrpc.BuildRouteRequest(
        amtMsat = __amtMsat,
        finalCltvDelta = __finalCltvDelta,
        outgoingChanId = __outgoingChanId,
        hopPubkeys = __hopPubkeys.result(),
        paymentAddr = __paymentAddr,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[routerrpc.BuildRouteRequest] = _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.BuildRouteRequest(
        amtMsat = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        finalCltvDelta = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Int]).getOrElse(0),
        outgoingChanId = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        hopPubkeys = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Seq[_root_.com.google.protobuf.ByteString]]).getOrElse(_root_.scala.Seq.empty),
        paymentAddr = __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 = RouterProto.javaDescriptor.getMessageTypes().get(24)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = RouterProto.scalaDescriptor.messages(24)
  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 = routerrpc.BuildRouteRequest(
    amtMsat = 0L,
    finalCltvDelta = 0,
    outgoingChanId = 0L,
    hopPubkeys = _root_.scala.Seq.empty,
    paymentAddr = _root_.com.google.protobuf.ByteString.EMPTY
  )
  implicit class BuildRouteRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.BuildRouteRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, routerrpc.BuildRouteRequest](_l) {
    def amtMsat: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.amtMsat)((c_, f_) => c_.copy(amtMsat = f_))
    def finalCltvDelta: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.finalCltvDelta)((c_, f_) => c_.copy(finalCltvDelta = f_))
    def outgoingChanId: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.outgoingChanId)((c_, f_) => c_.copy(outgoingChanId = f_))
    def hopPubkeys: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[_root_.com.google.protobuf.ByteString]] = field(_.hopPubkeys)((c_, f_) => c_.copy(hopPubkeys = f_))
    def paymentAddr: _root_.scalapb.lenses.Lens[UpperPB, _root_.com.google.protobuf.ByteString] = field(_.paymentAddr)((c_, f_) => c_.copy(paymentAddr = f_))
  }
  final val AMT_MSAT_FIELD_NUMBER = 1
  final val FINAL_CLTV_DELTA_FIELD_NUMBER = 2
  final val OUTGOING_CHAN_ID_FIELD_NUMBER = 3
  final val HOP_PUBKEYS_FIELD_NUMBER = 4
  final val PAYMENT_ADDR_FIELD_NUMBER = 5
  def of(
    amtMsat: _root_.scala.Long,
    finalCltvDelta: _root_.scala.Int,
    outgoingChanId: _root_.scala.Long,
    hopPubkeys: _root_.scala.Seq[_root_.com.google.protobuf.ByteString],
    paymentAddr: _root_.com.google.protobuf.ByteString
  ): _root_.routerrpc.BuildRouteRequest = _root_.routerrpc.BuildRouteRequest(
    amtMsat,
    finalCltvDelta,
    outgoingChanId,
    hopPubkeys,
    paymentAddr
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[routerrpc.BuildRouteRequest])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy