use serde::{Deserialize, Serialize};
use super::price_entry::PriceEntry;
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct SubscriptionAddOnPriceOverride {
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub price_entry: PriceEntry,
pub r#type: String,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl SubscriptionAddOnPriceOverride {
#[must_use]
pub fn new(price_entry: PriceEntry) -> Self {
Self {
name: None,
price_entry,
r#type: "PRICE_OVERRIDE".into(),
extra: serde_json::Map::new(),
}
}
#[must_use]
pub fn name(mut self, name: impl Into<String>) -> Self {
self.name = Some(name.into());
self
}
}