1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// Describes one specific validation failure for an input member.
|
4 + | #[derive(
|
5 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
6 + | )]
|
7 + | pub struct ValidationExceptionField {
|
8 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 + | pub path: ::std::string::String,
|
10 + | /// A detailed description of the validation failure.
|
11 + | pub message: ::std::string::String,
|
12 + | }
|
13 + | impl ValidationExceptionField {
|
14 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
15 + | pub fn path(&self) -> &str {
|
16 + | use std::ops::Deref;
|
17 + | self.path.deref()
|
18 + | }
|
19 + | /// A detailed description of the validation failure.
|
20 + | pub fn message(&self) -> &str {
|
21 + | use std::ops::Deref;
|
22 + | self.message.deref()
|
23 + | }
|
24 + | }
|
25 + | impl ValidationExceptionField {
|
26 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
27 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
28 + | crate::model::validation_exception_field::Builder::default()
|
29 + | }
|
30 + | }
|
31 + |
|
32 + | #[allow(missing_docs)] // documentation missing in model
|
33 + | ///
|
34 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
35 + | /// [constraint traits]. Use [`ObjectKey::try_from`] to construct values of this type.
|
36 + | ///
|
37 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
38 + | ///
|
39 + | #[derive(
|
40 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
41 + | )]
|
42 + | pub struct ObjectKey(pub(crate) ::std::string::String);
|
43 + | impl ObjectKey {
|
44 + | /// Extracts a string slice containing the entire underlying `String`.
|
45 + | pub fn as_str(&self) -> &str {
|
46 + | &self.0
|
47 + | }
|
48 + |
|
49 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
50 + | pub fn inner(&self) -> &::std::string::String {
|
51 + | &self.0
|
52 + | }
|
53 + |
|
54 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
55 + | pub fn into_inner(self) -> ::std::string::String {
|
56 + | self.0
|
57 + | }
|
58 + | }
|
59 + | impl ObjectKey {
|
60 + | fn check_length(
|
61 + | string: &str,
|
62 + | ) -> ::std::result::Result<(), crate::model::object_key::ConstraintViolation> {
|
63 + | let length = string.chars().count();
|
64 + |
|
65 + | if 1 <= length {
|
66 + | Ok(())
|
67 + | } else {
|
68 + | Err(crate::model::object_key::ConstraintViolation::Length(
|
69 + | length,
|
70 + | ))
|
71 + | }
|
72 + | }
|
73 + | }
|
74 + | impl ::std::convert::TryFrom<::std::string::String> for ObjectKey {
|
75 + | type Error = crate::model::object_key::ConstraintViolation;
|
76 + |
|
77 + | /// Constructs a `ObjectKey` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
78 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
79 + | Self::check_length(&value)?;
|
80 + |
|
81 + | Ok(Self(value))
|
82 + | }
|
83 + | }
|
84 + | impl crate::constrained::Constrained for ObjectKey {
|
85 + | type Unconstrained = ::std::string::String;
|
86 + | }
|
87 + |
|
88 + | impl ::std::convert::From<::std::string::String>
|
89 + | for crate::constrained::MaybeConstrained<crate::model::ObjectKey>
|
90 + | {
|
91 + | fn from(value: ::std::string::String) -> Self {
|
92 + | Self::Unconstrained(value)
|
93 + | }
|
94 + | }
|
95 + |
|
96 + | impl ::std::fmt::Display for ObjectKey {
|
97 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
98 + | self.0.fmt(f)
|
99 + | }
|
100 + | }
|
101 + |
|
102 + | impl ::std::convert::From<ObjectKey> for ::std::string::String {
|
103 + | fn from(value: ObjectKey) -> Self {
|
104 + | value.into_inner()
|
105 + | }
|
106 + | }
|
107 + |
|
108 + | #[allow(missing_docs)] // documentation missing in model
|
109 + | #[derive(
|
110 + | ::std::clone::Clone,
|
111 + | ::std::cmp::Eq,
|
112 + | ::std::cmp::Ord,
|
113 + | ::std::cmp::PartialEq,
|
114 + | ::std::cmp::PartialOrd,
|
115 + | ::std::fmt::Debug,
|
116 + | ::std::hash::Hash,
|
117 + | )]
|
118 + | pub enum BucketLocationConstraint {
|
119 + | #[allow(missing_docs)] // documentation missing in model
|
120 + | UsWest2,
|
121 + | }
|
122 + | /// See [`BucketLocationConstraint`](crate::model::BucketLocationConstraint).
|
123 + | pub mod bucket_location_constraint {
|
124 + | #[derive(Debug, PartialEq)]
|
125 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
126 + |
|
127 + | impl ::std::fmt::Display for ConstraintViolation {
|
128 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
129 + | write!(
|
130 + | f,
|
131 + | r#"Value provided for 'com.amazonaws.s3#BucketLocationConstraint' failed to satisfy constraint: Member must satisfy enum value set: [us-west-2]"#
|
132 + | )
|
133 + | }
|
134 + | }
|
135 + |
|
136 + | impl ::std::error::Error for ConstraintViolation {}
|
137 + | }
|
138 + | impl ::std::convert::TryFrom<&str> for BucketLocationConstraint {
|
139 + | type Error = crate::model::bucket_location_constraint::ConstraintViolation;
|
140 + | fn try_from(
|
141 + | s: &str,
|
142 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
143 + | match s {
|
144 + | "us-west-2" => Ok(BucketLocationConstraint::UsWest2),
|
145 + | _ => Err(crate::model::bucket_location_constraint::ConstraintViolation(s.to_owned())),
|
146 + | }
|
147 + | }
|
148 + | }
|
149 + | impl ::std::convert::TryFrom<::std::string::String> for BucketLocationConstraint {
|
150 + | type Error = crate::model::bucket_location_constraint::ConstraintViolation;
|
151 + | fn try_from(
|
152 + | s: ::std::string::String,
|
153 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
154 + | {
|
155 + | s.as_str().try_into()
|
156 + | }
|
157 + | }
|
158 + | impl std::str::FromStr for BucketLocationConstraint {
|
159 + | type Err = crate::model::bucket_location_constraint::ConstraintViolation;
|
160 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
161 + | Self::try_from(s)
|
162 + | }
|
163 + | }
|
164 + | impl BucketLocationConstraint {
|
165 + | /// Returns the `&str` value of the enum member.
|
166 + | pub fn as_str(&self) -> &str {
|
167 + | match self {
|
168 + | BucketLocationConstraint::UsWest2 => "us-west-2",
|
169 + | }
|
170 + | }
|
171 + | /// Returns all the `&str` representations of the enum members.
|
172 + | pub const fn values() -> &'static [&'static str] {
|
173 + | &["us-west-2"]
|
174 + | }
|
175 + | }
|
176 + | impl ::std::convert::AsRef<str> for BucketLocationConstraint {
|
177 + | fn as_ref(&self) -> &str {
|
178 + | self.as_str()
|
179 + | }
|
180 + | }
|
181 + | impl crate::constrained::Constrained for BucketLocationConstraint {
|
182 + | type Unconstrained = ::std::string::String;
|
183 + | }
|
184 + |
|
185 + | impl ::std::convert::From<::std::string::String>
|
186 + | for crate::constrained::MaybeConstrained<crate::model::BucketLocationConstraint>
|
187 + | {
|
188 + | fn from(value: ::std::string::String) -> Self {
|
189 + | Self::Unconstrained(value)
|
190 + | }
|
191 + | }
|
192 + |
|
193 + | #[allow(missing_docs)] // documentation missing in model
|
194 + | #[derive(
|
195 + | ::std::clone::Clone,
|
196 + | ::std::cmp::Eq,
|
197 + | ::std::cmp::Ord,
|
198 + | ::std::cmp::PartialEq,
|
199 + | ::std::cmp::PartialOrd,
|
200 + | ::std::fmt::Debug,
|
201 + | ::std::hash::Hash,
|
202 + | )]
|
203 + | pub enum EncodingType {
|
204 + | #[allow(missing_docs)] // documentation missing in model
|
205 + | Url,
|
206 + | }
|
207 + | /// See [`EncodingType`](crate::model::EncodingType).
|
208 + | pub mod encoding_type {
|
209 + | #[derive(Debug, PartialEq)]
|
210 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
211 + |
|
212 + | impl ::std::fmt::Display for ConstraintViolation {
|
213 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
214 + | write!(
|
215 + | f,
|
216 + | r#"Value provided for 'com.amazonaws.s3#EncodingType' failed to satisfy constraint: Member must satisfy enum value set: [url]"#
|
217 + | )
|
218 + | }
|
219 + | }
|
220 + |
|
221 + | impl ::std::error::Error for ConstraintViolation {}
|
222 + | impl ConstraintViolation {
|
223 + | pub(crate) fn as_validation_exception_field(
|
224 + | self,
|
225 + | path: ::std::string::String,
|
226 + | ) -> crate::model::ValidationExceptionField {
|
227 + | crate::model::ValidationExceptionField {
|
228 + | message: format!(
|
229 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [url]"#,
|
230 + | &path
|
231 + | ),
|
232 + | path,
|
233 + | }
|
234 + | }
|
235 + | }
|
236 + | }
|
237 + | impl ::std::convert::TryFrom<&str> for EncodingType {
|
238 + | type Error = crate::model::encoding_type::ConstraintViolation;
|
239 + | fn try_from(
|
240 + | s: &str,
|
241 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
242 + | match s {
|
243 + | "url" => Ok(EncodingType::Url),
|
244 + | _ => Err(crate::model::encoding_type::ConstraintViolation(
|
245 + | s.to_owned(),
|
246 + | )),
|
247 + | }
|
248 + | }
|
249 + | }
|
250 + | impl ::std::convert::TryFrom<::std::string::String> for EncodingType {
|
251 + | type Error = crate::model::encoding_type::ConstraintViolation;
|
252 + | fn try_from(
|
253 + | s: ::std::string::String,
|
254 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
255 + | {
|
256 + | s.as_str().try_into()
|
257 + | }
|
258 + | }
|
259 + | impl std::str::FromStr for EncodingType {
|
260 + | type Err = crate::model::encoding_type::ConstraintViolation;
|
261 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
262 + | Self::try_from(s)
|
263 + | }
|
264 + | }
|
265 + | impl EncodingType {
|
266 + | /// Returns the `&str` value of the enum member.
|
267 + | pub fn as_str(&self) -> &str {
|
268 + | match self {
|
269 + | EncodingType::Url => "url",
|
270 + | }
|
271 + | }
|
272 + | /// Returns all the `&str` representations of the enum members.
|
273 + | pub const fn values() -> &'static [&'static str] {
|
274 + | &["url"]
|
275 + | }
|
276 + | }
|
277 + | impl ::std::convert::AsRef<str> for EncodingType {
|
278 + | fn as_ref(&self) -> &str {
|
279 + | self.as_str()
|
280 + | }
|
281 + | }
|
282 + | impl crate::constrained::Constrained for EncodingType {
|
283 + | type Unconstrained = ::std::string::String;
|
284 + | }
|
285 + |
|
286 + | impl ::std::convert::From<::std::string::String>
|
287 + | for crate::constrained::MaybeConstrained<crate::model::EncodingType>
|
288 + | {
|
289 + | fn from(value: ::std::string::String) -> Self {
|
290 + | Self::Unconstrained(value)
|
291 + | }
|
292 + | }
|
293 + |
|
294 + | #[allow(missing_docs)] // documentation missing in model
|
295 + | #[derive(
|
296 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
297 + | )]
|
298 + | pub struct CommonPrefix {
|
299 + | #[allow(missing_docs)] // documentation missing in model
|
300 + | pub prefix: ::std::option::Option<::std::string::String>,
|
301 + | }
|
302 + | impl CommonPrefix {
|
303 + | #[allow(missing_docs)] // documentation missing in model
|
304 + | pub fn prefix(&self) -> ::std::option::Option<&str> {
|
305 + | self.prefix.as_deref()
|
306 + | }
|
307 + | }
|
308 + | impl CommonPrefix {
|
309 + | /// Creates a new builder-style object to manufacture [`CommonPrefix`](crate::model::CommonPrefix).
|
310 + | pub fn builder() -> crate::model::common_prefix::Builder {
|
311 + | crate::model::common_prefix::Builder::default()
|
312 + | }
|
313 + | }
|
314 + |
|
315 + | #[allow(missing_docs)] // documentation missing in model
|
316 + | #[derive(
|
317 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
318 + | )]
|
319 + | pub struct Object {
|
320 + | #[allow(missing_docs)] // documentation missing in model
|
321 + | pub key: ::std::option::Option<crate::model::ObjectKey>,
|
322 + | #[allow(missing_docs)] // documentation missing in model
|
323 + | pub last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
|
324 + | #[allow(missing_docs)] // documentation missing in model
|
325 + | pub e_tag: ::std::option::Option<::std::string::String>,
|
326 + | #[allow(missing_docs)] // documentation missing in model
|
327 + | pub size: ::std::option::Option<i32>,
|
328 + | #[allow(missing_docs)] // documentation missing in model
|
329 + | pub storage_class: ::std::option::Option<crate::model::ObjectStorageClass>,
|
330 + | #[allow(missing_docs)] // documentation missing in model
|
331 + | pub owner: ::std::option::Option<crate::model::Owner>,
|
332 + | }
|
333 + | impl Object {
|
334 + | #[allow(missing_docs)] // documentation missing in model
|
335 + | pub fn key(&self) -> ::std::option::Option<&crate::model::ObjectKey> {
|
336 + | self.key.as_ref()
|
337 + | }
|
338 + | #[allow(missing_docs)] // documentation missing in model
|
339 + | pub fn last_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
340 + | self.last_modified.as_ref()
|
341 + | }
|
342 + | #[allow(missing_docs)] // documentation missing in model
|
343 + | pub fn e_tag(&self) -> ::std::option::Option<&str> {
|
344 + | self.e_tag.as_deref()
|
345 + | }
|
346 + | #[allow(missing_docs)] // documentation missing in model
|
347 + | pub fn size(&self) -> ::std::option::Option<i32> {
|
348 + | self.size
|
349 + | }
|
350 + | #[allow(missing_docs)] // documentation missing in model
|
351 + | pub fn storage_class(&self) -> ::std::option::Option<&crate::model::ObjectStorageClass> {
|
352 + | self.storage_class.as_ref()
|
353 + | }
|
354 + | #[allow(missing_docs)] // documentation missing in model
|
355 + | pub fn owner(&self) -> ::std::option::Option<&crate::model::Owner> {
|
356 + | self.owner.as_ref()
|
357 + | }
|
358 + | }
|
359 + | impl Object {
|
360 + | /// Creates a new builder-style object to manufacture [`Object`](crate::model::Object).
|
361 + | pub fn builder() -> crate::model::object::Builder {
|
362 + | crate::model::object::Builder::default()
|
363 + | }
|
364 + | }
|
365 + |
|
366 + | #[allow(missing_docs)] // documentation missing in model
|
367 + | #[derive(
|
368 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
369 + | )]
|
370 + | pub struct Owner {
|
371 + | #[allow(missing_docs)] // documentation missing in model
|
372 + | pub display_name: ::std::option::Option<::std::string::String>,
|
373 + | #[allow(missing_docs)] // documentation missing in model
|
374 + | pub id: ::std::option::Option<::std::string::String>,
|
375 + | }
|
376 + | impl Owner {
|
377 + | #[allow(missing_docs)] // documentation missing in model
|
378 + | pub fn display_name(&self) -> ::std::option::Option<&str> {
|
379 + | self.display_name.as_deref()
|
380 + | }
|
381 + | #[allow(missing_docs)] // documentation missing in model
|
382 + | pub fn id(&self) -> ::std::option::Option<&str> {
|
383 + | self.id.as_deref()
|
384 + | }
|
385 + | }
|
386 + | impl Owner {
|
387 + | /// Creates a new builder-style object to manufacture [`Owner`](crate::model::Owner).
|
388 + | pub fn builder() -> crate::model::owner::Builder {
|
389 + | crate::model::owner::Builder::default()
|
390 + | }
|
391 + | }
|
392 + |
|
393 + | #[allow(missing_docs)] // documentation missing in model
|
394 + | #[derive(
|
395 + | ::std::clone::Clone,
|
396 + | ::std::cmp::Eq,
|
397 + | ::std::cmp::Ord,
|
398 + | ::std::cmp::PartialEq,
|
399 + | ::std::cmp::PartialOrd,
|
400 + | ::std::fmt::Debug,
|
401 + | ::std::hash::Hash,
|
402 + | )]
|
403 + | pub enum ObjectStorageClass {
|
404 + | #[allow(missing_docs)] // documentation missing in model
|
405 + | DeepArchive,
|
406 + | #[allow(missing_docs)] // documentation missing in model
|
407 + | Glacier,
|
408 + | #[allow(missing_docs)] // documentation missing in model
|
409 + | IntelligentTiering,
|
410 + | #[allow(missing_docs)] // documentation missing in model
|
411 + | OnezoneIa,
|
412 + | #[allow(missing_docs)] // documentation missing in model
|
413 + | Outposts,
|
414 + | #[allow(missing_docs)] // documentation missing in model
|
415 + | ReducedRedundancy,
|
416 + | #[allow(missing_docs)] // documentation missing in model
|
417 + | Standard,
|
418 + | #[allow(missing_docs)] // documentation missing in model
|
419 + | StandardIa,
|
420 + | }
|
421 + | /// See [`ObjectStorageClass`](crate::model::ObjectStorageClass).
|
422 + | pub mod object_storage_class {
|
423 + | #[derive(Debug, PartialEq)]
|
424 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
425 + |
|
426 + | impl ::std::fmt::Display for ConstraintViolation {
|
427 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
428 + | write!(
|
429 + | f,
|
430 + | r#"Value provided for 'com.amazonaws.s3#ObjectStorageClass' failed to satisfy constraint: Member must satisfy enum value set: [STANDARD, REDUCED_REDUNDANCY, GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, OUTPOSTS]"#
|
431 + | )
|
432 + | }
|
433 + | }
|
434 + |
|
435 + | impl ::std::error::Error for ConstraintViolation {}
|
436 + | }
|
437 + | impl ::std::convert::TryFrom<&str> for ObjectStorageClass {
|
438 + | type Error = crate::model::object_storage_class::ConstraintViolation;
|
439 + | fn try_from(
|
440 + | s: &str,
|
441 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
442 + | match s {
|
443 + | "DEEP_ARCHIVE" => Ok(ObjectStorageClass::DeepArchive),
|
444 + | "GLACIER" => Ok(ObjectStorageClass::Glacier),
|
445 + | "INTELLIGENT_TIERING" => Ok(ObjectStorageClass::IntelligentTiering),
|
446 + | "ONEZONE_IA" => Ok(ObjectStorageClass::OnezoneIa),
|
447 + | "OUTPOSTS" => Ok(ObjectStorageClass::Outposts),
|
448 + | "REDUCED_REDUNDANCY" => Ok(ObjectStorageClass::ReducedRedundancy),
|
449 + | "STANDARD" => Ok(ObjectStorageClass::Standard),
|
450 + | "STANDARD_IA" => Ok(ObjectStorageClass::StandardIa),
|
451 + | _ => Err(crate::model::object_storage_class::ConstraintViolation(
|
452 + | s.to_owned(),
|
453 + | )),
|
454 + | }
|
455 + | }
|
456 + | }
|
457 + | impl ::std::convert::TryFrom<::std::string::String> for ObjectStorageClass {
|
458 + | type Error = crate::model::object_storage_class::ConstraintViolation;
|
459 + | fn try_from(
|
460 + | s: ::std::string::String,
|
461 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
462 + | {
|
463 + | s.as_str().try_into()
|
464 + | }
|
465 + | }
|
466 + | impl std::str::FromStr for ObjectStorageClass {
|
467 + | type Err = crate::model::object_storage_class::ConstraintViolation;
|
468 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
469 + | Self::try_from(s)
|
470 + | }
|
471 + | }
|
472 + | impl ObjectStorageClass {
|
473 + | /// Returns the `&str` value of the enum member.
|
474 + | pub fn as_str(&self) -> &str {
|
475 + | match self {
|
476 + | ObjectStorageClass::DeepArchive => "DEEP_ARCHIVE",
|
477 + | ObjectStorageClass::Glacier => "GLACIER",
|
478 + | ObjectStorageClass::IntelligentTiering => "INTELLIGENT_TIERING",
|
479 + | ObjectStorageClass::OnezoneIa => "ONEZONE_IA",
|
480 + | ObjectStorageClass::Outposts => "OUTPOSTS",
|
481 + | ObjectStorageClass::ReducedRedundancy => "REDUCED_REDUNDANCY",
|
482 + | ObjectStorageClass::Standard => "STANDARD",
|
483 + | ObjectStorageClass::StandardIa => "STANDARD_IA",
|
484 + | }
|
485 + | }
|
486 + | /// Returns all the `&str` representations of the enum members.
|
487 + | pub const fn values() -> &'static [&'static str] {
|
488 + | &[
|
489 + | "DEEP_ARCHIVE",
|
490 + | "GLACIER",
|
491 + | "INTELLIGENT_TIERING",
|
492 + | "ONEZONE_IA",
|
493 + | "OUTPOSTS",
|
494 + | "REDUCED_REDUNDANCY",
|
495 + | "STANDARD",
|
496 + | "STANDARD_IA",
|
497 + | ]
|
498 + | }
|
499 + | }
|
500 + | impl ::std::convert::AsRef<str> for ObjectStorageClass {
|
501 + | fn as_ref(&self) -> &str {
|
502 + | self.as_str()
|
503 + | }
|
504 + | }
|
505 + | impl crate::constrained::Constrained for ObjectStorageClass {
|
506 + | type Unconstrained = ::std::string::String;
|
507 + | }
|
508 + |
|
509 + | impl ::std::convert::From<::std::string::String>
|
510 + | for crate::constrained::MaybeConstrained<crate::model::ObjectStorageClass>
|
511 + | {
|
512 + | fn from(value: ::std::string::String) -> Self {
|
513 + | Self::Unconstrained(value)
|
514 + | }
|
515 + | }
|
516 + |
|
517 + | #[allow(missing_docs)] // documentation missing in model
|
518 + | #[derive(
|
519 + | ::std::clone::Clone,
|
520 + | ::std::cmp::Eq,
|
521 + | ::std::cmp::Ord,
|
522 + | ::std::cmp::PartialEq,
|
523 + | ::std::cmp::PartialOrd,
|
524 + | ::std::fmt::Debug,
|
525 + | ::std::hash::Hash,
|
526 + | )]
|
527 + | pub enum RequestPayer {
|
528 + | #[allow(missing_docs)] // documentation missing in model
|
529 + | Requester,
|
530 + | }
|
531 + | /// See [`RequestPayer`](crate::model::RequestPayer).
|
532 + | pub mod request_payer {
|
533 + | #[derive(Debug, PartialEq)]
|
534 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
535 + |
|
536 + | impl ::std::fmt::Display for ConstraintViolation {
|
537 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
538 + | write!(
|
539 + | f,
|
540 + | r#"Value provided for 'com.amazonaws.s3#RequestPayer' failed to satisfy constraint: Member must satisfy enum value set: [requester]"#
|
541 + | )
|
542 + | }
|
543 + | }
|
544 + |
|
545 + | impl ::std::error::Error for ConstraintViolation {}
|
546 + | impl ConstraintViolation {
|
547 + | pub(crate) fn as_validation_exception_field(
|
548 + | self,
|
549 + | path: ::std::string::String,
|
550 + | ) -> crate::model::ValidationExceptionField {
|
551 + | crate::model::ValidationExceptionField {
|
552 + | message: format!(
|
553 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [requester]"#,
|
554 + | &path
|
555 + | ),
|
556 + | path,
|
557 + | }
|
558 + | }
|
559 + | }
|
560 + | }
|
561 + | impl ::std::convert::TryFrom<&str> for RequestPayer {
|
562 + | type Error = crate::model::request_payer::ConstraintViolation;
|
563 + | fn try_from(
|
564 + | s: &str,
|
565 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
566 + | match s {
|
567 + | "requester" => Ok(RequestPayer::Requester),
|
568 + | _ => Err(crate::model::request_payer::ConstraintViolation(
|
569 + | s.to_owned(),
|
570 + | )),
|
571 + | }
|
572 + | }
|
573 + | }
|
574 + | impl ::std::convert::TryFrom<::std::string::String> for RequestPayer {
|
575 + | type Error = crate::model::request_payer::ConstraintViolation;
|
576 + | fn try_from(
|
577 + | s: ::std::string::String,
|
578 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
579 + | {
|
580 + | s.as_str().try_into()
|
581 + | }
|
582 + | }
|
583 + | impl std::str::FromStr for RequestPayer {
|
584 + | type Err = crate::model::request_payer::ConstraintViolation;
|
585 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
586 + | Self::try_from(s)
|
587 + | }
|
588 + | }
|
589 + | impl RequestPayer {
|
590 + | /// Returns the `&str` value of the enum member.
|
591 + | pub fn as_str(&self) -> &str {
|
592 + | match self {
|
593 + | RequestPayer::Requester => "requester",
|
594 + | }
|
595 + | }
|
596 + | /// Returns all the `&str` representations of the enum members.
|
597 + | pub const fn values() -> &'static [&'static str] {
|
598 + | &["requester"]
|
599 + | }
|
600 + | }
|
601 + | impl ::std::convert::AsRef<str> for RequestPayer {
|
602 + | fn as_ref(&self) -> &str {
|
603 + | self.as_str()
|
604 + | }
|
605 + | }
|
606 + | impl crate::constrained::Constrained for RequestPayer {
|
607 + | type Unconstrained = ::std::string::String;
|
608 + | }
|
609 + |
|
610 + | impl ::std::convert::From<::std::string::String>
|
611 + | for crate::constrained::MaybeConstrained<crate::model::RequestPayer>
|
612 + | {
|
613 + | fn from(value: ::std::string::String) -> Self {
|
614 + | Self::Unconstrained(value)
|
615 + | }
|
616 + | }
|
617 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
618 + | pub mod validation_exception_field {
|
619 + |
|
620 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
621 + | /// Holds one variant for each of the ways the builder can fail.
|
622 + | #[non_exhaustive]
|
623 + | #[allow(clippy::enum_variant_names)]
|
624 + | pub enum ConstraintViolation {
|
625 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
626 + | MissingPath,
|
627 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
628 + | MissingMessage,
|
629 + | }
|
630 + | impl ::std::fmt::Display for ConstraintViolation {
|
631 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
632 + | match self {
|
633 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
634 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
635 + | }
|
636 + | }
|
637 + | }
|
638 + | impl ::std::error::Error for ConstraintViolation {}
|
639 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
640 + | type Error = ConstraintViolation;
|
641 + |
|
642 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
643 + | builder.build()
|
644 + | }
|
645 + | }
|
646 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
647 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
648 + | pub struct Builder {
|
649 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
650 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
651 + | }
|
652 + | impl Builder {
|
653 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
654 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
655 + | self.path = Some(input);
|
656 + | self
|
657 + | }
|
658 + | /// A detailed description of the validation failure.
|
659 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
660 + | self.message = Some(input);
|
661 + | self
|
662 + | }
|
663 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
664 + | ///
|
665 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
666 + | ///
|
667 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
668 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
669 + | self.build_enforcing_all_constraints()
|
670 + | }
|
671 + | fn build_enforcing_all_constraints(
|
672 + | self,
|
673 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
674 + | Ok(crate::model::ValidationExceptionField {
|
675 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
676 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
677 + | })
|
678 + | }
|
679 + | }
|
680 + | }
|
681 + | /// See [`ObjectKey`](crate::model::ObjectKey).
|
682 + | pub mod object_key {
|
683 + |
|
684 + | #[derive(Debug, PartialEq)]
|
685 + | pub enum ConstraintViolation {
|
686 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
687 + | Length(usize),
|
688 + | }
|
689 + |
|
690 + | impl ::std::fmt::Display for ConstraintViolation {
|
691 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
692 + | let message = match self {
|
693 + | Self::Length(length) => {
|
694 + | format!("Value with length {} provided for 'com.amazonaws.s3#ObjectKey' failed to satisfy constraint: Member must have length greater than or equal to 1", length)
|
695 + | }
|
696 + | };
|
697 + | write!(f, "{message}")
|
698 + | }
|
699 + | }
|
700 + |
|
701 + | impl ::std::error::Error for ConstraintViolation {}
|
702 + | impl ConstraintViolation {
|
703 + | pub(crate) fn as_validation_exception_field(
|
704 + | self,
|
705 + | path: ::std::string::String,
|
706 + | ) -> crate::model::ValidationExceptionField {
|
707 + | match self {
|
708 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
709 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 1", length, &path),
|
710 + | path,
|
711 + | },
|
712 + | }
|
713 + | }
|
714 + | }
|
715 + | }
|
716 + | /// See [`CommonPrefix`](crate::model::CommonPrefix).
|
717 + | pub mod common_prefix {
|
718 + |
|
719 + | impl ::std::convert::From<Builder> for crate::model::CommonPrefix {
|
720 + | fn from(builder: Builder) -> Self {
|
721 + | builder.build()
|
722 + | }
|
723 + | }
|
724 + | /// A builder for [`CommonPrefix`](crate::model::CommonPrefix).
|
725 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
726 + | pub struct Builder {
|
727 + | pub(crate) prefix: ::std::option::Option<::std::string::String>,
|
728 + | }
|
729 + | impl Builder {
|
730 + | #[allow(missing_docs)] // documentation missing in model
|
731 + | pub fn prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
732 + | self.prefix = input;
|
733 + | self
|
734 + | }
|
735 + | /// Consumes the builder and constructs a [`CommonPrefix`](crate::model::CommonPrefix).
|
736 + | pub fn build(self) -> crate::model::CommonPrefix {
|
737 + | self.build_enforcing_all_constraints()
|
738 + | }
|
739 + | fn build_enforcing_all_constraints(self) -> crate::model::CommonPrefix {
|
740 + | crate::model::CommonPrefix {
|
741 + | prefix: self.prefix,
|
742 + | }
|
743 + | }
|
744 + | }
|
745 + | }
|
746 + | /// See [`Object`](crate::model::Object).
|
747 + | pub mod object {
|
748 + |
|
749 + | impl ::std::convert::From<Builder> for crate::model::Object {
|
750 + | fn from(builder: Builder) -> Self {
|
751 + | builder.build()
|
752 + | }
|
753 + | }
|
754 + | /// A builder for [`Object`](crate::model::Object).
|
755 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
756 + | pub struct Builder {
|
757 + | pub(crate) key: ::std::option::Option<crate::model::ObjectKey>,
|
758 + | pub(crate) last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
|
759 + | pub(crate) e_tag: ::std::option::Option<::std::string::String>,
|
760 + | pub(crate) size: ::std::option::Option<i32>,
|
761 + | pub(crate) storage_class: ::std::option::Option<crate::model::ObjectStorageClass>,
|
762 + | pub(crate) owner: ::std::option::Option<crate::model::Owner>,
|
763 + | }
|
764 + | impl Builder {
|
765 + | #[allow(missing_docs)] // documentation missing in model
|
766 + | pub fn key(mut self, input: ::std::option::Option<crate::model::ObjectKey>) -> Self {
|
767 + | self.key = input;
|
768 + | self
|
769 + | }
|
770 + | #[allow(missing_docs)] // documentation missing in model
|
771 + | pub fn last_modified(
|
772 + | mut self,
|
773 + | input: ::std::option::Option<::aws_smithy_types::DateTime>,
|
774 + | ) -> Self {
|
775 + | self.last_modified = input;
|
776 + | self
|
777 + | }
|
778 + | #[allow(missing_docs)] // documentation missing in model
|
779 + | pub fn e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
780 + | self.e_tag = input;
|
781 + | self
|
782 + | }
|
783 + | #[allow(missing_docs)] // documentation missing in model
|
784 + | pub fn size(mut self, input: ::std::option::Option<i32>) -> Self {
|
785 + | self.size = input;
|
786 + | self
|
787 + | }
|
788 + | #[allow(missing_docs)] // documentation missing in model
|
789 + | pub fn storage_class(
|
790 + | mut self,
|
791 + | input: ::std::option::Option<crate::model::ObjectStorageClass>,
|
792 + | ) -> Self {
|
793 + | self.storage_class = input;
|
794 + | self
|
795 + | }
|
796 + | #[allow(missing_docs)] // documentation missing in model
|
797 + | pub fn owner(mut self, input: ::std::option::Option<crate::model::Owner>) -> Self {
|
798 + | self.owner = input;
|
799 + | self
|
800 + | }
|
801 + | /// Consumes the builder and constructs a [`Object`](crate::model::Object).
|
802 + | pub fn build(self) -> crate::model::Object {
|
803 + | self.build_enforcing_all_constraints()
|
804 + | }
|
805 + | fn build_enforcing_all_constraints(self) -> crate::model::Object {
|
806 + | crate::model::Object {
|
807 + | key: self.key,
|
808 + | last_modified: self.last_modified,
|
809 + | e_tag: self.e_tag,
|
810 + | size: self.size,
|
811 + | storage_class: self.storage_class,
|
812 + | owner: self.owner,
|
813 + | }
|
814 + | }
|
815 + | }
|
816 + | }
|
817 + | /// See [`Owner`](crate::model::Owner).
|
818 + | pub mod owner {
|
819 + |
|
820 + | impl ::std::convert::From<Builder> for crate::model::Owner {
|
821 + | fn from(builder: Builder) -> Self {
|
822 + | builder.build()
|
823 + | }
|
824 + | }
|
825 + | /// A builder for [`Owner`](crate::model::Owner).
|
826 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
827 + | pub struct Builder {
|
828 + | pub(crate) display_name: ::std::option::Option<::std::string::String>,
|
829 + | pub(crate) id: ::std::option::Option<::std::string::String>,
|
830 + | }
|
831 + | impl Builder {
|
832 + | #[allow(missing_docs)] // documentation missing in model
|
833 + | pub fn display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
834 + | self.display_name = input;
|
835 + | self
|
836 + | }
|
837 + | #[allow(missing_docs)] // documentation missing in model
|
838 + | pub fn id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
839 + | self.id = input;
|
840 + | self
|
841 + | }
|
842 + | /// Consumes the builder and constructs a [`Owner`](crate::model::Owner).
|
843 + | pub fn build(self) -> crate::model::Owner {
|
844 + | self.build_enforcing_all_constraints()
|
845 + | }
|
846 + | fn build_enforcing_all_constraints(self) -> crate::model::Owner {
|
847 + | crate::model::Owner {
|
848 + | display_name: self.display_name,
|
849 + | id: self.id,
|
850 + | }
|
851 + | }
|
852 + | }
|
853 + | }
|