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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Box Platform API
 *
 * [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.
 *
 * The version of the OpenAPI document: 2.0.0
 * Contact: devrel@box.com
 * Generated by: https://openapi-generator.tech
 */

use super::file_scope_object::FileScopeObject;

/// FileScope : A relation between a file and the scopes for which the file can be accessed

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct FileScope {
    /// The file scopes for the file access
    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
    pub scope: Option<Scope>,
    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
    pub object: Option<Box<FileScopeObject>>,
}

impl FileScope {
    /// A relation between a file and the scopes for which the file can be accessed
    pub fn new() -> FileScope {
        FileScope {
            scope: None,
            object: None,
        }
    }
}

/// The file scopes for the file access
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Scope {
    #[serde(rename = "annotation_edit")]
    AnnotationEdit,
    #[serde(rename = "annotation_view_all")]
    AnnotationViewAll,
    #[serde(rename = "annotation_view_self")]
    AnnotationViewSelf,
    #[serde(rename = "base_explorer")]
    BaseExplorer,
    #[serde(rename = "base_picker")]
    BasePicker,
    #[serde(rename = "base_preview")]
    BasePreview,
    #[serde(rename = "base_upload")]
    BaseUpload,
    #[serde(rename = "item_delete")]
    ItemDelete,
    #[serde(rename = "item_download")]
    ItemDownload,
    #[serde(rename = "item_preview")]
    ItemPreview,
    #[serde(rename = "item_rename")]
    ItemRename,
    #[serde(rename = "item_share")]
    ItemShare,
}

impl Default for Scope {
    fn default() -> Scope {
        Self::AnnotationEdit
    }
}