aws_sdk_bcmdashboards/operation/update_dashboard/
_update_dashboard_input.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 UpdateDashboardInput {
6    /// <p>The ARN of the dashboard to update.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The new name for the dashboard. If not specified, the existing name is retained.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The new description for the dashboard. If not specified, the existing description is retained.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The updated array of widget configurations for the dashboard. Replaces all existing widgets.</p>
13    pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
14}
15impl UpdateDashboardInput {
16    /// <p>The ARN of the dashboard to update.</p>
17    pub fn arn(&self) -> ::std::option::Option<&str> {
18        self.arn.as_deref()
19    }
20    /// <p>The new name for the dashboard. If not specified, the existing name is retained.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>The new description for the dashboard. If not specified, the existing description is retained.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>The updated array of widget configurations for the dashboard. Replaces all existing widgets.</p>
29    ///
30    /// 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()`.
31    pub fn widgets(&self) -> &[crate::types::Widget] {
32        self.widgets.as_deref().unwrap_or_default()
33    }
34}
35impl UpdateDashboardInput {
36    /// Creates a new builder-style object to manufacture [`UpdateDashboardInput`](crate::operation::update_dashboard::UpdateDashboardInput).
37    pub fn builder() -> crate::operation::update_dashboard::builders::UpdateDashboardInputBuilder {
38        crate::operation::update_dashboard::builders::UpdateDashboardInputBuilder::default()
39    }
40}
41
42/// A builder for [`UpdateDashboardInput`](crate::operation::update_dashboard::UpdateDashboardInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateDashboardInputBuilder {
46    pub(crate) arn: ::std::option::Option<::std::string::String>,
47    pub(crate) name: ::std::option::Option<::std::string::String>,
48    pub(crate) description: ::std::option::Option<::std::string::String>,
49    pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
50}
51impl UpdateDashboardInputBuilder {
52    /// <p>The ARN of the dashboard to update.</p>
53    /// This field is required.
54    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.arn = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ARN of the dashboard to update.</p>
59    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.arn = input;
61        self
62    }
63    /// <p>The ARN of the dashboard to update.</p>
64    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
65        &self.arn
66    }
67    /// <p>The new name for the dashboard. If not specified, the existing name is retained.</p>
68    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The new name for the dashboard. If not specified, the existing name is retained.</p>
73    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.name = input;
75        self
76    }
77    /// <p>The new name for the dashboard. If not specified, the existing name is retained.</p>
78    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.name
80    }
81    /// <p>The new description for the dashboard. If not specified, the existing description is retained.</p>
82    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.description = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The new description for the dashboard. If not specified, the existing description is retained.</p>
87    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.description = input;
89        self
90    }
91    /// <p>The new description for the dashboard. If not specified, the existing description is retained.</p>
92    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
93        &self.description
94    }
95    /// Appends an item to `widgets`.
96    ///
97    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
98    ///
99    /// <p>The updated array of widget configurations for the dashboard. Replaces all existing widgets.</p>
100    pub fn widgets(mut self, input: crate::types::Widget) -> Self {
101        let mut v = self.widgets.unwrap_or_default();
102        v.push(input);
103        self.widgets = ::std::option::Option::Some(v);
104        self
105    }
106    /// <p>The updated array of widget configurations for the dashboard. Replaces all existing widgets.</p>
107    pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>) -> Self {
108        self.widgets = input;
109        self
110    }
111    /// <p>The updated array of widget configurations for the dashboard. Replaces all existing widgets.</p>
112    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
113        &self.widgets
114    }
115    /// Consumes the builder and constructs a [`UpdateDashboardInput`](crate::operation::update_dashboard::UpdateDashboardInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::update_dashboard::UpdateDashboardInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::update_dashboard::UpdateDashboardInput {
120            arn: self.arn,
121            name: self.name,
122            description: self.description,
123            widgets: self.widgets,
124        })
125    }
126}