Skip to main content

netbox_openapi/models/
patched_bulk_contact_assignment_request.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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedBulkContactAssignmentRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkContactAssignmentRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    #[serde(rename = "object_id", skip_serializing_if = "Option::is_none")]
20    pub object_id: Option<i64>,
21    #[serde(rename = "contact", skip_serializing_if = "Option::is_none")]
22    pub contact: Option<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    /// * `primary` - Primary * `secondary` - Secondary * `tertiary` - Tertiary * `inactive` - Inactive
31    #[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 PatchedBulkContactAssignmentRequest {
40    /// Adds support for custom fields and tags.
41    pub fn new(id: i32) -> PatchedBulkContactAssignmentRequest {
42        PatchedBulkContactAssignmentRequest {
43            id,
44            object_type: None,
45            object_id: None,
46            contact: None,
47            role: None,
48            priority: None,
49            tags: None,
50            custom_fields: None,
51        }
52    }
53}
54
55/// * `primary` - Primary * `secondary` - Secondary * `tertiary` - Tertiary * `inactive` - Inactive
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum Priority {
58    #[serde(rename = "primary")]
59    Primary,
60    #[serde(rename = "secondary")]
61    Secondary,
62    #[serde(rename = "tertiary")]
63    Tertiary,
64    #[serde(rename = "inactive")]
65    Inactive,
66    #[serde(rename = "")]
67    Empty,
68}
69
70impl Default for Priority {
71    fn default() -> Priority {
72        Self::Primary
73    }
74}