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 = "pending")]
13    PENDING,
14    #[serde(rename = "syncing")]
15    SYNCING,
16    #[serde(rename = "synced")]
17    SYNCED,
18    #[serde(rename = "failed")]
19    FAILED,
20}
21
22impl SyncState {
23    /// Convert to string representation.
24    pub fn as_str(&self) -> &'static str {
25        match self {
26            SyncState::PENDING => "pending",
27            SyncState::SYNCING => "syncing",
28            SyncState::SYNCED => "synced",
29            SyncState::FAILED => "failed",
30        }
31    }
32}