fireblocks_sdk/models/policy_rule_error.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/// PolicyRuleError : Rule validation result error
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PolicyRuleError {
17 /// Error message
18 #[serde(rename = "errorMessage")]
19 pub error_message: String,
20 /// error code
21 #[serde(rename = "errorCode")]
22 pub error_code: f64,
23 /// error code name
24 #[serde(rename = "errorCodeName")]
25 pub error_code_name: String,
26 /// The field which the error relates to * operator - transaction initiator
27 /// * operators - transaction initiators * authorizationGroups - transaction
28 /// authorizer groups * designatedSigner - transaction signer *
29 /// designatedSigners - transaction signers * contractMethods - contract
30 /// methods * amountAggregation - transaction amount aggregation
31 /// configuration * src - transaction source asset configuration * dst -
32 /// transaction destination asset configuration
33 #[serde(rename = "errorField")]
34 pub error_field: ErrorField,
35}
36
37impl PolicyRuleError {
38 /// Rule validation result error
39 pub fn new(
40 error_message: String,
41 error_code: f64,
42 error_code_name: String,
43 error_field: ErrorField,
44 ) -> PolicyRuleError {
45 PolicyRuleError {
46 error_message,
47 error_code,
48 error_code_name,
49 error_field,
50 }
51 }
52}
53/// The field which the error relates to * operator - transaction initiator *
54/// operators - transaction initiators * authorizationGroups - transaction
55/// authorizer groups * designatedSigner - transaction signer *
56/// designatedSigners - transaction signers * contractMethods - contract methods
57/// * amountAggregation - transaction amount aggregation configuration * src -
58/// transaction source asset configuration * dst - transaction destination asset
59/// configuration
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum ErrorField {
62 #[serde(rename = "operator")]
63 Operator,
64 #[serde(rename = "operators")]
65 Operators,
66 #[serde(rename = "authorizationGroups")]
67 AuthorizationGroups,
68 #[serde(rename = "designatedSigner")]
69 DesignatedSigner,
70 #[serde(rename = "designatedSigners")]
71 DesignatedSigners,
72 #[serde(rename = "contractMethods")]
73 ContractMethods,
74 #[serde(rename = "amountAggregation")]
75 AmountAggregation,
76 #[serde(rename = "src")]
77 Src,
78 #[serde(rename = "dst")]
79 Dst,
80}
81
82impl Default for ErrorField {
83 fn default() -> ErrorField {
84 Self::Operator
85 }
86}