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

lnrpc.FeeReportResponse.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._

/** @param channelFees
  *   An array of channel fee reports which describes the current fee schedule
  *   for each channel.
  * @param dayFeeSum
  *   The total amount of fee revenue (in satoshis) the switch has collected
  *   over the past 24 hrs.
  * @param weekFeeSum
  *   The total amount of fee revenue (in satoshis) the switch has collected
  *   over the past 1 week.
  * @param monthFeeSum
  *   The total amount of fee revenue (in satoshis) the switch has collected
  *   over the past 1 month.
  */
@SerialVersionUID(0L)
final case class FeeReportResponse(
    channelFees: _root_.scala.Seq[lnrpc.ChannelFeeReport] = _root_.scala.Seq.empty,
    dayFeeSum: org.bitcoins.core.number.UInt64 = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toCustom(0L),
    weekFeeSum: org.bitcoins.core.number.UInt64 = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toCustom(0L),
    monthFeeSum: org.bitcoins.core.number.UInt64 = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toCustom(0L),
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[FeeReportResponse] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      channelFees.foreach { __item =>
        val __value = __item
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      }
      
      {
        val __value = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toBase(dayFeeSum)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(2, __value)
        }
      };
      
      {
        val __value = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toBase(weekFeeSum)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(3, __value)
        }
      };
      
      {
        val __value = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toBase(monthFeeSum)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(4, __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 = {
      channelFees.foreach { __v =>
        val __m = __v
        _output__.writeTag(1, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      {
        val __v = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toBase(dayFeeSum)
        if (__v != 0L) {
          _output__.writeUInt64(2, __v)
        }
      };
      {
        val __v = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toBase(weekFeeSum)
        if (__v != 0L) {
          _output__.writeUInt64(3, __v)
        }
      };
      {
        val __v = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toBase(monthFeeSum)
        if (__v != 0L) {
          _output__.writeUInt64(4, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def clearChannelFees = copy(channelFees = _root_.scala.Seq.empty)
    def addChannelFees(__vs: lnrpc.ChannelFeeReport *): FeeReportResponse = addAllChannelFees(__vs)
    def addAllChannelFees(__vs: Iterable[lnrpc.ChannelFeeReport]): FeeReportResponse = copy(channelFees = channelFees ++ __vs)
    def withChannelFees(__v: _root_.scala.Seq[lnrpc.ChannelFeeReport]): FeeReportResponse = copy(channelFees = __v)
    def withDayFeeSum(__v: org.bitcoins.core.number.UInt64): FeeReportResponse = copy(dayFeeSum = __v)
    def withWeekFeeSum(__v: org.bitcoins.core.number.UInt64): FeeReportResponse = copy(weekFeeSum = __v)
    def withMonthFeeSum(__v: org.bitcoins.core.number.UInt64): FeeReportResponse = copy(monthFeeSum = __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 => channelFees
        case 2 => {
          val __t = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toBase(dayFeeSum)
          if (__t != 0L) __t else null
        }
        case 3 => {
          val __t = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toBase(weekFeeSum)
          if (__t != 0L) __t else null
        }
        case 4 => {
          val __t = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toBase(monthFeeSum)
          if (__t != 0L) __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.PRepeated(channelFees.iterator.map(_.toPMessage).toVector)
        case 2 => _root_.scalapb.descriptors.PLong(lnrpc.FeeReportResponse._typemapper_dayFeeSum.toBase(dayFeeSum))
        case 3 => _root_.scalapb.descriptors.PLong(lnrpc.FeeReportResponse._typemapper_weekFeeSum.toBase(weekFeeSum))
        case 4 => _root_.scalapb.descriptors.PLong(lnrpc.FeeReportResponse._typemapper_monthFeeSum.toBase(monthFeeSum))
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: lnrpc.FeeReportResponse.type = lnrpc.FeeReportResponse
    // @@protoc_insertion_point(GeneratedMessage[lnrpc.FeeReportResponse])
}

object FeeReportResponse extends scalapb.GeneratedMessageCompanion[lnrpc.FeeReportResponse] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.FeeReportResponse] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.FeeReportResponse = {
    val __channelFees: _root_.scala.collection.immutable.VectorBuilder[lnrpc.ChannelFeeReport] = new _root_.scala.collection.immutable.VectorBuilder[lnrpc.ChannelFeeReport]
    var __dayFeeSum: _root_.scala.Long = 0L
    var __weekFeeSum: _root_.scala.Long = 0L
    var __monthFeeSum: _root_.scala.Long = 0L
    var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
    var _done__ = false
    while (!_done__) {
      val _tag__ = _input__.readTag()
      _tag__ match {
        case 0 => _done__ = true
        case 10 =>
          __channelFees += _root_.scalapb.LiteParser.readMessage[lnrpc.ChannelFeeReport](_input__)
        case 16 =>
          __dayFeeSum = _input__.readUInt64()
        case 24 =>
          __weekFeeSum = _input__.readUInt64()
        case 32 =>
          __monthFeeSum = _input__.readUInt64()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    lnrpc.FeeReportResponse(
        channelFees = __channelFees.result(),
        dayFeeSum = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toCustom(__dayFeeSum),
        weekFeeSum = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toCustom(__weekFeeSum),
        monthFeeSum = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toCustom(__monthFeeSum),
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.FeeReportResponse] = _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.FeeReportResponse(
        channelFees = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Seq[lnrpc.ChannelFeeReport]]).getOrElse(_root_.scala.Seq.empty),
        dayFeeSum = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        weekFeeSum = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        monthFeeSum = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L))
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(153)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(153)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 1 => __out = lnrpc.ChannelFeeReport
    }
    __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.FeeReportResponse(
    channelFees = _root_.scala.Seq.empty,
    dayFeeSum = lnrpc.FeeReportResponse._typemapper_dayFeeSum.toCustom(0L),
    weekFeeSum = lnrpc.FeeReportResponse._typemapper_weekFeeSum.toCustom(0L),
    monthFeeSum = lnrpc.FeeReportResponse._typemapper_monthFeeSum.toCustom(0L)
  )
  implicit class FeeReportResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.FeeReportResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.FeeReportResponse](_l) {
    def channelFees: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Seq[lnrpc.ChannelFeeReport]] = field(_.channelFees)((c_, f_) => c_.copy(channelFees = f_))
    def dayFeeSum: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.dayFeeSum)((c_, f_) => c_.copy(dayFeeSum = f_))
    def weekFeeSum: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.weekFeeSum)((c_, f_) => c_.copy(weekFeeSum = f_))
    def monthFeeSum: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.monthFeeSum)((c_, f_) => c_.copy(monthFeeSum = f_))
  }
  final val CHANNEL_FEES_FIELD_NUMBER = 1
  final val DAY_FEE_SUM_FIELD_NUMBER = 2
  final val WEEK_FEE_SUM_FIELD_NUMBER = 3
  final val MONTH_FEE_SUM_FIELD_NUMBER = 4
  @transient
  private[lnrpc] val _typemapper_dayFeeSum: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  @transient
  private[lnrpc] val _typemapper_weekFeeSum: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  @transient
  private[lnrpc] val _typemapper_monthFeeSum: _root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64] = implicitly[_root_.scalapb.TypeMapper[_root_.scala.Long, org.bitcoins.core.number.UInt64]]
  def of(
    channelFees: _root_.scala.Seq[lnrpc.ChannelFeeReport],
    dayFeeSum: org.bitcoins.core.number.UInt64,
    weekFeeSum: org.bitcoins.core.number.UInt64,
    monthFeeSum: org.bitcoins.core.number.UInt64
  ): _root_.lnrpc.FeeReportResponse = _root_.lnrpc.FeeReportResponse(
    channelFees,
    dayFeeSum,
    weekFeeSum,
    monthFeeSum
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.FeeReportResponse])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy