backend/model/enum/
privacy_option.rs

1//! [`PrivacyOption`] enum.
2
3use diesel_derive_enum::DbEnum;
4use serde::{Deserialize, Serialize};
5use typeshare::typeshare;
6use utoipa::ToSchema;
7
8/// Enum for map privacy setting options.
9#[typeshare]
10#[derive(Serialize, Deserialize, DbEnum, Debug, ToSchema, Clone)]
11#[ExistingTypePath = "crate::schema::sql_types::PrivacyOption"]
12pub enum PrivacyOption {
13    /// Data is private and only visible for owner or members, the data was explicitly shared with.
14    #[serde(rename = "private")]
15    #[db_rename = "private"]
16    Private,
17
18    /// Data is protected and only visible for other members.
19    #[serde(rename = "protected")]
20    #[db_rename = "protected"]
21    Protected,
22
23    /// Data is public and visible for everyone.
24    #[serde(rename = "public")]
25    #[db_rename = "public"]
26    Public,
27}