use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MarketplacePurchase {
#[serde(rename = "account")]
pub account: Box<models::WebhooksMarketplacePurchaseAccount>,
#[serde(rename = "billing_cycle")]
pub billing_cycle: String,
#[serde(rename = "free_trial_ends_on", deserialize_with = "Option::deserialize")]
pub free_trial_ends_on: Option<String>,
#[serde(rename = "next_billing_date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub next_billing_date: Option<Option<String>>,
#[serde(rename = "on_free_trial", deserialize_with = "Option::deserialize")]
pub on_free_trial: Option<bool>,
#[serde(rename = "plan")]
pub plan: Box<models::WebhooksPreviousMarketplacePurchasePlan>,
#[serde(rename = "unit_count")]
pub unit_count: i32,
}
impl MarketplacePurchase {
pub fn new(account: models::WebhooksMarketplacePurchaseAccount, billing_cycle: String, free_trial_ends_on: Option<String>, on_free_trial: Option<bool>, plan: models::WebhooksPreviousMarketplacePurchasePlan, unit_count: i32) -> MarketplacePurchase {
MarketplacePurchase {
account: Box::new(account),
billing_cycle,
free_trial_ends_on,
next_billing_date: None,
on_free_trial,
plan: Box::new(plan),
unit_count,
}
}
}