Skip to main content

oci_rust_sdk/core/models/
instance_options.rs

1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5/// Optional mutable instance options
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct InstanceOptions {
9    /// Whether to disable the legacy (/v1) instance metadata service endpoints. Customers who have migrated to /v2 should set this to true for added security. Default is false.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub are_legacy_imds_endpoints_disabled: Option<bool>,
12}
13
14impl InstanceOptions {
15    /// Create a new InstanceOptions
16    pub fn new() -> Self {
17        Self {
18            are_legacy_imds_endpoints_disabled: None,
19        }
20    }
21
22    /// Set are_legacy_imds_endpoints_disabled
23    pub fn set_are_legacy_imds_endpoints_disabled(mut self, value: Option<bool>) -> Self {
24        self.are_legacy_imds_endpoints_disabled = value;
25        self
26    }
27
28    /// Set are_legacy_imds_endpoints_disabled (unwraps Option)
29    pub fn with_are_legacy_imds_endpoints_disabled(mut self, value: bool) -> Self {
30        self.are_legacy_imds_endpoints_disabled = Some(value);
31        self
32    }
33}
34
35impl Default for InstanceOptions {
36    fn default() -> Self {
37        Self::new()
38    }
39}