nomy-data-models 0.35.9

Data model definitions for Nomy wallet analysis data processing
Documentation
#![allow(clippy::too_many_arguments, unused_imports, non_camel_case_types)]
//! SyncState enum definition.
//!
//! This file is generated automatically from the Python enum.
//! Do not edit this file manually.

use serde::{Deserialize, Serialize};

/// Enum for synchronization states.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SyncState {
    #[serde(rename = "synced")]
    SYNCED,
    #[serde(rename = "synced_missing_open")]
    SYNCED_MISSING_OPEN,
    #[serde(rename = "synced_missing_close")]
    SYNCED_MISSING_CLOSE,
    #[serde(rename = "synced_missing_open_close")]
    SYNCED_MISSING_OPEN_CLOSE,
    #[serde(rename = "syncing")]
    SYNCING,
    #[serde(rename = "pending")]
    PENDING,
    #[serde(rename = "failed")]
    FAILED,
}

impl SyncState {
    /// Convert to string representation.
    pub fn as_str(&self) -> &'static str {
        match self {
            SyncState::SYNCED => "synced",
            SyncState::SYNCED_MISSING_OPEN => "synced_missing_open",
            SyncState::SYNCED_MISSING_CLOSE => "synced_missing_close",
            SyncState::SYNCED_MISSING_OPEN_CLOSE => "synced_missing_open_close",
            SyncState::SYNCING => "syncing",
            SyncState::PENDING => "pending",
            SyncState::FAILED => "failed",
        }
    }
}