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

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

sealed abstract class PaymentFailureReason(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
  type EnumType = PaymentFailureReason
  def isFailureReasonNone: _root_.scala.Boolean = false
  def isFailureReasonTimeout: _root_.scala.Boolean = false
  def isFailureReasonNoRoute: _root_.scala.Boolean = false
  def isFailureReasonError: _root_.scala.Boolean = false
  def isFailureReasonIncorrectPaymentDetails: _root_.scala.Boolean = false
  def isFailureReasonInsufficientBalance: _root_.scala.Boolean = false
  def companion: _root_.scalapb.GeneratedEnumCompanion[PaymentFailureReason] = lnrpc.PaymentFailureReason
  final def asRecognized: _root_.scala.Option[lnrpc.PaymentFailureReason.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[lnrpc.PaymentFailureReason.Recognized])
}

object PaymentFailureReason extends _root_.scalapb.GeneratedEnumCompanion[PaymentFailureReason] {
  sealed trait Recognized extends PaymentFailureReason
  implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[PaymentFailureReason] = this
  
  /**
    * Payment isn't failed (yet).
    */
  @SerialVersionUID(0L)
  case object FAILURE_REASON_NONE extends PaymentFailureReason(0) with PaymentFailureReason.Recognized {
    val index = 0
    val name = "FAILURE_REASON_NONE"
    override def isFailureReasonNone: _root_.scala.Boolean = true
  }
  
  /**
    * There are more routes to try, but the payment timeout was exceeded.
    */
  @SerialVersionUID(0L)
  case object FAILURE_REASON_TIMEOUT extends PaymentFailureReason(1) with PaymentFailureReason.Recognized {
    val index = 1
    val name = "FAILURE_REASON_TIMEOUT"
    override def isFailureReasonTimeout: _root_.scala.Boolean = true
  }
  
  /**
    * All possible routes were tried and failed permanently. Or were no
    * routes to the destination at all.
    */
  @SerialVersionUID(0L)
  case object FAILURE_REASON_NO_ROUTE extends PaymentFailureReason(2) with PaymentFailureReason.Recognized {
    val index = 2
    val name = "FAILURE_REASON_NO_ROUTE"
    override def isFailureReasonNoRoute: _root_.scala.Boolean = true
  }
  
  /**
    * A non-recoverable error has occured.
    */
  @SerialVersionUID(0L)
  case object FAILURE_REASON_ERROR extends PaymentFailureReason(3) with PaymentFailureReason.Recognized {
    val index = 3
    val name = "FAILURE_REASON_ERROR"
    override def isFailureReasonError: _root_.scala.Boolean = true
  }
  
  /**
    * Payment details incorrect (unknown hash, invalid amt or
    * invalid final cltv delta)
    */
  @SerialVersionUID(0L)
  case object FAILURE_REASON_INCORRECT_PAYMENT_DETAILS extends PaymentFailureReason(4) with PaymentFailureReason.Recognized {
    val index = 4
    val name = "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS"
    override def isFailureReasonIncorrectPaymentDetails: _root_.scala.Boolean = true
  }
  
  /**
    * Insufficient local balance.
    */
  @SerialVersionUID(0L)
  case object FAILURE_REASON_INSUFFICIENT_BALANCE extends PaymentFailureReason(5) with PaymentFailureReason.Recognized {
    val index = 5
    val name = "FAILURE_REASON_INSUFFICIENT_BALANCE"
    override def isFailureReasonInsufficientBalance: _root_.scala.Boolean = true
  }
  
  @SerialVersionUID(0L)
  final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends PaymentFailureReason(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
  lazy val values = scala.collection.immutable.Seq(FAILURE_REASON_NONE, FAILURE_REASON_TIMEOUT, FAILURE_REASON_NO_ROUTE, FAILURE_REASON_ERROR, FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, FAILURE_REASON_INSUFFICIENT_BALANCE)
  def fromValue(__value: _root_.scala.Int): PaymentFailureReason = __value match {
    case 0 => FAILURE_REASON_NONE
    case 1 => FAILURE_REASON_TIMEOUT
    case 2 => FAILURE_REASON_NO_ROUTE
    case 3 => FAILURE_REASON_ERROR
    case 4 => FAILURE_REASON_INCORRECT_PAYMENT_DETAILS
    case 5 => FAILURE_REASON_INSUFFICIENT_BALANCE
    case __other => Unrecognized(__other)
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = LightningProto.javaDescriptor.getEnumTypes().get(8)
  def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = LightningProto.scalaDescriptor.enums(8)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy