/*
* NetBox REST API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.5.9-Docker-4.0.2 (4.5)
*
* Generated by: https://openapi-generator.tech
*/
/// Cable : Base serializer class for models inheriting from PrimaryModel.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Cable {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i32>,
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
pub display_url: Option<String>,
#[serde(rename = "display", skip_serializing_if = "Option::is_none")]
pub display: Option<String>,
/// * `cat3` - CAT3 * `cat5` - CAT5 * `cat5e` - CAT5e * `cat6` - CAT6 * `cat6a` - CAT6a * `cat7` - CAT7 * `cat7a` - CAT7a * `cat8` - CAT8 * `mrj21-trunk` - MRJ21 Trunk * `dac-active` - Direct Attach Copper (Active) * `dac-passive` - Direct Attach Copper (Passive) * `coaxial` - Coaxial * `rg-6` - RG-6 * `rg-8` - RG-8 * `rg-11` - RG-11 * `rg-59` - RG-59 * `rg-62` - RG-62 * `rg-213` - RG-213 * `lmr-100` - LMR-100 * `lmr-200` - LMR-200 * `lmr-400` - LMR-400 * `mmf` - Multimode Fiber * `mmf-om1` - Multimode Fiber (OM1) * `mmf-om2` - Multimode Fiber (OM2) * `mmf-om3` - Multimode Fiber (OM3) * `mmf-om4` - Multimode Fiber (OM4) * `mmf-om5` - Multimode Fiber (OM5) * `smf` - Single-mode Fiber * `smf-os1` - Single-mode Fiber (OS1) * `smf-os2` - Single-mode Fiber (OS2) * `aoc` - Active Optical Cabling (AOC) * `power` - Power * `usb` - USB
#[serde(
rename = "type",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub r#type: Option<Option<RHashType>>,
#[serde(rename = "a_terminations", skip_serializing_if = "Option::is_none")]
pub a_terminations: Option<Vec<crate::models::GenericObject>>,
#[serde(rename = "b_terminations", skip_serializing_if = "Option::is_none")]
pub b_terminations: Option<Vec<crate::models::GenericObject>>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Box<crate::models::CableStatus>>,
#[serde(rename = "profile", skip_serializing_if = "Option::is_none")]
pub profile: Option<Box<crate::models::CableProfile>>,
#[serde(
rename = "tenant",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub tenant: Option<Option<Box<crate::models::BriefTenant>>>,
#[serde(rename = "label", skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(rename = "color", skip_serializing_if = "Option::is_none")]
pub color: Option<String>,
#[serde(
rename = "length",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub length: Option<Option<f64>>,
#[serde(
rename = "length_unit",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub length_unit: Option<Option<Box<crate::models::CableLengthUnit>>>,
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(
rename = "owner",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub owner: Option<Option<Box<crate::models::BriefOwner>>>,
#[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
pub comments: Option<String>,
#[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<crate::models::NestedTag>>,
#[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
#[serde(
rename = "created",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub created: Option<Option<String>>,
#[serde(
rename = "last_updated",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_updated: Option<Option<String>>,
}
impl Cable {
/// Base serializer class for models inheriting from PrimaryModel.
pub fn new() -> Cable {
Cable {
id: None,
url: None,
display_url: None,
display: None,
r#type: None,
a_terminations: None,
b_terminations: None,
status: None,
profile: None,
tenant: None,
label: None,
color: None,
length: None,
length_unit: None,
description: None,
owner: None,
comments: None,
tags: None,
custom_fields: None,
created: None,
last_updated: None,
}
}
}
/// * `cat3` - CAT3 * `cat5` - CAT5 * `cat5e` - CAT5e * `cat6` - CAT6 * `cat6a` - CAT6a * `cat7` - CAT7 * `cat7a` - CAT7a * `cat8` - CAT8 * `mrj21-trunk` - MRJ21 Trunk * `dac-active` - Direct Attach Copper (Active) * `dac-passive` - Direct Attach Copper (Passive) * `coaxial` - Coaxial * `rg-6` - RG-6 * `rg-8` - RG-8 * `rg-11` - RG-11 * `rg-59` - RG-59 * `rg-62` - RG-62 * `rg-213` - RG-213 * `lmr-100` - LMR-100 * `lmr-200` - LMR-200 * `lmr-400` - LMR-400 * `mmf` - Multimode Fiber * `mmf-om1` - Multimode Fiber (OM1) * `mmf-om2` - Multimode Fiber (OM2) * `mmf-om3` - Multimode Fiber (OM3) * `mmf-om4` - Multimode Fiber (OM4) * `mmf-om5` - Multimode Fiber (OM5) * `smf` - Single-mode Fiber * `smf-os1` - Single-mode Fiber (OS1) * `smf-os2` - Single-mode Fiber (OS2) * `aoc` - Active Optical Cabling (AOC) * `power` - Power * `usb` - USB
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RHashType {
#[serde(rename = "cat3")]
Cat3,
#[serde(rename = "cat5")]
Cat5,
#[serde(rename = "cat5e")]
Cat5e,
#[serde(rename = "cat6")]
Cat6,
#[serde(rename = "cat6a")]
Cat6a,
#[serde(rename = "cat7")]
Cat7,
#[serde(rename = "cat7a")]
Cat7a,
#[serde(rename = "cat8")]
Cat8,
#[serde(rename = "mrj21-trunk")]
Mrj21Trunk,
#[serde(rename = "dac-active")]
DacActive,
#[serde(rename = "dac-passive")]
DacPassive,
#[serde(rename = "coaxial")]
Coaxial,
#[serde(rename = "rg-6")]
Rg6,
#[serde(rename = "rg-8")]
Rg8,
#[serde(rename = "rg-11")]
Rg11,
#[serde(rename = "rg-59")]
Rg59,
#[serde(rename = "rg-62")]
Rg62,
#[serde(rename = "rg-213")]
Rg213,
#[serde(rename = "lmr-100")]
Lmr100,
#[serde(rename = "lmr-200")]
Lmr200,
#[serde(rename = "lmr-400")]
Lmr400,
#[serde(rename = "mmf")]
Mmf,
#[serde(rename = "mmf-om1")]
MmfOm1,
#[serde(rename = "mmf-om2")]
MmfOm2,
#[serde(rename = "mmf-om3")]
MmfOm3,
#[serde(rename = "mmf-om4")]
MmfOm4,
#[serde(rename = "mmf-om5")]
MmfOm5,
#[serde(rename = "smf")]
Smf,
#[serde(rename = "smf-os1")]
SmfOs1,
#[serde(rename = "smf-os2")]
SmfOs2,
#[serde(rename = "aoc")]
Aoc,
#[serde(rename = "power")]
Power,
#[serde(rename = "usb")]
Usb,
#[serde(rename = "")]
Empty,
#[serde(rename = "null")]
Null,
}
impl Default for RHashType {
fn default() -> RHashType {
Self::Cat3
}
}