1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use serde_derive::{Deserialize, Serialize};

use crate::types::{asset::AccountAsset, deserialize_str_i32, Paging};

#[derive(Debug, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)]
pub struct VaultAccounts {
  pub accounts: Vec<Account>,
  pub paging: Paging,
  pub previous_url: Option<String>,
  pub next_url: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)]
pub struct Account {
  #[serde(deserialize_with = "deserialize_str_i32")]
  pub id: i32,
  pub name: String,
  #[serde(rename = "hiddenOnUI")]
  pub hidden_on_ui: bool,
  pub assets: Vec<AccountAsset>,
  pub customer_ref_id: Option<String>,
  pub auto_fuel: bool,
}

#[derive(Debug, Serialize, Clone)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)]
pub struct CreateAccount {
  pub name: String,
  #[serde(rename = "hiddenOnUI")]
  pub hidden_on_ui: bool,
  pub customer_ref_id: Option<String>,
  pub auto_fuel: bool,
}

#[derive(Debug, Default, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
#[allow(dead_code)]
pub struct VaultRenameResponse {
  pub name: String,
  #[serde(deserialize_with = "deserialize_str_i32")]
  pub id: i32,
}