rusty_box/rest_api/users/models/
post_users_request.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::{tracking_code::TrackingCode, Role, Status};
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PostUsersRequest {
15    /// The name of the user
16    #[serde(rename = "name")]
17    pub name: String,
18    /// The email address the user uses to log in  Required, unless `is_platform_access_only` is set to `true`.
19    #[serde(rename = "login", skip_serializing_if = "Option::is_none")]
20    pub login: Option<String>,
21    /// Specifies that the user is an app user.
22    #[serde(
23        rename = "is_platform_access_only",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub is_platform_access_only: Option<bool>,
27    /// The user’s enterprise role
28    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
29    pub role: Option<Role>,
30    /// The language of the user, formatted in modified version of the [ISO 639-1](/guides/api-calls/language-codes) format.
31    #[serde(rename = "language", skip_serializing_if = "Option::is_none")]
32    pub language: Option<String>,
33    /// Whether the user can use Box Sync
34    #[serde(rename = "is_sync_enabled", skip_serializing_if = "Option::is_none")]
35    pub is_sync_enabled: Option<bool>,
36    /// The user’s job title
37    #[serde(rename = "job_title", skip_serializing_if = "Option::is_none")]
38    pub job_title: Option<String>,
39    /// The user’s phone number
40    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
41    pub phone: Option<String>,
42    /// The user’s address
43    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
44    pub address: Option<String>,
45    /// The user’s total available space in bytes. Set this to `-1` to indicate unlimited storage.
46    #[serde(rename = "space_amount", skip_serializing_if = "Option::is_none")]
47    pub space_amount: Option<i64>,
48    /// 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.
49    #[serde(rename = "tracking_codes", skip_serializing_if = "Option::is_none")]
50    pub tracking_codes: Option<Vec<TrackingCode>>,
51    /// Whether the user can see other enterprise users in their contact list
52    #[serde(
53        rename = "can_see_managed_users",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub can_see_managed_users: Option<bool>,
57    /// The user's timezone
58    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
59    pub timezone: Option<String>,
60    /// Whether the user is allowed to collaborate with users outside their enterprise
61    #[serde(
62        rename = "is_external_collab_restricted",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub is_external_collab_restricted: Option<bool>,
66    /// Whether to exempt the user from enterprise device limits
67    #[serde(
68        rename = "is_exempt_from_device_limits",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub is_exempt_from_device_limits: Option<bool>,
72    /// Whether the user must use two-factor authentication
73    #[serde(
74        rename = "is_exempt_from_login_verification",
75        skip_serializing_if = "Option::is_none"
76    )]
77    pub is_exempt_from_login_verification: Option<bool>,
78    /// The user's account status
79    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
80    pub status: Option<Status>,
81    /// 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.
82    #[serde(
83        rename = "external_app_user_id",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub external_app_user_id: Option<String>,
87}
88
89impl PostUsersRequest {
90    pub fn new(name: String) -> PostUsersRequest {
91        PostUsersRequest {
92            name,
93            login: None,
94            is_platform_access_only: None,
95            role: None,
96            language: None,
97            is_sync_enabled: None,
98            job_title: None,
99            phone: None,
100            address: None,
101            space_amount: None,
102            tracking_codes: None,
103            can_see_managed_users: None,
104            timezone: None,
105            is_external_collab_restricted: None,
106            is_exempt_from_device_limits: None,
107            is_exempt_from_login_verification: None,
108            status: None,
109            external_app_user_id: None,
110        }
111    }
112}