Skip to main content

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