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

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

sealed abstract class PaymentState(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
  type EnumType = PaymentState
  def isInFlight: _root_.scala.Boolean = false
  def isSucceeded: _root_.scala.Boolean = false
  def isFailedTimeout: _root_.scala.Boolean = false
  def isFailedNoRoute: _root_.scala.Boolean = false
  def isFailedError: _root_.scala.Boolean = false
  def isFailedIncorrectPaymentDetails: _root_.scala.Boolean = false
  def isFailedInsufficientBalance: _root_.scala.Boolean = false
  def companion: _root_.scalapb.GeneratedEnumCompanion[PaymentState] = routerrpc.PaymentState
  final def asRecognized: _root_.scala.Option[routerrpc.PaymentState.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[routerrpc.PaymentState.Recognized])
}

object PaymentState extends _root_.scalapb.GeneratedEnumCompanion[PaymentState] {
  sealed trait Recognized extends PaymentState
  implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[PaymentState] = this
  
  /**
    * Payment is still in flight.
    */
  @SerialVersionUID(0L)
  case object IN_FLIGHT extends PaymentState(0) with PaymentState.Recognized {
    val index = 0
    val name = "IN_FLIGHT"
    override def isInFlight: _root_.scala.Boolean = true
  }
  
  /**
    * Payment completed successfully.
    */
  @SerialVersionUID(0L)
  case object SUCCEEDED extends PaymentState(1) with PaymentState.Recognized {
    val index = 1
    val name = "SUCCEEDED"
    override def isSucceeded: _root_.scala.Boolean = true
  }
  
  /**
    * There are more routes to try, but the payment timeout was exceeded.
    */
  @SerialVersionUID(0L)
  case object FAILED_TIMEOUT extends PaymentState(2) with PaymentState.Recognized {
    val index = 2
    val name = "FAILED_TIMEOUT"
    override def isFailedTimeout: _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 FAILED_NO_ROUTE extends PaymentState(3) with PaymentState.Recognized {
    val index = 3
    val name = "FAILED_NO_ROUTE"
    override def isFailedNoRoute: _root_.scala.Boolean = true
  }
  
  /**
    * A non-recoverable error has occurred.
    */
  @SerialVersionUID(0L)
  case object FAILED_ERROR extends PaymentState(4) with PaymentState.Recognized {
    val index = 4
    val name = "FAILED_ERROR"
    override def isFailedError: _root_.scala.Boolean = true
  }
  
  /**
    * Payment details incorrect (unknown hash, invalid amt or
    * invalid final cltv delta)
    */
  @SerialVersionUID(0L)
  case object FAILED_INCORRECT_PAYMENT_DETAILS extends PaymentState(5) with PaymentState.Recognized {
    val index = 5
    val name = "FAILED_INCORRECT_PAYMENT_DETAILS"
    override def isFailedIncorrectPaymentDetails: _root_.scala.Boolean = true
  }
  
  /**
    * Insufficient local balance.
    */
  @SerialVersionUID(0L)
  case object FAILED_INSUFFICIENT_BALANCE extends PaymentState(6) with PaymentState.Recognized {
    val index = 6
    val name = "FAILED_INSUFFICIENT_BALANCE"
    override def isFailedInsufficientBalance: _root_.scala.Boolean = true
  }
  
  @SerialVersionUID(0L)
  final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends PaymentState(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
  lazy val values = scala.collection.immutable.Seq(IN_FLIGHT, SUCCEEDED, FAILED_TIMEOUT, FAILED_NO_ROUTE, FAILED_ERROR, FAILED_INCORRECT_PAYMENT_DETAILS, FAILED_INSUFFICIENT_BALANCE)
  def fromValue(__value: _root_.scala.Int): PaymentState = __value match {
    case 0 => IN_FLIGHT
    case 1 => SUCCEEDED
    case 2 => FAILED_TIMEOUT
    case 3 => FAILED_NO_ROUTE
    case 4 => FAILED_ERROR
    case 5 => FAILED_INCORRECT_PAYMENT_DETAILS
    case 6 => FAILED_INSUFFICIENT_BALANCE
    case __other => Unrecognized(__other)
  }
  def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = RouterProto.javaDescriptor.getEnumTypes().get(1)
  def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = RouterProto.scalaDescriptor.enums(1)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy