1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//! [`PrivacyOption`] enum.

use diesel_derive_enum::DbEnum;
use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use utoipa::ToSchema;

/// Enum for map privacy setting options.
#[typeshare]
#[derive(Serialize, Deserialize, DbEnum, Debug, ToSchema, Clone)]
#[ExistingTypePath = "crate::schema::sql_types::PrivacyOption"]
pub enum PrivacyOption {
    /// Data is private and only visible for owner or members, the data was explicitly shared with.
    #[serde(rename = "private")]
    #[db_rename = "private"]
    Private,

    /// Data is protected and only visible for other members.
    #[serde(rename = "protected")]
    #[db_rename = "protected"]
    Protected,

    /// Data is public and visible for everyone.
    #[serde(rename = "public")]
    #[db_rename = "public"]
    Public,
}