use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Subscription {
#[serde(rename = "billing_interval", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub billing_interval: Option<Option<String>>,
#[serde(rename = "cancel_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub cancel_at: Option<Option<String>>,
#[serde(rename = "current_period_end", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub current_period_end: Option<Option<String>>,
#[serde(rename = "current_period_start", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub current_period_start: Option<Option<String>>,
#[serde(rename = "events")]
pub events: models::EventsUsage,
#[serde(rename = "has_payment_method")]
pub has_payment_method: bool,
#[serde(rename = "is_active")]
pub is_active: bool,
#[serde(rename = "plan")]
pub plan: models::Plan,
#[serde(rename = "status")]
pub status: String,
#[serde(rename = "trial")]
pub trial: models::Trial,
}
impl Subscription {
pub fn new(events: models::EventsUsage, has_payment_method: bool, is_active: bool, plan: models::Plan, status: String, trial: models::Trial) -> Subscription {
Subscription {
billing_interval: None,
cancel_at: None,
current_period_end: None,
current_period_start: None,
events,
has_payment_method,
is_active,
plan,
status,
trial,
}
}
}