netbox_openapi/models/
rir.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/// Rir : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Rir {
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 = "name")]
24    pub name: String,
25    #[serde(rename = "slug")]
26    pub slug: String,
27    /// IP space managed by this RIR is considered private
28    #[serde(rename = "is_private", skip_serializing_if = "Option::is_none")]
29    pub is_private: Option<bool>,
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
31    pub description: Option<String>,
32    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
33    pub tags: Option<Vec<crate::models::NestedTag>>,
34    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
35    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
36    #[serde(
37        rename = "created",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub created: Option<Option<String>>,
43    #[serde(
44        rename = "last_updated",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub last_updated: Option<Option<String>>,
50    #[serde(rename = "aggregate_count", skip_serializing_if = "Option::is_none")]
51    pub aggregate_count: Option<i64>,
52}
53
54impl Rir {
55    /// Adds support for custom fields and tags.
56    pub fn new(name: String, slug: String) -> Rir {
57        Rir {
58            id: None,
59            url: None,
60            display_url: None,
61            display: None,
62            name,
63            slug,
64            is_private: None,
65            description: None,
66            tags: None,
67            custom_fields: None,
68            created: None,
69            last_updated: None,
70            aggregate_count: None,
71        }
72    }
73}