rust_okx/api/finance/requests/
savings.rs1use serde::Serialize;
2
3#[derive(Debug, Clone, Serialize)]
5pub struct SavingsPurchaseRedemptionRequest {
6 ccy: String,
7 amt: String,
8 side: String,
9 #[serde(skip_serializing_if = "Option::is_none")]
10 rate: Option<String>,
11}
12
13impl SavingsPurchaseRedemptionRequest {
14 pub fn new(ccy: impl Into<String>, amt: impl Into<String>, side: impl Into<String>) -> Self {
18 Self {
19 ccy: ccy.into(),
20 amt: amt.into(),
21 side: side.into(),
22 rate: None,
23 }
24 }
25
26 pub fn rate(mut self, rate: impl Into<String>) -> Self {
30 self.rate = Some(rate.into());
31 self
32 }
33}