aws_sdk_quicksight/operation/create_folder/
_create_folder_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 CreateFolderInput {
6    /// <p>The ID for the Amazon Web Services account where you want to create the folder.</p>
7    pub aws_account_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the folder.</p>
9    pub folder_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the folder.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The type of folder. By default, <code>folderType</code> is <code>SHARED</code>.</p>
13    pub folder_type: ::std::option::Option<crate::types::FolderType>,
14    /// <p>The Amazon Resource Name (ARN) for the parent folder.</p>
15    /// <p><code>ParentFolderArn</code> can be null. An empty <code>parentFolderArn</code> creates a root-level folder.</p>
16    pub parent_folder_arn: ::std::option::Option<::std::string::String>,
17    /// <p>A structure that describes the principals and the resource-level permissions of a folder.</p>
18    /// <p>To specify no permissions, omit <code>Permissions</code>.</p>
19    pub permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
20    /// <p>Tags for the folder.</p>
21    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
22    /// <p>An optional parameter that determines the sharing scope of the folder. The default value for this parameter is <code>ACCOUNT</code>.</p>
23    pub sharing_model: ::std::option::Option<crate::types::SharingModel>,
24}
25impl CreateFolderInput {
26    /// <p>The ID for the Amazon Web Services account where you want to create the folder.</p>
27    pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
28        self.aws_account_id.as_deref()
29    }
30    /// <p>The ID of the folder.</p>
31    pub fn folder_id(&self) -> ::std::option::Option<&str> {
32        self.folder_id.as_deref()
33    }
34    /// <p>The name of the folder.</p>
35    pub fn name(&self) -> ::std::option::Option<&str> {
36        self.name.as_deref()
37    }
38    /// <p>The type of folder. By default, <code>folderType</code> is <code>SHARED</code>.</p>
39    pub fn folder_type(&self) -> ::std::option::Option<&crate::types::FolderType> {
40        self.folder_type.as_ref()
41    }
42    /// <p>The Amazon Resource Name (ARN) for the parent folder.</p>
43    /// <p><code>ParentFolderArn</code> can be null. An empty <code>parentFolderArn</code> creates a root-level folder.</p>
44    pub fn parent_folder_arn(&self) -> ::std::option::Option<&str> {
45        self.parent_folder_arn.as_deref()
46    }
47    /// <p>A structure that describes the principals and the resource-level permissions of a folder.</p>
48    /// <p>To specify no permissions, omit <code>Permissions</code>.</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>Tags for the folder.</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    /// <p>An optional parameter that determines the sharing scope of the folder. The default value for this parameter is <code>ACCOUNT</code>.</p>
61    pub fn sharing_model(&self) -> ::std::option::Option<&crate::types::SharingModel> {
62        self.sharing_model.as_ref()
63    }
64}
65impl CreateFolderInput {
66    /// Creates a new builder-style object to manufacture [`CreateFolderInput`](crate::operation::create_folder::CreateFolderInput).
67    pub fn builder() -> crate::operation::create_folder::builders::CreateFolderInputBuilder {
68        crate::operation::create_folder::builders::CreateFolderInputBuilder::default()
69    }
70}
71
72/// A builder for [`CreateFolderInput`](crate::operation::create_folder::CreateFolderInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct CreateFolderInputBuilder {
76    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
77    pub(crate) folder_id: ::std::option::Option<::std::string::String>,
78    pub(crate) name: ::std::option::Option<::std::string::String>,
79    pub(crate) folder_type: ::std::option::Option<crate::types::FolderType>,
80    pub(crate) parent_folder_arn: ::std::option::Option<::std::string::String>,
81    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
82    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
83    pub(crate) sharing_model: ::std::option::Option<crate::types::SharingModel>,
84}
85impl CreateFolderInputBuilder {
86    /// <p>The ID for the Amazon Web Services account where you want to create the folder.</p>
87    /// This field is required.
88    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.aws_account_id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The ID for the Amazon Web Services account where you want to create the folder.</p>
93    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.aws_account_id = input;
95        self
96    }
97    /// <p>The ID for the Amazon Web Services account where you want to create the folder.</p>
98    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.aws_account_id
100    }
101    /// <p>The ID of the folder.</p>
102    /// This field is required.
103    pub fn folder_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.folder_id = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The ID of the folder.</p>
108    pub fn set_folder_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.folder_id = input;
110        self
111    }
112    /// <p>The ID of the folder.</p>
113    pub fn get_folder_id(&self) -> &::std::option::Option<::std::string::String> {
114        &self.folder_id
115    }
116    /// <p>The name of the folder.</p>
117    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.name = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The name of the folder.</p>
122    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.name = input;
124        self
125    }
126    /// <p>The name of the folder.</p>
127    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
128        &self.name
129    }
130    /// <p>The type of folder. By default, <code>folderType</code> is <code>SHARED</code>.</p>
131    pub fn folder_type(mut self, input: crate::types::FolderType) -> Self {
132        self.folder_type = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The type of folder. By default, <code>folderType</code> is <code>SHARED</code>.</p>
136    pub fn set_folder_type(mut self, input: ::std::option::Option<crate::types::FolderType>) -> Self {
137        self.folder_type = input;
138        self
139    }
140    /// <p>The type of folder. By default, <code>folderType</code> is <code>SHARED</code>.</p>
141    pub fn get_folder_type(&self) -> &::std::option::Option<crate::types::FolderType> {
142        &self.folder_type
143    }
144    /// <p>The Amazon Resource Name (ARN) for the parent folder.</p>
145    /// <p><code>ParentFolderArn</code> can be null. An empty <code>parentFolderArn</code> creates a root-level folder.</p>
146    pub fn parent_folder_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.parent_folder_arn = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>The Amazon Resource Name (ARN) for the parent folder.</p>
151    /// <p><code>ParentFolderArn</code> can be null. An empty <code>parentFolderArn</code> creates a root-level folder.</p>
152    pub fn set_parent_folder_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.parent_folder_arn = input;
154        self
155    }
156    /// <p>The Amazon Resource Name (ARN) for the parent folder.</p>
157    /// <p><code>ParentFolderArn</code> can be null. An empty <code>parentFolderArn</code> creates a root-level folder.</p>
158    pub fn get_parent_folder_arn(&self) -> &::std::option::Option<::std::string::String> {
159        &self.parent_folder_arn
160    }
161    /// Appends an item to `permissions`.
162    ///
163    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
164    ///
165    /// <p>A structure that describes the principals and the resource-level permissions of a folder.</p>
166    /// <p>To specify no permissions, omit <code>Permissions</code>.</p>
167    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
168        let mut v = self.permissions.unwrap_or_default();
169        v.push(input);
170        self.permissions = ::std::option::Option::Some(v);
171        self
172    }
173    /// <p>A structure that describes the principals and the resource-level permissions of a folder.</p>
174    /// <p>To specify no permissions, omit <code>Permissions</code>.</p>
175    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
176        self.permissions = input;
177        self
178    }
179    /// <p>A structure that describes the principals and the resource-level permissions of a folder.</p>
180    /// <p>To specify no permissions, omit <code>Permissions</code>.</p>
181    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
182        &self.permissions
183    }
184    /// Appends an item to `tags`.
185    ///
186    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
187    ///
188    /// <p>Tags for the folder.</p>
189    pub fn tags(mut self, input: crate::types::Tag) -> Self {
190        let mut v = self.tags.unwrap_or_default();
191        v.push(input);
192        self.tags = ::std::option::Option::Some(v);
193        self
194    }
195    /// <p>Tags for the folder.</p>
196    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
197        self.tags = input;
198        self
199    }
200    /// <p>Tags for the folder.</p>
201    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
202        &self.tags
203    }
204    /// <p>An optional parameter that determines the sharing scope of the folder. The default value for this parameter is <code>ACCOUNT</code>.</p>
205    pub fn sharing_model(mut self, input: crate::types::SharingModel) -> Self {
206        self.sharing_model = ::std::option::Option::Some(input);
207        self
208    }
209    /// <p>An optional parameter that determines the sharing scope of the folder. The default value for this parameter is <code>ACCOUNT</code>.</p>
210    pub fn set_sharing_model(mut self, input: ::std::option::Option<crate::types::SharingModel>) -> Self {
211        self.sharing_model = input;
212        self
213    }
214    /// <p>An optional parameter that determines the sharing scope of the folder. The default value for this parameter is <code>ACCOUNT</code>.</p>
215    pub fn get_sharing_model(&self) -> &::std::option::Option<crate::types::SharingModel> {
216        &self.sharing_model
217    }
218    /// Consumes the builder and constructs a [`CreateFolderInput`](crate::operation::create_folder::CreateFolderInput).
219    pub fn build(
220        self,
221    ) -> ::std::result::Result<crate::operation::create_folder::CreateFolderInput, ::aws_smithy_types::error::operation::BuildError> {
222        ::std::result::Result::Ok(crate::operation::create_folder::CreateFolderInput {
223            aws_account_id: self.aws_account_id,
224            folder_id: self.folder_id,
225            name: self.name,
226            folder_type: self.folder_type,
227            parent_folder_arn: self.parent_folder_arn,
228            permissions: self.permissions,
229            tags: self.tags,
230            sharing_model: self.sharing_model,
231        })
232    }
233}