Skip to main content

nautobot_openapi/models/
interface_connection.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// InterfaceConnection : 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 InterfaceConnection {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "interface_a", skip_serializing_if = "Option::is_none")]
23    pub interface_a: Option<Box<crate::models::Interface>>,
24    #[serde(rename = "interface_b")]
25    pub interface_b: Box<crate::models::Interface>,
26    #[serde(
27        rename = "connected_endpoint_reachable",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub connected_endpoint_reachable: Option<Option<bool>>,
33    #[serde(
34        rename = "created",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub created: Option<Option<String>>,
40    #[serde(
41        rename = "last_updated",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub last_updated: Option<Option<String>>,
47}
48
49impl InterfaceConnection {
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(interface_b: crate::models::Interface) -> InterfaceConnection {
52        InterfaceConnection {
53            id: None,
54            object_type: None,
55            display: None,
56            interface_a: None,
57            interface_b: Box::new(interface_b),
58            connected_endpoint_reachable: None,
59            created: None,
60            last_updated: None,
61        }
62    }
63}