use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(test, derive(Default))]
pub struct BillingPlanAddonDetails {
#[serde(rename = "supported")]
pub supported: bool,
#[serde(rename = "planIncluded")]
pub plan_included: i64,
#[serde(rename = "limit")]
pub limit: i64,
#[serde(rename = "type")]
pub r#type: String,
#[serde(rename = "currency")]
pub currency: String,
#[serde(rename = "price")]
pub price: f64,
#[serde(rename = "value")]
pub value: i64,
#[serde(rename = "invoiceDesc")]
pub invoice_desc: String,
}
impl BillingPlanAddonDetails {
pub fn supported(&self) -> &bool {
&self.supported
}
pub fn plan_included(&self) -> &i64 {
&self.plan_included
}
pub fn limit(&self) -> &i64 {
&self.limit
}
pub fn r#type(&self) -> &String {
&self.r#type
}
pub fn currency(&self) -> &String {
&self.currency
}
pub fn price(&self) -> &f64 {
&self.price
}
pub fn value(&self) -> &i64 {
&self.value
}
pub fn invoice_desc(&self) -> &String {
&self.invoice_desc
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_billing_plan_addon_details_creation() {
let _model = <BillingPlanAddonDetails as Default>::default();
let _ = _model.supported();
let _ = _model.plan_included();
let _ = _model.limit();
let _ = _model.r#type();
let _ = _model.currency();
let _ = _model.price();
let _ = _model.value();
let _ = _model.invoice_desc();
}
#[test]
fn test_billing_plan_addon_details_serialization() {
let model = <BillingPlanAddonDetails as Default>::default();
let json = serde_json::to_string(&model);
assert!(json.is_ok());
let deserialized: Result<BillingPlanAddonDetails, _> = serde_json::from_str(&json.unwrap());
assert!(deserialized.is_ok());
}
}