Skip to main content

nautobot_openapi/models/
cluster.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Cluster : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Cluster {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
18    pub object_type: Option<String>,
19    /// Human friendly display value
20    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
21    pub display: Option<String>,
22    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
23    pub url: Option<String>,
24    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
25    pub natural_slug: Option<String>,
26    #[serde(rename = "device_count", skip_serializing_if = "Option::is_none")]
27    pub device_count: Option<i32>,
28    #[serde(
29        rename = "virtualmachine_count",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub virtualmachine_count: Option<i32>,
33    #[serde(rename = "name")]
34    pub name: String,
35    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
36    pub comments: Option<String>,
37    #[serde(rename = "cluster_type")]
38    pub cluster_type: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
39    #[serde(
40        rename = "cluster_group",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub cluster_group: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
46    #[serde(
47        rename = "tenant",
48        default,
49        with = "::serde_with::rust::double_option",
50        skip_serializing_if = "Option::is_none"
51    )]
52    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
53    #[serde(
54        rename = "location",
55        default,
56        with = "::serde_with::rust::double_option",
57        skip_serializing_if = "Option::is_none"
58    )]
59    pub location: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
60    #[serde(
61        rename = "created",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub created: Option<Option<String>>,
67    #[serde(
68        rename = "last_updated",
69        default,
70        with = "::serde_with::rust::double_option",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub last_updated: Option<Option<String>>,
74    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
75    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
76    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
77    pub notes_url: Option<String>,
78    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
79    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
80}
81
82impl Cluster {
83    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
84    pub fn new(
85        name: String,
86        cluster_type: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
87    ) -> Cluster {
88        Cluster {
89            id: None,
90            object_type: None,
91            display: None,
92            url: None,
93            natural_slug: None,
94            device_count: None,
95            virtualmachine_count: None,
96            name,
97            comments: None,
98            cluster_type: Box::new(cluster_type),
99            cluster_group: None,
100            tenant: None,
101            location: None,
102            created: None,
103            last_updated: None,
104            tags: None,
105            notes_url: None,
106            custom_fields: None,
107        }
108    }
109}