netbox_openapi/models/
mac_address_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/// MacAddressRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct MacAddressRequest {
15    #[serde(rename = "mac_address")]
16    pub mac_address: String,
17    #[serde(
18        rename = "assigned_object_type",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub assigned_object_type: Option<Option<String>>,
24    #[serde(
25        rename = "assigned_object_id",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub assigned_object_id: Option<Option<i64>>,
31    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
32    pub description: Option<String>,
33    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
34    pub comments: Option<String>,
35    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
36    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
37    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
38    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
39}
40
41impl MacAddressRequest {
42    /// Adds support for custom fields and tags.
43    pub fn new(mac_address: String) -> MacAddressRequest {
44        MacAddressRequest {
45            mac_address,
46            assigned_object_type: None,
47            assigned_object_id: None,
48            description: None,
49            comments: None,
50            tags: None,
51            custom_fields: None,
52        }
53    }
54}