Skip to main content

netbox_openapi/models/
patched_bulk_table_config_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/// PatchedBulkTableConfigRequest : 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 PatchedBulkTableConfigRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    #[serde(rename = "table", skip_serializing_if = "Option::is_none")]
20    pub table: Option<String>,
21    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
22    pub name: Option<String>,
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    #[serde(
26        rename = "user",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub user: Option<Option<i32>>,
32    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
33    pub weight: Option<i32>,
34    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
35    pub enabled: Option<bool>,
36    #[serde(rename = "shared", skip_serializing_if = "Option::is_none")]
37    pub shared: Option<bool>,
38    #[serde(rename = "columns", skip_serializing_if = "Option::is_none")]
39    pub columns: Option<Vec<String>>,
40    #[serde(
41        rename = "ordering",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub ordering: Option<Option<Vec<String>>>,
47}
48
49impl PatchedBulkTableConfigRequest {
50    /// 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>)
51    pub fn new(id: i32) -> PatchedBulkTableConfigRequest {
52        PatchedBulkTableConfigRequest {
53            id,
54            object_type: None,
55            table: None,
56            name: None,
57            description: None,
58            user: None,
59            weight: None,
60            enabled: None,
61            shared: None,
62            columns: None,
63            ordering: None,
64        }
65    }
66}