azisaba_graph/models/
api_key_scope.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum ApiKeyScope {
18 #[serde(rename = "*")]
19 Star,
20 #[serde(rename = "api-keys:read")]
21 ApiKeysColonRead,
22 #[serde(rename = "api-keys:write")]
23 ApiKeysColonWrite,
24 #[serde(rename = "crawls:read")]
25 CrawlsColonRead,
26 #[serde(rename = "crawls:write")]
27 CrawlsColonWrite,
28 #[serde(rename = "emojis:read")]
29 EmojisColonRead,
30 #[serde(rename = "emojis:write")]
31 EmojisColonWrite,
32 #[serde(rename = "patch-notes:read")]
33 PatchNotesColonRead,
34 #[serde(rename = "patch-notes:write")]
35 PatchNotesColonWrite,
36 #[serde(rename = "players:read")]
37 PlayersColonRead,
38 #[serde(rename = "players:read-details")]
39 PlayersColonReadDetails,
40 #[serde(rename = "players:write")]
41 PlayersColonWrite,
42 #[serde(rename = "punishments:read")]
43 PunishmentsColonRead,
44 #[serde(rename = "punishments:write")]
45 PunishmentsColonWrite,
46 #[serde(rename = "stream:read")]
47 StreamColonRead,
48
49}
50
51impl std::fmt::Display for ApiKeyScope {
52 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
53 match self {
54 Self::Star => write!(f, "*"),
55 Self::ApiKeysColonRead => write!(f, "api-keys:read"),
56 Self::ApiKeysColonWrite => write!(f, "api-keys:write"),
57 Self::CrawlsColonRead => write!(f, "crawls:read"),
58 Self::CrawlsColonWrite => write!(f, "crawls:write"),
59 Self::EmojisColonRead => write!(f, "emojis:read"),
60 Self::EmojisColonWrite => write!(f, "emojis:write"),
61 Self::PatchNotesColonRead => write!(f, "patch-notes:read"),
62 Self::PatchNotesColonWrite => write!(f, "patch-notes:write"),
63 Self::PlayersColonRead => write!(f, "players:read"),
64 Self::PlayersColonReadDetails => write!(f, "players:read-details"),
65 Self::PlayersColonWrite => write!(f, "players:write"),
66 Self::PunishmentsColonRead => write!(f, "punishments:read"),
67 Self::PunishmentsColonWrite => write!(f, "punishments:write"),
68 Self::StreamColonRead => write!(f, "stream:read"),
69 }
70 }
71}
72
73impl Default for ApiKeyScope {
74 fn default() -> ApiKeyScope {
75 Self::Star
76 }
77}
78