use std::borrow::Cow;
use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct SetPositionModeRequest<'a> {
#[serde(rename = "posMode")]
pos_mode: Cow<'a, str>,
}
impl<'a> SetPositionModeRequest<'a> {
pub fn new(pos_mode: impl Into<Cow<'a, str>>) -> Self {
Self {
pos_mode: pos_mode.into(),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SetGreeksRequest<'a> {
#[serde(rename = "greeksType")]
greeks_type: Cow<'a, str>,
}
impl<'a> SetGreeksRequest<'a> {
pub fn new(greeks_type: impl Into<Cow<'a, str>>) -> Self {
Self {
greeks_type: greeks_type.into(),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SetIsolatedModeRequest<'a> {
#[serde(rename = "isoMode")]
iso_mode: Cow<'a, str>,
#[serde(rename = "type")]
mode_type: Cow<'a, str>,
}
impl<'a> SetIsolatedModeRequest<'a> {
pub fn new(iso_mode: impl Into<Cow<'a, str>>, mode_type: impl Into<Cow<'a, str>>) -> Self {
Self {
iso_mode: iso_mode.into(),
mode_type: mode_type.into(),
}
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SetAutoLoanRequest {
#[serde(rename = "autoLoan")]
auto_loan: bool,
}
impl SetAutoLoanRequest {
pub fn new(auto_loan: bool) -> Self {
Self { auto_loan }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SetAccountLevelRequest<'a> {
#[serde(rename = "acctLv")]
acct_lv: Cow<'a, str>,
}
impl<'a> SetAccountLevelRequest<'a> {
pub fn new(acct_lv: impl Into<Cow<'a, str>>) -> Self {
Self {
acct_lv: acct_lv.into(),
}
}
}