Skip to main content

netbox_openapi/models/
circuit_type.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/// CircuitType : Base serializer class for models inheriting from OrganizationalModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct CircuitType {
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    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
28    pub color: Option<String>,
29    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
30    pub description: Option<String>,
31    #[serde(
32        rename = "owner",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub owner: Option<Option<Box<crate::models::BriefOwner>>>,
38    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
39    pub comments: Option<String>,
40    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
41    pub tags: Option<Vec<crate::models::NestedTag>>,
42    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
43    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
44    #[serde(
45        rename = "created",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub created: Option<Option<String>>,
51    #[serde(
52        rename = "last_updated",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub last_updated: Option<Option<String>>,
58    #[serde(rename = "circuit_count", skip_serializing_if = "Option::is_none")]
59    pub circuit_count: Option<i64>,
60}
61
62impl CircuitType {
63    /// Base serializer class for models inheriting from OrganizationalModel.
64    pub fn new(name: String, slug: String) -> CircuitType {
65        CircuitType {
66            id: None,
67            url: None,
68            display_url: None,
69            display: None,
70            name,
71            slug,
72            color: None,
73            description: None,
74            owner: None,
75            comments: None,
76            tags: None,
77            custom_fields: None,
78            created: None,
79            last_updated: None,
80            circuit_count: None,
81        }
82    }
83}