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};

/// CbbOverageBehavior : Controls how overage is handled at the end of a billing cycle.  | Preset                  | Charge at billing | Credits reduce overage | Preserve overage at reset | |-------------------------|:-----------------:|:---------------------:|:-------------------------:| | `forgive_at_reset`      | No                | No                    | No                        | | `invoice_at_billing`    | Yes               | No                    | No                        | | `carry_deficit`         | No                | No                    | Yes                       | | `carry_deficit_auto_repay` | No             | Yes                   | Yes                       |
/// Controls how overage is handled at the end of a billing cycle.  | Preset                  | Charge at billing | Credits reduce overage | Preserve overage at reset | |-------------------------|:-----------------:|:---------------------:|:-------------------------:| | `forgive_at_reset`      | No                | No                    | No                        | | `invoice_at_billing`    | Yes               | No                    | No                        | | `carry_deficit`         | No                | No                    | Yes                       | | `carry_deficit_auto_repay` | No             | Yes                   | Yes                       |
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CbbOverageBehavior {
    #[serde(rename = "forgive_at_reset")]
    ForgiveAtReset,
    #[serde(rename = "invoice_at_billing")]
    InvoiceAtBilling,
    #[serde(rename = "carry_deficit")]
    CarryDeficit,
    #[serde(rename = "carry_deficit_auto_repay")]
    CarryDeficitAutoRepay,

}

impl std::fmt::Display for CbbOverageBehavior {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::ForgiveAtReset => write!(f, "forgive_at_reset"),
            Self::InvoiceAtBilling => write!(f, "invoice_at_billing"),
            Self::CarryDeficit => write!(f, "carry_deficit"),
            Self::CarryDeficitAutoRepay => write!(f, "carry_deficit_auto_repay"),
        }
    }
}

impl Default for CbbOverageBehavior {
    fn default() -> CbbOverageBehavior {
        Self::ForgiveAtReset
    }
}