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