rusty_box/rest_api/files/models/
file_scope.rs1use super::file_scope_object::FileScopeObject;
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct FileScope {
17 #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
19 pub scope: Option<Scope>,
20 #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
21 pub object: Option<Box<FileScopeObject>>,
22}
23
24impl FileScope {
25 pub fn new() -> FileScope {
27 FileScope {
28 scope: None,
29 object: None,
30 }
31 }
32}
33
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Scope {
37 #[serde(rename = "annotation_edit")]
38 AnnotationEdit,
39 #[serde(rename = "annotation_view_all")]
40 AnnotationViewAll,
41 #[serde(rename = "annotation_view_self")]
42 AnnotationViewSelf,
43 #[serde(rename = "base_explorer")]
44 BaseExplorer,
45 #[serde(rename = "base_picker")]
46 BasePicker,
47 #[serde(rename = "base_preview")]
48 BasePreview,
49 #[serde(rename = "base_upload")]
50 BaseUpload,
51 #[serde(rename = "item_delete")]
52 ItemDelete,
53 #[serde(rename = "item_download")]
54 ItemDownload,
55 #[serde(rename = "item_preview")]
56 ItemPreview,
57 #[serde(rename = "item_rename")]
58 ItemRename,
59 #[serde(rename = "item_share")]
60 ItemShare,
61}
62
63impl Default for Scope {
64 fn default() -> Scope {
65 Self::AnnotationEdit
66 }
67}