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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
// 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 UpdateBucketInput {
/// <p>The name of the bucket to update.</p>
pub bucket_name: ::std::option::Option<::std::string::String>,
/// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
pub access_rules: ::std::option::Option<crate::types::AccessRules>,
/// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
/// <p>The following options can be specified:</p>
/// <ul>
/// <li>
/// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
/// <li>
/// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
/// </ul>
pub versioning: ::std::option::Option<::std::string::String>,
/// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
/// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
pub readonly_access_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>An object that describes the access log configuration for the bucket.</p>
pub access_log_config: ::std::option::Option<crate::types::BucketAccessLogConfig>,
/// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
/// <p>CORS information is only returned in a response when you update the CORS policy.</p>
/// </note>
pub cors: ::std::option::Option<crate::types::BucketCorsConfig>,
}
impl UpdateBucketInput {
/// <p>The name of the bucket to update.</p>
pub fn bucket_name(&self) -> ::std::option::Option<&str> {
self.bucket_name.as_deref()
}
/// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
pub fn access_rules(&self) -> ::std::option::Option<&crate::types::AccessRules> {
self.access_rules.as_ref()
}
/// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
/// <p>The following options can be specified:</p>
/// <ul>
/// <li>
/// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
/// <li>
/// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
/// </ul>
pub fn versioning(&self) -> ::std::option::Option<&str> {
self.versioning.as_deref()
}
/// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
/// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</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 `.readonly_access_accounts.is_none()`.
pub fn readonly_access_accounts(&self) -> &[::std::string::String] {
self.readonly_access_accounts.as_deref().unwrap_or_default()
}
/// <p>An object that describes the access log configuration for the bucket.</p>
pub fn access_log_config(&self) -> ::std::option::Option<&crate::types::BucketAccessLogConfig> {
self.access_log_config.as_ref()
}
/// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
/// <p>CORS information is only returned in a response when you update the CORS policy.</p>
/// </note>
pub fn cors(&self) -> ::std::option::Option<&crate::types::BucketCorsConfig> {
self.cors.as_ref()
}
}
impl UpdateBucketInput {
/// Creates a new builder-style object to manufacture [`UpdateBucketInput`](crate::operation::update_bucket::UpdateBucketInput).
pub fn builder() -> crate::operation::update_bucket::builders::UpdateBucketInputBuilder {
crate::operation::update_bucket::builders::UpdateBucketInputBuilder::default()
}
}
/// A builder for [`UpdateBucketInput`](crate::operation::update_bucket::UpdateBucketInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateBucketInputBuilder {
pub(crate) bucket_name: ::std::option::Option<::std::string::String>,
pub(crate) access_rules: ::std::option::Option<crate::types::AccessRules>,
pub(crate) versioning: ::std::option::Option<::std::string::String>,
pub(crate) readonly_access_accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) access_log_config: ::std::option::Option<crate::types::BucketAccessLogConfig>,
pub(crate) cors: ::std::option::Option<crate::types::BucketCorsConfig>,
}
impl UpdateBucketInputBuilder {
/// <p>The name of the bucket to update.</p>
/// This field is required.
pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.bucket_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the bucket to update.</p>
pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.bucket_name = input;
self
}
/// <p>The name of the bucket to update.</p>
pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
&self.bucket_name
}
/// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
pub fn access_rules(mut self, input: crate::types::AccessRules) -> Self {
self.access_rules = ::std::option::Option::Some(input);
self
}
/// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
pub fn set_access_rules(mut self, input: ::std::option::Option<crate::types::AccessRules>) -> Self {
self.access_rules = input;
self
}
/// <p>An object that sets the public accessibility of objects in the specified bucket.</p>
pub fn get_access_rules(&self) -> &::std::option::Option<crate::types::AccessRules> {
&self.access_rules
}
/// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
/// <p>The following options can be specified:</p>
/// <ul>
/// <li>
/// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
/// <li>
/// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
/// </ul>
pub fn versioning(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.versioning = ::std::option::Option::Some(input.into());
self
}
/// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
/// <p>The following options can be specified:</p>
/// <ul>
/// <li>
/// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
/// <li>
/// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
/// </ul>
pub fn set_versioning(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.versioning = input;
self
}
/// <p>Specifies whether to enable or suspend versioning of objects in the bucket.</p>
/// <p>The following options can be specified:</p>
/// <ul>
/// <li>
/// <p><code>Enabled</code> - Enables versioning of objects in the specified bucket.</p></li>
/// <li>
/// <p><code>Suspended</code> - Suspends versioning of objects in the specified bucket. Existing object versions are retained.</p></li>
/// </ul>
pub fn get_versioning(&self) -> &::std::option::Option<::std::string::String> {
&self.versioning
}
/// Appends an item to `readonly_access_accounts`.
///
/// To override the contents of this collection use [`set_readonly_access_accounts`](Self::set_readonly_access_accounts).
///
/// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
/// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
pub fn readonly_access_accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.readonly_access_accounts.unwrap_or_default();
v.push(input.into());
self.readonly_access_accounts = ::std::option::Option::Some(v);
self
}
/// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
/// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
pub fn set_readonly_access_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.readonly_access_accounts = input;
self
}
/// <p>An array of strings to specify the Amazon Web Services account IDs that can access the bucket.</p>
/// <p>You can give a maximum of 10 Amazon Web Services accounts access to a bucket.</p>
pub fn get_readonly_access_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.readonly_access_accounts
}
/// <p>An object that describes the access log configuration for the bucket.</p>
pub fn access_log_config(mut self, input: crate::types::BucketAccessLogConfig) -> Self {
self.access_log_config = ::std::option::Option::Some(input);
self
}
/// <p>An object that describes the access log configuration for the bucket.</p>
pub fn set_access_log_config(mut self, input: ::std::option::Option<crate::types::BucketAccessLogConfig>) -> Self {
self.access_log_config = input;
self
}
/// <p>An object that describes the access log configuration for the bucket.</p>
pub fn get_access_log_config(&self) -> &::std::option::Option<crate::types::BucketAccessLogConfig> {
&self.access_log_config
}
/// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
/// <p>CORS information is only returned in a response when you update the CORS policy.</p>
/// </note>
pub fn cors(mut self, input: crate::types::BucketCorsConfig) -> Self {
self.cors = ::std::option::Option::Some(input);
self
}
/// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
/// <p>CORS information is only returned in a response when you update the CORS policy.</p>
/// </note>
pub fn set_cors(mut self, input: ::std::option::Option<crate::types::BucketCorsConfig>) -> Self {
self.cors = input;
self
}
/// <p>Sets the cross-origin resource sharing (CORS) configuration for your bucket. If a CORS configuration exists, it is replaced with the specified configuration. For AWS CLI operations, this parameter can also be passed as a file. For more information, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/configure-cors.html">Configuring cross-origin resource sharing (CORS)</a>.</p><note>
/// <p>CORS information is only returned in a response when you update the CORS policy.</p>
/// </note>
pub fn get_cors(&self) -> &::std::option::Option<crate::types::BucketCorsConfig> {
&self.cors
}
/// Consumes the builder and constructs a [`UpdateBucketInput`](crate::operation::update_bucket::UpdateBucketInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::update_bucket::UpdateBucketInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_bucket::UpdateBucketInput {
bucket_name: self.bucket_name,
access_rules: self.access_rules,
versioning: self.versioning,
readonly_access_accounts: self.readonly_access_accounts,
access_log_config: self.access_log_config,
cors: self.cors,
})
}
}