Skip to main content

netbox_openapi/models/
bulk_console_server_port_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/// BulkConsoleServerPortTemplateRequest : 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 BulkConsoleServerPortTemplateRequest {
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    /// * `de-9` - DE-9 * `db-25` - DB-25 * `rj-11` - RJ-11 * `rj-12` - RJ-12 * `rj-45` - RJ-45 * `mini-din-8` - Mini-DIN 8 * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `other` - Other
38    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
39    pub r#type: Option<RHashType>,
40    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
41    pub description: Option<String>,
42}
43
44impl BulkConsoleServerPortTemplateRequest {
45    /// 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>)
46    pub fn new(id: i32, name: String) -> BulkConsoleServerPortTemplateRequest {
47        BulkConsoleServerPortTemplateRequest {
48            id,
49            device_type: None,
50            module_type: None,
51            name,
52            label: None,
53            r#type: None,
54            description: None,
55        }
56    }
57}
58
59/// * `de-9` - DE-9 * `db-25` - DB-25 * `rj-11` - RJ-11 * `rj-12` - RJ-12 * `rj-45` - RJ-45 * `mini-din-8` - Mini-DIN 8 * `usb-a` - USB Type A * `usb-b` - USB Type B * `usb-c` - USB Type C * `usb-mini-a` - USB Mini A * `usb-mini-b` - USB Mini B * `usb-micro-a` - USB Micro A * `usb-micro-b` - USB Micro B * `usb-micro-ab` - USB Micro AB * `other` - Other
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum RHashType {
62    #[serde(rename = "de-9")]
63    De9,
64    #[serde(rename = "db-25")]
65    Db25,
66    #[serde(rename = "rj-11")]
67    Rj11,
68    #[serde(rename = "rj-12")]
69    Rj12,
70    #[serde(rename = "rj-45")]
71    Rj45,
72    #[serde(rename = "mini-din-8")]
73    MiniDin8,
74    #[serde(rename = "usb-a")]
75    UsbA,
76    #[serde(rename = "usb-b")]
77    UsbB,
78    #[serde(rename = "usb-c")]
79    UsbC,
80    #[serde(rename = "usb-mini-a")]
81    UsbMiniA,
82    #[serde(rename = "usb-mini-b")]
83    UsbMiniB,
84    #[serde(rename = "usb-micro-a")]
85    UsbMicroA,
86    #[serde(rename = "usb-micro-b")]
87    UsbMicroB,
88    #[serde(rename = "usb-micro-ab")]
89    UsbMicroAb,
90    #[serde(rename = "other")]
91    Other,
92    #[serde(rename = "")]
93    Empty,
94}
95
96impl Default for RHashType {
97    fn default() -> RHashType {
98        Self::De9
99    }
100}