fireblocks_sdk/models/policy_rule_authorization_groups.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/// PolicyRuleAuthorizationGroups : Defines the transaction approval terms
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PolicyRuleAuthorizationGroups {
17 /// * AND - requires approval of all authorization groups * OR - requires
18 /// approval of at least one of the authorization groups
19 #[serde(rename = "logic", skip_serializing_if = "Option::is_none")]
20 pub logic: Option<Logic>,
21 /// Defines whether the user who initiates a transaction can approve their
22 /// own transaction and count toward the approval threshold for their
23 /// transaction
24 #[serde(
25 rename = "allowOperatorAsAuthorizer",
26 skip_serializing_if = "Option::is_none"
27 )]
28 pub allow_operator_as_authorizer: Option<bool>,
29 /// Groups of entities which can approve the transaction
30 #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
31 pub groups: Option<Vec<models::PolicyRuleAuthorizationGroupsGroupsInner>>,
32}
33
34impl PolicyRuleAuthorizationGroups {
35 /// Defines the transaction approval terms
36 pub fn new() -> PolicyRuleAuthorizationGroups {
37 PolicyRuleAuthorizationGroups {
38 logic: None,
39 allow_operator_as_authorizer: None,
40 groups: None,
41 }
42 }
43}
44/// * AND - requires approval of all authorization groups * OR - requires
45/// approval of at least one of the authorization groups
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum Logic {
48 #[serde(rename = "AND")]
49 And,
50 #[serde(rename = "OR")]
51 Or,
52}
53
54impl Default for Logic {
55 fn default() -> Logic {
56 Self::And
57 }
58}