dodopayments_rust 2.2.2

Rust SDK for Dodo Payments API
Documentation
/*
 * public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.87.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum IntentStatus {
    #[serde(rename = "succeeded")]
    Succeeded,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "processing")]
    Processing,
    #[serde(rename = "requires_customer_action")]
    RequiresCustomerAction,
    #[serde(rename = "requires_merchant_action")]
    RequiresMerchantAction,
    #[serde(rename = "requires_payment_method")]
    RequiresPaymentMethod,
    #[serde(rename = "requires_confirmation")]
    RequiresConfirmation,
    #[serde(rename = "requires_capture")]
    RequiresCapture,
    #[serde(rename = "partially_captured")]
    PartiallyCaptured,
    #[serde(rename = "partially_captured_and_capturable")]
    PartiallyCapturedAndCapturable,

}

impl std::fmt::Display for IntentStatus {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Succeeded => write!(f, "succeeded"),
            Self::Failed => write!(f, "failed"),
            Self::Cancelled => write!(f, "cancelled"),
            Self::Processing => write!(f, "processing"),
            Self::RequiresCustomerAction => write!(f, "requires_customer_action"),
            Self::RequiresMerchantAction => write!(f, "requires_merchant_action"),
            Self::RequiresPaymentMethod => write!(f, "requires_payment_method"),
            Self::RequiresConfirmation => write!(f, "requires_confirmation"),
            Self::RequiresCapture => write!(f, "requires_capture"),
            Self::PartiallyCaptured => write!(f, "partially_captured"),
            Self::PartiallyCapturedAndCapturable => write!(f, "partially_captured_and_capturable"),
        }
    }
}

impl Default for IntentStatus {
    fn default() -> IntentStatus {
        Self::Succeeded
    }
}