rusty_box/rest_api/users/models/
user_full.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::{
12    tracking_code::TrackingCode, user_full_all_of_enterprise::UserFullAllOfEnterprise, Role, Status,
13};
14
15/// UserFull : A full representation of a user, as can be returned from any user API endpoint.
16
17#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
18pub struct UserFull {
19    /// The unique identifier for this user
20    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
21    pub id: Option<String>,
22    /// `user`
23    #[serde(rename = "type")]
24    pub r#type: RHashType,
25    /// The display name of this user
26    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
27    pub name: Option<String>,
28    /// The primary email address of this user
29    #[serde(rename = "login", skip_serializing_if = "Option::is_none")]
30    pub login: Option<String>,
31    /// When the user object was created
32    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
33    pub created_at: Option<String>,
34    /// When the user object was last modified
35    #[serde(rename = "modified_at", skip_serializing_if = "Option::is_none")]
36    pub modified_at: Option<String>,
37    /// The language of the user, formatted in modified version of the [ISO 639-1](/guides/api-calls/language-codes) format.
38    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
39    pub language: Option<String>,
40    /// The user's timezone
41    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
42    pub timezone: Option<String>,
43    /// The user’s total available space amount in bytes
44    #[serde(rename = "space_amount", skip_serializing_if = "Option::is_none")]
45    pub space_amount: Option<i64>,
46    /// The amount of space in use by the user
47    #[serde(rename = "space_used", skip_serializing_if = "Option::is_none")]
48    pub space_used: Option<i64>,
49    /// The maximum individual file size in bytes the user can have
50    #[serde(rename = "max_upload_size", skip_serializing_if = "Option::is_none")]
51    pub max_upload_size: Option<i64>,
52    /// The user's account status
53    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
54    pub status: Option<Status>,
55    /// The user’s job title
56    #[serde(rename = "job_title", skip_serializing_if = "Option::is_none")]
57    pub job_title: Option<String>,
58    /// The user’s phone number
59    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
60    pub phone: Option<String>,
61    /// The user’s address
62    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
63    pub address: Option<String>,
64    /// URL of the user’s avatar image
65    #[serde(rename = "avatar_url", skip_serializing_if = "Option::is_none")]
66    pub avatar_url: Option<String>,
67    //
68    //TODO: Empty notification email is not working
69    // #[serde(
70    //     rename = "notification_email",
71    //     default,
72    //     with = "::serde_with::rust::double_option",
73    //     skip_serializing_if = "Option::is_none"
74    // )]
75    // pub notification_email: Option<Option<Box<UserAllOfNotificationEmail>>>,
76    //
77    //
78    /// The user’s enterprise role
79    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
80    pub role: Option<Role>,
81    /// Tracking codes allow an admin to generate reports from the admin console and assign an attribute to a specific group of users. This setting must be enabled for an enterprise before it can be used.
82    #[serde(rename = "tracking_codes", skip_serializing_if = "Option::is_none")]
83    pub tracking_codes: Option<Vec<TrackingCode>>,
84    /// Whether the user can see other enterprise users in their contact list
85    #[serde(
86        rename = "can_see_managed_users",
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub can_see_managed_users: Option<bool>,
90    /// Whether the user can use Box Sync
91    #[serde(rename = "is_sync_enabled", skip_serializing_if = "Option::is_none")]
92    pub is_sync_enabled: Option<bool>,
93    /// Whether the user is allowed to collaborate with users outside their enterprise
94    #[serde(
95        rename = "is_external_collab_restricted",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub is_external_collab_restricted: Option<bool>,
99    /// Whether to exempt the user from Enterprise device limits
100    #[serde(
101        rename = "is_exempt_from_device_limits",
102        skip_serializing_if = "Option::is_none"
103    )]
104    pub is_exempt_from_device_limits: Option<bool>,
105    /// Whether the user must use two-factor authentication
106    #[serde(
107        rename = "is_exempt_from_login_verification",
108        skip_serializing_if = "Option::is_none"
109    )]
110    pub is_exempt_from_login_verification: Option<bool>,
111    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
112    pub enterprise: Option<Box<UserFullAllOfEnterprise>>,
113    /// Tags for all files and folders owned by the user. Values returned will only contain tags that were set by the requester.
114    #[serde(rename = "my_tags", skip_serializing_if = "Option::is_none")]
115    pub my_tags: Option<Vec<String>>,
116    /// The root (protocol, subdomain, domain) of any links that need to be generated for the user
117    #[serde(rename = "hostname", skip_serializing_if = "Option::is_none")]
118    pub hostname: Option<String>,
119    /// Whether the user is an App User
120    #[serde(
121        rename = "is_platform_access_only",
122        skip_serializing_if = "Option::is_none"
123    )]
124    pub is_platform_access_only: Option<bool>,
125    /// An external identifier for an app user, which can be used to look up the user. This can be used to tie user IDs from external identity providers to Box users.
126    #[serde(
127        rename = "external_app_user_id",
128        skip_serializing_if = "Option::is_none"
129    )]
130    pub external_app_user_id: Option<String>,
131}
132
133impl UserFull {
134    /// A full representation of a user, as can be returned from any user API endpoint.
135    pub fn new(r#type: RHashType) -> UserFull {
136        UserFull {
137            id: None,
138            r#type,
139            name: None,
140            login: None,
141            created_at: None,
142            modified_at: None,
143            language: None,
144            timezone: None,
145            space_amount: None,
146            space_used: None,
147            max_upload_size: None,
148            status: None,
149            job_title: None,
150            phone: None,
151            address: None,
152            avatar_url: None,
153            //
154            //TODO: Empty notification email is not working
155            // notification_email: None,
156            //
157            role: None,
158            tracking_codes: None,
159            can_see_managed_users: None,
160            is_sync_enabled: None,
161            is_external_collab_restricted: None,
162            is_exempt_from_device_limits: None,
163            is_exempt_from_login_verification: None,
164            enterprise: None,
165            my_tags: None,
166            hostname: None,
167            is_platform_access_only: None,
168            external_app_user_id: None,
169        }
170    }
171}
172
173/// `user`
174#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
175pub enum RHashType {
176    #[serde(rename = "user")]
177    User,
178}
179
180impl Default for RHashType {
181    fn default() -> RHashType {
182        Self::User
183    }
184}