nomy_data_models/enums/
sync_state.rs

1#![allow(clippy::too_many_arguments, unused_imports, non_camel_case_types)]
2//! SyncState enum definition.
3//!
4//! This file is generated automatically from the Python enum.
5//! Do not edit this file manually.
6
7use serde::{Deserialize, Serialize};
8
9/// Enum for synchronization states.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
11pub enum SyncState {
12    #[serde(rename = "synced")]
13    SYNCED,
14    #[serde(rename = "synced_missing_open")]
15    SYNCED_MISSING_OPEN,
16    #[serde(rename = "synced_missing_close")]
17    SYNCED_MISSING_CLOSE,
18    #[serde(rename = "synced_missing_open_close")]
19    SYNCED_MISSING_OPEN_CLOSE,
20    #[serde(rename = "syncing")]
21    SYNCING,
22    #[serde(rename = "pending")]
23    PENDING,
24    #[serde(rename = "failed")]
25    FAILED,
26}
27
28impl SyncState {
29    /// Convert to string representation.
30    pub fn as_str(&self) -> &'static str {
31        match self {
32            SyncState::SYNCED => "synced",
33            SyncState::SYNCED_MISSING_OPEN => "synced_missing_open",
34            SyncState::SYNCED_MISSING_CLOSE => "synced_missing_close",
35            SyncState::SYNCED_MISSING_OPEN_CLOSE => "synced_missing_open_close",
36            SyncState::SYNCING => "syncing",
37            SyncState::PENDING => "pending",
38            SyncState::FAILED => "failed",
39        }
40    }
41}