netbox_openapi/models/
patched_token_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedTokenRequest : 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 PatchedTokenRequest {
15    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
16    pub user: Option<Box<crate::models::BookmarkRequestUser>>,
17    #[serde(
18        rename = "expires",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub expires: Option<Option<String>>,
24    #[serde(
25        rename = "last_used",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub last_used: Option<Option<String>>,
31    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
32    pub key: Option<String>,
33    /// Permit create/update/delete operations using this key
34    #[serde(rename = "write_enabled", skip_serializing_if = "Option::is_none")]
35    pub write_enabled: Option<bool>,
36    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
37    pub description: Option<String>,
38}
39
40impl PatchedTokenRequest {
41    /// 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>)
42    pub fn new() -> PatchedTokenRequest {
43        PatchedTokenRequest {
44            user: None,
45            expires: None,
46            last_used: None,
47            key: None,
48            write_enabled: None,
49            description: None,
50        }
51    }
52}