Skip to main content

nautobot_openapi/models/
patched_user_request.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedUserRequest : Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedUserRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(
18        rename = "password",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub password: Option<Option<String>>,
24    #[serde(
25        rename = "last_login",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub last_login: Option<Option<String>>,
31    /// Designates that this user has all permissions without explicitly assigning them.
32    #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")]
33    pub is_superuser: Option<bool>,
34    /// Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
35    #[serde(rename = "username", skip_serializing_if = "Option::is_none")]
36    pub username: Option<String>,
37    #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")]
38    pub first_name: Option<String>,
39    #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")]
40    pub last_name: Option<String>,
41    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
42    pub email: Option<String>,
43    /// Designates whether the user can log into this admin site.
44    #[serde(rename = "is_staff", skip_serializing_if = "Option::is_none")]
45    pub is_staff: Option<bool>,
46    /// Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
47    #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")]
48    pub is_active: Option<bool>,
49    #[serde(rename = "date_joined", skip_serializing_if = "Option::is_none")]
50    pub date_joined: Option<String>,
51    #[serde(
52        rename = "config_data",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub config_data: Option<Option<serde_json::Value>>,
58    /// The groups this user belongs to. A user will get all permissions granted to each of their groups.
59    #[serde(rename = "groups", skip_serializing_if = "Option::is_none")]
60    pub groups: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
61}
62
63impl PatchedUserRequest {
64    /// Extends the built-in ModelSerializer to enforce calling full_clean() on a copy of the associated instance during validation. (DRF does not do this by default; see <https://github.com/encode/django-rest-framework/issues/3144>)
65    pub fn new() -> PatchedUserRequest {
66        PatchedUserRequest {
67            id: None,
68            password: None,
69            last_login: None,
70            is_superuser: None,
71            username: None,
72            first_name: None,
73            last_name: None,
74            email: None,
75            is_staff: None,
76            is_active: None,
77            date_joined: None,
78            config_data: None,
79            groups: None,
80        }
81    }
82}