pinterest_api/parameter/
privacy.rs

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
28
29
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Privacy {
    All,
    Protected,
    Public,
    PublicAndSecret,
    Secret,
}

impl std::fmt::Display for Privacy {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::All => write!(f, "ALL"),
            Self::Protected => write!(f, "PROTECTED"),
            Self::Public => write!(f, "PUBLIC"),
            Self::PublicAndSecret => write!(f, "PUBLIC_AND_SECRET"),
            Self::Secret => write!(f, "SECRET"),
        }
    }
}

impl Default for Privacy {
    fn default() -> Self {
        Self::All
    }
}