Skip to main content

netbox_openapi/models/
patched_bulk_owner_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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedBulkOwnerRequest : 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 PatchedBulkOwnerRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(
20        rename = "group",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub group: Option<Option<Box<crate::models::BulkOwnerRequestGroup>>>,
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    #[serde(rename = "user_groups", skip_serializing_if = "Option::is_none")]
29    pub user_groups: Option<Vec<i32>>,
30    #[serde(rename = "users", skip_serializing_if = "Option::is_none")]
31    pub users: Option<Vec<i32>>,
32}
33
34impl PatchedBulkOwnerRequest {
35    /// 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>)
36    pub fn new(id: i32) -> PatchedBulkOwnerRequest {
37        PatchedBulkOwnerRequest {
38            id,
39            name: None,
40            group: None,
41            description: None,
42            user_groups: None,
43            users: None,
44        }
45    }
46}