use serde::Serialize;
#[derive(Debug, Clone, Default, Serialize)]
pub struct CurrencyRequest<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub ccy: Option<&'a str>,
}
#[derive(Debug, Clone, Serialize)]
pub struct SetLendingRateRequest<'a> {
pub ccy: &'a str,
pub rate: &'a str,
}
#[derive(Debug, Clone, Serialize)]
pub struct AmountRequest<'a> {
pub amt: &'a str,
}
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CancelRedeemRequest<'a> {
pub ord_id: &'a str,
}
#[derive(Debug, Clone, Serialize)]
pub struct ApyHistoryRequest<'a> {
pub days: &'a str,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct FinanceHistoryRequest {
#[serde(skip_serializing_if = "Option::is_none")]
ccy: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
after: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
before: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
limit: Option<u32>,
}
impl FinanceHistoryRequest {
pub fn new() -> Self {
Self::default()
}
pub fn currency(mut self, ccy: impl Into<String>) -> Self {
self.ccy = Some(ccy.into());
self
}
pub fn after(mut self, after: impl Into<String>) -> Self {
self.after = Some(after.into());
self
}
pub fn before(mut self, before: impl Into<String>) -> Self {
self.before = Some(before.into());
self
}
pub fn limit(mut self, limit: u32) -> Self {
self.limit = Some(limit);
self
}
}