fireblocks_sdk/models/
error_codes.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///
15#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
16pub enum ErrorCodes {
17    #[serde(rename = "INVALID_TOKEN")]
18    InvalidToken,
19    #[serde(rename = "MISSING_PARAMETER")]
20    MissingParameter,
21    #[serde(rename = "INVALID_PARAMETER")]
22    InvalidParameter,
23    #[serde(rename = "RESOURCE_NOT_FOUND")]
24    ResourceNotFound,
25    #[serde(rename = "INVALID_TIME_RANGE")]
26    InvalidTimeRange,
27    #[serde(rename = "UNAUTHORIZED")]
28    Unauthorized,
29    #[serde(rename = "ACCOUNT_NOT_ACTIVE")]
30    AccountNotActive,
31    #[serde(rename = "UNMANAGED_WALLET_NOT_APPROVED")]
32    UnmanagedWalletNotApproved,
33}
34
35impl std::fmt::Display for ErrorCodes {
36    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37        match self {
38            Self::InvalidToken => write!(f, "INVALID_TOKEN"),
39            Self::MissingParameter => write!(f, "MISSING_PARAMETER"),
40            Self::InvalidParameter => write!(f, "INVALID_PARAMETER"),
41            Self::ResourceNotFound => write!(f, "RESOURCE_NOT_FOUND"),
42            Self::InvalidTimeRange => write!(f, "INVALID_TIME_RANGE"),
43            Self::Unauthorized => write!(f, "UNAUTHORIZED"),
44            Self::AccountNotActive => write!(f, "ACCOUNT_NOT_ACTIVE"),
45            Self::UnmanagedWalletNotApproved => write!(f, "UNMANAGED_WALLET_NOT_APPROVED"),
46        }
47    }
48}
49
50impl Default for ErrorCodes {
51    fn default() -> ErrorCodes {
52        Self::InvalidToken
53    }
54}