oci_rust_sdk/core/models/
instance_configuration_summary.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 InstanceConfigurationSummary {
11 pub compartment_id: String,
13
14 pub id: String,
16
17 pub time_created: DateTime<Utc>,
19
20 #[serde(skip_serializing_if = "Option::is_none")]
22 pub display_name: Option<String>,
23
24 #[serde(skip_serializing_if = "Option::is_none")]
26 pub defined_tags: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
27
28 #[serde(skip_serializing_if = "Option::is_none")]
30 pub freeform_tags: Option<HashMap<String, String>>,
31}
32
33pub struct InstanceConfigurationSummaryRequired {
35 pub compartment_id: String,
37
38 pub id: String,
40
41 pub time_created: DateTime<Utc>,
43}
44
45impl InstanceConfigurationSummary {
46 pub fn new(required: InstanceConfigurationSummaryRequired) -> Self {
48 Self {
49 compartment_id: required.compartment_id,
50
51 id: required.id,
52
53 time_created: required.time_created,
54
55 display_name: None,
56
57 defined_tags: None,
58
59 freeform_tags: None,
60 }
61 }
62
63 pub fn set_compartment_id(mut self, value: String) -> Self {
65 self.compartment_id = value;
66 self
67 }
68
69 pub fn set_display_name(mut self, value: Option<String>) -> Self {
71 self.display_name = value;
72 self
73 }
74
75 pub fn set_id(mut self, value: String) -> Self {
77 self.id = value;
78 self
79 }
80
81 pub fn set_time_created(mut self, value: DateTime<Utc>) -> Self {
83 self.time_created = value;
84 self
85 }
86
87 pub fn set_defined_tags(
89 mut self,
90 value: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
91 ) -> Self {
92 self.defined_tags = value;
93 self
94 }
95
96 pub fn set_freeform_tags(mut self, value: Option<HashMap<String, String>>) -> Self {
98 self.freeform_tags = value;
99 self
100 }
101
102 pub fn with_display_name(mut self, value: impl Into<String>) -> Self {
104 self.display_name = Some(value.into());
105 self
106 }
107
108 pub fn with_defined_tags(
110 mut self,
111 value: HashMap<String, HashMap<String, serde_json::Value>>,
112 ) -> Self {
113 self.defined_tags = Some(value);
114 self
115 }
116
117 pub fn with_freeform_tags(mut self, value: HashMap<String, String>) -> Self {
119 self.freeform_tags = Some(value);
120 self
121 }
122}