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

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

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ContactAssignment {
    #[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", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "object_type")]
    pub object_type: String,
    #[serde(rename = "object_id")]
    pub object_id: i64,
    #[serde(
        rename = "object",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub object: Option<Option<serde_json::Value>>,
    #[serde(rename = "contact")]
    pub contact: Box<crate::models::BriefContact>,
    #[serde(
        rename = "role",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub role: Option<Option<Box<crate::models::BriefContactRole>>>,
    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
    pub priority: Option<Box<crate::models::BriefCircuitGroupAssignmentSerializerPriority>>,
    #[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 ContactAssignment {
    /// Adds support for custom fields and tags.
    pub fn new(
        object_type: String,
        object_id: i64,
        contact: crate::models::BriefContact,
    ) -> ContactAssignment {
        ContactAssignment {
            id: None,
            url: None,
            display: None,
            object_type,
            object_id,
            object: None,
            contact: Box::new(contact),
            role: None,
            priority: None,
            tags: None,
            custom_fields: None,
            created: None,
            last_updated: None,
        }
    }
}