rusty_box/rest_api/files/models/
file_scope.rs

1/*
2 * Box Platform API
3 *
4 * [Box Platform](https://box.dev) provides functionality to provide access to content stored within [Box](https://box.com). It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.
5 *
6 * The version of the OpenAPI document: 2.0.0
7 * Contact: devrel@box.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::file_scope_object::FileScopeObject;
12
13/// FileScope : A relation between a file and the scopes for which the file can be accessed
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct FileScope {
17    /// The file scopes for the file access
18    #[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    /// A relation between a file and the scopes for which the file can be accessed
26    pub fn new() -> FileScope {
27        FileScope {
28            scope: None,
29            object: None,
30        }
31    }
32}
33
34/// The file scopes for the file access
35#[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}