use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
pub struct CancelSubscriptionRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub effective_date: Option<chrono::NaiveDate>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl CancelSubscriptionRequest {
#[must_use]
pub fn new() -> Self {
Self {
effective_date: None,
reason: None,
extra: serde_json::Map::new(),
}
}
#[must_use]
pub fn effective_date(mut self, effective_date: impl Into<chrono::NaiveDate>) -> Self {
self.effective_date = Some(effective_date.into());
self
}
#[must_use]
pub fn reason(mut self, reason: impl Into<String>) -> Self {
self.reason = Some(reason.into());
self
}
}