fireblocks_sdk/models/
destination_config_v2.rs1use {
10 crate::models,
11 serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DestinationConfigV2 {
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 #[serde(rename = "addressType")]
30 pub address_type: AddressType,
31}
32
33impl DestinationConfigV2 {
34 pub fn new(
36 r#type: models::AccountTypeV2,
37 operator: models::PolicyOperatorV2,
38 address_type: AddressType,
39 ) -> DestinationConfigV2 {
40 DestinationConfigV2 {
41 r#type,
42 sub_type: None,
43 ids: None,
44 operator,
45 match_from: None,
46 address_type,
47 }
48 }
49}
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum MatchFrom {
53 #[serde(rename = "ACCOUNT")]
54 Account,
55 #[serde(rename = "SOURCE")]
56 Source,
57}
58
59impl Default for MatchFrom {
60 fn default() -> MatchFrom {
61 Self::Account
62 }
63}
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum AddressType {
67 #[serde(rename = "ALL")]
68 All,
69 #[serde(rename = "*")]
70 Star,
71 #[serde(rename = "WHITELISTED")]
72 Whitelisted,
73 #[serde(rename = "ONE_TIME")]
74 OneTime,
75 #[serde(rename = "OEC_PARTNER")]
76 OecPartner,
77}
78
79impl Default for AddressType {
80 fn default() -> AddressType {
81 Self::All
82 }
83}