Skip to main content

comdirect_rest_api/
types.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize, Clone)]
4pub struct DepotsResponse {
5    pub values: Vec<Depot>,
6}
7
8#[derive(Debug, Serialize, Deserialize, Clone)]
9#[serde(rename_all = "camelCase")]
10pub struct Depot {
11    pub depot_id: Option<String>,
12    pub depot_display_id: Option<String>,
13    pub client_id: Option<String>,
14    pub depot_type: Option<String>,
15    pub default_settlement_account_id: Option<String>,
16    pub settlement_account_ids: Option<String>,
17    pub holder_name: Option<String>,
18}
19
20#[derive(Debug, Serialize, Deserialize, Clone)]
21pub struct DepotPositionsResponse {
22    pub values: Vec<Position>,
23}
24
25#[derive(Debug, Serialize, Deserialize, Clone)]
26#[serde(rename_all = "camelCase")]
27pub struct Position {
28    pub wkn: Option<String>,
29    pub quantity: Option<Amount>,
30    pub current_price: Option<CurrentPrice>,
31    pub purchase_value: Option<Amount>,
32}
33
34#[derive(Debug, Serialize, Deserialize, Clone)]
35#[serde(rename_all = "camelCase")]
36pub struct CurrentPrice {
37    pub price: Amount,
38}
39
40#[derive(Debug, Serialize, Deserialize, Clone)]
41pub struct Amount {
42    pub value: String,
43    pub unit: Option<String>,
44}
45
46#[derive(Debug, Serialize, Deserialize, Clone)]
47pub struct InstrumentResponse {
48    pub values: Vec<Instrument>,
49}
50
51#[derive(Debug, Serialize, Deserialize, Clone)]
52pub struct Instrument {
53    pub isin: Option<String>,
54    pub name: Option<String>,
55}
56
57#[derive(Debug, Serialize, Deserialize, Clone)]
58pub struct OutputItem {
59    pub name: String,
60    pub wkn: String,
61    pub isin: String,
62    pub amount: String,
63    pub purchase_value: String,
64    pub current_price: String,
65}