dhan_rs/types/
traders_control.rs1#![allow(missing_docs)]
2use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Deserialize)]
12#[serde(rename_all = "camelCase")]
13pub struct KillSwitchResponse {
14 pub dhan_client_id: Option<String>,
15 pub kill_switch_status: String,
16}
17
18#[derive(Debug, Clone, Serialize)]
26#[serde(rename_all = "camelCase")]
27pub struct PnlExitRequest {
28 pub profit_value: String,
30 pub loss_value: String,
32 pub product_type: Vec<String>,
34 pub enable_kill_switch: bool,
36}
37
38#[derive(Debug, Clone, Deserialize)]
40#[serde(rename_all = "camelCase")]
41pub struct PnlExitResponse {
42 pub pnl_exit_status: String,
43 pub message: String,
44}
45
46#[derive(Debug, Clone, Deserialize)]
48#[serde(rename_all = "camelCase")]
49pub struct PnlExitConfig {
50 pub pnl_exit_status: Option<String>,
51 #[serde(default)]
52 pub profit: Option<String>,
53 #[serde(default)]
54 pub loss: Option<String>,
55 #[serde(default, alias = "segments")]
57 pub product_type: Option<Vec<String>>,
58 #[serde(default)]
59 pub enable_kill_switch: Option<bool>,
60}