netbox_openapi/models/
mac_address.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/// MacAddress : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct MacAddress {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<i32>,
17    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18    pub url: Option<String>,
19    #[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
20    pub display_url: Option<String>,
21    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
22    pub display: Option<String>,
23    #[serde(rename = "mac_address")]
24    pub mac_address: String,
25    #[serde(
26        rename = "assigned_object_type",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub assigned_object_type: Option<Option<String>>,
32    #[serde(
33        rename = "assigned_object_id",
34        default,
35        with = "::serde_with::rust::double_option",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub assigned_object_id: Option<Option<i64>>,
39    #[serde(
40        rename = "assigned_object",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub assigned_object: Option<Option<serde_json::Value>>,
46    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
47    pub description: Option<String>,
48    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
49    pub comments: Option<String>,
50    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
51    pub tags: Option<Vec<crate::models::NestedTag>>,
52    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
53    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
54    #[serde(
55        rename = "created",
56        default,
57        with = "::serde_with::rust::double_option",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub created: Option<Option<String>>,
61    #[serde(
62        rename = "last_updated",
63        default,
64        with = "::serde_with::rust::double_option",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub last_updated: Option<Option<String>>,
68}
69
70impl MacAddress {
71    /// Adds support for custom fields and tags.
72    pub fn new(mac_address: String) -> MacAddress {
73        MacAddress {
74            id: None,
75            url: None,
76            display_url: None,
77            display: None,
78            mac_address,
79            assigned_object_type: None,
80            assigned_object_id: None,
81            assigned_object: None,
82            description: None,
83            comments: None,
84            tags: None,
85            custom_fields: None,
86            created: None,
87            last_updated: None,
88        }
89    }
90}