netbox_openapi/models/
nested_interface.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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// NestedInterface : Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct NestedInterface {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<i32>,
17    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18    pub url: Option<String>,
19    #[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
20    pub display_url: Option<String>,
21    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
22    pub display: Option<String>,
23    #[serde(rename = "device", skip_serializing_if = "Option::is_none")]
24    pub device: Option<Box<crate::models::NestedDevice>>,
25    #[serde(rename = "name")]
26    pub name: String,
27    #[serde(
28        rename = "cable",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub cable: Option<Option<i32>>,
34    #[serde(rename = "_occupied", skip_serializing_if = "Option::is_none")]
35    pub _occupied: Option<bool>,
36}
37
38impl NestedInterface {
39    /// Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read.
40    pub fn new(name: String) -> NestedInterface {
41        NestedInterface {
42            id: None,
43            url: None,
44            display_url: None,
45            display: None,
46            device: None,
47            name,
48            cable: None,
49            _occupied: None,
50        }
51    }
52}