enbbox 1.0.1

Notification infrastructure API — open-source alternative to Novu/Courier
Documentation
/*
 * enbbox API
 *
 * Notification infrastructure API — open-source alternative to Novu/Courier
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// PlanLimits : Plan limits + current usage for the project.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PlanLimits {
    /// Events consumed this period.
    #[serde(rename = "current_events")]
    pub current_events: i64,
    /// Current team member count.
    #[serde(rename = "current_members")]
    pub current_members: i64,
    /// Current workflow count.
    #[serde(rename = "current_workflows")]
    pub current_workflows: i64,
    /// Max events/month (null = unlimited).
    #[serde(rename = "max_events", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub max_events: Option<Option<u64>>,
    /// Max team members (null = unlimited).
    #[serde(rename = "max_team_members", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub max_team_members: Option<Option<u32>>,
    /// Max workflows (null = unlimited).
    #[serde(rename = "max_workflows", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub max_workflows: Option<Option<u32>>,
    /// Current plan tier.
    #[serde(rename = "plan")]
    pub plan: models::Plan,
}

impl PlanLimits {
    /// Plan limits + current usage for the project.
    pub fn new(current_events: i64, current_members: i64, current_workflows: i64, plan: models::Plan) -> PlanLimits {
        PlanLimits {
            current_events,
            current_members,
            current_workflows,
            max_events: None,
            max_team_members: None,
            max_workflows: None,
            plan,
        }
    }
}