oci_rust_sdk/core/models/
instance_console_connection.rs1use 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 InstanceConsoleConnection {
10 #[serde(skip_serializing_if = "Option::is_none")]
12 pub compartment_id: Option<String>,
13
14 #[serde(skip_serializing_if = "Option::is_none")]
16 pub connection_string: Option<String>,
17
18 #[serde(skip_serializing_if = "Option::is_none")]
20 pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
21
22 #[serde(skip_serializing_if = "Option::is_none")]
24 pub fingerprint: Option<String>,
25
26 #[serde(skip_serializing_if = "Option::is_none")]
28 pub freeform_tags: Option<HashMap<String, String>>,
29
30 #[serde(skip_serializing_if = "Option::is_none")]
32 pub id: Option<String>,
33
34 #[serde(skip_serializing_if = "Option::is_none")]
36 pub instance_id: Option<String>,
37
38 #[serde(skip_serializing_if = "Option::is_none")]
40 pub lifecycle_state: Option<InstanceConsoleConnectionLifecycleState>,
41
42 #[serde(skip_serializing_if = "Option::is_none")]
44 pub service_host_key_fingerprint: Option<String>,
45
46 #[serde(skip_serializing_if = "Option::is_none")]
48 pub vnc_connection_string: Option<String>,
49}
50
51impl InstanceConsoleConnection {
52 pub fn new() -> Self {
54 Self {
55 compartment_id: None,
56
57 connection_string: None,
58
59 defined_tags: None,
60
61 fingerprint: None,
62
63 freeform_tags: None,
64
65 id: None,
66
67 instance_id: None,
68
69 lifecycle_state: None,
70
71 service_host_key_fingerprint: None,
72
73 vnc_connection_string: None,
74 }
75 }
76
77 pub fn set_compartment_id(mut self, value: Option<String>) -> Self {
79 self.compartment_id = value;
80 self
81 }
82
83 pub fn set_connection_string(mut self, value: Option<String>) -> Self {
85 self.connection_string = value;
86 self
87 }
88
89 pub fn set_defined_tags(
91 mut self,
92 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
93 ) -> Self {
94 self.defined_tags = value;
95 self
96 }
97
98 pub fn set_fingerprint(mut self, value: Option<String>) -> Self {
100 self.fingerprint = value;
101 self
102 }
103
104 pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
106 self.freeform_tags = value;
107 self
108 }
109
110 pub fn set_id(mut self, value: Option<String>) -> Self {
112 self.id = value;
113 self
114 }
115
116 pub fn set_instance_id(mut self, value: Option<String>) -> Self {
118 self.instance_id = value;
119 self
120 }
121
122 pub fn set_lifecycle_state(
124 mut self,
125 value: Option<InstanceConsoleConnectionLifecycleState>,
126 ) -> Self {
127 self.lifecycle_state = value;
128 self
129 }
130
131 pub fn set_service_host_key_fingerprint(mut self, value: Option<String>) -> Self {
133 self.service_host_key_fingerprint = value;
134 self
135 }
136
137 pub fn set_vnc_connection_string(mut self, value: Option<String>) -> Self {
139 self.vnc_connection_string = value;
140 self
141 }
142
143 pub fn with_compartment_id(mut self, value: impl Into<String>) -> Self {
145 self.compartment_id = Some(value.into());
146 self
147 }
148
149 pub fn with_connection_string(mut self, value: impl Into<String>) -> Self {
151 self.connection_string = Some(value.into());
152 self
153 }
154
155 pub fn with_defined_tags(
157 mut self,
158 value: HashMap<String, HashMap<String, serde_json::Value>>,
159 ) -> Self {
160 self.defined_tags = Some(value);
161 self
162 }
163
164 pub fn with_fingerprint(mut self, value: impl Into<String>) -> Self {
166 self.fingerprint = Some(value.into());
167 self
168 }
169
170 pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
172 self.freeform_tags = Some(value);
173 self
174 }
175
176 pub fn with_id(mut self, value: impl Into<String>) -> Self {
178 self.id = Some(value.into());
179 self
180 }
181
182 pub fn with_instance_id(mut self, value: impl Into<String>) -> Self {
184 self.instance_id = Some(value.into());
185 self
186 }
187
188 pub fn with_lifecycle_state(mut self, value: InstanceConsoleConnectionLifecycleState) -> Self {
190 self.lifecycle_state = Some(value);
191 self
192 }
193
194 pub fn with_service_host_key_fingerprint(mut self, value: impl Into<String>) -> Self {
196 self.service_host_key_fingerprint = Some(value.into());
197 self
198 }
199
200 pub fn with_vnc_connection_string(mut self, value: impl Into<String>) -> Self {
202 self.vnc_connection_string = Some(value.into());
203 self
204 }
205}
206
207impl Default for InstanceConsoleConnection {
208 fn default() -> Self {
209 Self::new()
210 }
211}