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

lnrpc.ListInvoiceRequest.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 pendingOnly
  *  
  *  If set, only invoices that are not settled and not canceled will be returned
  *  in the response.
  * @param indexOffset
  *  
  *  The index of an invoice that will be used as either the start or end of a
  *  query to determine which invoices should be returned in the response.
  * @param numMaxInvoices
  *   The max number of invoices to return in the response to this query.
  * @param reversed
  *  
  *  If set, the invoices returned will result from seeking backwards from the
  *  specified index offset. This can be used to paginate backwards.
  * @param creationDateStart
  *   If set, returns all invoices with a creation date greater than or equal
  *   to it. Measured in seconds since the unix epoch.
  * @param creationDateEnd
  *   If set, returns all invoices with a creation date less than or equal to
  *   it. Measured in seconds since the unix epoch.
  */
@SerialVersionUID(0L)
final case class ListInvoiceRequest(
    pendingOnly: _root_.scala.Boolean = false,
    indexOffset: org.bitcoins.core.number.UInt64 = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toCustom(0L),
    numMaxInvoices: org.bitcoins.core.number.UInt64 = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toCustom(0L),
    reversed: _root_.scala.Boolean = false,
    creationDateStart: org.bitcoins.core.number.UInt64 = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toCustom(0L),
    creationDateEnd: org.bitcoins.core.number.UInt64 = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toCustom(0L),
    unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
    ) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[ListInvoiceRequest] {
    @transient
    private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
    private[this] def __computeSerializedSize(): _root_.scala.Int = {
      var __size = 0
      
      {
        val __value = pendingOnly
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(1, __value)
        }
      };
      
      {
        val __value = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toBase(indexOffset)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(4, __value)
        }
      };
      
      {
        val __value = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toBase(numMaxInvoices)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(5, __value)
        }
      };
      
      {
        val __value = reversed
        if (__value != false) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeBoolSize(6, __value)
        }
      };
      
      {
        val __value = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toBase(creationDateStart)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(7, __value)
        }
      };
      
      {
        val __value = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toBase(creationDateEnd)
        if (__value != 0L) {
          __size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(8, __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 = pendingOnly
        if (__v != false) {
          _output__.writeBool(1, __v)
        }
      };
      {
        val __v = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toBase(indexOffset)
        if (__v != 0L) {
          _output__.writeUInt64(4, __v)
        }
      };
      {
        val __v = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toBase(numMaxInvoices)
        if (__v != 0L) {
          _output__.writeUInt64(5, __v)
        }
      };
      {
        val __v = reversed
        if (__v != false) {
          _output__.writeBool(6, __v)
        }
      };
      {
        val __v = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toBase(creationDateStart)
        if (__v != 0L) {
          _output__.writeUInt64(7, __v)
        }
      };
      {
        val __v = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toBase(creationDateEnd)
        if (__v != 0L) {
          _output__.writeUInt64(8, __v)
        }
      };
      unknownFields.writeTo(_output__)
    }
    def withPendingOnly(__v: _root_.scala.Boolean): ListInvoiceRequest = copy(pendingOnly = __v)
    def withIndexOffset(__v: org.bitcoins.core.number.UInt64): ListInvoiceRequest = copy(indexOffset = __v)
    def withNumMaxInvoices(__v: org.bitcoins.core.number.UInt64): ListInvoiceRequest = copy(numMaxInvoices = __v)
    def withReversed(__v: _root_.scala.Boolean): ListInvoiceRequest = copy(reversed = __v)
    def withCreationDateStart(__v: org.bitcoins.core.number.UInt64): ListInvoiceRequest = copy(creationDateStart = __v)
    def withCreationDateEnd(__v: org.bitcoins.core.number.UInt64): ListInvoiceRequest = copy(creationDateEnd = __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 = pendingOnly
          if (__t != false) __t else null
        }
        case 4 => {
          val __t = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toBase(indexOffset)
          if (__t != 0L) __t else null
        }
        case 5 => {
          val __t = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toBase(numMaxInvoices)
          if (__t != 0L) __t else null
        }
        case 6 => {
          val __t = reversed
          if (__t != false) __t else null
        }
        case 7 => {
          val __t = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toBase(creationDateStart)
          if (__t != 0L) __t else null
        }
        case 8 => {
          val __t = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toBase(creationDateEnd)
          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.PBoolean(pendingOnly)
        case 4 => _root_.scalapb.descriptors.PLong(lnrpc.ListInvoiceRequest._typemapper_indexOffset.toBase(indexOffset))
        case 5 => _root_.scalapb.descriptors.PLong(lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toBase(numMaxInvoices))
        case 6 => _root_.scalapb.descriptors.PBoolean(reversed)
        case 7 => _root_.scalapb.descriptors.PLong(lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toBase(creationDateStart))
        case 8 => _root_.scalapb.descriptors.PLong(lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toBase(creationDateEnd))
      }
    }
    def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
    def companion: lnrpc.ListInvoiceRequest.type = lnrpc.ListInvoiceRequest
    // @@protoc_insertion_point(GeneratedMessage[lnrpc.ListInvoiceRequest])
}

