Skip to main content

comdirect_rest_api/
types.rs

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