pinterest_api/parameter/
privacy.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Serialize, Deserialize, Debug, Clone)]
4#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
5pub enum Privacy {
6    All,
7    Protected,
8    Public,
9    PublicAndSecret,
10    Secret,
11}
12
13impl std::fmt::Display for Privacy {
14    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
15        match self {
16            Self::All => write!(f, "ALL"),
17            Self::Protected => write!(f, "PROTECTED"),
18            Self::Public => write!(f, "PUBLIC"),
19            Self::PublicAndSecret => write!(f, "PUBLIC_AND_SECRET"),
20            Self::Secret => write!(f, "SECRET"),
21        }
22    }
23}
24
25impl Default for Privacy {
26    fn default() -> Self {
27        Self::All
28    }
29}