netbox_openapi/models/
contact_assignment.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/// ContactAssignment : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ContactAssignment {
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", skip_serializing_if = "Option::is_none")]
20    pub display: Option<String>,
21    #[serde(rename = "object_type")]
22    pub object_type: String,
23    #[serde(rename = "object_id")]
24    pub object_id: i64,
25    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
26    pub object: Option<::std::collections::HashMap<String, serde_json::Value>>,
27    #[serde(rename = "contact")]
28    pub contact: Box<crate::models::BriefContact>,
29    #[serde(
30        rename = "role",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub role: Option<Option<Box<crate::models::BriefContactRole>>>,
36    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
37    pub priority: Option<Box<crate::models::BriefCircuitGroupAssignmentSerializerPriority>>,
38    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
39    pub tags: Option<Vec<crate::models::NestedTag>>,
40    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
41    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
42    #[serde(
43        rename = "created",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub created: Option<Option<String>>,
49    #[serde(
50        rename = "last_updated",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub last_updated: Option<Option<String>>,
56}
57
58impl ContactAssignment {
59    /// Adds support for custom fields and tags.
60    pub fn new(
61        object_type: String,
62        object_id: i64,
63        contact: crate::models::BriefContact,
64    ) -> ContactAssignment {
65        ContactAssignment {
66            id: None,
67            url: None,
68            display: None,
69            object_type,
70            object_id,
71            object: None,
72            contact: Box::new(contact),
73            role: None,
74            priority: None,
75            tags: None,
76            custom_fields: None,
77            created: None,
78            last_updated: None,
79        }
80    }
81}