1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4#[allow(unused_imports)]
5use super::*;
6#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct LaunchInstanceDetails {
10 pub availability_domain: String,
12
13 pub compartment_id: String,
15
16 #[serde(skip_serializing_if = "Option::is_none")]
18 pub capacity_reservation_id: Option<String>,
19
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub create_vnic_details: Option<CreateVnicDetails>,
22
23 #[serde(skip_serializing_if = "Option::is_none")]
25 pub dedicated_vm_host_id: Option<String>,
26
27 #[serde(skip_serializing_if = "Option::is_none")]
29 pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
30
31 #[serde(skip_serializing_if = "Option::is_none")]
33 pub security_attributes: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
34
35 #[serde(skip_serializing_if = "Option::is_none")]
37 pub display_name: Option<String>,
38
39 #[serde(skip_serializing_if = "Option::is_none")]
41 pub extended_metadata: Option<HashMap<String, serde_json::Value>>,
42
43 #[serde(skip_serializing_if = "Option::is_none")]
45 pub fault_domain: Option<String>,
46
47 #[serde(skip_serializing_if = "Option::is_none")]
49 pub cluster_placement_group_id: Option<String>,
50
51 #[serde(skip_serializing_if = "Option::is_none")]
53 pub freeform_tags: Option<HashMap<String, String>>,
54
55 #[serde(skip_serializing_if = "Option::is_none")]
57 pub compute_cluster_id: Option<String>,
58
59 #[serde(skip_serializing_if = "Option::is_none")]
61 pub hostname_label: Option<String>,
62
63 #[serde(skip_serializing_if = "Option::is_none")]
65 pub image_id: Option<String>,
66
67 #[serde(skip_serializing_if = "Option::is_none")]
69 pub ipxe_script: Option<String>,
70
71 #[serde(skip_serializing_if = "Option::is_none")]
72 pub launch_options: Option<LaunchOptions>,
73
74 #[serde(skip_serializing_if = "Option::is_none")]
75 pub instance_options: Option<InstanceOptions>,
76
77 #[serde(skip_serializing_if = "Option::is_none")]
78 pub availability_config: Option<LaunchInstanceAvailabilityConfigDetails>,
79
80 #[serde(skip_serializing_if = "Option::is_none")]
81 pub preemptible_instance_config: Option<PreemptibleInstanceConfigDetails>,
82
83 #[serde(skip_serializing_if = "Option::is_none")]
85 pub metadata: Option<HashMap<String, String>>,
86
87 #[serde(skip_serializing_if = "Option::is_none")]
88 pub agent_config: Option<LaunchInstanceAgentConfigDetails>,
89
90 #[serde(skip_serializing_if = "Option::is_none")]
92 pub shape: Option<String>,
93
94 #[serde(skip_serializing_if = "Option::is_none")]
95 pub shape_config: Option<LaunchInstanceShapeConfigDetails>,
96
97 #[serde(skip_serializing_if = "Option::is_none")]
98 pub source_details: Option<InstanceSourceViaImageDetails>,
99
100 #[serde(skip_serializing_if = "Option::is_none")]
102 pub subnet_id: Option<String>,
103
104 #[serde(skip_serializing_if = "Option::is_none")]
106 pub launch_volume_attachments: Option<Vec<LaunchAttachVolumeDetails>>,
107
108 #[serde(skip_serializing_if = "Option::is_none")]
110 pub is_pv_encryption_in_transit_enabled: Option<bool>,
111
112 #[serde(skip_serializing_if = "Option::is_none")]
113 pub platform_config: Option<AmdRomeBmGpuLaunchInstancePlatformConfig>,
114
115 #[serde(skip_serializing_if = "Option::is_none")]
116 pub placement_constraint_details: Option<HostGroupPlacementConstraintDetails>,
117
118 #[serde(skip_serializing_if = "Option::is_none")]
120 pub is_aienterprise_enabled: Option<bool>,
121
122 #[serde(skip_serializing_if = "Option::is_none")]
124 pub instance_configuration_id: Option<String>,
125
126 #[serde(skip_serializing_if = "Option::is_none")]
128 pub licensing_configs: Option<Vec<LaunchInstanceLicensingConfig>>,
129}
130
131pub struct LaunchInstanceDetailsRequired {
133 pub availability_domain: String,
135
136 pub compartment_id: String,
138}
139
140impl LaunchInstanceDetails {
141 pub fn new(required: LaunchInstanceDetailsRequired) -> Self {
143 Self {
144 availability_domain: required.availability_domain,
145
146 compartment_id: required.compartment_id,
147
148 capacity_reservation_id: None,
149
150 create_vnic_details: None,
151
152 dedicated_vm_host_id: None,
153
154 defined_tags: None,
155
156 security_attributes: None,
157
158 display_name: None,
159
160 extended_metadata: None,
161
162 fault_domain: None,
163
164 cluster_placement_group_id: None,
165
166 freeform_tags: None,
167
168 compute_cluster_id: None,
169
170 hostname_label: None,
171
172 image_id: None,
173
174 ipxe_script: None,
175
176 launch_options: None,
177
178 instance_options: None,
179
180 availability_config: None,
181
182 preemptible_instance_config: None,
183
184 metadata: None,
185
186 agent_config: None,
187
188 shape: None,
189
190 shape_config: None,
191
192 source_details: None,
193
194 subnet_id: None,
195
196 launch_volume_attachments: None,
197
198 is_pv_encryption_in_transit_enabled: None,
199
200 platform_config: None,
201
202 placement_constraint_details: None,
203
204 is_aienterprise_enabled: None,
205
206 instance_configuration_id: None,
207
208 licensing_configs: None,
209 }
210 }
211
212 pub fn set_availability_domain(mut self, value: String) -> Self {
214 self.availability_domain = value;
215 self
216 }
217
218 pub fn set_capacity_reservation_id(mut self, value: Option<String>) -> Self {
220 self.capacity_reservation_id = value;
221 self
222 }
223
224 pub fn set_compartment_id(mut self, value: String) -> Self {
226 self.compartment_id = value;
227 self
228 }
229
230 pub fn set_create_vnic_details(mut self, value: Option<CreateVnicDetails>) -> Self {
232 self.create_vnic_details = value;
233 self
234 }
235
236 pub fn set_dedicated_vm_host_id(mut self, value: Option<String>) -> Self {
238 self.dedicated_vm_host_id = value;
239 self
240 }
241
242 pub fn set_defined_tags(
244 mut self,
245 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
246 ) -> Self {
247 self.defined_tags = value;
248 self
249 }
250
251 pub fn set_security_attributes(
253 mut self,
254 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
255 ) -> Self {
256 self.security_attributes = value;
257 self
258 }
259
260 pub fn set_display_name(mut self, value: Option<String>) -> Self {
262 self.display_name = value;
263 self
264 }
265
266 pub fn set_extended_metadata(
268 mut self,
269 value: Option<HashMap<String, serde_json::Value>>,
270 ) -> Self {
271 self.extended_metadata = value;
272 self
273 }
274
275 pub fn set_fault_domain(mut self, value: Option<String>) -> Self {
277 self.fault_domain = value;
278 self
279 }
280
281 pub fn set_cluster_placement_group_id(mut self, value: Option<String>) -> Self {
283 self.cluster_placement_group_id = value;
284 self
285 }
286
287 pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
289 self.freeform_tags = value;
290 self
291 }
292
293 pub fn set_compute_cluster_id(mut self, value: Option<String>) -> Self {
295 self.compute_cluster_id = value;
296 self
297 }
298
299 pub fn set_hostname_label(mut self, value: Option<String>) -> Self {
301 self.hostname_label = value;
302 self
303 }
304
305 pub fn set_image_id(mut self, value: Option<String>) -> Self {
307 self.image_id = value;
308 self
309 }
310
311 pub fn set_ipxe_script(mut self, value: Option<String>) -> Self {
313 self.ipxe_script = value;
314 self
315 }
316
317 pub fn set_launch_options(mut self, value: Option<LaunchOptions>) -> Self {
319 self.launch_options = value;
320 self
321 }
322
323 pub fn set_instance_options(mut self, value: Option<InstanceOptions>) -> Self {
325 self.instance_options = value;
326 self
327 }
328
329 pub fn set_availability_config(
331 mut self,
332 value: Option<LaunchInstanceAvailabilityConfigDetails>,
333 ) -> Self {
334 self.availability_config = value;
335 self
336 }
337
338 pub fn set_preemptible_instance_config(
340 mut self,
341 value: Option<PreemptibleInstanceConfigDetails>,
342 ) -> Self {
343 self.preemptible_instance_config = value;
344 self
345 }
346
347 pub fn set_metadata(mut self, value: Option<HashMap<String, String>>) -> Self {
349 self.metadata = value;
350 self
351 }
352
353 pub fn set_agent_config(mut self, value: Option<LaunchInstanceAgentConfigDetails>) -> Self {
355 self.agent_config = value;
356 self
357 }
358
359 pub fn set_shape(mut self, value: Option<String>) -> Self {
361 self.shape = value;
362 self
363 }
364
365 pub fn set_shape_config(mut self, value: Option<LaunchInstanceShapeConfigDetails>) -> Self {
367 self.shape_config = value;
368 self
369 }
370
371 pub fn set_source_details(mut self, value: Option<InstanceSourceViaImageDetails>) -> Self {
373 self.source_details = value;
374 self
375 }
376
377 pub fn set_subnet_id(mut self, value: Option<String>) -> Self {
379 self.subnet_id = value;
380 self
381 }
382
383 pub fn set_launch_volume_attachments(
385 mut self,
386 value: Option<Vec<LaunchAttachVolumeDetails>>,
387 ) -> Self {
388 self.launch_volume_attachments = value;
389 self
390 }
391
392 pub fn set_is_pv_encryption_in_transit_enabled(mut self, value: Option<bool>) -> Self {
394 self.is_pv_encryption_in_transit_enabled = value;
395 self
396 }
397
398 pub fn set_platform_config(
400 mut self,
401 value: Option<AmdRomeBmGpuLaunchInstancePlatformConfig>,
402 ) -> Self {
403 self.platform_config = value;
404 self
405 }
406
407 pub fn set_placement_constraint_details(
409 mut self,
410 value: Option<HostGroupPlacementConstraintDetails>,
411 ) -> Self {
412 self.placement_constraint_details = value;
413 self
414 }
415
416 pub fn set_is_aienterprise_enabled(mut self, value: Option<bool>) -> Self {
418 self.is_aienterprise_enabled = value;
419 self
420 }
421
422 pub fn set_instance_configuration_id(mut self, value: Option<String>) -> Self {
424 self.instance_configuration_id = value;
425 self
426 }
427
428 pub fn set_licensing_configs(
430 mut self,
431 value: Option<Vec<LaunchInstanceLicensingConfig>>,
432 ) -> Self {
433 self.licensing_configs = value;
434 self
435 }
436
437 pub fn with_capacity_reservation_id(mut self, value: impl Into<String>) -> Self {
439 self.capacity_reservation_id = Some(value.into());
440 self
441 }
442
443 pub fn with_create_vnic_details(mut self, value: CreateVnicDetails) -> Self {
445 self.create_vnic_details = Some(value);
446 self
447 }
448
449 pub fn with_dedicated_vm_host_id(mut self, value: impl Into<String>) -> Self {
451 self.dedicated_vm_host_id = Some(value.into());
452 self
453 }
454
455 pub fn with_defined_tags(
457 mut self,
458 value: HashMap<String, HashMap<String, serde_json::Value>>,
459 ) -> Self {
460 self.defined_tags = Some(value);
461 self
462 }
463
464 pub fn with_security_attributes(
466 mut self,
467 value: HashMap<String, HashMap<String, serde_json::Value>>,
468 ) -> Self {
469 self.security_attributes = Some(value);
470 self
471 }
472
473 pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
475 self.display_name = Some(value.into());
476 self
477 }
478
479 pub fn with_extended_metadata(mut self, value: HashMap<String, serde_json::Value>) -> Self {
481 self.extended_metadata = Some(value);
482 self
483 }
484
485 pub fn with_fault_domain(mut self, value: impl Into<String>) -> Self {
487 self.fault_domain = Some(value.into());
488 self
489 }
490
491 pub fn with_cluster_placement_group_id(mut self, value: impl Into<String>) -> Self {
493 self.cluster_placement_group_id = Some(value.into());
494 self
495 }
496
497 pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
499 self.freeform_tags = Some(value);
500 self
501 }
502
503 pub fn with_compute_cluster_id(mut self, value: impl Into<String>) -> Self {
505 self.compute_cluster_id = Some(value.into());
506 self
507 }
508
509 pub fn with_hostname_label(mut self, value: impl Into<String>) -> Self {
511 self.hostname_label = Some(value.into());
512 self
513 }
514
515 pub fn with_image_id(mut self, value: impl Into<String>) -> Self {
517 self.image_id = Some(value.into());
518 self
519 }
520
521 pub fn with_ipxe_script(mut self, value: impl Into<String>) -> Self {
523 self.ipxe_script = Some(value.into());
524 self
525 }
526
527 pub fn with_launch_options(mut self, value: LaunchOptions) -> Self {
529 self.launch_options = Some(value);
530 self
531 }
532
533 pub fn with_instance_options(mut self, value: InstanceOptions) -> Self {
535 self.instance_options = Some(value);
536 self
537 }
538
539 pub fn with_availability_config(
541 mut self,
542 value: LaunchInstanceAvailabilityConfigDetails,
543 ) -> Self {
544 self.availability_config = Some(value);
545 self
546 }
547
548 pub fn with_preemptible_instance_config(
550 mut self,
551 value: PreemptibleInstanceConfigDetails,
552 ) -> Self {
553 self.preemptible_instance_config = Some(value);
554 self
555 }
556
557 pub fn with_metadata(mut self, value: HashMap<String, String>) -> Self {
559 self.metadata = Some(value);
560 self
561 }
562
563 pub fn with_agent_config(mut self, value: LaunchInstanceAgentConfigDetails) -> Self {
565 self.agent_config = Some(value);
566 self
567 }
568
569 pub fn with_shape(mut self, value: impl Into<String>) -> Self {
571 self.shape = Some(value.into());
572 self
573 }
574
575 pub fn with_shape_config(mut self, value: LaunchInstanceShapeConfigDetails) -> Self {
577 self.shape_config = Some(value);
578 self
579 }
580
581 pub fn with_source_details(mut self, value: InstanceSourceViaImageDetails) -> Self {
583 self.source_details = Some(value);
584 self
585 }
586
587 pub fn with_subnet_id(mut self, value: impl Into<String>) -> Self {
589 self.subnet_id = Some(value.into());
590 self
591 }
592
593 pub fn with_launch_volume_attachments(mut self, value: Vec<LaunchAttachVolumeDetails>) -> Self {
595 self.launch_volume_attachments = Some(value);
596 self
597 }
598
599 pub fn with_is_pv_encryption_in_transit_enabled(mut self, value: bool) -> Self {
601 self.is_pv_encryption_in_transit_enabled = Some(value);
602 self
603 }
604
605 pub fn with_platform_config(mut self, value: AmdRomeBmGpuLaunchInstancePlatformConfig) -> Self {
607 self.platform_config = Some(value);
608 self
609 }
610
611 pub fn with_placement_constraint_details(
613 mut self,
614 value: HostGroupPlacementConstraintDetails,
615 ) -> Self {
616 self.placement_constraint_details = Some(value);
617 self
618 }
619
620 pub fn with_is_aienterprise_enabled(mut self, value: bool) -> Self {
622 self.is_aienterprise_enabled = Some(value);
623 self
624 }
625
626 pub fn with_instance_configuration_id(mut self, value: impl Into<String>) -> Self {
628 self.instance_configuration_id = Some(value.into());
629 self
630 }
631
632 pub fn with_licensing_configs(mut self, value: Vec<LaunchInstanceLicensingConfig>) -> Self {
634 self.licensing_configs = Some(value);
635 self
636 }
637}