aptos-client-icp 0.0.1

The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
Documentation
/*
 * Aptos Node API
 *
 * The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
 *
 * The version of the OpenAPI document: 1.2.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// AptosErrorCode : These codes provide more granular error information beyond just the HTTP status code of the response.
/// These codes provide more granular error information beyond just the HTTP status code of the response.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AptosErrorCode {
    #[serde(rename = "account_not_found")]
    AccountNotFound,
    #[serde(rename = "resource_not_found")]
    ResourceNotFound,
    #[serde(rename = "module_not_found")]
    ModuleNotFound,
    #[serde(rename = "struct_field_not_found")]
    StructFieldNotFound,
    #[serde(rename = "version_not_found")]
    VersionNotFound,
    #[serde(rename = "transaction_not_found")]
    TransactionNotFound,
    #[serde(rename = "table_item_not_found")]
    TableItemNotFound,
    #[serde(rename = "block_not_found")]
    BlockNotFound,
    #[serde(rename = "state_value_not_found")]
    StateValueNotFound,
    #[serde(rename = "version_pruned")]
    VersionPruned,
    #[serde(rename = "block_pruned")]
    BlockPruned,
    #[serde(rename = "invalid_input")]
    InvalidInput,
    #[serde(rename = "invalid_transaction_update")]
    InvalidTransactionUpdate,
    #[serde(rename = "sequence_number_too_old")]
    SequenceNumberTooOld,
    #[serde(rename = "vm_error")]
    VmError,
    #[serde(rename = "health_check_failed")]
    HealthCheckFailed,
    #[serde(rename = "mempool_is_full")]
    MempoolIsFull,
    #[serde(rename = "internal_error")]
    InternalError,
    #[serde(rename = "web_framework_error")]
    WebFrameworkError,
    #[serde(rename = "bcs_not_supported")]
    BcsNotSupported,
    #[serde(rename = "api_disabled")]
    ApiDisabled,

}

impl std::fmt::Display for AptosErrorCode {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::AccountNotFound => write!(f, "account_not_found"),
            Self::ResourceNotFound => write!(f, "resource_not_found"),
            Self::ModuleNotFound => write!(f, "module_not_found"),
            Self::StructFieldNotFound => write!(f, "struct_field_not_found"),
            Self::VersionNotFound => write!(f, "version_not_found"),
            Self::TransactionNotFound => write!(f, "transaction_not_found"),
            Self::TableItemNotFound => write!(f, "table_item_not_found"),
            Self::BlockNotFound => write!(f, "block_not_found"),
            Self::StateValueNotFound => write!(f, "state_value_not_found"),
            Self::VersionPruned => write!(f, "version_pruned"),
            Self::BlockPruned => write!(f, "block_pruned"),
            Self::InvalidInput => write!(f, "invalid_input"),
            Self::InvalidTransactionUpdate => write!(f, "invalid_transaction_update"),
            Self::SequenceNumberTooOld => write!(f, "sequence_number_too_old"),
            Self::VmError => write!(f, "vm_error"),
            Self::HealthCheckFailed => write!(f, "health_check_failed"),
            Self::MempoolIsFull => write!(f, "mempool_is_full"),
            Self::InternalError => write!(f, "internal_error"),
            Self::WebFrameworkError => write!(f, "web_framework_error"),
            Self::BcsNotSupported => write!(f, "bcs_not_supported"),
            Self::ApiDisabled => write!(f, "api_disabled"),
        }
    }
}

impl Default for AptosErrorCode {
    fn default() -> AptosErrorCode {
        Self::AccountNotFound
    }
}