Skip to main content

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