object ListInvoiceRequest extends scalapb.GeneratedMessageCompanion[lnrpc.ListInvoiceRequest] {
  implicit def messageCompanion: scalapb.GeneratedMessageCompanion[lnrpc.ListInvoiceRequest] = this
  def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): lnrpc.ListInvoiceRequest = {
    var __pendingOnly: _root_.scala.Boolean = false
    var __indexOffset: _root_.scala.Long = 0L
    var __numMaxInvoices: _root_.scala.Long = 0L
    var __reversed: _root_.scala.Boolean = false
    var __creationDateStart: _root_.scala.Long = 0L
    var __creationDateEnd: _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 8 =>
          __pendingOnly = _input__.readBool()
        case 32 =>
          __indexOffset = _input__.readUInt64()
        case 40 =>
          __numMaxInvoices = _input__.readUInt64()
        case 48 =>
          __reversed = _input__.readBool()
        case 56 =>
          __creationDateStart = _input__.readUInt64()
        case 64 =>
          __creationDateEnd = _input__.readUInt64()
        case tag =>
          if (_unknownFields__ == null) {
            _unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
          }
          _unknownFields__.parseField(tag, _input__)
      }
    }
    lnrpc.ListInvoiceRequest(
        pendingOnly = __pendingOnly,
        indexOffset = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toCustom(__indexOffset),
        numMaxInvoices = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toCustom(__numMaxInvoices),
        reversed = __reversed,
        creationDateStart = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toCustom(__creationDateStart),
        creationDateEnd = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toCustom(__creationDateEnd),
        unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
    )
  }
  implicit def messageReads: _root_.scalapb.descriptors.Reads[lnrpc.ListInvoiceRequest] = _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.ListInvoiceRequest(
        pendingOnly = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        indexOffset = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        numMaxInvoices = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        reversed = __fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scala.Boolean]).getOrElse(false),
        creationDateStart = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).map(_.as[_root_.scala.Long]).getOrElse(0L)),
        creationDateEnd = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toCustom(__fieldsMap.get(scalaDescriptor.findFieldByNumber(8).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(133)
  def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = LightningProto.scalaDescriptor.messages(133)
  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 = lnrpc.ListInvoiceRequest(
    pendingOnly = false,
    indexOffset = lnrpc.ListInvoiceRequest._typemapper_indexOffset.toCustom(0L),
    numMaxInvoices = lnrpc.ListInvoiceRequest._typemapper_numMaxInvoices.toCustom(0L),
    reversed = false,
    creationDateStart = lnrpc.ListInvoiceRequest._typemapper_creationDateStart.toCustom(0L),
    creationDateEnd = lnrpc.ListInvoiceRequest._typemapper_creationDateEnd.toCustom(0L)
  )
  implicit class ListInvoiceRequestLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, lnrpc.ListInvoiceRequest]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, lnrpc.ListInvoiceRequest](_l) {
    def pendingOnly: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.pendingOnly)((c_, f_) => c_.copy(pendingOnly = f_))
    def indexOffset: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.indexOffset)((c_, f_) => c_.copy(indexOffset = f_))
    def numMaxInvoices: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.numMaxInvoices)((c_, f_) => c_.copy(numMaxInvoices = f_))
    def reversed: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Boolean] = field(_.reversed)((c_, f_) => c_.copy(reversed = f_))
    def creationDateStart: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.creationDateStart)((c_, f_) => c_.copy(creationDateStart = f_))
    def creationDateEnd: _root_.scalapb.lenses.Lens[UpperPB, org.bitcoins.core.number.UInt64] = field(_.creationDateEnd)((c_, f_) => c_.copy(creationDateEnd = f_))
  }
  final val PENDING_ONLY_FIELD_NUMBER = 1
  final val INDEX_OFFSET_FIELD_NUMBER = 4
  final val NUM_MAX_INVOICES_FIELD_NUMBER = 5
  final val REVERSED_FIELD_NUMBER = 6
  final val CREATION_DATE_START_FIELD_NUMBER = 7
  final val CREATION_DATE_END_FIELD_NUMBER = 8
  @transient
  private[lnrpc] val _typemapper_indexOffset: _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_numMaxInvoices: _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_creationDateStart: _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_creationDateEnd: _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(
    pendingOnly: _root_.scala.Boolean,
    indexOffset: org.bitcoins.core.number.UInt64,
    numMaxInvoices: org.bitcoins.core.number.UInt64,
    reversed: _root_.scala.Boolean,
    creationDateStart: org.bitcoins.core.number.UInt64,
    creationDateEnd: org.bitcoins.core.number.UInt64
  ): _root_.lnrpc.ListInvoiceRequest = _root_.lnrpc.ListInvoiceRequest(
    pendingOnly,
    indexOffset,
    numMaxInvoices,
    reversed,
    creationDateStart,
    creationDateEnd
  )
  // @@protoc_insertion_point(GeneratedMessageCompanion[lnrpc.ListInvoiceRequest])
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy