netbox_openapi/models/
patched_writable_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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableContactAssignmentRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableContactAssignmentRequest {
15    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
16    pub object_type: Option<String>,
17    #[serde(rename = "object_id", skip_serializing_if = "Option::is_none")]
18    pub object_id: Option<i64>,
19    #[serde(rename = "contact", skip_serializing_if = "Option::is_none")]
20    pub contact: Option<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    /// * `primary` - Primary * `secondary` - Secondary * `tertiary` - Tertiary * `inactive` - Inactive
29    #[serde(
30        rename = "priority",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub priority: Option<Option<Priority>>,
36    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
37    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
38    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
39    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
40}
41
42impl PatchedWritableContactAssignmentRequest {
43    /// Adds support for custom fields and tags.
44    pub fn new() -> PatchedWritableContactAssignmentRequest {
45        PatchedWritableContactAssignmentRequest {
46            object_type: None,
47            object_id: None,
48            contact: None,
49            role: None,
50            priority: None,
51            tags: None,
52            custom_fields: None,
53        }
54    }
55}
56
57/// * `primary` - Primary * `secondary` - Secondary * `tertiary` - Tertiary * `inactive` - Inactive
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Priority {
60    #[serde(rename = "primary")]
61    Primary,
62    #[serde(rename = "secondary")]
63    Secondary,
64    #[serde(rename = "tertiary")]
65    Tertiary,
66    #[serde(rename = "inactive")]
67    Inactive,
68    #[serde(rename = "")]
69    Empty,
70    #[serde(rename = "null")]
71    Null,
72}
73
74impl Default for Priority {
75    fn default() -> Priority {
76        Self::Primary
77    }
78}