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

lnrpc.ChannelBalanceResponse.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 balance
  *   Deprecated. Sum of channels balances denominated in satoshis
  * @param pendingOpenBalance
  *   Deprecated. Sum of channels pending balances denominated in satoshis
  * @param localBalance
  *   Sum of channels local balances.
  * @param remoteBalance
  *   Sum of channels remote balances.
  * @param unsettledLocalBalance
  *   Sum of channels local unsettled balances.
  * @param unsettledRemoteBalance
  *   Sum of channels remote unsettled balances.
  * @param pendingOpenLocalBalance
  *   Sum of channels pending local balances.
  * @param pendingOpenRemoteBalance
  *   Sum of channels pending remote balances.
  */
@SerialVersionUID(0L)
final case class ChannelBalanceResponse(
    @scala.deprecated(message="Marked as deprecated in proto file", "") balance: _root_.scala.Long = 0L,
    @scala.deprecated(message="Marked as deprecated in proto file", "") pendingOpenBalance: _root_.scala.Long = 0L,
    localBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None,
    remoteBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None,
    unsettledLocalBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None,
    unsettledRemoteBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None,
    pendingOpenLocalBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None,
    pendingOpenRemoteBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None,
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ChannelBalanceResponse] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = balance
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(1, __value)
        }
      };
      
      {
        val __value = pendingOpenBalance
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeInt64Size(2, __value)
        }
      };
      if (localBalance.isDefined) {
        val __value = localBalance.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (remoteBalance.isDefined) {
        val __value = remoteBalance.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (unsettledLocalBalance.isDefined) {
        val __value = unsettledLocalBalance.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (unsettledRemoteBalance.isDefined) {
        val __value = unsettledRemoteBalance.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (pendingOpenLocalBalance.isDefined) {
        val __value = pendingOpenLocalBalance.get
        __size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
      };
      if (pendingOpenRemoteBalance.isDefined) {
        val __value = pendingOpenRemoteBalance.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 = balance
        if (__v != 0L) {
          _output__.writeInt64(1, __v)
        }
      };
      {
        val __v = pendingOpenBalance
        if (__v != 0L) {
          _output__.writeInt64(2, __v)
        }
      };
      localBalance.foreach { __v =>
        val __m = __v
        _output__.writeTag(3, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      remoteBalance.foreach { __v =>
        val __m = __v
        _output__.writeTag(4, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unsettledLocalBalance.foreach { __v =>
        val __m = __v
        _output__.writeTag(5, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unsettledRemoteBalance.foreach { __v =>
        val __m = __v
        _output__.writeTag(6, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      pendingOpenLocalBalance.foreach { __v =>
        val __m = __v
        _output__.writeTag(7, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      pendingOpenRemoteBalance.foreach { __v =>
        val __m = __v
        _output__.writeTag(8, 2)
        _output__.writeUInt32NoTag(__m.serializedSize)
        __m.writeTo(_output__)
      };
      unknownFields.writeTo(_output__)
    }
    def withBalance(__v: _root_.scala.Long): ChannelBalanceResponse = copy(balance = __v)
    def withPendingOpenBalance(__v: _root_.scala.Long): ChannelBalanceResponse = copy(pendingOpenBalance = __v)
    def getLocalBalance: lnrpc.Amount = localBalance.getOrElse(lnrpc.Amount.defaultInstance)
    def clearLocalBalance: ChannelBalanceResponse = copy(localBalance = _root_.scala.None)
    def withLocalBalance(__v: lnrpc.Amount): ChannelBalanceResponse = copy(localBalance = Option(__v))
    def getRemoteBalance: lnrpc.Amount = remoteBalance.getOrElse(lnrpc.Amount.defaultInstance)
    def clearRemoteBalance: ChannelBalanceResponse = copy(remoteBalance = _root_.scala.None)
    def withRemoteBalance(__v: lnrpc.Amount): ChannelBalanceResponse = copy(remoteBalance = Option(__v))
    def getUnsettledLocalBalance: lnrpc.Amount = unsettledLocalBalance.getOrElse(lnrpc.Amount.defaultInstance)
    def clearUnsettledLocalBalance: ChannelBalanceResponse = copy(unsettledLocalBalance = _root_.scala.None)
    def withUnsettledLocalBalance(__v: lnrpc.Amount): ChannelBalanceResponse = copy(unsettledLocalBalance = Option(__v))
    def getUnsettledRemoteBalance: lnrpc.Amount = unsettledRemoteBalance.getOrElse(lnrpc.Amount.defaultInstance)
    def clearUnsettledRemoteBalance: ChannelBalanceResponse = copy(unsettledRemoteBalance = _root_.scala.None)
    def withUnsettledRemoteBalance(__v: lnrpc.Amount): ChannelBalanceResponse = copy(unsettledRemoteBalance = Option(__v))
    def getPendingOpenLocalBalance: lnrpc.Amount = pendingOpenLocalBalance.getOrElse(lnrpc.Amount.defaultInstance)
    def clearPendingOpenLocalBalance: ChannelBalanceResponse = copy(pendingOpenLocalBalance = _root_.scala.None)
    def withPendingOpenLocalBalance(__v: lnrpc.Amount): ChannelBalanceResponse = copy(pendingOpenLocalBalance = Option(__v))
    def getPendingOpenRemoteBalance: lnrpc.Amount = pendingOpenRemoteBalance.getOrElse(lnrpc.Amount.defaultInstance)
    def clearPendingOpenRemoteBalance: ChannelBalanceResponse = copy(pendingOpenRemoteBalance = _root_.scala.None)
    def withPendingOpenRemoteBalance(__v: lnrpc.Amount): ChannelBalanceResponse = copy(pendingOpenRemoteBalance = 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 = balance
          if (__t != 0L) __t else null
        }
        case 2 => {
          val __t = pendingOpenBalance
          if (__t != 0L) __t else null
        }
        case 3 => localBalance.orNull
        case 4 => remoteBalance.orNull
        case 5 => unsettledLocalBalance.orNull
        case 6 => unsettledRemoteBalance.orNull
        case 7 => pendingOpenLocalBalance.orNull
        case 8 => pendingOpenRemoteBalance.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.PLong(balance)
        case 2 => _root_.scalapb.descriptors.PLong(pendingOpenBalance)
        case 3 => localBalance.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 4 => remoteBalance.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 5 => unsettledLocalBalance.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 6 => unsettledRemoteBalance.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 7 => pendingOpenLocalBalance.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
        case 8 => pendingOpenRemoteBalance.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: lnrpc.ChannelBalanceResponse.type = lnrpc.ChannelBalanceResponse
    // @@protoc_insertion_point(GeneratedMessage[lnrpc.ChannelBalanceResponse])
}

object ChannelBalanceResponse extends scalapb.GeneratedMessageCompanion[lnrpc.ChannelBalanceResponse] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.ChannelBalanceResponse] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.ChannelBalanceResponse = {
    var __balance: _root_.scala.Long = 0L
    var __pendingOpenBalance: _root_.scala.Long = 0L
    var __localBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None
    var __remoteBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None
    var __unsettledLocalBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None
    var __unsettledRemoteBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None
    var __pendingOpenLocalBalance: _root_.scala.Option[lnrpc.Amount] = _root_.scala.None
    var __pendingOpenRemoteBalance: _root_.scala.Option[lnrpc.Amount] = _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 =>
          __balance = _input__.readInt64()
        case 16 =>
          __pendingOpenBalance = _input__.readInt64()
        case 26 =>
          __localBalance = Option(__localBalance.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Amount](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 34 =>
          __remoteBalance = Option(__remoteBalance.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Amount](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 42 =>
          __unsettledLocalBalance = Option(__unsettledLocalBalance.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Amount](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 50 =>
          __unsettledRemoteBalance = Option(__unsettledRemoteBalance.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Amount](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 58 =>
          __pendingOpenLocalBalance = Option(__pendingOpenLocalBalance.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Amount](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case 66 =>
          __pendingOpenRemoteBalance = Option(__pendingOpenRemoteBalance.fold(_root_.scalapb.LiteParser.readMessage[lnrpc.Amount](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    lnrpc.ChannelBalanceResponse(
        balance = __balance,
        pendingOpenBalance = __pendingOpenBalance,
        localBalance = __localBalance,
        remoteBalance = __remoteBalance,
        unsettledLocalBalance = __unsettledLocalBalance,
        unsettledRemoteBalance = __unsettledRemoteBalance,
        pendingOpenLocalBalance = __pendingOpenLocalBalance,
        pendingOpenRemoteBalance = __pendingOpenRemoteBalance,
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.ChannelBalanceResponse] = _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.ChannelBalanceResponse(
        balance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        pendingOpenBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
        localBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).flatMap(_.as[_root_.scala.Option[lnrpc.Amount]]),
        remoteBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).flatMap(_.as[_root_.scala.Option[lnrpc.Amount]]),
        unsettledLocalBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).flatMap(_.as[_root_.scala.Option[lnrpc.Amount]]),
        unsettledRemoteBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).flatMap(_.as[_root_.scala.Option[lnrpc.Amount]]),
        pendingOpenLocalBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[lnrpc.Amount]]),
        pendingOpenRemoteBalance = __fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[lnrpc.Amount]])
      )
    case _ => throw new RuntimeException("Expected PMessage")
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = LightningProto.javaDescriptor.getMessageTypes().get(94)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(94)
  def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
    var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
    (__number: @_root_.scala.unchecked) match {
      case 3 => __out = lnrpc.Amount
      case 4 => __out = lnrpc.Amount
      case 5 => __out = lnrpc.Amount
      case 6 => __out = lnrpc.Amount
      case 7 => __out = lnrpc.Amount
      case 8 => __out = lnrpc.Amount
    }
    __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.ChannelBalanceResponse(
    balance = 0L,
    pendingOpenBalance = 0L,
    localBalance = _root_.scala.None,
    remoteBalance = _root_.scala.None,
    unsettledLocalBalance = _root_.scala.None,
    unsettledRemoteBalance = _root_.scala.None,
    pendingOpenLocalBalance = _root_.scala.None,
    pendingOpenRemoteBalance = _root_.scala.None
  )
  implicit class ChannelBalanceResponseLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.ChannelBalanceResponse]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.ChannelBalanceResponse](_l) {
    def balance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.balance)((c_, f_) => c_.copy(balance = f_))
    def pendingOpenBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.pendingOpenBalance)((c_, f_) => c_.copy(pendingOpenBalance = f_))
    def localBalance: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Amount] = field(_.getLocalBalance)((c_, f_) => c_.copy(localBalance = Option(f_)))
    def optionalLocalBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Amount]] = field(_.localBalance)((c_, f_) => c_.copy(localBalance = f_))
    def remoteBalance: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Amount] = field(_.getRemoteBalance)((c_, f_) => c_.copy(remoteBalance = Option(f_)))
    def optionalRemoteBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Amount]] = field(_.remoteBalance)((c_, f_) => c_.copy(remoteBalance = f_))
    def unsettledLocalBalance: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Amount] = field(_.getUnsettledLocalBalance)((c_, f_) => c_.copy(unsettledLocalBalance = Option(f_)))
    def optionalUnsettledLocalBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Amount]] = field(_.unsettledLocalBalance)((c_, f_) => c_.copy(unsettledLocalBalance = f_))
    def unsettledRemoteBalance: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Amount] = field(_.getUnsettledRemoteBalance)((c_, f_) => c_.copy(unsettledRemoteBalance = Option(f_)))
    def optionalUnsettledRemoteBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Amount]] = field(_.unsettledRemoteBalance)((c_, f_) => c_.copy(unsettledRemoteBalance = f_))
    def pendingOpenLocalBalance: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Amount] = field(_.getPendingOpenLocalBalance)((c_, f_) => c_.copy(pendingOpenLocalBalance = Option(f_)))
    def optionalPendingOpenLocalBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Amount]] = field(_.pendingOpenLocalBalance)((c_, f_) => c_.copy(pendingOpenLocalBalance = f_))
    def pendingOpenRemoteBalance: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.Amount] = field(_.getPendingOpenRemoteBalance)((c_, f_) => c_.copy(pendingOpenRemoteBalance = Option(f_)))
    def optionalPendingOpenRemoteBalance: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Option[lnrpc.Amount]] = field(_.pendingOpenRemoteBalance)((c_, f_) => c_.copy(pendingOpenRemoteBalance = f_))
  }
  final val BALANCE_FIELD_NUMBER = 1
  final val PENDING_OPEN_BALANCE_FIELD_NUMBER = 2
  final val LOCAL_BALANCE_FIELD_NUMBER = 3
  final val REMOTE_BALANCE_FIELD_NUMBER = 4
  final val UNSETTLED_LOCAL_BALANCE_FIELD_NUMBER = 5
  final val UNSETTLED_REMOTE_BALANCE_FIELD_NUMBER = 6
  final val PENDING_OPEN_LOCAL_BALANCE_FIELD_NUMBER = 7
  final val PENDING_OPEN_REMOTE_BALANCE_FIELD_NUMBER = 8
  def of(
    balance: _root_.scala.Long,
    pendingOpenBalance: _root_.scala.Long,
    localBalance: _root_.scala.Option[lnrpc.Amount],
    remoteBalance: _root_.scala.Option[lnrpc.Amount],
    unsettledLocalBalance: _root_.scala.Option[lnrpc.Amount],
    unsettledRemoteBalance: _root_.scala.Option[lnrpc.Amount],
    pendingOpenLocalBalance: _root_.scala.Option[lnrpc.Amount],
    pendingOpenRemoteBalance: _root_.scala.Option[lnrpc.Amount]
  ): _root_.lnrpc.ChannelBalanceResponse = _root_.lnrpc.ChannelBalanceResponse(
    balance,
    pendingOpenBalance,
    localBalance,
    remoteBalance,
    unsettledLocalBalance,
    unsettledRemoteBalance,
    pendingOpenLocalBalance,
    pendingOpenRemoteBalance
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.ChannelBalanceResponse])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy