nautobot-openapi 0.2.0

low level nautobot bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * API Documentation
 *
 * Source of truth and network automation platform
 *
 * The version of the OpenAPI document: 2.4.20 (2.4)
 *
 * Generated by: https://openapi-generator.tech
 */

/// 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>)

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct InterfaceConnection {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
    pub object_type: Option<String>,
    /// Human friendly display value
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "interface_a", skip_serializing_if = "Option::is_none")]
    pub interface_a: Option<Box<crate::models::Interface>>,
    #[serde(rename = "interface_b")]
    pub interface_b: Box<crate::models::Interface>,
    #[serde(
        rename = "connected_endpoint_reachable",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub connected_endpoint_reachable: Option<Option<bool>>,
    #[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 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>)
    pub fn new(interface_b: crate::models::Interface) -> InterfaceConnection {
        InterfaceConnection {
            id: None,
            object_type: None,
            display: None,
            interface_a: None,
            interface_b: Box::new(interface_b),
            connected_endpoint_reachable: None,
            created: None,
            last_updated: None,
        }
    }
}