Skip to main content

nautobot_openapi/models/
virtual_machine.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/// VirtualMachine : 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 VirtualMachine {
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(
27        rename = "local_config_context_data",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub local_config_context_data: Option<Option<serde_json::Value>>,
33    #[serde(
34        rename = "local_config_context_data_owner_object_id",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub local_config_context_data_owner_object_id: Option<Option<uuid::Uuid>>,
40    #[serde(rename = "name")]
41    pub name: String,
42    #[serde(
43        rename = "vcpus",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub vcpus: Option<Option<i32>>,
49    #[serde(
50        rename = "memory",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub memory: Option<Option<i32>>,
56    #[serde(
57        rename = "disk",
58        default,
59        with = "::serde_with::rust::double_option",
60        skip_serializing_if = "Option::is_none"
61    )]
62    pub disk: Option<Option<i32>>,
63    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
64    pub comments: Option<String>,
65    #[serde(
66        rename = "local_config_context_schema",
67        default,
68        with = "::serde_with::rust::double_option",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub local_config_context_schema:
72        Option<Option<Box<crate::models::BulkWritableConfigContextRequestConfigContextSchema>>>,
73    #[serde(
74        rename = "local_config_context_data_owner_content_type",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub local_config_context_data_owner_content_type:
80        Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
81    #[serde(rename = "cluster")]
82    pub cluster: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
83    #[serde(
84        rename = "tenant",
85        default,
86        with = "::serde_with::rust::double_option",
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
90    #[serde(
91        rename = "platform",
92        default,
93        with = "::serde_with::rust::double_option",
94        skip_serializing_if = "Option::is_none"
95    )]
96    pub platform: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
97    #[serde(rename = "status")]
98    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
99    #[serde(
100        rename = "role",
101        default,
102        with = "::serde_with::rust::double_option",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
106    #[serde(
107        rename = "primary_ip4",
108        default,
109        with = "::serde_with::rust::double_option",
110        skip_serializing_if = "Option::is_none"
111    )]
112    pub primary_ip4: Option<Option<Box<crate::models::PrimaryIpv4>>>,
113    #[serde(
114        rename = "primary_ip6",
115        default,
116        with = "::serde_with::rust::double_option",
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub primary_ip6: Option<Option<Box<crate::models::PrimaryIpv6>>>,
120    #[serde(
121        rename = "software_version",
122        default,
123        with = "::serde_with::rust::double_option",
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub software_version:
127        Option<Option<Box<crate::models::BulkWritableVirtualMachineRequestSoftwareVersion>>>,
128    #[serde(
129        rename = "created",
130        default,
131        with = "::serde_with::rust::double_option",
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub created: Option<Option<String>>,
135    #[serde(
136        rename = "last_updated",
137        default,
138        with = "::serde_with::rust::double_option",
139        skip_serializing_if = "Option::is_none"
140    )]
141    pub last_updated: Option<Option<String>>,
142    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
143    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
144    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
145    pub notes_url: Option<String>,
146    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
147    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
148}
149
150impl VirtualMachine {
151    /// 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.
152    pub fn new(
153        name: String,
154        cluster: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
155        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
156    ) -> VirtualMachine {
157        VirtualMachine {
158            id: None,
159            object_type: None,
160            display: None,
161            url: None,
162            natural_slug: None,
163            local_config_context_data: None,
164            local_config_context_data_owner_object_id: None,
165            name,
166            vcpus: None,
167            memory: None,
168            disk: None,
169            comments: None,
170            local_config_context_schema: None,
171            local_config_context_data_owner_content_type: None,
172            cluster: Box::new(cluster),
173            tenant: None,
174            platform: None,
175            status: Box::new(status),
176            role: None,
177            primary_ip4: None,
178            primary_ip6: None,
179            software_version: None,
180            created: None,
181            last_updated: None,
182            tags: None,
183            notes_url: None,
184            custom_fields: None,
185        }
186    }
187}