oci_rust_sdk/core/models/
virtual_circuit.rs1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[allow(unused_imports)]
6use super::*;
7#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct VirtualCircuit {
11 #[serde(skip_serializing_if = "Option::is_none")]
13 pub bandwidth_shape_name: Option<String>,
14
15 #[serde(skip_serializing_if = "Option::is_none")]
17 pub bgp_management: Option<VirtualCircuitBgpManagement>,
18
19 #[serde(skip_serializing_if = "Option::is_none")]
21 pub bgp_session_state: Option<VirtualCircuitBgpSessionState>,
22
23 #[serde(skip_serializing_if = "Option::is_none")]
25 pub bgp_ipv6_session_state: Option<VirtualCircuitBgpIpv6SessionState>,
26
27 #[serde(skip_serializing_if = "Option::is_none")]
29 pub compartment_id: Option<String>,
30
31 #[serde(skip_serializing_if = "Option::is_none")]
33 pub cross_connect_mappings: Option<Vec<CrossConnectMapping>>,
34
35 #[serde(skip_serializing_if = "Option::is_none")]
37 pub routing_policy: Option<Vec<VirtualCircuitRoutingPolicy>>,
38
39 #[serde(skip_serializing_if = "Option::is_none")]
41 pub bgp_admin_state: Option<VirtualCircuitBgpAdminState>,
42
43 #[serde(skip_serializing_if = "Option::is_none")]
45 pub is_bfd_enabled: Option<bool>,
46
47 #[serde(skip_serializing_if = "Option::is_none")]
49 pub is_transport_mode: Option<bool>,
50
51 #[serde(skip_serializing_if = "Option::is_none")]
53 pub customer_bgp_asn: Option<i64>,
54
55 #[serde(skip_serializing_if = "Option::is_none")]
57 pub customer_asn: Option<i64>,
58
59 #[serde(skip_serializing_if = "Option::is_none")]
61 pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
62
63 #[serde(skip_serializing_if = "Option::is_none")]
65 pub display_name: Option<String>,
66
67 #[serde(skip_serializing_if = "Option::is_none")]
69 pub freeform_tags: Option<HashMap<String, String>>,
70
71 #[serde(skip_serializing_if = "Option::is_none")]
73 pub gateway_id: Option<String>,
74
75 #[serde(skip_serializing_if = "Option::is_none")]
77 pub id: Option<String>,
78
79 #[serde(skip_serializing_if = "Option::is_none")]
81 pub lifecycle_state: Option<VirtualCircuitLifecycleState>,
82
83 #[serde(skip_serializing_if = "Option::is_none")]
85 pub oracle_bgp_asn: Option<i64>,
86
87 #[serde(skip_serializing_if = "Option::is_none")]
89 pub provider_name: Option<String>,
90
91 #[serde(skip_serializing_if = "Option::is_none")]
93 pub provider_service_id: Option<String>,
94
95 #[serde(skip_serializing_if = "Option::is_none")]
97 pub provider_service_key_name: Option<String>,
98
99 #[serde(skip_serializing_if = "Option::is_none")]
101 pub provider_service_name: Option<String>,
102
103 #[serde(skip_serializing_if = "Option::is_none")]
105 pub provider_state: Option<VirtualCircuitProviderState>,
106
107 #[serde(skip_serializing_if = "Option::is_none")]
109 pub public_prefixes: Option<Vec<String>>,
110
111 #[serde(skip_serializing_if = "Option::is_none")]
113 pub reference_comment: Option<String>,
114
115 #[serde(skip_serializing_if = "Option::is_none")]
117 pub region: Option<String>,
118
119 #[serde(skip_serializing_if = "Option::is_none")]
121 pub service_type: Option<VirtualCircuitServiceType>,
122
123 #[serde(skip_serializing_if = "Option::is_none")]
125 pub time_created: Option<DateTime<Utc>>,
126
127 #[serde(rename = "type")]
129 #[serde(skip_serializing_if = "Option::is_none")]
130 pub r#type: Option<VirtualCircuitType>,
131
132 #[serde(skip_serializing_if = "Option::is_none")]
134 pub ip_mtu: Option<VirtualCircuitIpMtu>,
135
136 #[serde(skip_serializing_if = "Option::is_none")]
137 pub virtual_circuit_redundancy_metadata: Option<VirtualCircuitRedundancyMetadata>,
138}
139
140impl VirtualCircuit {
141 pub fn new() -> Self {
143 Self {
144 bandwidth_shape_name: None,
145
146 bgp_management: None,
147
148 bgp_session_state: None,
149
150 bgp_ipv6_session_state: None,
151
152 compartment_id: None,
153
154 cross_connect_mappings: None,
155
156 routing_policy: None,
157
158 bgp_admin_state: None,
159
160 is_bfd_enabled: None,
161
162 is_transport_mode: None,
163
164 customer_bgp_asn: None,
165
166 customer_asn: None,
167
168 defined_tags: None,
169
170 display_name: None,
171
172 freeform_tags: None,
173
174 gateway_id: None,
175
176 id: None,
177
178 lifecycle_state: None,
179
180 oracle_bgp_asn: None,
181
182 provider_name: None,
183
184 provider_service_id: None,
185
186 provider_service_key_name: None,
187
188 provider_service_name: None,
189
190 provider_state: None,
191
192 public_prefixes: None,
193
194 reference_comment: None,
195
196 region: None,
197
198 service_type: None,
199
200 time_created: None,
201
202 r#type: None,
203
204 ip_mtu: None,
205
206 virtual_circuit_redundancy_metadata: None,
207 }
208 }
209
210 pub fn set_bandwidth_shape_name(mut self, value: Option<String>) -> Self {
212 self.bandwidth_shape_name = value;
213 self
214 }
215
216 pub fn set_bgp_management(mut self, value: Option<VirtualCircuitBgpManagement>) -> Self {
218 self.bgp_management = value;
219 self
220 }
221
222 pub fn set_bgp_session_state(mut self, value: Option<VirtualCircuitBgpSessionState>) -> Self {
224 self.bgp_session_state = value;
225 self
226 }
227
228 pub fn set_bgp_ipv6_session_state(
230 mut self,
231 value: Option<VirtualCircuitBgpIpv6SessionState>,
232 ) -> Self {
233 self.bgp_ipv6_session_state = value;
234 self
235 }
236
237 pub fn set_compartment_id(mut self, value: Option<String>) -> Self {
239 self.compartment_id = value;
240 self
241 }
242
243 pub fn set_cross_connect_mappings(mut self, value: Option<Vec<CrossConnectMapping>>) -> Self {
245 self.cross_connect_mappings = value;
246 self
247 }
248
249 pub fn set_routing_policy(mut self, value: Option<Vec<VirtualCircuitRoutingPolicy>>) -> Self {
251 self.routing_policy = value;
252 self
253 }
254
255 pub fn set_bgp_admin_state(mut self, value: Option<VirtualCircuitBgpAdminState>) -> Self {
257 self.bgp_admin_state = value;
258 self
259 }
260
261 pub fn set_is_bfd_enabled(mut self, value: Option<bool>) -> Self {
263 self.is_bfd_enabled = value;
264 self
265 }
266
267 pub fn set_is_transport_mode(mut self, value: Option<bool>) -> Self {
269 self.is_transport_mode = value;
270 self
271 }
272
273 pub fn set_customer_bgp_asn(mut self, value: Option<i64>) -> Self {
275 self.customer_bgp_asn = value;
276 self
277 }
278
279 pub fn set_customer_asn(mut self, value: Option<i64>) -> Self {
281 self.customer_asn = value;
282 self
283 }
284
285 pub fn set_defined_tags(
287 mut self,
288 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
289 ) -> Self {
290 self.defined_tags = value;
291 self
292 }
293
294 pub fn set_display_name(mut self, value: Option<String>) -> Self {
296 self.display_name = value;
297 self
298 }
299
300 pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
302 self.freeform_tags = value;
303 self
304 }
305
306 pub fn set_gateway_id(mut self, value: Option<String>) -> Self {
308 self.gateway_id = value;
309 self
310 }
311
312 pub fn set_id(mut self, value: Option<String>) -> Self {
314 self.id = value;
315 self
316 }
317
318 pub fn set_lifecycle_state(mut self, value: Option<VirtualCircuitLifecycleState>) -> Self {
320 self.lifecycle_state = value;
321 self
322 }
323
324 pub fn set_oracle_bgp_asn(mut self, value: Option<i64>) -> Self {
326 self.oracle_bgp_asn = value;
327 self
328 }
329
330 pub fn set_provider_name(mut self, value: Option<String>) -> Self {
332 self.provider_name = value;
333 self
334 }
335
336 pub fn set_provider_service_id(mut self, value: Option<String>) -> Self {
338 self.provider_service_id = value;
339 self
340 }
341
342 pub fn set_provider_service_key_name(mut self, value: Option<String>) -> Self {
344 self.provider_service_key_name = value;
345 self
346 }
347
348 pub fn set_provider_service_name(mut self, value: Option<String>) -> Self {
350 self.provider_service_name = value;
351 self
352 }
353
354 pub fn set_provider_state(mut self, value: Option<VirtualCircuitProviderState>) -> Self {
356 self.provider_state = value;
357 self
358 }
359
360 pub fn set_public_prefixes(mut self, value: Option<Vec<String>>) -> Self {
362 self.public_prefixes = value;
363 self
364 }
365
366 pub fn set_reference_comment(mut self, value: Option<String>) -> Self {
368 self.reference_comment = value;
369 self
370 }
371
372 pub fn set_region(mut self, value: Option<String>) -> Self {
374 self.region = value;
375 self
376 }
377
378 pub fn set_service_type(mut self, value: Option<VirtualCircuitServiceType>) -> Self {
380 self.service_type = value;
381 self
382 }
383
384 pub fn set_time_created(mut self, value: Option<DateTime<Utc>>) -> Self {
386 self.time_created = value;
387 self
388 }
389
390 pub fn set_type(mut self, value: Option<VirtualCircuitType>) -> Self {
392 self.r#type = value;
393 self
394 }
395
396 pub fn set_ip_mtu(mut self, value: Option<VirtualCircuitIpMtu>) -> Self {
398 self.ip_mtu = value;
399 self
400 }
401
402 pub fn set_virtual_circuit_redundancy_metadata(
404 mut self,
405 value: Option<VirtualCircuitRedundancyMetadata>,
406 ) -> Self {
407 self.virtual_circuit_redundancy_metadata = value;
408 self
409 }
410
411 pub fn with_bandwidth_shape_name(mut self, value: impl Into<String>) -> Self {
413 self.bandwidth_shape_name = Some(value.into());
414 self
415 }
416
417 pub fn with_bgp_management(mut self, value: VirtualCircuitBgpManagement) -> Self {
419 self.bgp_management = Some(value);
420 self
421 }
422
423 pub fn with_bgp_session_state(mut self, value: VirtualCircuitBgpSessionState) -> Self {
425 self.bgp_session_state = Some(value);
426 self
427 }
428
429 pub fn with_bgp_ipv6_session_state(mut self, value: VirtualCircuitBgpIpv6SessionState) -> Self {
431 self.bgp_ipv6_session_state = Some(value);
432 self
433 }
434
435 pub fn with_compartment_id(mut self, value: impl Into<String>) -> Self {
437 self.compartment_id = Some(value.into());
438 self
439 }
440
441 pub fn with_cross_connect_mappings(mut self, value: Vec<CrossConnectMapping>) -> Self {
443 self.cross_connect_mappings = Some(value);
444 self
445 }
446
447 pub fn with_routing_policy(mut self, value: Vec<VirtualCircuitRoutingPolicy>) -> Self {
449 self.routing_policy = Some(value);
450 self
451 }
452
453 pub fn with_bgp_admin_state(mut self, value: VirtualCircuitBgpAdminState) -> Self {
455 self.bgp_admin_state = Some(value);
456 self
457 }
458
459 pub fn with_is_bfd_enabled(mut self, value: bool) -> Self {
461 self.is_bfd_enabled = Some(value);
462 self
463 }
464
465 pub fn with_is_transport_mode(mut self, value: bool) -> Self {
467 self.is_transport_mode = Some(value);
468 self
469 }
470
471 pub fn with_customer_bgp_asn(mut self, value: i64) -> Self {
473 self.customer_bgp_asn = Some(value);
474 self
475 }
476
477 pub fn with_customer_asn(mut self, value: i64) -> Self {
479 self.customer_asn = Some(value);
480 self
481 }
482
483 pub fn with_defined_tags(
485 mut self,
486 value: HashMap<String, HashMap<String, serde_json::Value>>,
487 ) -> Self {
488 self.defined_tags = Some(value);
489 self
490 }
491
492 pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
494 self.display_name = Some(value.into());
495 self
496 }
497
498 pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
500 self.freeform_tags = Some(value);
501 self
502 }
503
504 pub fn with_gateway_id(mut self, value: impl Into<String>) -> Self {
506 self.gateway_id = Some(value.into());
507 self
508 }
509
510 pub fn with_id(mut self, value: impl Into<String>) -> Self {
512 self.id = Some(value.into());
513 self
514 }
515
516 pub fn with_lifecycle_state(mut self, value: VirtualCircuitLifecycleState) -> Self {
518 self.lifecycle_state = Some(value);
519 self
520 }
521
522 pub fn with_oracle_bgp_asn(mut self, value: i64) -> Self {
524 self.oracle_bgp_asn = Some(value);
525 self
526 }
527
528 pub fn with_provider_name(mut self, value: impl Into<String>) -> Self {
530 self.provider_name = Some(value.into());
531 self
532 }
533
534 pub fn with_provider_service_id(mut self, value: impl Into<String>) -> Self {
536 self.provider_service_id = Some(value.into());
537 self
538 }
539
540 pub fn with_provider_service_key_name(mut self, value: impl Into<String>) -> Self {
542 self.provider_service_key_name = Some(value.into());
543 self
544 }
545
546 pub fn with_provider_service_name(mut self, value: impl Into<String>) -> Self {
548 self.provider_service_name = Some(value.into());
549 self
550 }
551
552 pub fn with_provider_state(mut self, value: VirtualCircuitProviderState) -> Self {
554 self.provider_state = Some(value);
555 self
556 }
557
558 pub fn with_public_prefixes(mut self, value: Vec<String>) -> Self {
560 self.public_prefixes = Some(value);
561 self
562 }
563
564 pub fn with_reference_comment(mut self, value: impl Into<String>) -> Self {
566 self.reference_comment = Some(value.into());
567 self
568 }
569
570 pub fn with_region(mut self, value: impl Into<String>) -> Self {
572 self.region = Some(value.into());
573 self
574 }
575
576 pub fn with_service_type(mut self, value: VirtualCircuitServiceType) -> Self {
578 self.service_type = Some(value);
579 self
580 }
581
582 pub fn with_time_created(mut self, value: DateTime<Utc>) -> Self {
584 self.time_created = Some(value);
585 self
586 }
587
588 pub fn with_type(mut self, value: VirtualCircuitType) -> Self {
590 self.r#type = Some(value);
591 self
592 }
593
594 pub fn with_ip_mtu(mut self, value: VirtualCircuitIpMtu) -> Self {
596 self.ip_mtu = Some(value);
597 self
598 }
599
600 pub fn with_virtual_circuit_redundancy_metadata(
602 mut self,
603 value: VirtualCircuitRedundancyMetadata,
604 ) -> Self {
605 self.virtual_circuit_redundancy_metadata = Some(value);
606 self
607 }
608}
609
610impl Default for VirtualCircuit {
611 fn default() -> Self {
612 Self::new()
613 }
614}