fireblocks_sdk/models/
account_config_v2.rs1use {
10 crate::models,
11 serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AccountConfigV2 {
17 #[serde(rename = "type")]
18 pub r#type: models::AccountTypeV2,
19 #[serde(rename = "subType", skip_serializing_if = "Option::is_none")]
20 pub sub_type: Option<Vec<models::AccountIdentifierV2>>,
21 #[serde(rename = "ids", skip_serializing_if = "Option::is_none")]
22 pub ids: Option<Vec<models::AccountIdentifierV2>>,
23 #[serde(rename = "operator")]
24 pub operator: models::PolicyOperatorV2,
25 #[serde(rename = "matchFrom", skip_serializing_if = "Option::is_none")]
27 pub match_from: Option<MatchFrom>,
28}
29
30impl AccountConfigV2 {
31 pub fn new(
33 r#type: models::AccountTypeV2,
34 operator: models::PolicyOperatorV2,
35 ) -> AccountConfigV2 {
36 AccountConfigV2 {
37 r#type,
38 sub_type: None,
39 ids: None,
40 operator,
41 match_from: None,
42 }
43 }
44}
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum MatchFrom {
48 #[serde(rename = "ACCOUNT")]
49 Account,
50 #[serde(rename = "SOURCE")]
51 Source,
52}
53
54impl Default for MatchFrom {
55 fn default() -> MatchFrom {
56 Self::Account
57 }
58}