aws_sdk_cloudtrail/operation/create_dashboard/
_create_dashboard_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDashboardOutput {
6 pub dashboard_arn: ::std::option::Option<::std::string::String>,
8 pub name: ::std::option::Option<::std::string::String>,
10 pub r#type: ::std::option::Option<crate::types::DashboardType>,
12 pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
14 pub tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16 pub refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
18 pub termination_protection_enabled: ::std::option::Option<bool>,
20 _request_id: Option<String>,
21}
22impl CreateDashboardOutput {
23 pub fn dashboard_arn(&self) -> ::std::option::Option<&str> {
25 self.dashboard_arn.as_deref()
26 }
27 pub fn name(&self) -> ::std::option::Option<&str> {
29 self.name.as_deref()
30 }
31 pub fn r#type(&self) -> ::std::option::Option<&crate::types::DashboardType> {
33 self.r#type.as_ref()
34 }
35 pub fn widgets(&self) -> &[crate::types::Widget] {
39 self.widgets.as_deref().unwrap_or_default()
40 }
41 pub fn tags_list(&self) -> &[crate::types::Tag] {
45 self.tags_list.as_deref().unwrap_or_default()
46 }
47 pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
49 self.refresh_schedule.as_ref()
50 }
51 pub fn termination_protection_enabled(&self) -> ::std::option::Option<bool> {
53 self.termination_protection_enabled
54 }
55}
56impl ::aws_types::request_id::RequestId for CreateDashboardOutput {
57 fn request_id(&self) -> Option<&str> {
58 self._request_id.as_deref()
59 }
60}
61impl CreateDashboardOutput {
62 pub fn builder() -> crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder {
64 crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder::default()
65 }
66}
67
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct CreateDashboardOutputBuilder {
72 pub(crate) dashboard_arn: ::std::option::Option<::std::string::String>,
73 pub(crate) name: ::std::option::Option<::std::string::String>,
74 pub(crate) r#type: ::std::option::Option<crate::types::DashboardType>,
75 pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
76 pub(crate) tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
77 pub(crate) refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
78 pub(crate) termination_protection_enabled: ::std::option::Option<bool>,
79 _request_id: Option<String>,
80}
81impl CreateDashboardOutputBuilder {
82 pub fn dashboard_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.dashboard_arn = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_dashboard_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.dashboard_arn = input;
90 self
91 }
92 pub fn get_dashboard_arn(&self) -> &::std::option::Option<::std::string::String> {
94 &self.dashboard_arn
95 }
96 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.name = ::std::option::Option::Some(input.into());
99 self
100 }
101 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.name = input;
104 self
105 }
106 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
108 &self.name
109 }
110 pub fn r#type(mut self, input: crate::types::DashboardType) -> Self {
112 self.r#type = ::std::option::Option::Some(input);
113 self
114 }
115 pub fn set_type(mut self, input: ::std::option::Option<crate::types::DashboardType>) -> Self {
117 self.r#type = input;
118 self
119 }
120 pub fn get_type(&self) -> &::std::option::Option<crate::types::DashboardType> {
122 &self.r#type
123 }
124 pub fn widgets(mut self, input: crate::types::Widget) -> Self {
130 let mut v = self.widgets.unwrap_or_default();
131 v.push(input);
132 self.widgets = ::std::option::Option::Some(v);
133 self
134 }
135 pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>) -> Self {
137 self.widgets = input;
138 self
139 }
140 pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
142 &self.widgets
143 }
144 pub fn tags_list(mut self, input: crate::types::Tag) -> Self {
150 let mut v = self.tags_list.unwrap_or_default();
151 v.push(input);
152 self.tags_list = ::std::option::Option::Some(v);
153 self
154 }
155 pub fn set_tags_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
157 self.tags_list = input;
158 self
159 }
160 pub fn get_tags_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
162 &self.tags_list
163 }
164 pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
166 self.refresh_schedule = ::std::option::Option::Some(input);
167 self
168 }
169 pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
171 self.refresh_schedule = input;
172 self
173 }
174 pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
176 &self.refresh_schedule
177 }
178 pub fn termination_protection_enabled(mut self, input: bool) -> Self {
180 self.termination_protection_enabled = ::std::option::Option::Some(input);
181 self
182 }
183 pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
185 self.termination_protection_enabled = input;
186 self
187 }
188 pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
190 &self.termination_protection_enabled
191 }
192 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
193 self._request_id = Some(request_id.into());
194 self
195 }
196
197 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
198 self._request_id = request_id;
199 self
200 }
201 pub fn build(self) -> crate::operation::create_dashboard::CreateDashboardOutput {
203 crate::operation::create_dashboard::CreateDashboardOutput {
204 dashboard_arn: self.dashboard_arn,
205 name: self.name,
206 r#type: self.r#type,
207 widgets: self.widgets,
208 tags_list: self.tags_list,
209 refresh_schedule: self.refresh_schedule,
210 termination_protection_enabled: self.termination_protection_enabled,
211 _request_id: self._request_id,
212 }
213 }
214}