netbox-openapi 0.6.0

low level netbox bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * NetBox REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.6.2 (4.6)
 *
 * Generated by: https://openapi-generator.tech
 */

/// TunnelTermination : Adds support for custom fields and tags.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct TunnelTermination {
    #[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>,
    #[serde(rename = "tunnel")]
    pub tunnel: Box<crate::models::BriefTunnel>,
    #[serde(rename = "role")]
    pub role: Box<crate::models::TunnelTerminationRole>,
    #[serde(rename = "termination_type")]
    pub termination_type: String,
    #[serde(
        rename = "termination_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub termination_id: Option<Option<i64>>,
    #[serde(
        rename = "termination",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub termination: Option<Option<serde_json::Value>>,
    #[serde(
        rename = "outside_ip",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub outside_ip: Option<Option<Box<crate::models::BriefIpAddress>>>,
    #[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 TunnelTermination {
    /// Adds support for custom fields and tags.
    pub fn new(
        tunnel: crate::models::BriefTunnel,
        role: crate::models::TunnelTerminationRole,
        termination_type: String,
    ) -> TunnelTermination {
        TunnelTermination {
            id: None,
            url: None,
            display_url: None,
            display: None,
            tunnel: Box::new(tunnel),
            role: Box::new(role),
            termination_type,
            termination_id: None,
            termination: None,
            outside_ip: None,
            tags: None,
            custom_fields: None,
            created: None,
            last_updated: None,
        }
    }
}