use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::fmt;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub enum OutgoingPaymentAttemptStatus {
#[serde(rename = "IN_FLIGHT")]
InFlight,
#[serde(rename = "SUCCEEDED")]
Succeeded,
#[serde(rename = "FAILED")]
Failed,
}
impl From<OutgoingPaymentAttemptStatus> for Value {
fn from(val: OutgoingPaymentAttemptStatus) -> Self {
Value::from(val.to_string())
}
}
impl fmt::Display for OutgoingPaymentAttemptStatus {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::InFlight => write!(f, "IN_FLIGHT"),
Self::Succeeded => write!(f, "SUCCEEDED"),
Self::Failed => write!(f, "FAILED"),
}
}
}