Skip to main content

netbox_openapi/models/
bulk_module_bay_template_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/// BulkModuleBayTemplateRequest : 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 BulkModuleBayTemplateRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(
18        rename = "device_type",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub device_type: Option<Option<Box<crate::models::BulkConsolePortTemplateRequestDeviceType>>>,
24    #[serde(
25        rename = "module_type",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub module_type: Option<Option<Box<crate::models::BulkConsolePortTemplateRequestModuleType>>>,
31    /// {module} is accepted as a substitution for the module bay position when attached to a module type.
32    #[serde(rename = "name")]
33    pub name: String,
34    /// Physical label
35    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
36    pub label: Option<String>,
37    /// Identifier to reference when renaming installed components
38    #[serde(rename = "position", skip_serializing_if = "Option::is_none")]
39    pub position: Option<String>,
40    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
41    pub enabled: Option<bool>,
42    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
43    pub description: Option<String>,
44}
45
46impl BulkModuleBayTemplateRequest {
47    /// 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>)
48    pub fn new(id: i32, name: String) -> BulkModuleBayTemplateRequest {
49        BulkModuleBayTemplateRequest {
50            id,
51            device_type: None,
52            module_type: None,
53            name,
54            label: None,
55            position: None,
56            enabled: None,
57            description: None,
58        }
59    }
60}