1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(missing_docs)] // documentation missing in model
|
3 3 | #[derive(
|
4 4 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5 5 | )]
|
6 - | pub struct GetObjectInput {
|
6 + | pub struct ListObjectsV2Input {
|
7 7 | #[allow(missing_docs)] // documentation missing in model
|
8 8 | pub bucket: ::std::string::String,
|
9 9 | #[allow(missing_docs)] // documentation missing in model
|
10 - | pub key: crate::model::ObjectKey,
|
10 + | pub delimiter: ::std::option::Option<::std::string::String>,
|
11 + | #[allow(missing_docs)] // documentation missing in model
|
12 + | pub encoding_type: ::std::option::Option<crate::model::EncodingType>,
|
13 + | #[allow(missing_docs)] // documentation missing in model
|
14 + | pub max_keys: ::std::option::Option<i32>,
|
15 + | #[allow(missing_docs)] // documentation missing in model
|
16 + | pub prefix: ::std::option::Option<::std::string::String>,
|
17 + | #[allow(missing_docs)] // documentation missing in model
|
18 + | pub continuation_token: ::std::option::Option<::std::string::String>,
|
19 + | #[allow(missing_docs)] // documentation missing in model
|
20 + | pub fetch_owner: ::std::option::Option<bool>,
|
21 + | #[allow(missing_docs)] // documentation missing in model
|
22 + | pub start_after: ::std::option::Option<::std::string::String>,
|
23 + | #[allow(missing_docs)] // documentation missing in model
|
24 + | pub request_payer: ::std::option::Option<crate::model::RequestPayer>,
|
25 + | #[allow(missing_docs)] // documentation missing in model
|
26 + | pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
11 27 | }
|
12 - | impl GetObjectInput {
|
28 + | impl ListObjectsV2Input {
|
13 29 | #[allow(missing_docs)] // documentation missing in model
|
14 30 | pub fn bucket(&self) -> &str {
|
15 31 | use std::ops::Deref;
|
16 32 | self.bucket.deref()
|
17 33 | }
|
18 34 | #[allow(missing_docs)] // documentation missing in model
|
19 - | pub fn key(&self) -> &crate::model::ObjectKey {
|
20 - | &self.key
|
21 - | }
|
22 - | }
|
23 - | impl GetObjectInput {
|
24 - | /// Creates a new builder-style object to manufacture [`GetObjectInput`](crate::input::GetObjectInput).
|
25 - | pub fn builder() -> crate::input::get_object_input::Builder {
|
26 - | crate::input::get_object_input::Builder::default()
|
35 + | pub fn delimiter(&self) -> ::std::option::Option<&str> {
|
36 + | self.delimiter.as_deref()
|
27 37 | }
|
28 - | }
|
29 - | impl crate::constrained::Constrained for crate::input::GetObjectInput {
|
30 - | type Unconstrained = crate::input::get_object_input::Builder;
|
31 - | }
|
32 - |
|
33 - | #[allow(missing_docs)] // documentation missing in model
|
34 - | #[derive(
|
35 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
36 - | )]
|
37 - | pub struct DeleteObjectTaggingInput {
|
38 38 | #[allow(missing_docs)] // documentation missing in model
|
39 - | pub bucket: ::std::string::String,
|
39 + | pub fn encoding_type(&self) -> ::std::option::Option<&crate::model::EncodingType> {
|
40 + | self.encoding_type.as_ref()
|
41 + | }
|
40 42 | #[allow(missing_docs)] // documentation missing in model
|
41 - | pub key: crate::model::ObjectKey,
|
43 + | pub fn max_keys(&self) -> ::std::option::Option<i32> {
|
44 + | self.max_keys
|
45 + | }
|
42 46 | #[allow(missing_docs)] // documentation missing in model
|
43 - | pub version_id: ::std::option::Option<::std::string::String>,
|
47 + | pub fn prefix(&self) -> ::std::option::Option<&str> {
|
48 + | self.prefix.as_deref()
|
49 + | }
|
44 50 | #[allow(missing_docs)] // documentation missing in model
|
45 - | pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
46 - | }
|
47 - | impl DeleteObjectTaggingInput {
|
51 + | pub fn continuation_token(&self) -> ::std::option::Option<&str> {
|
52 + | self.continuation_token.as_deref()
|
53 + | }
|
48 54 | #[allow(missing_docs)] // documentation missing in model
|
49 - | pub fn bucket(&self) -> &str {
|
50 - | use std::ops::Deref;
|
51 - | self.bucket.deref()
|
55 + | pub fn fetch_owner(&self) -> ::std::option::Option<bool> {
|
56 + | self.fetch_owner
|
52 57 | }
|
53 58 | #[allow(missing_docs)] // documentation missing in model
|
54 - | pub fn key(&self) -> &crate::model::ObjectKey {
|
55 - | &self.key
|
59 + | pub fn start_after(&self) -> ::std::option::Option<&str> {
|
60 + | self.start_after.as_deref()
|
56 61 | }
|
57 62 | #[allow(missing_docs)] // documentation missing in model
|
58 - | pub fn version_id(&self) -> ::std::option::Option<&str> {
|
59 - | self.version_id.as_deref()
|
63 + | pub fn request_payer(&self) -> ::std::option::Option<&crate::model::RequestPayer> {
|
64 + | self.request_payer.as_ref()
|
60 65 | }
|
61 66 | #[allow(missing_docs)] // documentation missing in model
|
62 67 | pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
|
63 68 | self.expected_bucket_owner.as_deref()
|
64 69 | }
|
65 70 | }
|
66 - | impl DeleteObjectTaggingInput {
|
67 - | /// Creates a new builder-style object to manufacture [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
68 - | pub fn builder() -> crate::input::delete_object_tagging_input::Builder {
|
69 - | crate::input::delete_object_tagging_input::Builder::default()
|
71 + | impl ListObjectsV2Input {
|
72 + | /// Creates a new builder-style object to manufacture [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
73 + | pub fn builder() -> crate::input::list_objects_v2_input::Builder {
|
74 + | crate::input::list_objects_v2_input::Builder::default()
|
70 75 | }
|
71 76 | }
|
72 - | impl crate::constrained::Constrained for crate::input::DeleteObjectTaggingInput {
|
73 - | type Unconstrained = crate::input::delete_object_tagging_input::Builder;
|
77 + | impl crate::constrained::Constrained for crate::input::ListObjectsV2Input {
|
78 + | type Unconstrained = crate::input::list_objects_v2_input::Builder;
|
74 79 | }
|
75 80 |
|
76 81 | #[allow(missing_docs)] // documentation missing in model
|
77 82 | #[derive(
|
78 83 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
79 84 | )]
|
80 85 | pub struct GetBucketLocationInput {
|
81 86 | #[allow(missing_docs)] // documentation missing in model
|
82 87 | pub bucket: ::std::string::String,
|
83 88 | }
|
84 89 | impl GetBucketLocationInput {
|
85 90 | #[allow(missing_docs)] // documentation missing in model
|
86 91 | pub fn bucket(&self) -> &str {
|
87 92 | use std::ops::Deref;
|
88 93 | self.bucket.deref()
|
89 94 | }
|
90 95 | }
|
91 96 | impl GetBucketLocationInput {
|
92 97 | /// Creates a new builder-style object to manufacture [`GetBucketLocationInput`](crate::input::GetBucketLocationInput).
|
93 98 | pub fn builder() -> crate::input::get_bucket_location_input::Builder {
|
94 99 | crate::input::get_bucket_location_input::Builder::default()
|
95 100 | }
|
96 101 | }
|
97 102 | impl crate::constrained::Constrained for crate::input::GetBucketLocationInput {
|
98 103 | type Unconstrained = crate::input::get_bucket_location_input::Builder;
|
99 104 | }
|
100 105 |
|
101 106 | #[allow(missing_docs)] // documentation missing in model
|
102 107 | #[derive(
|
103 108 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
104 109 | )]
|
105 - | pub struct ListObjectsV2Input {
|
110 + | pub struct DeleteObjectTaggingInput {
|
106 111 | #[allow(missing_docs)] // documentation missing in model
|
107 112 | pub bucket: ::std::string::String,
|
108 113 | #[allow(missing_docs)] // documentation missing in model
|
109 - | pub delimiter: ::std::option::Option<::std::string::String>,
|
110 - | #[allow(missing_docs)] // documentation missing in model
|
111 - | pub encoding_type: ::std::option::Option<crate::model::EncodingType>,
|
112 - | #[allow(missing_docs)] // documentation missing in model
|
113 - | pub max_keys: ::std::option::Option<i32>,
|
114 - | #[allow(missing_docs)] // documentation missing in model
|
115 - | pub prefix: ::std::option::Option<::std::string::String>,
|
116 - | #[allow(missing_docs)] // documentation missing in model
|
117 - | pub continuation_token: ::std::option::Option<::std::string::String>,
|
118 - | #[allow(missing_docs)] // documentation missing in model
|
119 - | pub fetch_owner: ::std::option::Option<bool>,
|
120 - | #[allow(missing_docs)] // documentation missing in model
|
121 - | pub start_after: ::std::option::Option<::std::string::String>,
|
114 + | pub key: crate::model::ObjectKey,
|
122 115 | #[allow(missing_docs)] // documentation missing in model
|
123 - | pub request_payer: ::std::option::Option<crate::model::RequestPayer>,
|
116 + | pub version_id: ::std::option::Option<::std::string::String>,
|
124 117 | #[allow(missing_docs)] // documentation missing in model
|
125 118 | pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
126 119 | }
|
127 - | impl ListObjectsV2Input {
|
120 + | impl DeleteObjectTaggingInput {
|
128 121 | #[allow(missing_docs)] // documentation missing in model
|
129 122 | pub fn bucket(&self) -> &str {
|
130 123 | use std::ops::Deref;
|
131 124 | self.bucket.deref()
|
132 125 | }
|
133 126 | #[allow(missing_docs)] // documentation missing in model
|
134 - | pub fn delimiter(&self) -> ::std::option::Option<&str> {
|
135 - | self.delimiter.as_deref()
|
136 - | }
|
137 - | #[allow(missing_docs)] // documentation missing in model
|
138 - | pub fn encoding_type(&self) -> ::std::option::Option<&crate::model::EncodingType> {
|
139 - | self.encoding_type.as_ref()
|
127 + | pub fn key(&self) -> &crate::model::ObjectKey {
|
128 + | &self.key
|
140 129 | }
|
141 130 | #[allow(missing_docs)] // documentation missing in model
|
142 - | pub fn max_keys(&self) -> ::std::option::Option<i32> {
|
143 - | self.max_keys
|
131 + | pub fn version_id(&self) -> ::std::option::Option<&str> {
|
132 + | self.version_id.as_deref()
|
144 133 | }
|
145 134 | #[allow(missing_docs)] // documentation missing in model
|
146 - | pub fn prefix(&self) -> ::std::option::Option<&str> {
|
147 - | self.prefix.as_deref()
|
135 + | pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
|
136 + | self.expected_bucket_owner.as_deref()
|
148 137 | }
|
149 - | #[allow(missing_docs)] // documentation missing in model
|
150 - | pub fn continuation_token(&self) -> ::std::option::Option<&str> {
|
151 - | self.continuation_token.as_deref()
|
138 + | }
|
139 + | impl DeleteObjectTaggingInput {
|
140 + | /// Creates a new builder-style object to manufacture [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
141 + | pub fn builder() -> crate::input::delete_object_tagging_input::Builder {
|
142 + | crate::input::delete_object_tagging_input::Builder::default()
|
152 143 | }
|
144 + | }
|
145 + | impl crate::constrained::Constrained for crate::input::DeleteObjectTaggingInput {
|
146 + | type Unconstrained = crate::input::delete_object_tagging_input::Builder;
|
147 + | }
|
148 + |
|
149 + | #[allow(missing_docs)] // documentation missing in model
|
150 + | #[derive(
|
151 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
152 + | )]
|
153 + | pub struct GetObjectInput {
|
153 154 | #[allow(missing_docs)] // documentation missing in model
|
154 - | pub fn fetch_owner(&self) -> ::std::option::Option<bool> {
|
155 - | self.fetch_owner
|
156 - | }
|
155 + | pub bucket: ::std::string::String,
|
157 156 | #[allow(missing_docs)] // documentation missing in model
|
158 - | pub fn start_after(&self) -> ::std::option::Option<&str> {
|
159 - | self.start_after.as_deref()
|
160 - | }
|
157 + | pub key: crate::model::ObjectKey,
|
158 + | }
|
159 + | impl GetObjectInput {
|
161 160 | #[allow(missing_docs)] // documentation missing in model
|
162 - | pub fn request_payer(&self) -> ::std::option::Option<&crate::model::RequestPayer> {
|
163 - | self.request_payer.as_ref()
|
161 + | pub fn bucket(&self) -> &str {
|
162 + | use std::ops::Deref;
|
163 + | self.bucket.deref()
|
164 164 | }
|
165 165 | #[allow(missing_docs)] // documentation missing in model
|
166 - | pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
|
167 - | self.expected_bucket_owner.as_deref()
|
166 + | pub fn key(&self) -> &crate::model::ObjectKey {
|
167 + | &self.key
|
168 168 | }
|
169 169 | }
|
170 - | impl ListObjectsV2Input {
|
171 - | /// Creates a new builder-style object to manufacture [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
172 - | pub fn builder() -> crate::input::list_objects_v2_input::Builder {
|
173 - | crate::input::list_objects_v2_input::Builder::default()
|
170 + | impl GetObjectInput {
|
171 + | /// Creates a new builder-style object to manufacture [`GetObjectInput`](crate::input::GetObjectInput).
|
172 + | pub fn builder() -> crate::input::get_object_input::Builder {
|
173 + | crate::input::get_object_input::Builder::default()
|
174 174 | }
|
175 175 | }
|
176 - | impl crate::constrained::Constrained for crate::input::ListObjectsV2Input {
|
177 - | type Unconstrained = crate::input::list_objects_v2_input::Builder;
|
176 + | impl crate::constrained::Constrained for crate::input::GetObjectInput {
|
177 + | type Unconstrained = crate::input::get_object_input::Builder;
|
178 178 | }
|
179 - | /// See [`GetObjectInput`](crate::input::GetObjectInput).
|
180 - | pub mod get_object_input {
|
179 + | /// See [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
180 + | pub mod list_objects_v2_input {
|
181 181 |
|
182 182 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
183 183 | /// Holds one variant for each of the ways the builder can fail.
|
184 184 | #[non_exhaustive]
|
185 185 | #[allow(clippy::enum_variant_names)]
|
186 186 | pub enum ConstraintViolation {
|
187 - | /// `bucket` was not provided but it is required when building `GetObjectInput`.
|
187 + | /// `bucket` was not provided but it is required when building `ListObjectsV2Input`.
|
188 188 | MissingBucket,
|
189 - | /// `key` was not provided but it is required when building `GetObjectInput`.
|
190 - | MissingKey,
|
191 - | /// Constraint violation occurred building member `key` when building `GetObjectInput`.
|
189 + | /// Constraint violation occurred building member `encoding_type` when building `ListObjectsV2Input`.
|
192 190 | #[doc(hidden)]
|
193 - | Key(crate::model::object_key::ConstraintViolation),
|
191 + | EncodingType(crate::model::encoding_type::ConstraintViolation),
|
192 + | /// Constraint violation occurred building member `request_payer` when building `ListObjectsV2Input`.
|
193 + | #[doc(hidden)]
|
194 + | RequestPayer(crate::model::request_payer::ConstraintViolation),
|
194 195 | }
|
195 196 | impl ::std::fmt::Display for ConstraintViolation {
|
196 197 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
197 198 | match self {
|
198 - | ConstraintViolation::MissingBucket => write!(f, "`bucket` was not provided but it is required when building `GetObjectInput`"),
|
199 - | ConstraintViolation::MissingKey => write!(f, "`key` was not provided but it is required when building `GetObjectInput`"),
|
200 - | ConstraintViolation::Key(_) => write!(f, "constraint violation occurred building member `key` when building `GetObjectInput`"),
|
199 + | ConstraintViolation::MissingBucket => write!(f, "`bucket` was not provided but it is required when building `ListObjectsV2Input`"),
|
200 + | ConstraintViolation::EncodingType(_) => write!(f, "constraint violation occurred building member `encoding_type` when building `ListObjectsV2Input`"),
|
201 + | ConstraintViolation::RequestPayer(_) => write!(f, "constraint violation occurred building member `request_payer` when building `ListObjectsV2Input`"),
|
201 202 | }
|
202 203 | }
|
203 204 | }
|
204 205 | impl ::std::error::Error for ConstraintViolation {}
|
205 206 | impl ConstraintViolation {
|
206 207 | pub(crate) fn as_validation_exception_field(
|
207 208 | self,
|
208 209 | path: ::std::string::String,
|
209 210 | ) -> crate::model::ValidationExceptionField {
|
210 211 | match self {
|
211 212 | ConstraintViolation::MissingBucket => crate::model::ValidationExceptionField {
|
212 213 | message: format!("Value at '{}/Bucket' failed to satisfy constraint: Member must not be null", path),
|
213 214 | path: path + "/Bucket",
|
214 215 | },
|
215 - | ConstraintViolation::MissingKey => crate::model::ValidationExceptionField {
|
216 - | message: format!("Value at '{}/Key' failed to satisfy constraint: Member must not be null", path),
|
217 - | path: path + "/Key",
|
218 - | },
|
219 - | ConstraintViolation::Key(inner) => inner.as_validation_exception_field(path + "/Key"),
|
216 + | ConstraintViolation::EncodingType(inner) => inner.as_validation_exception_field(path + "/EncodingType"),
|
217 + | ConstraintViolation::RequestPayer(inner) => inner.as_validation_exception_field(path + "/RequestPayer"),
|
220 218 | }
|
221 219 | }
|
222 220 | }
|
223 221 | impl ::std::convert::From<ConstraintViolation>
|
224 222 | for ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection
|
225 223 | {
|
226 224 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
227 225 | let first_validation_exception_field =
|
228 226 | constraint_violation.as_validation_exception_field("".to_owned());
|
229 227 | let validation_exception = crate::error::ValidationException {
|
230 228 | message: format!(
|
231 229 | "1 validation error detected. {}",
|
232 230 | &first_validation_exception_field.message
|
233 231 | ),
|
234 232 | field_list: Some(vec![first_validation_exception_field]),
|
235 233 | };
|
236 234 | Self::ConstraintViolation(
|
237 235 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
238 236 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
239 237 | )
|
240 238 | }
|
241 239 | }
|
242 240 | impl ::std::convert::From<Builder>
|
243 - | for crate::constrained::MaybeConstrained<crate::input::GetObjectInput>
|
241 + | for crate::constrained::MaybeConstrained<crate::input::ListObjectsV2Input>
|
244 242 | {
|
245 243 | fn from(builder: Builder) -> Self {
|
246 244 | Self::Unconstrained(builder)
|
247 245 | }
|
248 246 | }
|
249 - | impl ::std::convert::TryFrom<Builder> for crate::input::GetObjectInput {
|
247 + | impl ::std::convert::TryFrom<Builder> for crate::input::ListObjectsV2Input {
|
250 248 | type Error = ConstraintViolation;
|
251 249 |
|
252 250 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
253 251 | builder.build()
|
254 252 | }
|
255 253 | }
|
256 - | /// A builder for [`GetObjectInput`](crate::input::GetObjectInput).
|
254 + | /// A builder for [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
257 255 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
258 256 | pub struct Builder {
|
259 257 | pub(crate) bucket: ::std::option::Option<::std::string::String>,
|
260 - | pub(crate) key:
|
261 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ObjectKey>>,
|
258 + | pub(crate) delimiter: ::std::option::Option<::std::string::String>,
|
259 + | pub(crate) encoding_type:
|
260 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EncodingType>>,
|
261 + | pub(crate) max_keys: ::std::option::Option<i32>,
|
262 + | pub(crate) prefix: ::std::option::Option<::std::string::String>,
|
263 + | pub(crate) continuation_token: ::std::option::Option<::std::string::String>,
|
264 + | pub(crate) fetch_owner: ::std::option::Option<bool>,
|
265 + | pub(crate) start_after: ::std::option::Option<::std::string::String>,
|
266 + | pub(crate) request_payer:
|
267 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RequestPayer>>,
|
268 + | pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
262 269 | }
|
263 270 | impl Builder {
|
264 271 | #[allow(missing_docs)] // documentation missing in model
|
265 272 | pub fn bucket(mut self, input: ::std::string::String) -> Self {
|
266 273 | self.bucket = Some(input);
|
267 274 | self
|
268 275 | }
|
269 276 | #[allow(missing_docs)] // documentation missing in model
|
270 277 | pub(crate) fn set_bucket(
|
271 278 | mut self,
|
272 279 | input: impl ::std::convert::Into<::std::string::String>,
|
273 280 | ) -> Self {
|
274 281 | self.bucket = Some(input.into());
|
275 282 | self
|
276 283 | }
|
277 284 | #[allow(missing_docs)] // documentation missing in model
|
278 - | pub fn key(mut self, input: crate::model::ObjectKey) -> Self {
|
279 - | self.key = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
285 + | pub fn delimiter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
286 + | self.delimiter = input;
|
280 287 | self
|
281 288 | }
|
282 289 | #[allow(missing_docs)] // documentation missing in model
|
283 - | pub(crate) fn set_key(
|
290 + | pub(crate) fn set_delimiter(
|
284 291 | mut self,
|
285 - | input: impl ::std::convert::Into<
|
286 - | crate::constrained::MaybeConstrained<crate::model::ObjectKey>,
|
287 - | >,
|
292 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
288 293 | ) -> Self {
|
289 - | self.key = Some(input.into());
|
294 + | self.delimiter = input.map(|v| v.into());
|
290 295 | self
|
291 296 | }
|
292 - | /// Consumes the builder and constructs a [`GetObjectInput`](crate::input::GetObjectInput).
|
293 - | ///
|
294 - | /// The builder fails to construct a [`GetObjectInput`](crate::input::GetObjectInput) if a [`ConstraintViolation`] occurs.
|
295 - | ///
|
296 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
297 - | pub fn build(self) -> Result<crate::input::GetObjectInput, ConstraintViolation> {
|
298 - | self.build_enforcing_all_constraints()
|
297 + | #[allow(missing_docs)] // documentation missing in model
|
298 + | pub fn encoding_type(
|
299 + | mut self,
|
300 + | input: ::std::option::Option<crate::model::EncodingType>,
|
301 + | ) -> Self {
|
302 + | self.encoding_type = input.map(crate::constrained::MaybeConstrained::Constrained);
|
303 + | self
|
299 304 | }
|
300 - | fn build_enforcing_all_constraints(
|
301 - | self,
|
302 - | ) -> Result<crate::input::GetObjectInput, ConstraintViolation> {
|
303 - | Ok(crate::input::GetObjectInput {
|
304 - | bucket: self.bucket.ok_or(ConstraintViolation::MissingBucket)?,
|
305 - | key: self
|
306 - | .key
|
307 - | .map(|v| match v {
|
308 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
309 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
310 - | })
|
311 - | .map(|res| res.map_err(ConstraintViolation::Key))
|
312 - | .transpose()?
|
313 - | .ok_or(ConstraintViolation::MissingKey)?,
|
314 - | })
|
315 - | }
|
316 - | }
|
317 - | }
|
318 - | /// See [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
319 - | pub mod delete_object_tagging_input {
|
320 - |
|
321 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
322 - | /// Holds one variant for each of the ways the builder can fail.
|
323 - | #[non_exhaustive]
|
324 - | #[allow(clippy::enum_variant_names)]
|
325 - | pub enum ConstraintViolation {
|
326 - | /// `bucket` was not provided but it is required when building `DeleteObjectTaggingInput`.
|
327 - | MissingBucket,
|
328 - | /// `key` was not provided but it is required when building `DeleteObjectTaggingInput`.
|
329 - | MissingKey,
|
330 - | /// Constraint violation occurred building member `key` when building `DeleteObjectTaggingInput`.
|
331 - | #[doc(hidden)]
|
332 - | Key(crate::model::object_key::ConstraintViolation),
|
333 - | }
|
334 - | impl ::std::fmt::Display for ConstraintViolation {
|
335 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
336 - | match self {
|
337 - | ConstraintViolation::MissingBucket => write!(f, "`bucket` was not provided but it is required when building `DeleteObjectTaggingInput`"),
|
338 - | ConstraintViolation::MissingKey => write!(f, "`key` was not provided but it is required when building `DeleteObjectTaggingInput`"),
|
339 - | ConstraintViolation::Key(_) => write!(f, "constraint violation occurred building member `key` when building `DeleteObjectTaggingInput`"),
|
340 - | }
|
341 - | }
|
342 - | }
|
343 - | impl ::std::error::Error for ConstraintViolation {}
|
344 - | impl ConstraintViolation {
|
345 - | pub(crate) fn as_validation_exception_field(
|
346 - | self,
|
347 - | path: ::std::string::String,
|
348 - | ) -> crate::model::ValidationExceptionField {
|
349 - | match self {
|
350 - | ConstraintViolation::MissingBucket => crate::model::ValidationExceptionField {
|
351 - | message: format!("Value at '{}/Bucket' failed to satisfy constraint: Member must not be null", path),
|
352 - | path: path + "/Bucket",
|
353 - | },
|
354 - | ConstraintViolation::MissingKey => crate::model::ValidationExceptionField {
|
355 - | message: format!("Value at '{}/Key' failed to satisfy constraint: Member must not be null", path),
|
356 - | path: path + "/Key",
|
357 - | },
|
358 - | ConstraintViolation::Key(inner) => inner.as_validation_exception_field(path + "/Key"),
|
359 - | }
|
360 - | }
|
361 - | }
|
362 - | impl ::std::convert::From<ConstraintViolation>
|
363 - | for ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection
|
364 - | {
|
365 - | fn from(constraint_violation: ConstraintViolation) -> Self {
|
366 - | let first_validation_exception_field =
|
367 - | constraint_violation.as_validation_exception_field("".to_owned());
|
368 - | let validation_exception = crate::error::ValidationException {
|
369 - | message: format!(
|
370 - | "1 validation error detected. {}",
|
371 - | &first_validation_exception_field.message
|
372 - | ),
|
373 - | field_list: Some(vec![first_validation_exception_field]),
|
374 - | };
|
375 - | Self::ConstraintViolation(
|
376 - | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
377 - | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
378 - | )
|
305 + | #[allow(missing_docs)] // documentation missing in model
|
306 + | pub(crate) fn set_encoding_type(
|
307 + | mut self,
|
308 + | input: Option<
|
309 + | impl ::std::convert::Into<
|
310 + | crate::constrained::MaybeConstrained<crate::model::EncodingType>,
|
311 + | >,
|
312 + | >,
|
313 + | ) -> Self {
|
314 + | self.encoding_type = input.map(|v| v.into());
|
315 + | self
|
379 316 | }
|
317 + | #[allow(missing_docs)] // documentation missing in model
|
318 + | pub fn max_keys(mut self, input: ::std::option::Option<i32>) -> Self {
|
319 + | self.max_keys = input;
|
320 + | self
|
380 321 | }
|
381 - | impl ::std::convert::From<Builder>
|
382 - | for crate::constrained::MaybeConstrained<crate::input::DeleteObjectTaggingInput>
|
383 - | {
|
384 - | fn from(builder: Builder) -> Self {
|
385 - | Self::Unconstrained(builder)
|
322 + | #[allow(missing_docs)] // documentation missing in model
|
323 + | pub(crate) fn set_max_keys(
|
324 + | mut self,
|
325 + | input: Option<impl ::std::convert::Into<i32>>,
|
326 + | ) -> Self {
|
327 + | self.max_keys = input.map(|v| v.into());
|
328 + | self
|
386 329 | }
|
330 + | #[allow(missing_docs)] // documentation missing in model
|
331 + | pub fn prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
332 + | self.prefix = input;
|
333 + | self
|
387 334 | }
|
388 - | impl ::std::convert::TryFrom<Builder> for crate::input::DeleteObjectTaggingInput {
|
389 - | type Error = ConstraintViolation;
|
390 - |
|
391 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
392 - | builder.build()
|
335 + | #[allow(missing_docs)] // documentation missing in model
|
336 + | pub(crate) fn set_prefix(
|
337 + | mut self,
|
338 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
339 + | ) -> Self {
|
340 + | self.prefix = input.map(|v| v.into());
|
341 + | self
|
393 342 | }
|
343 + | #[allow(missing_docs)] // documentation missing in model
|
344 + | pub fn continuation_token(
|
345 + | mut self,
|
346 + | input: ::std::option::Option<::std::string::String>,
|
347 + | ) -> Self {
|
348 + | self.continuation_token = input;
|
349 + | self
|
394 350 | }
|
395 - | /// A builder for [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
396 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
397 - | pub struct Builder {
|
398 - | pub(crate) bucket: ::std::option::Option<::std::string::String>,
|
399 - | pub(crate) key:
|
400 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ObjectKey>>,
|
401 - | pub(crate) version_id: ::std::option::Option<::std::string::String>,
|
402 - | pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
351 + | #[allow(missing_docs)] // documentation missing in model
|
352 + | pub(crate) fn set_continuation_token(
|
353 + | mut self,
|
354 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
355 + | ) -> Self {
|
356 + | self.continuation_token = input.map(|v| v.into());
|
357 + | self
|
403 358 | }
|
404 - | impl Builder {
|
405 359 | #[allow(missing_docs)] // documentation missing in model
|
406 - | pub fn bucket(mut self, input: ::std::string::String) -> Self {
|
407 - | self.bucket = Some(input);
|
360 + | pub fn fetch_owner(mut self, input: ::std::option::Option<bool>) -> Self {
|
361 + | self.fetch_owner = input;
|
408 362 | self
|
409 363 | }
|
410 364 | #[allow(missing_docs)] // documentation missing in model
|
411 - | pub(crate) fn set_bucket(
|
365 + | pub(crate) fn set_fetch_owner(
|
412 366 | mut self,
|
413 - | input: impl ::std::convert::Into<::std::string::String>,
|
367 + | input: Option<impl ::std::convert::Into<bool>>,
|
414 368 | ) -> Self {
|
415 - | self.bucket = Some(input.into());
|
369 + | self.fetch_owner = input.map(|v| v.into());
|
416 370 | self
|
417 371 | }
|
418 372 | #[allow(missing_docs)] // documentation missing in model
|
419 - | pub fn key(mut self, input: crate::model::ObjectKey) -> Self {
|
420 - | self.key = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
373 + | pub fn start_after(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
374 + | self.start_after = input;
|
421 375 | self
|
422 376 | }
|
423 377 | #[allow(missing_docs)] // documentation missing in model
|
424 - | pub(crate) fn set_key(
|
378 + | pub(crate) fn set_start_after(
|
425 379 | mut self,
|
426 - | input: impl ::std::convert::Into<
|
427 - | crate::constrained::MaybeConstrained<crate::model::ObjectKey>,
|
428 - | >,
|
380 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
429 381 | ) -> Self {
|
430 - | self.key = Some(input.into());
|
382 + | self.start_after = input.map(|v| v.into());
|
431 383 | self
|
432 384 | }
|
433 385 | #[allow(missing_docs)] // documentation missing in model
|
434 - | pub fn version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
435 - | self.version_id = input;
|
386 + | pub fn request_payer(
|
387 + | mut self,
|
388 + | input: ::std::option::Option<crate::model::RequestPayer>,
|
389 + | ) -> Self {
|
390 + | self.request_payer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
436 391 | self
|
437 392 | }
|
438 393 | #[allow(missing_docs)] // documentation missing in model
|
439 - | pub(crate) fn set_version_id(
|
394 + | pub(crate) fn set_request_payer(
|
440 395 | mut self,
|
441 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
396 + | input: Option<
|
397 + | impl ::std::convert::Into<
|
398 + | crate::constrained::MaybeConstrained<crate::model::RequestPayer>,
|
399 + | >,
|
400 + | >,
|
442 401 | ) -> Self {
|
443 - | self.version_id = input.map(|v| v.into());
|
402 + | self.request_payer = input.map(|v| v.into());
|
444 403 | self
|
445 404 | }
|
446 405 | #[allow(missing_docs)] // documentation missing in model
|
447 406 | pub fn expected_bucket_owner(
|
448 407 | mut self,
|
449 408 | input: ::std::option::Option<::std::string::String>,
|
450 409 | ) -> Self {
|
451 410 | self.expected_bucket_owner = input;
|
452 411 | self
|
453 412 | }
|
454 413 | #[allow(missing_docs)] // documentation missing in model
|
455 414 | pub(crate) fn set_expected_bucket_owner(
|
456 415 | mut self,
|
457 416 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
458 417 | ) -> Self {
|
459 418 | self.expected_bucket_owner = input.map(|v| v.into());
|
460 419 | self
|
461 420 | }
|
462 - | /// Consumes the builder and constructs a [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
421 + | /// Consumes the builder and constructs a [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
463 422 | ///
|
464 - | /// The builder fails to construct a [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput) if a [`ConstraintViolation`] occurs.
|
423 + | /// The builder fails to construct a [`ListObjectsV2Input`](crate::input::ListObjectsV2Input) if a [`ConstraintViolation`] occurs.
|
465 424 | ///
|
466 425 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
467 - | pub fn build(self) -> Result<crate::input::DeleteObjectTaggingInput, ConstraintViolation> {
|
426 + | pub fn build(self) -> Result<crate::input::ListObjectsV2Input, ConstraintViolation> {
|
468 427 | self.build_enforcing_all_constraints()
|
469 428 | }
|
470 429 | fn build_enforcing_all_constraints(
|
471 430 | self,
|
472 - | ) -> Result<crate::input::DeleteObjectTaggingInput, ConstraintViolation> {
|
473 - | Ok(crate::input::DeleteObjectTaggingInput {
|
431 + | ) -> Result<crate::input::ListObjectsV2Input, ConstraintViolation> {
|
432 + | Ok(crate::input::ListObjectsV2Input {
|
474 433 | bucket: self.bucket.ok_or(ConstraintViolation::MissingBucket)?,
|
475 - | key: self
|
476 - | .key
|
434 + | delimiter: self.delimiter,
|
435 + | encoding_type: self
|
436 + | .encoding_type
|
477 437 | .map(|v| match v {
|
478 438 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
479 439 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
480 440 | })
|
481 - | .map(|res| res.map_err(ConstraintViolation::Key))
|
482 - | .transpose()?
|
483 - | .ok_or(ConstraintViolation::MissingKey)?,
|
484 - | version_id: self.version_id,
|
441 + | .map(|res| res.map_err(ConstraintViolation::EncodingType))
|
442 + | .transpose()?,
|
443 + | max_keys: self.max_keys,
|
444 + | prefix: self.prefix,
|
445 + | continuation_token: self.continuation_token,
|
446 + | fetch_owner: self.fetch_owner,
|
447 + | start_after: self.start_after,
|
448 + | request_payer: self
|
449 + | .request_payer
|
450 + | .map(|v| match v {
|
451 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
452 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
453 + | })
|
454 + | .map(|res| res.map_err(ConstraintViolation::RequestPayer))
|
455 + | .transpose()?,
|
485 456 | expected_bucket_owner: self.expected_bucket_owner,
|
486 457 | })
|
487 458 | }
|
488 459 | }
|
489 460 | }
|
490 461 | /// See [`GetBucketLocationInput`](crate::input::GetBucketLocationInput).
|
491 462 | pub mod get_bucket_location_input {
|
492 463 |
|
493 464 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
494 465 | /// Holds one variant for each of the ways the builder can fail.
|
580 551 | }
|
581 552 | fn build_enforcing_all_constraints(
|
582 553 | self,
|
583 554 | ) -> Result<crate::input::GetBucketLocationInput, ConstraintViolation> {
|
584 555 | Ok(crate::input::GetBucketLocationInput {
|
585 556 | bucket: self.bucket.ok_or(ConstraintViolation::MissingBucket)?,
|
586 557 | })
|
587 558 | }
|
588 559 | }
|
589 560 | }
|
590 - | /// See [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
591 - | pub mod list_objects_v2_input {
|
561 + | /// See [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
562 + | pub mod delete_object_tagging_input {
|
592 563 |
|
593 564 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
594 565 | /// Holds one variant for each of the ways the builder can fail.
|
595 566 | #[non_exhaustive]
|
596 567 | #[allow(clippy::enum_variant_names)]
|
597 568 | pub enum ConstraintViolation {
|
598 - | /// `bucket` was not provided but it is required when building `ListObjectsV2Input`.
|
569 + | /// `bucket` was not provided but it is required when building `DeleteObjectTaggingInput`.
|
599 570 | MissingBucket,
|
600 - | /// Constraint violation occurred building member `encoding_type` when building `ListObjectsV2Input`.
|
601 - | #[doc(hidden)]
|
602 - | EncodingType(crate::model::encoding_type::ConstraintViolation),
|
603 - | /// Constraint violation occurred building member `request_payer` when building `ListObjectsV2Input`.
|
571 + | /// `key` was not provided but it is required when building `DeleteObjectTaggingInput`.
|
572 + | MissingKey,
|
573 + | /// Constraint violation occurred building member `key` when building `DeleteObjectTaggingInput`.
|
604 574 | #[doc(hidden)]
|
605 - | RequestPayer(crate::model::request_payer::ConstraintViolation),
|
575 + | Key(crate::model::object_key::ConstraintViolation),
|
606 576 | }
|
607 577 | impl ::std::fmt::Display for ConstraintViolation {
|
608 578 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
609 579 | match self {
|
610 - | ConstraintViolation::MissingBucket => write!(f, "`bucket` was not provided but it is required when building `ListObjectsV2Input`"),
|
611 - | ConstraintViolation::EncodingType(_) => write!(f, "constraint violation occurred building member `encoding_type` when building `ListObjectsV2Input`"),
|
612 - | ConstraintViolation::RequestPayer(_) => write!(f, "constraint violation occurred building member `request_payer` when building `ListObjectsV2Input`"),
|
580 + | ConstraintViolation::MissingBucket => write!(f, "`bucket` was not provided but it is required when building `DeleteObjectTaggingInput`"),
|
581 + | ConstraintViolation::MissingKey => write!(f, "`key` was not provided but it is required when building `DeleteObjectTaggingInput`"),
|
582 + | ConstraintViolation::Key(_) => write!(f, "constraint violation occurred building member `key` when building `DeleteObjectTaggingInput`"),
|
613 583 | }
|
614 584 | }
|
615 585 | }
|
616 586 | impl ::std::error::Error for ConstraintViolation {}
|
617 587 | impl ConstraintViolation {
|
618 588 | pub(crate) fn as_validation_exception_field(
|
619 589 | self,
|
620 590 | path: ::std::string::String,
|
621 591 | ) -> crate::model::ValidationExceptionField {
|
622 592 | match self {
|
623 593 | ConstraintViolation::MissingBucket => crate::model::ValidationExceptionField {
|
624 594 | message: format!("Value at '{}/Bucket' failed to satisfy constraint: Member must not be null", path),
|
625 595 | path: path + "/Bucket",
|
626 596 | },
|
627 - | ConstraintViolation::EncodingType(inner) => inner.as_validation_exception_field(path + "/EncodingType"),
|
628 - | ConstraintViolation::RequestPayer(inner) => inner.as_validation_exception_field(path + "/RequestPayer"),
|
597 + | ConstraintViolation::MissingKey => crate::model::ValidationExceptionField {
|
598 + | message: format!("Value at '{}/Key' failed to satisfy constraint: Member must not be null", path),
|
599 + | path: path + "/Key",
|
600 + | },
|
601 + | ConstraintViolation::Key(inner) => inner.as_validation_exception_field(path + "/Key"),
|
629 602 | }
|
630 603 | }
|
631 604 | }
|
632 605 | impl ::std::convert::From<ConstraintViolation>
|
633 606 | for ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection
|
634 607 | {
|
635 608 | fn from(constraint_violation: ConstraintViolation) -> Self {
|
636 609 | let first_validation_exception_field =
|
637 610 | constraint_violation.as_validation_exception_field("".to_owned());
|
638 611 | let validation_exception = crate::error::ValidationException {
|
639 612 | message: format!(
|
640 613 | "1 validation error detected. {}",
|
641 614 | &first_validation_exception_field.message
|
642 615 | ),
|
643 616 | field_list: Some(vec![first_validation_exception_field]),
|
644 617 | };
|
645 618 | Self::ConstraintViolation(
|
646 619 | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
647 620 | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
648 621 | )
|
649 622 | }
|
650 623 | }
|
651 624 | impl ::std::convert::From<Builder>
|
652 - | for crate::constrained::MaybeConstrained<crate::input::ListObjectsV2Input>
|
625 + | for crate::constrained::MaybeConstrained<crate::input::DeleteObjectTaggingInput>
|
653 626 | {
|
654 627 | fn from(builder: Builder) -> Self {
|
655 628 | Self::Unconstrained(builder)
|
656 629 | }
|
657 630 | }
|
658 - | impl ::std::convert::TryFrom<Builder> for crate::input::ListObjectsV2Input {
|
631 + | impl ::std::convert::TryFrom<Builder> for crate::input::DeleteObjectTaggingInput {
|
659 632 | type Error = ConstraintViolation;
|
660 633 |
|
661 634 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
662 635 | builder.build()
|
663 636 | }
|
664 637 | }
|
665 - | /// A builder for [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
638 + | /// A builder for [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
666 639 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
667 640 | pub struct Builder {
|
668 641 | pub(crate) bucket: ::std::option::Option<::std::string::String>,
|
669 - | pub(crate) delimiter: ::std::option::Option<::std::string::String>,
|
670 - | pub(crate) encoding_type:
|
671 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EncodingType>>,
|
672 - | pub(crate) max_keys: ::std::option::Option<i32>,
|
673 - | pub(crate) prefix: ::std::option::Option<::std::string::String>,
|
674 - | pub(crate) continuation_token: ::std::option::Option<::std::string::String>,
|
675 - | pub(crate) fetch_owner: ::std::option::Option<bool>,
|
676 - | pub(crate) start_after: ::std::option::Option<::std::string::String>,
|
677 - | pub(crate) request_payer:
|
678 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RequestPayer>>,
|
642 + | pub(crate) key:
|
643 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ObjectKey>>,
|
644 + | pub(crate) version_id: ::std::option::Option<::std::string::String>,
|
679 645 | pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
|
680 646 | }
|
681 647 | impl Builder {
|
682 648 | #[allow(missing_docs)] // documentation missing in model
|
683 649 | pub fn bucket(mut self, input: ::std::string::String) -> Self {
|
684 650 | self.bucket = Some(input);
|
685 651 | self
|
686 652 | }
|
687 653 | #[allow(missing_docs)] // documentation missing in model
|
688 654 | pub(crate) fn set_bucket(
|
689 655 | mut self,
|
690 656 | input: impl ::std::convert::Into<::std::string::String>,
|
691 657 | ) -> Self {
|
692 658 | self.bucket = Some(input.into());
|
693 659 | self
|
694 660 | }
|
695 661 | #[allow(missing_docs)] // documentation missing in model
|
696 - | pub fn delimiter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
697 - | self.delimiter = input;
|
698 - | self
|
699 - | }
|
700 - | #[allow(missing_docs)] // documentation missing in model
|
701 - | pub(crate) fn set_delimiter(
|
702 - | mut self,
|
703 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
704 - | ) -> Self {
|
705 - | self.delimiter = input.map(|v| v.into());
|
706 - | self
|
707 - | }
|
708 - | #[allow(missing_docs)] // documentation missing in model
|
709 - | pub fn encoding_type(
|
710 - | mut self,
|
711 - | input: ::std::option::Option<crate::model::EncodingType>,
|
712 - | ) -> Self {
|
713 - | self.encoding_type = input.map(crate::constrained::MaybeConstrained::Constrained);
|
662 + | pub fn key(mut self, input: crate::model::ObjectKey) -> Self {
|
663 + | self.key = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
714 664 | self
|
715 665 | }
|
716 666 | #[allow(missing_docs)] // documentation missing in model
|
717 - | pub(crate) fn set_encoding_type(
|
667 + | pub(crate) fn set_key(
|
718 668 | mut self,
|
719 - | input: Option<
|
720 - | impl ::std::convert::Into<
|
721 - | crate::constrained::MaybeConstrained<crate::model::EncodingType>,
|
722 - | >,
|
669 + | input: impl ::std::convert::Into<
|
670 + | crate::constrained::MaybeConstrained<crate::model::ObjectKey>,
|
723 671 | >,
|
724 672 | ) -> Self {
|
725 - | self.encoding_type = input.map(|v| v.into());
|
726 - | self
|
727 - | }
|
728 - | #[allow(missing_docs)] // documentation missing in model
|
729 - | pub fn max_keys(mut self, input: ::std::option::Option<i32>) -> Self {
|
730 - | self.max_keys = input;
|
731 - | self
|
732 - | }
|
733 - | #[allow(missing_docs)] // documentation missing in model
|
734 - | pub(crate) fn set_max_keys(
|
735 - | mut self,
|
736 - | input: Option<impl ::std::convert::Into<i32>>,
|
737 - | ) -> Self {
|
738 - | self.max_keys = input.map(|v| v.into());
|
673 + | self.key = Some(input.into());
|
739 674 | self
|
740 675 | }
|
741 676 | #[allow(missing_docs)] // documentation missing in model
|
742 - | pub fn prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
743 - | self.prefix = input;
|
677 + | pub fn version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
678 + | self.version_id = input;
|
744 679 | self
|
745 680 | }
|
746 681 | #[allow(missing_docs)] // documentation missing in model
|
747 - | pub(crate) fn set_prefix(
|
682 + | pub(crate) fn set_version_id(
|
748 683 | mut self,
|
749 684 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
750 685 | ) -> Self {
|
751 - | self.prefix = input.map(|v| v.into());
|
686 + | self.version_id = input.map(|v| v.into());
|
752 687 | self
|
753 688 | }
|
754 689 | #[allow(missing_docs)] // documentation missing in model
|
755 - | pub fn continuation_token(
|
690 + | pub fn expected_bucket_owner(
|
756 691 | mut self,
|
757 692 | input: ::std::option::Option<::std::string::String>,
|
758 693 | ) -> Self {
|
759 - | self.continuation_token = input;
|
694 + | self.expected_bucket_owner = input;
|
760 695 | self
|
761 696 | }
|
762 697 | #[allow(missing_docs)] // documentation missing in model
|
763 - | pub(crate) fn set_continuation_token(
|
698 + | pub(crate) fn set_expected_bucket_owner(
|
764 699 | mut self,
|
765 700 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
766 701 | ) -> Self {
|
767 - | self.continuation_token = input.map(|v| v.into());
|
702 + | self.expected_bucket_owner = input.map(|v| v.into());
|
768 703 | self
|
769 704 | }
|
770 - | #[allow(missing_docs)] // documentation missing in model
|
771 - | pub fn fetch_owner(mut self, input: ::std::option::Option<bool>) -> Self {
|
772 - | self.fetch_owner = input;
|
773 - | self
|
705 + | /// Consumes the builder and constructs a [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput).
|
706 + | ///
|
707 + | /// The builder fails to construct a [`DeleteObjectTaggingInput`](crate::input::DeleteObjectTaggingInput) if a [`ConstraintViolation`] occurs.
|
708 + | ///
|
709 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
710 + | pub fn build(self) -> Result<crate::input::DeleteObjectTaggingInput, ConstraintViolation> {
|
711 + | self.build_enforcing_all_constraints()
|
774 712 | }
|
775 - | #[allow(missing_docs)] // documentation missing in model
|
776 - | pub(crate) fn set_fetch_owner(
|
777 - | mut self,
|
778 - | input: Option<impl ::std::convert::Into<bool>>,
|
779 - | ) -> Self {
|
780 - | self.fetch_owner = input.map(|v| v.into());
|
781 - | self
|
713 + | fn build_enforcing_all_constraints(
|
714 + | self,
|
715 + | ) -> Result<crate::input::DeleteObjectTaggingInput, ConstraintViolation> {
|
716 + | Ok(crate::input::DeleteObjectTaggingInput {
|
717 + | bucket: self.bucket.ok_or(ConstraintViolation::MissingBucket)?,
|
718 + | key: self
|
719 + | .key
|
720 + | .map(|v| match v {
|
721 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
722 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
723 + | })
|
724 + | .map(|res| res.map_err(ConstraintViolation::Key))
|
725 + | .transpose()?
|
726 + | .ok_or(ConstraintViolation::MissingKey)?,
|
727 + | version_id: self.version_id,
|
728 + | expected_bucket_owner: self.expected_bucket_owner,
|
729 + | })
|
782 730 | }
|
783 - | #[allow(missing_docs)] // documentation missing in model
|
784 - | pub fn start_after(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
785 - | self.start_after = input;
|
786 - | self
|
787 731 | }
|
788 - | #[allow(missing_docs)] // documentation missing in model
|
789 - | pub(crate) fn set_start_after(
|
790 - | mut self,
|
791 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
792 - | ) -> Self {
|
793 - | self.start_after = input.map(|v| v.into());
|
794 - | self
|
732 + | }
|
733 + | /// See [`GetObjectInput`](crate::input::GetObjectInput).
|
734 + | pub mod get_object_input {
|
735 + |
|
736 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
737 + | /// Holds one variant for each of the ways the builder can fail.
|
738 + | #[non_exhaustive]
|
739 + | #[allow(clippy::enum_variant_names)]
|
740 + | pub enum ConstraintViolation {
|
741 + | /// `bucket` was not provided but it is required when building `GetObjectInput`.
|
742 + | MissingBucket,
|
743 + | /// `key` was not provided but it is required when building `GetObjectInput`.
|
744 + | MissingKey,
|
745 + | /// Constraint violation occurred building member `key` when building `GetObjectInput`.
|
746 + | #[doc(hidden)]
|
747 + | Key(crate::model::object_key::ConstraintViolation),
|
748 + | }
|
749 + | impl ::std::fmt::Display for ConstraintViolation {
|
750 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
751 + | match self {
|
752 + | ConstraintViolation::MissingBucket => write!(f, "`bucket` was not provided but it is required when building `GetObjectInput`"),
|
753 + | ConstraintViolation::MissingKey => write!(f, "`key` was not provided but it is required when building `GetObjectInput`"),
|
754 + | ConstraintViolation::Key(_) => write!(f, "constraint violation occurred building member `key` when building `GetObjectInput`"),
|
755 + | }
|
795 756 | }
|
757 + | }
|
758 + | impl ::std::error::Error for ConstraintViolation {}
|
759 + | impl ConstraintViolation {
|
760 + | pub(crate) fn as_validation_exception_field(
|
761 + | self,
|
762 + | path: ::std::string::String,
|
763 + | ) -> crate::model::ValidationExceptionField {
|
764 + | match self {
|
765 + | ConstraintViolation::MissingBucket => crate::model::ValidationExceptionField {
|
766 + | message: format!("Value at '{}/Bucket' failed to satisfy constraint: Member must not be null", path),
|
767 + | path: path + "/Bucket",
|
768 + | },
|
769 + | ConstraintViolation::MissingKey => crate::model::ValidationExceptionField {
|
770 + | message: format!("Value at '{}/Key' failed to satisfy constraint: Member must not be null", path),
|
771 + | path: path + "/Key",
|
772 + | },
|
773 + | ConstraintViolation::Key(inner) => inner.as_validation_exception_field(path + "/Key"),
|
774 + | }
|
775 + | }
|
776 + | }
|
777 + | impl ::std::convert::From<ConstraintViolation>
|
778 + | for ::aws_smithy_http_server::protocol::rest_xml::rejection::RequestRejection
|
779 + | {
|
780 + | fn from(constraint_violation: ConstraintViolation) -> Self {
|
781 + | let first_validation_exception_field =
|
782 + | constraint_violation.as_validation_exception_field("".to_owned());
|
783 + | let validation_exception = crate::error::ValidationException {
|
784 + | message: format!(
|
785 + | "1 validation error detected. {}",
|
786 + | &first_validation_exception_field.message
|
787 + | ),
|
788 + | field_list: Some(vec![first_validation_exception_field]),
|
789 + | };
|
790 + | Self::ConstraintViolation(
|
791 + | crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(&validation_exception)
|
792 + | .expect("validation exceptions should never fail to serialize; please file a bug report under https://github.com/smithy-lang/smithy-rs/issues")
|
793 + | )
|
794 + | }
|
795 + | }
|
796 + | impl ::std::convert::From<Builder>
|
797 + | for crate::constrained::MaybeConstrained<crate::input::GetObjectInput>
|
798 + | {
|
799 + | fn from(builder: Builder) -> Self {
|
800 + | Self::Unconstrained(builder)
|
801 + | }
|
802 + | }
|
803 + | impl ::std::convert::TryFrom<Builder> for crate::input::GetObjectInput {
|
804 + | type Error = ConstraintViolation;
|
805 + |
|
806 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
807 + | builder.build()
|
808 + | }
|
809 + | }
|
810 + | /// A builder for [`GetObjectInput`](crate::input::GetObjectInput).
|
811 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
812 + | pub struct Builder {
|
813 + | pub(crate) bucket: ::std::option::Option<::std::string::String>,
|
814 + | pub(crate) key:
|
815 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ObjectKey>>,
|
816 + | }
|
817 + | impl Builder {
|
796 818 | #[allow(missing_docs)] // documentation missing in model
|
797 - | pub fn request_payer(
|
798 - | mut self,
|
799 - | input: ::std::option::Option<crate::model::RequestPayer>,
|
800 - | ) -> Self {
|
801 - | self.request_payer = input.map(crate::constrained::MaybeConstrained::Constrained);
|
819 + | pub fn bucket(mut self, input: ::std::string::String) -> Self {
|
820 + | self.bucket = Some(input);
|
802 821 | self
|
803 822 | }
|
804 823 | #[allow(missing_docs)] // documentation missing in model
|
805 - | pub(crate) fn set_request_payer(
|
824 + | pub(crate) fn set_bucket(
|
806 825 | mut self,
|
807 - | input: Option<
|
808 - | impl ::std::convert::Into<
|
809 - | crate::constrained::MaybeConstrained<crate::model::RequestPayer>,
|
810 - | >,
|
811 - | >,
|
826 + | input: impl ::std::convert::Into<::std::string::String>,
|
812 827 | ) -> Self {
|
813 - | self.request_payer = input.map(|v| v.into());
|
828 + | self.bucket = Some(input.into());
|
814 829 | self
|
815 830 | }
|
816 831 | #[allow(missing_docs)] // documentation missing in model
|
817 - | pub fn expected_bucket_owner(
|
818 - | mut self,
|
819 - | input: ::std::option::Option<::std::string::String>,
|
820 - | ) -> Self {
|
821 - | self.expected_bucket_owner = input;
|
832 + | pub fn key(mut self, input: crate::model::ObjectKey) -> Self {
|
833 + | self.key = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
822 834 | self
|
823 835 | }
|
824 836 | #[allow(missing_docs)] // documentation missing in model
|
825 - | pub(crate) fn set_expected_bucket_owner(
|
837 + | pub(crate) fn set_key(
|
826 838 | mut self,
|
827 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
839 + | input: impl ::std::convert::Into<
|
840 + | crate::constrained::MaybeConstrained<crate::model::ObjectKey>,
|
841 + | >,
|
828 842 | ) -> Self {
|
829 - | self.expected_bucket_owner = input.map(|v| v.into());
|
843 + | self.key = Some(input.into());
|
830 844 | self
|
831 845 | }
|
832 - | /// Consumes the builder and constructs a [`ListObjectsV2Input`](crate::input::ListObjectsV2Input).
|
846 + | /// Consumes the builder and constructs a [`GetObjectInput`](crate::input::GetObjectInput).
|
833 847 | ///
|
834 - | /// The builder fails to construct a [`ListObjectsV2Input`](crate::input::ListObjectsV2Input) if a [`ConstraintViolation`] occurs.
|
848 + | /// The builder fails to construct a [`GetObjectInput`](crate::input::GetObjectInput) if a [`ConstraintViolation`] occurs.
|
835 849 | ///
|
836 850 | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
837 - | pub fn build(self) -> Result<crate::input::ListObjectsV2Input, ConstraintViolation> {
|
851 + | pub fn build(self) -> Result<crate::input::GetObjectInput, ConstraintViolation> {
|
838 852 | self.build_enforcing_all_constraints()
|
839 853 | }
|
840 854 | fn build_enforcing_all_constraints(
|
841 855 | self,
|
842 - | ) -> Result<crate::input::ListObjectsV2Input, ConstraintViolation> {
|
843 - | Ok(crate::input::ListObjectsV2Input {
|
856 + | ) -> Result<crate::input::GetObjectInput, ConstraintViolation> {
|
857 + | Ok(crate::input::GetObjectInput {
|
844 858 | bucket: self.bucket.ok_or(ConstraintViolation::MissingBucket)?,
|
845 - | delimiter: self.delimiter,
|
846 - | encoding_type: self
|
847 - | .encoding_type
|
848 - | .map(|v| match v {
|
849 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
850 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
851 - | })
|
852 - | .map(|res| res.map_err(ConstraintViolation::EncodingType))
|
853 - | .transpose()?,
|
854 - | max_keys: self.max_keys,
|
855 - | prefix: self.prefix,
|
856 - | continuation_token: self.continuation_token,
|
857 - | fetch_owner: self.fetch_owner,
|
858 - | start_after: self.start_after,
|
859 - | request_payer: self
|
860 - | .request_payer
|
859 + | key: self
|
860 + | .key
|
861 861 | .map(|v| match v {
|
862 862 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
863 863 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
864 864 | })
|
865 - | .map(|res| res.map_err(ConstraintViolation::RequestPayer))
|
866 - | .transpose()?,
|
867 - | expected_bucket_owner: self.expected_bucket_owner,
|
865 + | .map(|res| res.map_err(ConstraintViolation::Key))
|
866 + | .transpose()?
|
867 + | .ok_or(ConstraintViolation::MissingKey)?,
|
868 868 | })
|
869 869 | }
|
870 870 | }
|
871 871 | }
|