/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

/// BillingSnapshot : Account billing state — plan, cycle, balance, spend caps, and payment / access status. Returned by `GET /v1/billing`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BillingSnapshot {
    #[serde(rename = "billingSystem", skip_serializing_if = "Option::is_none")]
    pub billing_system: Option<BillingSystem>,
    #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
    pub plan: Option<Box<models::BillingSnapshotPlan>>,
    #[serde(rename = "period", skip_serializing_if = "Option::is_none")]
    pub period: Option<Box<models::BillingSnapshotPeriod>>,
    #[serde(rename = "balance", skip_serializing_if = "Option::is_none")]
    pub balance: Option<Box<models::BillingSnapshotBalance>>,
    #[serde(rename = "caps", skip_serializing_if = "Option::is_none")]
    pub caps: Option<Box<models::BillingSnapshotCaps>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Box<models::BillingSnapshotStatus>>,
    #[serde(rename = "legacy", skip_serializing_if = "Option::is_none")]
    pub legacy: Option<Box<models::BillingSnapshotLegacy>>,
}

impl BillingSnapshot {
    /// Account billing state — plan, cycle, balance, spend caps, and payment / access status. Returned by `GET /v1/billing`.
    pub fn new() -> BillingSnapshot {
        BillingSnapshot {
            billing_system: None,
            plan: None,
            period: None,
            balance: None,
            caps: None,
            status: None,
            legacy: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BillingSystem {
    #[serde(rename = "metronome")]
    Metronome,
    #[serde(rename = "stripe")]
    Stripe,
}

impl Default for BillingSystem {
    fn default() -> BillingSystem {
        Self::Metronome
    }
}
