aws_sdk_quicksight/operation/create_theme/
_create_theme_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 CreateThemeInput {
6    /// <p>The ID of the Amazon Web Services account where you want to store the new theme.</p>
7    pub aws_account_id: ::std::option::Option<::std::string::String>,
8    /// <p>An ID for the theme that you want to create. The theme ID is unique per Amazon Web Services Region in each Amazon Web Services account.</p>
9    pub theme_id: ::std::option::Option<::std::string::String>,
10    /// <p>A display name for the theme.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use <code>ListThemes</code> or choose <b>Themes</b> from within an analysis.</p>
13    pub base_theme_id: ::std::option::Option<::std::string::String>,
14    /// <p>A description of the first version of the theme that you're creating. Every time <code>UpdateTheme</code> is called, a new version is created. Each version of the theme has a description of the version in the <code>VersionDescription</code> field.</p>
15    pub version_description: ::std::option::Option<::std::string::String>,
16    /// <p>The theme configuration, which contains the theme display properties.</p>
17    pub configuration: ::std::option::Option<crate::types::ThemeConfiguration>,
18    /// <p>A valid grouping of resource permissions to apply to the new theme.</p>
19    pub permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
20    /// <p>A map of the key-value pairs for the resource tag or tags that you want to add to the resource.</p>
21    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
22}
23impl CreateThemeInput {
24    /// <p>The ID of the Amazon Web Services account where you want to store the new theme.</p>
25    pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
26        self.aws_account_id.as_deref()
27    }
28    /// <p>An ID for the theme that you want to create. The theme ID is unique per Amazon Web Services Region in each Amazon Web Services account.</p>
29    pub fn theme_id(&self) -> ::std::option::Option<&str> {
30        self.theme_id.as_deref()
31    }
32    /// <p>A display name for the theme.</p>
33    pub fn name(&self) -> ::std::option::Option<&str> {
34        self.name.as_deref()
35    }
36    /// <p>The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use <code>ListThemes</code> or choose <b>Themes</b> from within an analysis.</p>
37    pub fn base_theme_id(&self) -> ::std::option::Option<&str> {
38        self.base_theme_id.as_deref()
39    }
40    /// <p>A description of the first version of the theme that you're creating. Every time <code>UpdateTheme</code> is called, a new version is created. Each version of the theme has a description of the version in the <code>VersionDescription</code> field.</p>
41    pub fn version_description(&self) -> ::std::option::Option<&str> {
42        self.version_description.as_deref()
43    }
44    /// <p>The theme configuration, which contains the theme display properties.</p>
45    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ThemeConfiguration> {
46        self.configuration.as_ref()
47    }
48    /// <p>A valid grouping of resource permissions to apply to the new theme.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.permissions.is_none()`.
51    pub fn permissions(&self) -> &[crate::types::ResourcePermission] {
52        self.permissions.as_deref().unwrap_or_default()
53    }
54    /// <p>A map of the key-value pairs for the resource tag or tags that you want to add to the resource.</p>
55    ///
56    /// 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.is_none()`.
57    pub fn tags(&self) -> &[crate::types::Tag] {
58        self.tags.as_deref().unwrap_or_default()
59    }
60}
61impl CreateThemeInput {
62    /// Creates a new builder-style object to manufacture [`CreateThemeInput`](crate::operation::create_theme::CreateThemeInput).
63    pub fn builder() -> crate::operation::create_theme::builders::CreateThemeInputBuilder {
64        crate::operation::create_theme::builders::CreateThemeInputBuilder::default()
65    }
66}
67
68/// A builder for [`CreateThemeInput`](crate::operation::create_theme::CreateThemeInput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct CreateThemeInputBuilder {
72    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
73    pub(crate) theme_id: ::std::option::Option<::std::string::String>,
74    pub(crate) name: ::std::option::Option<::std::string::String>,
75    pub(crate) base_theme_id: ::std::option::Option<::std::string::String>,
76    pub(crate) version_description: ::std::option::Option<::std::string::String>,
77    pub(crate) configuration: ::std::option::Option<crate::types::ThemeConfiguration>,
78    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
79    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
80}
81impl CreateThemeInputBuilder {
82    /// <p>The ID of the Amazon Web Services account where you want to store the new theme.</p>
83    /// This field is required.
84    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.aws_account_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The ID of the Amazon Web Services account where you want to store the new theme.</p>
89    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.aws_account_id = input;
91        self
92    }
93    /// <p>The ID of the Amazon Web Services account where you want to store the new theme.</p>
94    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.aws_account_id
96    }
97    /// <p>An ID for the theme that you want to create. The theme ID is unique per Amazon Web Services Region in each Amazon Web Services account.</p>
98    /// This field is required.
99    pub fn theme_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.theme_id = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>An ID for the theme that you want to create. The theme ID is unique per Amazon Web Services Region in each Amazon Web Services account.</p>
104    pub fn set_theme_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.theme_id = input;
106        self
107    }
108    /// <p>An ID for the theme that you want to create. The theme ID is unique per Amazon Web Services Region in each Amazon Web Services account.</p>
109    pub fn get_theme_id(&self) -> &::std::option::Option<::std::string::String> {
110        &self.theme_id
111    }
112    /// <p>A display name for the theme.</p>
113    /// This field is required.
114    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.name = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>A display name for the theme.</p>
119    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.name = input;
121        self
122    }
123    /// <p>A display name for the theme.</p>
124    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125        &self.name
126    }
127    /// <p>The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use <code>ListThemes</code> or choose <b>Themes</b> from within an analysis.</p>
128    /// This field is required.
129    pub fn base_theme_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.base_theme_id = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use <code>ListThemes</code> or choose <b>Themes</b> from within an analysis.</p>
134    pub fn set_base_theme_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.base_theme_id = input;
136        self
137    }
138    /// <p>The ID of the theme that a custom theme will inherit from. All themes inherit from one of the starting themes defined by Amazon QuickSight. For a list of the starting themes, use <code>ListThemes</code> or choose <b>Themes</b> from within an analysis.</p>
139    pub fn get_base_theme_id(&self) -> &::std::option::Option<::std::string::String> {
140        &self.base_theme_id
141    }
142    /// <p>A description of the first version of the theme that you're creating. Every time <code>UpdateTheme</code> is called, a new version is created. Each version of the theme has a description of the version in the <code>VersionDescription</code> field.</p>
143    pub fn version_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.version_description = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>A description of the first version of the theme that you're creating. Every time <code>UpdateTheme</code> is called, a new version is created. Each version of the theme has a description of the version in the <code>VersionDescription</code> field.</p>
148    pub fn set_version_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.version_description = input;
150        self
151    }
152    /// <p>A description of the first version of the theme that you're creating. Every time <code>UpdateTheme</code> is called, a new version is created. Each version of the theme has a description of the version in the <code>VersionDescription</code> field.</p>
153    pub fn get_version_description(&self) -> &::std::option::Option<::std::string::String> {
154        &self.version_description
155    }
156    /// <p>The theme configuration, which contains the theme display properties.</p>
157    /// This field is required.
158    pub fn configuration(mut self, input: crate::types::ThemeConfiguration) -> Self {
159        self.configuration = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The theme configuration, which contains the theme display properties.</p>
163    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ThemeConfiguration>) -> Self {
164        self.configuration = input;
165        self
166    }
167    /// <p>The theme configuration, which contains the theme display properties.</p>
168    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ThemeConfiguration> {
169        &self.configuration
170    }
171    /// Appends an item to `permissions`.
172    ///
173    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
174    ///
175    /// <p>A valid grouping of resource permissions to apply to the new theme.</p>
176    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
177        let mut v = self.permissions.unwrap_or_default();
178        v.push(input);
179        self.permissions = ::std::option::Option::Some(v);
180        self
181    }
182    /// <p>A valid grouping of resource permissions to apply to the new theme.</p>
183    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
184        self.permissions = input;
185        self
186    }
187    /// <p>A valid grouping of resource permissions to apply to the new theme.</p>
188    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
189        &self.permissions
190    }
191    /// Appends an item to `tags`.
192    ///
193    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
194    ///
195    /// <p>A map of the key-value pairs for the resource tag or tags that you want to add to the resource.</p>
196    pub fn tags(mut self, input: crate::types::Tag) -> Self {
197        let mut v = self.tags.unwrap_or_default();
198        v.push(input);
199        self.tags = ::std::option::Option::Some(v);
200        self
201    }
202    /// <p>A map of the key-value pairs for the resource tag or tags that you want to add to the resource.</p>
203    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
204        self.tags = input;
205        self
206    }
207    /// <p>A map of the key-value pairs for the resource tag or tags that you want to add to the resource.</p>
208    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
209        &self.tags
210    }
211    /// Consumes the builder and constructs a [`CreateThemeInput`](crate::operation::create_theme::CreateThemeInput).
212    pub fn build(self) -> ::std::result::Result<crate::operation::create_theme::CreateThemeInput, ::aws_smithy_types::error::operation::BuildError> {
213        ::std::result::Result::Ok(crate::operation::create_theme::CreateThemeInput {
214            aws_account_id: self.aws_account_id,
215            theme_id: self.theme_id,
216            name: self.name,
217            base_theme_id: self.base_theme_id,
218            version_description: self.version_description,
219            configuration: self.configuration,
220            permissions: self.permissions,
221            tags: self.tags,
222        })
223    }
224}