fireblocks_sdk/models/
destination_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/// DestinationConfigV2 : Destination configuration for policy rules
15#[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    /// Whether to match from account or source
26    #[serde(rename = "matchFrom", skip_serializing_if = "Option::is_none")]
27    pub match_from: Option<MatchFrom>,
28    /// Type of destination addresses allowed
29    #[serde(rename = "addressType")]
30    pub address_type: AddressType,
31}
32
33impl DestinationConfigV2 {
34    /// Destination configuration for policy rules
35    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/// Whether to match from account or source
51#[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/// Type of destination addresses allowed
65#[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}