use std::borrow::Cow;
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct SavingsPurchaseRedemptionRequest<'a> {
ccy: Cow<'a, str>,
amt: Cow<'a, str>,
side: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
rate: Option<Cow<'a, str>>,
}
impl<'a> SavingsPurchaseRedemptionRequest<'a> {
pub fn new(
ccy: impl Into<Cow<'a, str>>,
amt: impl Into<Cow<'a, str>>,
side: impl Into<Cow<'a, str>>,
) -> Self {
Self {
ccy: ccy.into(),
amt: amt.into(),
side: side.into(),
rate: None,
}
}
pub fn rate(mut self, rate: impl Into<Cow<'a, str>>) -> Self {
self.rate = Some(rate.into());
self
}
}