/*
 * 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.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UsageStats {
    #[serde(rename = "planName", skip_serializing_if = "Option::is_none")]
    pub plan_name: Option<String>,
    #[serde(rename = "billingPeriod", skip_serializing_if = "Option::is_none")]
    pub billing_period: Option<BillingPeriod>,
    #[serde(rename = "signupDate", skip_serializing_if = "Option::is_none")]
    pub signup_date: Option<String>,
    /// Day of month (1-31) when the billing cycle resets
    #[serde(rename = "billingAnchorDay", skip_serializing_if = "Option::is_none")]
    pub billing_anchor_day: Option<i32>,
    #[serde(rename = "limits", skip_serializing_if = "Option::is_none")]
    pub limits: Option<Box<models::UsageStatsLimits>>,
    #[serde(rename = "usage", skip_serializing_if = "Option::is_none")]
    pub usage: Option<Box<models::UsageStatsUsage>>,
}

impl UsageStats {
    pub fn new() -> UsageStats {
        UsageStats {
            plan_name: None,
            billing_period: None,
            signup_date: None,
            billing_anchor_day: None,
            limits: None,
            usage: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum BillingPeriod {
    #[serde(rename = "monthly")]
    Monthly,
    #[serde(rename = "yearly")]
    Yearly,
}

impl Default for BillingPeriod {
    fn default() -> BillingPeriod {
        Self::Monthly
    }
}
