netbox_openapi/models/
contact_assignment_request.rs1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ContactAssignmentRequest {
15 #[serde(rename = "object_type")]
16 pub object_type: String,
17 #[serde(rename = "object_id")]
18 pub object_id: i64,
19 #[serde(rename = "contact")]
20 pub contact: Box<crate::models::ContactAssignmentRequestContact>,
21 #[serde(
22 rename = "role",
23 default,
24 with = "::serde_with::rust::double_option",
25 skip_serializing_if = "Option::is_none"
26 )]
27 pub role: Option<Option<Box<crate::models::ContactAssignmentRequestRole>>>,
28 #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
30 pub priority: Option<Priority>,
31 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
32 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
33 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
34 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
35}
36
37impl ContactAssignmentRequest {
38 pub fn new(
40 object_type: String,
41 object_id: i64,
42 contact: crate::models::ContactAssignmentRequestContact,
43 ) -> ContactAssignmentRequest {
44 ContactAssignmentRequest {
45 object_type,
46 object_id,
47 contact: Box::new(contact),
48 role: None,
49 priority: None,
50 tags: None,
51 custom_fields: None,
52 }
53 }
54}
55
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Priority {
59 #[serde(rename = "primary")]
60 Primary,
61 #[serde(rename = "secondary")]
62 Secondary,
63 #[serde(rename = "tertiary")]
64 Tertiary,
65 #[serde(rename = "inactive")]
66 Inactive,
67 #[serde(rename = "")]
68 Empty,
69}
70
71impl Default for Priority {
72 fn default() -> Priority {
73 Self::Primary
74 }
75}