aws_sdk_bcmdashboards/operation/create_dashboard/
_create_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 CreateDashboardInput {
6    /// <p>The name of the dashboard. The name must be unique within your account.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the dashboard's purpose or contents.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>An array of widget configurations that define the visualizations to be displayed in the dashboard. Each dashboard can contain up to 20 widgets.</p>
11    pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
12    /// <p>The tags to apply to the dashboard resource for organization and management.</p>
13    pub resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
14}
15impl CreateDashboardInput {
16    /// <p>The name of the dashboard. The name must be unique within your account.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>A description of the dashboard's purpose or contents.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>An array of widget configurations that define the visualizations to be displayed in the dashboard. Each dashboard can contain up to 20 widgets.</p>
25    ///
26    /// 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()`.
27    pub fn widgets(&self) -> &[crate::types::Widget] {
28        self.widgets.as_deref().unwrap_or_default()
29    }
30    /// <p>The tags to apply to the dashboard resource for organization and management.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_tags.is_none()`.
33    pub fn resource_tags(&self) -> &[crate::types::ResourceTag] {
34        self.resource_tags.as_deref().unwrap_or_default()
35    }
36}
37impl CreateDashboardInput {
38    /// Creates a new builder-style object to manufacture [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
39    pub fn builder() -> crate::operation::create_dashboard::builders::CreateDashboardInputBuilder {
40        crate::operation::create_dashboard::builders::CreateDashboardInputBuilder::default()
41    }
42}
43
44/// A builder for [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct CreateDashboardInputBuilder {
48    pub(crate) name: ::std::option::Option<::std::string::String>,
49    pub(crate) description: ::std::option::Option<::std::string::String>,
50    pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
51    pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
52}
53impl CreateDashboardInputBuilder {
54    /// <p>The name of the dashboard. The name must be unique within your account.</p>
55    /// This field is required.
56    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.name = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>The name of the dashboard. The name must be unique within your account.</p>
61    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.name = input;
63        self
64    }
65    /// <p>The name of the dashboard. The name must be unique within your account.</p>
66    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
67        &self.name
68    }
69    /// <p>A description of the dashboard's purpose or contents.</p>
70    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.description = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>A description of the dashboard's purpose or contents.</p>
75    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.description = input;
77        self
78    }
79    /// <p>A description of the dashboard's purpose or contents.</p>
80    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
81        &self.description
82    }
83    /// Appends an item to `widgets`.
84    ///
85    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
86    ///
87    /// <p>An array of widget configurations that define the visualizations to be displayed in the dashboard. Each dashboard can contain up to 20 widgets.</p>
88    pub fn widgets(mut self, input: crate::types::Widget) -> Self {
89        let mut v = self.widgets.unwrap_or_default();
90        v.push(input);
91        self.widgets = ::std::option::Option::Some(v);
92        self
93    }
94    /// <p>An array of widget configurations that define the visualizations to be displayed in the dashboard. Each dashboard can contain up to 20 widgets.</p>
95    pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>) -> Self {
96        self.widgets = input;
97        self
98    }
99    /// <p>An array of widget configurations that define the visualizations to be displayed in the dashboard. Each dashboard can contain up to 20 widgets.</p>
100    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
101        &self.widgets
102    }
103    /// Appends an item to `resource_tags`.
104    ///
105    /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
106    ///
107    /// <p>The tags to apply to the dashboard resource for organization and management.</p>
108    pub fn resource_tags(mut self, input: crate::types::ResourceTag) -> Self {
109        let mut v = self.resource_tags.unwrap_or_default();
110        v.push(input);
111        self.resource_tags = ::std::option::Option::Some(v);
112        self
113    }
114    /// <p>The tags to apply to the dashboard resource for organization and management.</p>
115    pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>) -> Self {
116        self.resource_tags = input;
117        self
118    }
119    /// <p>The tags to apply to the dashboard resource for organization and management.</p>
120    pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>> {
121        &self.resource_tags
122    }
123    /// Consumes the builder and constructs a [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
124    pub fn build(
125        self,
126    ) -> ::std::result::Result<crate::operation::create_dashboard::CreateDashboardInput, ::aws_smithy_types::error::operation::BuildError> {
127        ::std::result::Result::Ok(crate::operation::create_dashboard::CreateDashboardInput {
128            name: self.name,
129            description: self.description,
130            widgets: self.widgets,
131            resource_tags: self.resource_tags,
132        })
133    }
134}