Skip to main content

netbox_openapi/models/
aggregate.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/// Aggregate : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Aggregate {
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 = "family", skip_serializing_if = "Option::is_none")]
24    pub family: Option<Box<crate::models::AggregateFamily>>,
25    #[serde(rename = "prefix")]
26    pub prefix: String,
27    #[serde(rename = "rir")]
28    pub rir: Box<crate::models::BriefRir>,
29    #[serde(
30        rename = "tenant",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub tenant: Option<Option<Box<crate::models::BriefTenant>>>,
36    #[serde(
37        rename = "date_added",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub date_added: Option<Option<String>>,
43    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
44    pub description: Option<String>,
45    #[serde(
46        rename = "owner",
47        default,
48        with = "::serde_with::rust::double_option",
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub owner: Option<Option<Box<crate::models::BriefOwner>>>,
52    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
53    pub comments: Option<String>,
54    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
55    pub tags: Option<Vec<crate::models::NestedTag>>,
56    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
57    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
58    #[serde(
59        rename = "created",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub created: Option<Option<String>>,
65    #[serde(
66        rename = "last_updated",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub last_updated: Option<Option<String>>,
72}
73
74impl Aggregate {
75    /// Base serializer class for models inheriting from PrimaryModel.
76    pub fn new(prefix: String, rir: crate::models::BriefRir) -> Aggregate {
77        Aggregate {
78            id: None,
79            url: None,
80            display_url: None,
81            display: None,
82            family: None,
83            prefix,
84            rir: Box::new(rir),
85            tenant: None,
86            date_added: None,
87            description: None,
88            owner: None,
89            comments: None,
90            tags: None,
91            custom_fields: None,
92            created: None,
93            last_updated: None,
94        }
95    }
96}