1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateFolderPermissionsInput {
/// <p>The ID for the Amazon Web Services account that contains the folder to update.</p>
pub aws_account_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the folder.</p>
pub folder_id: ::std::option::Option<::std::string::String>,
/// <p>The permissions that you want to grant on a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
/// <p>The permissions that you want to revoke from a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateFolderPermissionsInput {
/// <p>The ID for the Amazon Web Services account that contains the folder to update.</p>
pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
self.aws_account_id.as_deref()
}
/// <p>The ID of the folder.</p>
pub fn folder_id(&self) -> ::std::option::Option<&str> {
self.folder_id.as_deref()
}
/// <p>The permissions that you want to grant on a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.grant_permissions.is_none()`.
pub fn grant_permissions(&self) -> &[crate::types::ResourcePermission] {
self.grant_permissions.as_deref().unwrap_or_default()
}
/// <p>The permissions that you want to revoke from a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.revoke_permissions.is_none()`.
pub fn revoke_permissions(&self) -> &[crate::types::ResourcePermission] {
self.revoke_permissions.as_deref().unwrap_or_default()
}
}
impl UpdateFolderPermissionsInput {
/// Creates a new builder-style object to manufacture [`UpdateFolderPermissionsInput`](crate::operation::update_folder_permissions::UpdateFolderPermissionsInput).
pub fn builder() -> crate::operation::update_folder_permissions::builders::UpdateFolderPermissionsInputBuilder {
crate::operation::update_folder_permissions::builders::UpdateFolderPermissionsInputBuilder::default()
}
}
/// A builder for [`UpdateFolderPermissionsInput`](crate::operation::update_folder_permissions::UpdateFolderPermissionsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateFolderPermissionsInputBuilder {
pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
pub(crate) folder_id: ::std::option::Option<::std::string::String>,
pub(crate) grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
pub(crate) revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateFolderPermissionsInputBuilder {
/// <p>The ID for the Amazon Web Services account that contains the folder to update.</p>
/// This field is required.
pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.aws_account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID for the Amazon Web Services account that contains the folder to update.</p>
pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.aws_account_id = input;
self
}
/// <p>The ID for the Amazon Web Services account that contains the folder to update.</p>
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_account_id
}
/// <p>The ID of the folder.</p>
/// This field is required.
pub fn folder_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.folder_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the folder.</p>
pub fn set_folder_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.folder_id = input;
self
}
/// <p>The ID of the folder.</p>
pub fn get_folder_id(&self) -> &::std::option::Option<::std::string::String> {
&self.folder_id
}
/// Appends an item to `grant_permissions`.
///
/// To override the contents of this collection use [`set_grant_permissions`](Self::set_grant_permissions).
///
/// <p>The permissions that you want to grant on a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub fn grant_permissions(mut self, input: crate::types::ResourcePermission) -> Self {
let mut v = self.grant_permissions.unwrap_or_default();
v.push(input);
self.grant_permissions = ::std::option::Option::Some(v);
self
}
/// <p>The permissions that you want to grant on a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub fn set_grant_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
self.grant_permissions = input;
self
}
/// <p>The permissions that you want to grant on a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub fn get_grant_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
&self.grant_permissions
}
/// Appends an item to `revoke_permissions`.
///
/// To override the contents of this collection use [`set_revoke_permissions`](Self::set_revoke_permissions).
///
/// <p>The permissions that you want to revoke from a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub fn revoke_permissions(mut self, input: crate::types::ResourcePermission) -> Self {
let mut v = self.revoke_permissions.unwrap_or_default();
v.push(input);
self.revoke_permissions = ::std::option::Option::Some(v);
self
}
/// <p>The permissions that you want to revoke from a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub fn set_revoke_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
self.revoke_permissions = input;
self
}
/// <p>The permissions that you want to revoke from a resource. Namespace ARNs are not supported <code>Principal</code> values for folder permissions.</p>
pub fn get_revoke_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
&self.revoke_permissions
}
/// Consumes the builder and constructs a [`UpdateFolderPermissionsInput`](crate::operation::update_folder_permissions::UpdateFolderPermissionsInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::update_folder_permissions::UpdateFolderPermissionsInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::update_folder_permissions::UpdateFolderPermissionsInput {
aws_account_id: self.aws_account_id,
folder_id: self.folder_id,
grant_permissions: self.grant_permissions,
revoke_permissions: self.revoke_permissions,
})
}
}