aws_sdk_cloudtrail/operation/create_dashboard/
_create_dashboard_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDashboardOutput {
6    /// <p>The ARN for the dashboard.</p>
7    pub dashboard_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the dashboard.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The dashboard type.</p>
11    pub r#type: ::std::option::Option<crate::types::DashboardType>,
12    /// <p>An array of widgets for the dashboard.</p>
13    pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
14    /// <p>A list of tags.</p>
15    pub tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16    /// <p>The refresh schedule for the dashboard, if configured.</p>
17    pub refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
18    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
19    pub termination_protection_enabled: ::std::option::Option<bool>,
20    _request_id: Option<String>,
21}
22impl CreateDashboardOutput {
23    /// <p>The ARN for the dashboard.</p>
24    pub fn dashboard_arn(&self) -> ::std::option::Option<&str> {
25        self.dashboard_arn.as_deref()
26    }
27    /// <p>The name of the dashboard.</p>
28    pub fn name(&self) -> ::std::option::Option<&str> {
29        self.name.as_deref()
30    }
31    /// <p>The dashboard type.</p>
32    pub fn r#type(&self) -> ::std::option::Option<&crate::types::DashboardType> {
33        self.r#type.as_ref()
34    }
35    /// <p>An array of widgets for the dashboard.</p>
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.widgets.is_none()`.
38    pub fn widgets(&self) -> &[crate::types::Widget] {
39        self.widgets.as_deref().unwrap_or_default()
40    }
41    /// <p>A list of tags.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags_list.is_none()`.
44    pub fn tags_list(&self) -> &[crate::types::Tag] {
45        self.tags_list.as_deref().unwrap_or_default()
46    }
47    /// <p>The refresh schedule for the dashboard, if configured.</p>
48    pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
49        self.refresh_schedule.as_ref()
50    }
51    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
52    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    /// Creates a new builder-style object to manufacture [`CreateDashboardOutput`](crate::operation::create_dashboard::CreateDashboardOutput).
63    pub fn builder() -> crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder {
64        crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder::default()
65    }
66}
67
68/// A builder for [`CreateDashboardOutput`](crate::operation::create_dashboard::CreateDashboardOutput).
69#[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    /// <p>The ARN for the dashboard.</p>
83    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    /// <p>The ARN for the dashboard.</p>
88    pub fn set_dashboard_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.dashboard_arn = input;
90        self
91    }
92    /// <p>The ARN for the dashboard.</p>
93    pub fn get_dashboard_arn(&self) -> &::std::option::Option<::std::string::String> {
94        &self.dashboard_arn
95    }
96    /// <p>The name of the dashboard.</p>
97    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    /// <p>The name of the dashboard.</p>
102    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.name = input;
104        self
105    }
106    /// <p>The name of the dashboard.</p>
107    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
108        &self.name
109    }
110    /// <p>The dashboard type.</p>
111    pub fn r#type(mut self, input: crate::types::DashboardType) -> Self {
112        self.r#type = ::std::option::Option::Some(input);
113        self
114    }
115    /// <p>The dashboard type.</p>
116    pub fn set_type(mut self, input: ::std::option::Option<crate::types::DashboardType>) -> Self {
117        self.r#type = input;
118        self
119    }
120    /// <p>The dashboard type.</p>
121    pub fn get_type(&self) -> &::std::option::Option<crate::types::DashboardType> {
122        &self.r#type
123    }
124    /// Appends an item to `widgets`.
125    ///
126    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
127    ///
128    /// <p>An array of widgets for the dashboard.</p>
129    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    /// <p>An array of widgets for the dashboard.</p>
136    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    /// <p>An array of widgets for the dashboard.</p>
141    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
142        &self.widgets
143    }
144    /// Appends an item to `tags_list`.
145    ///
146    /// To override the contents of this collection use [`set_tags_list`](Self::set_tags_list).
147    ///
148    /// <p>A list of tags.</p>
149    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    /// <p>A list of tags.</p>
156    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    /// <p>A list of tags.</p>
161    pub fn get_tags_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
162        &self.tags_list
163    }
164    /// <p>The refresh schedule for the dashboard, if configured.</p>
165    pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
166        self.refresh_schedule = ::std::option::Option::Some(input);
167        self
168    }
169    /// <p>The refresh schedule for the dashboard, if configured.</p>
170    pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
171        self.refresh_schedule = input;
172        self
173    }
174    /// <p>The refresh schedule for the dashboard, if configured.</p>
175    pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
176        &self.refresh_schedule
177    }
178    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
179    pub fn termination_protection_enabled(mut self, input: bool) -> Self {
180        self.termination_protection_enabled = ::std::option::Option::Some(input);
181        self
182    }
183    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
184    pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
185        self.termination_protection_enabled = input;
186        self
187    }
188    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
189    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    /// Consumes the builder and constructs a [`CreateDashboardOutput`](crate::operation::create_dashboard::CreateDashboardOutput).
202    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}