Skip to main content

netbox_openapi/models/
patched_bulk_virtual_machine_with_config_context_request.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.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedBulkVirtualMachineWithConfigContextRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkVirtualMachineWithConfigContextRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(
20        rename = "virtual_machine_type",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub virtual_machine_type: Option<
26        Option<Box<crate::models::BulkVirtualMachineWithConfigContextRequestVirtualMachineType>>,
27    >,
28    #[serde(
29        rename = "role",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub role: Option<Option<Box<crate::models::BulkVirtualMachineWithConfigContextRequestRole>>>,
35    /// * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `decommissioning` - Decommissioning * `paused` - Paused
36    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
37    pub status: Option<Status>,
38    /// * `on` - On * `off` - Off * `laststate` - Last State
39    #[serde(rename = "start_on_boot", skip_serializing_if = "Option::is_none")]
40    pub start_on_boot: Option<StartOnBoot>,
41    #[serde(
42        rename = "site",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub site: Option<Option<Box<crate::models::BulkVlanRequestSite>>>,
48    #[serde(
49        rename = "cluster",
50        default,
51        with = "::serde_with::rust::double_option",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub cluster: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestCluster>>>,
55    #[serde(
56        rename = "device",
57        default,
58        with = "::serde_with::rust::double_option",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub device: Option<Option<Box<crate::models::BulkDeviceBayRequestInstalledDevice>>>,
62    #[serde(
63        rename = "platform",
64        default,
65        with = "::serde_with::rust::double_option",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub platform: Option<Option<Box<crate::models::BulkDeviceTypeRequestDefaultPlatform>>>,
69    #[serde(
70        rename = "primary_ip4",
71        default,
72        with = "::serde_with::rust::double_option",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub primary_ip4:
76        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
77    #[serde(
78        rename = "primary_ip6",
79        default,
80        with = "::serde_with::rust::double_option",
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub primary_ip6:
84        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
85    #[serde(
86        rename = "vcpus",
87        default,
88        with = "::serde_with::rust::double_option",
89        skip_serializing_if = "Option::is_none"
90    )]
91    pub vcpus: Option<Option<f64>>,
92    #[serde(
93        rename = "memory",
94        default,
95        with = "::serde_with::rust::double_option",
96        skip_serializing_if = "Option::is_none"
97    )]
98    pub memory: Option<Option<i32>>,
99    #[serde(
100        rename = "disk",
101        default,
102        with = "::serde_with::rust::double_option",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub disk: Option<Option<i32>>,
106    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
107    pub description: Option<String>,
108    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
109    pub serial: Option<String>,
110    #[serde(
111        rename = "tenant",
112        default,
113        with = "::serde_with::rust::double_option",
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
117    #[serde(
118        rename = "owner",
119        default,
120        with = "::serde_with::rust::double_option",
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
124    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
125    pub comments: Option<String>,
126    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
127    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
128    /// Local config context data takes precedence over source contexts in the final rendered config context
129    #[serde(
130        rename = "local_context_data",
131        default,
132        with = "::serde_with::rust::double_option",
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub local_context_data: Option<Option<serde_json::Value>>,
136    #[serde(
137        rename = "config_template",
138        default,
139        with = "::serde_with::rust::double_option",
140        skip_serializing_if = "Option::is_none"
141    )]
142    pub config_template: Option<Option<Box<crate::models::BulkDeviceRoleRequestConfigTemplate>>>,
143    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
144    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
145}
146
147impl PatchedBulkVirtualMachineWithConfigContextRequest {
148    /// Base serializer class for models inheriting from PrimaryModel.
149    pub fn new(id: i32) -> PatchedBulkVirtualMachineWithConfigContextRequest {
150        PatchedBulkVirtualMachineWithConfigContextRequest {
151            id,
152            name: None,
153            virtual_machine_type: None,
154            role: None,
155            status: None,
156            start_on_boot: None,
157            site: None,
158            cluster: None,
159            device: None,
160            platform: None,
161            primary_ip4: None,
162            primary_ip6: None,
163            vcpus: None,
164            memory: None,
165            disk: None,
166            description: None,
167            serial: None,
168            tenant: None,
169            owner: None,
170            comments: None,
171            tags: None,
172            local_context_data: None,
173            config_template: None,
174            custom_fields: None,
175        }
176    }
177}
178
179/// * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `decommissioning` - Decommissioning * `paused` - Paused
180#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
181pub enum Status {
182    #[serde(rename = "offline")]
183    Offline,
184    #[serde(rename = "active")]
185    Active,
186    #[serde(rename = "planned")]
187    Planned,
188    #[serde(rename = "staged")]
189    Staged,
190    #[serde(rename = "failed")]
191    Failed,
192    #[serde(rename = "decommissioning")]
193    Decommissioning,
194    #[serde(rename = "paused")]
195    Paused,
196}
197
198impl Default for Status {
199    fn default() -> Status {
200        Self::Offline
201    }
202}
203/// * `on` - On * `off` - Off * `laststate` - Last State
204#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
205pub enum StartOnBoot {
206    #[serde(rename = "on")]
207    On,
208    #[serde(rename = "off")]
209    Off,
210    #[serde(rename = "laststate")]
211    Laststate,
212}
213
214impl Default for StartOnBoot {
215    fn default() -> StartOnBoot {
216        Self::On
217    }
218}