fireblocks_sdk/models/
account_config_v2.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    crate::models,
11    serde::{Deserialize, Serialize},
12};
13
14/// AccountConfigV2 : Policy source/destination configuration
15#[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    /// Whether to match from account or source
26    #[serde(rename = "matchFrom", skip_serializing_if = "Option::is_none")]
27    pub match_from: Option<MatchFrom>,
28}
29
30impl AccountConfigV2 {
31    /// Policy source/destination configuration
32    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/// Whether to match from account or source
46#[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}