netbox_openapi/models/
tagged_item.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#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct TaggedItem {
13    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
14    pub id: Option<i32>,
15    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
16    pub url: Option<String>,
17    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
18    pub display: Option<String>,
19    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
20    pub object_type: Option<String>,
21    #[serde(rename = "object_id")]
22    pub object_id: i32,
23    #[serde(
24        rename = "object",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub object: Option<Option<serde_json::Value>>,
30    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
31    pub tag: Option<Box<crate::models::BriefTag>>,
32}
33
34impl TaggedItem {
35    pub fn new(object_id: i32) -> TaggedItem {
36        TaggedItem {
37            id: None,
38            url: None,
39            display: None,
40            object_type: None,
41            object_id,
42            object: None,
43            tag: None,
44        }
45    }
46}