1 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 2 | #[allow(missing_docs)] // documentation missing in model
|
109 3 | #[derive(
|
110 4 | ::std::clone::Clone,
|
111 5 | ::std::cmp::Eq,
|
112 6 | ::std::cmp::Ord,
|
113 7 | ::std::cmp::PartialEq,
|
114 8 | ::std::cmp::PartialOrd,
|
115 9 | ::std::fmt::Debug,
|
116 10 | ::std::hash::Hash,
|
117 11 | )]
|
118 - | pub enum BucketLocationConstraint {
|
12 + | pub enum EncodingType {
|
119 13 | #[allow(missing_docs)] // documentation missing in model
|
120 - | UsWest2,
|
14 + | Url,
|
121 15 | }
|
122 - | /// See [`BucketLocationConstraint`](crate::model::BucketLocationConstraint).
|
123 - | pub mod bucket_location_constraint {
|
16 + | /// See [`EncodingType`](crate::model::EncodingType).
|
17 + | pub mod encoding_type {
|
124 18 | #[derive(Debug, PartialEq)]
|
125 19 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
126 20 |
|
127 21 | impl ::std::fmt::Display for ConstraintViolation {
|
128 22 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
129 23 | write!(
|
130 24 | f,
|
131 - | r#"Value provided for 'com.amazonaws.s3#BucketLocationConstraint' failed to satisfy constraint: Member must satisfy enum value set: [us-west-2]"#
|
25 + | r#"Value provided for 'com.amazonaws.s3#EncodingType' failed to satisfy constraint: Member must satisfy enum value set: [url]"#
|
132 26 | )
|
133 27 | }
|
134 28 | }
|
135 29 |
|
136 30 | impl ::std::error::Error for ConstraintViolation {}
|
31 + | impl ConstraintViolation {
|
32 + | pub(crate) fn as_validation_exception_field(
|
33 + | self,
|
34 + | path: ::std::string::String,
|
35 + | ) -> crate::model::ValidationExceptionField {
|
36 + | crate::model::ValidationExceptionField {
|
37 + | message: format!(
|
38 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [url]"#,
|
39 + | &path
|
40 + | ),
|
41 + | path,
|
42 + | }
|
43 + | }
|
44 + | }
|
137 45 | }
|
138 - | impl ::std::convert::TryFrom<&str> for BucketLocationConstraint {
|
139 - | type Error = crate::model::bucket_location_constraint::ConstraintViolation;
|
46 + | impl ::std::convert::TryFrom<&str> for EncodingType {
|
47 + | type Error = crate::model::encoding_type::ConstraintViolation;
|
140 48 | fn try_from(
|
141 49 | s: &str,
|
142 50 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
143 51 | match s {
|
144 - | "us-west-2" => Ok(BucketLocationConstraint::UsWest2),
|
145 - | _ => Err(crate::model::bucket_location_constraint::ConstraintViolation(s.to_owned())),
|
52 + | "url" => Ok(EncodingType::Url),
|
53 + | _ => Err(crate::model::encoding_type::ConstraintViolation(
|
54 + | s.to_owned(),
|
55 + | )),
|
146 56 | }
|
147 57 | }
|
148 58 | }
|
149 - | impl ::std::convert::TryFrom<::std::string::String> for BucketLocationConstraint {
|
150 - | type Error = crate::model::bucket_location_constraint::ConstraintViolation;
|
59 + | impl ::std::convert::TryFrom<::std::string::String> for EncodingType {
|
60 + | type Error = crate::model::encoding_type::ConstraintViolation;
|
151 61 | fn try_from(
|
152 62 | s: ::std::string::String,
|
153 63 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
154 64 | {
|
155 65 | s.as_str().try_into()
|
156 66 | }
|
157 67 | }
|
158 - | impl std::str::FromStr for BucketLocationConstraint {
|
159 - | type Err = crate::model::bucket_location_constraint::ConstraintViolation;
|
68 + | impl std::str::FromStr for EncodingType {
|
69 + | type Err = crate::model::encoding_type::ConstraintViolation;
|
160 70 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
161 71 | Self::try_from(s)
|
162 72 | }
|
163 73 | }
|
164 - | impl BucketLocationConstraint {
|
74 + | impl EncodingType {
|
165 75 | /// Returns the `&str` value of the enum member.
|
166 76 | pub fn as_str(&self) -> &str {
|
167 77 | match self {
|
168 - | BucketLocationConstraint::UsWest2 => "us-west-2",
|
78 + | EncodingType::Url => "url",
|
169 79 | }
|
170 80 | }
|
171 81 | /// Returns all the `&str` representations of the enum members.
|
172 82 | pub const fn values() -> &'static [&'static str] {
|
173 - | &["us-west-2"]
|
83 + | &["url"]
|
174 84 | }
|
175 85 | }
|
176 - | impl ::std::convert::AsRef<str> for BucketLocationConstraint {
|
86 + | impl ::std::convert::AsRef<str> for EncodingType {
|
177 87 | fn as_ref(&self) -> &str {
|
178 88 | self.as_str()
|
179 89 | }
|
180 90 | }
|
181 - | impl crate::constrained::Constrained for BucketLocationConstraint {
|
91 + | impl crate::constrained::Constrained for EncodingType {
|
182 92 | type Unconstrained = ::std::string::String;
|
183 93 | }
|
184 94 |
|
185 95 | impl ::std::convert::From<::std::string::String>
|
186 - | for crate::constrained::MaybeConstrained<crate::model::BucketLocationConstraint>
|
96 + | for crate::constrained::MaybeConstrained<crate::model::EncodingType>
|
187 97 | {
|
188 98 | fn from(value: ::std::string::String) -> Self {
|
189 99 | Self::Unconstrained(value)
|
190 100 | }
|
191 101 | }
|
192 102 |
|
193 103 | #[allow(missing_docs)] // documentation missing in model
|
194 104 | #[derive(
|
195 105 | ::std::clone::Clone,
|
196 106 | ::std::cmp::Eq,
|
197 107 | ::std::cmp::Ord,
|
198 108 | ::std::cmp::PartialEq,
|
199 109 | ::std::cmp::PartialOrd,
|
200 110 | ::std::fmt::Debug,
|
201 111 | ::std::hash::Hash,
|
202 112 | )]
|
203 - | pub enum EncodingType {
|
113 + | pub enum RequestPayer {
|
204 114 | #[allow(missing_docs)] // documentation missing in model
|
205 - | Url,
|
115 + | Requester,
|
206 116 | }
|
207 - | /// See [`EncodingType`](crate::model::EncodingType).
|
208 - | pub mod encoding_type {
|
117 + | /// See [`RequestPayer`](crate::model::RequestPayer).
|
118 + | pub mod request_payer {
|
209 119 | #[derive(Debug, PartialEq)]
|
210 120 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
211 121 |
|
212 122 | impl ::std::fmt::Display for ConstraintViolation {
|
213 123 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
214 124 | write!(
|
215 125 | f,
|
216 - | r#"Value provided for 'com.amazonaws.s3#EncodingType' failed to satisfy constraint: Member must satisfy enum value set: [url]"#
|
126 + | r#"Value provided for 'com.amazonaws.s3#RequestPayer' failed to satisfy constraint: Member must satisfy enum value set: [requester]"#
|
217 127 | )
|
218 128 | }
|
219 129 | }
|
220 130 |
|
221 131 | impl ::std::error::Error for ConstraintViolation {}
|
222 132 | impl ConstraintViolation {
|
223 133 | pub(crate) fn as_validation_exception_field(
|
224 134 | self,
|
225 135 | path: ::std::string::String,
|
226 136 | ) -> crate::model::ValidationExceptionField {
|
227 137 | crate::model::ValidationExceptionField {
|
228 138 | message: format!(
|
229 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [url]"#,
|
139 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [requester]"#,
|
230 140 | &path
|
231 141 | ),
|
232 142 | path,
|
233 143 | }
|
234 144 | }
|
235 145 | }
|
236 146 | }
|
237 - | impl ::std::convert::TryFrom<&str> for EncodingType {
|
238 - | type Error = crate::model::encoding_type::ConstraintViolation;
|
147 + | impl ::std::convert::TryFrom<&str> for RequestPayer {
|
148 + | type Error = crate::model::request_payer::ConstraintViolation;
|
239 149 | fn try_from(
|
240 150 | s: &str,
|
241 151 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
242 152 | match s {
|
243 - | "url" => Ok(EncodingType::Url),
|
244 - | _ => Err(crate::model::encoding_type::ConstraintViolation(
|
153 + | "requester" => Ok(RequestPayer::Requester),
|
154 + | _ => Err(crate::model::request_payer::ConstraintViolation(
|
245 155 | s.to_owned(),
|
246 156 | )),
|
247 157 | }
|
248 158 | }
|
249 159 | }
|
250 - | impl ::std::convert::TryFrom<::std::string::String> for EncodingType {
|
251 - | type Error = crate::model::encoding_type::ConstraintViolation;
|
160 + | impl ::std::convert::TryFrom<::std::string::String> for RequestPayer {
|
161 + | type Error = crate::model::request_payer::ConstraintViolation;
|
252 162 | fn try_from(
|
253 163 | s: ::std::string::String,
|
254 164 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
255 165 | {
|
256 166 | s.as_str().try_into()
|
257 167 | }
|
258 168 | }
|
259 - | impl std::str::FromStr for EncodingType {
|
260 - | type Err = crate::model::encoding_type::ConstraintViolation;
|
169 + | impl std::str::FromStr for RequestPayer {
|
170 + | type Err = crate::model::request_payer::ConstraintViolation;
|
261 171 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
262 172 | Self::try_from(s)
|
263 173 | }
|
264 174 | }
|
265 - | impl EncodingType {
|
175 + | impl RequestPayer {
|
266 176 | /// Returns the `&str` value of the enum member.
|
267 177 | pub fn as_str(&self) -> &str {
|
268 178 | match self {
|
269 - | EncodingType::Url => "url",
|
179 + | RequestPayer::Requester => "requester",
|
270 180 | }
|
271 181 | }
|
272 182 | /// Returns all the `&str` representations of the enum members.
|
273 183 | pub const fn values() -> &'static [&'static str] {
|
274 - | &["url"]
|
184 + | &["requester"]
|
275 185 | }
|
276 186 | }
|
277 - | impl ::std::convert::AsRef<str> for EncodingType {
|
187 + | impl ::std::convert::AsRef<str> for RequestPayer {
|
278 188 | fn as_ref(&self) -> &str {
|
279 189 | self.as_str()
|
280 190 | }
|
281 191 | }
|
282 - | impl crate::constrained::Constrained for EncodingType {
|
192 + | impl crate::constrained::Constrained for RequestPayer {
|
283 193 | type Unconstrained = ::std::string::String;
|
284 194 | }
|
285 195 |
|
286 196 | impl ::std::convert::From<::std::string::String>
|
287 - | for crate::constrained::MaybeConstrained<crate::model::EncodingType>
|
197 + | for crate::constrained::MaybeConstrained<crate::model::RequestPayer>
|
288 198 | {
|
289 199 | fn from(value: ::std::string::String) -> Self {
|
290 200 | Self::Unconstrained(value)
|
291 201 | }
|
292 202 | }
|
293 203 |
|
294 204 | #[allow(missing_docs)] // documentation missing in model
|
295 205 | #[derive(
|
296 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
206 + | ::std::clone::Clone,
|
207 + | ::std::cmp::Eq,
|
208 + | ::std::cmp::Ord,
|
209 + | ::std::cmp::PartialEq,
|
210 + | ::std::cmp::PartialOrd,
|
211 + | ::std::fmt::Debug,
|
212 + | ::std::hash::Hash,
|
297 213 | )]
|
298 - | pub struct CommonPrefix {
|
214 + | pub enum BucketLocationConstraint {
|
299 215 | #[allow(missing_docs)] // documentation missing in model
|
300 - | pub prefix: ::std::option::Option<::std::string::String>,
|
216 + | UsWest2,
|
301 217 | }
|
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()
|
218 + | /// See [`BucketLocationConstraint`](crate::model::BucketLocationConstraint).
|
219 + | pub mod bucket_location_constraint {
|
220 + | #[derive(Debug, PartialEq)]
|
221 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
222 + |
|
223 + | impl ::std::fmt::Display for ConstraintViolation {
|
224 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
225 + | write!(
|
226 + | f,
|
227 + | r#"Value provided for 'com.amazonaws.s3#BucketLocationConstraint' failed to satisfy constraint: Member must satisfy enum value set: [us-west-2]"#
|
228 + | )
|
306 229 | }
|
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 230 | }
|
313 - | }
|
314 231 |
|
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>,
|
232 + | impl ::std::error::Error for ConstraintViolation {}
|
332 233 | }
|
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 - | }
|
234 + | impl ::std::convert::TryFrom<&str> for BucketLocationConstraint {
|
235 + | type Error = crate::model::bucket_location_constraint::ConstraintViolation;
|
236 + | fn try_from(
|
237 + | s: &str,
|
238 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
239 + | match s {
|
240 + | "us-west-2" => Ok(BucketLocationConstraint::UsWest2),
|
241 + | _ => Err(crate::model::bucket_location_constraint::ConstraintViolation(s.to_owned())),
|
242 + | }
|
243 + | }
|
244 + | }
|
245 + | impl ::std::convert::TryFrom<::std::string::String> for BucketLocationConstraint {
|
246 + | type Error = crate::model::bucket_location_constraint::ConstraintViolation;
|
247 + | fn try_from(
|
248 + | s: ::std::string::String,
|
249 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
250 + | {
|
251 + | s.as_str().try_into()
|
252 + | }
|
253 + | }
|
254 + | impl std::str::FromStr for BucketLocationConstraint {
|
255 + | type Err = crate::model::bucket_location_constraint::ConstraintViolation;
|
256 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
257 + | Self::try_from(s)
|
258 + | }
|
259 + | }
|
260 + | impl BucketLocationConstraint {
|
261 + | /// Returns the `&str` value of the enum member.
|
262 + | pub fn as_str(&self) -> &str {
|
263 + | match self {
|
264 + | BucketLocationConstraint::UsWest2 => "us-west-2",
|
265 + | }
|
266 + | }
|
267 + | /// Returns all the `&str` representations of the enum members.
|
268 + | pub const fn values() -> &'static [&'static str] {
|
269 + | &["us-west-2"]
|
270 + | }
|
271 + | }
|
272 + | impl ::std::convert::AsRef<str> for BucketLocationConstraint {
|
273 + | fn as_ref(&self) -> &str {
|
274 + | self.as_str()
|
275 + | }
|
276 + | }
|
277 + | impl crate::constrained::Constrained for BucketLocationConstraint {
|
278 + | type Unconstrained = ::std::string::String;
|
279 + | }
|
280 + |
|
281 + | impl ::std::convert::From<::std::string::String>
|
282 + | for crate::constrained::MaybeConstrained<crate::model::BucketLocationConstraint>
|
283 + | {
|
284 + | fn from(value: ::std::string::String) -> Self {
|
285 + | Self::Unconstrained(value)
|
286 + | }
|
287 + | }
|
288 + |
|
289 + | #[allow(missing_docs)] // documentation missing in model
|
290 + | ///
|
291 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
292 + | /// [constraint traits]. Use [`ObjectKey::try_from`] to construct values of this type.
|
293 + | ///
|
294 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
295 + | ///
|
296 + | #[derive(
|
297 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
298 + | )]
|
299 + | pub struct ObjectKey(pub(crate) ::std::string::String);
|
300 + | impl ObjectKey {
|
301 + | /// Extracts a string slice containing the entire underlying `String`.
|
302 + | pub fn as_str(&self) -> &str {
|
303 + | &self.0
|
304 + | }
|
305 + |
|
306 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
307 + | pub fn inner(&self) -> &::std::string::String {
|
308 + | &self.0
|
309 + | }
|
310 + |
|
311 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
312 + | pub fn into_inner(self) -> ::std::string::String {
|
313 + | self.0
|
314 + | }
|
315 + | }
|
316 + | impl ObjectKey {
|
317 + | fn check_length(
|
318 + | string: &str,
|
319 + | ) -> ::std::result::Result<(), crate::model::object_key::ConstraintViolation> {
|
320 + | let length = string.chars().count();
|
321 + |
|
322 + | if 1 <= length {
|
323 + | Ok(())
|
324 + | } else {
|
325 + | Err(crate::model::object_key::ConstraintViolation::Length(
|
326 + | length,
|
327 + | ))
|
328 + | }
|
329 + | }
|
330 + | }
|
331 + | impl ::std::convert::TryFrom<::std::string::String> for ObjectKey {
|
332 + | type Error = crate::model::object_key::ConstraintViolation;
|
333 + |
|
334 + | /// Constructs a `ObjectKey` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
335 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
336 + | Self::check_length(&value)?;
|
337 + |
|
338 + | Ok(Self(value))
|
339 + | }
|
340 + | }
|
341 + | impl crate::constrained::Constrained for ObjectKey {
|
342 + | type Unconstrained = ::std::string::String;
|
343 + | }
|
344 + |
|
345 + | impl ::std::convert::From<::std::string::String>
|
346 + | for crate::constrained::MaybeConstrained<crate::model::ObjectKey>
|
347 + | {
|
348 + | fn from(value: ::std::string::String) -> Self {
|
349 + | Self::Unconstrained(value)
|
350 + | }
|
351 + | }
|
352 + |
|
353 + | impl ::std::fmt::Display for ObjectKey {
|
354 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
355 + | self.0.fmt(f)
|
356 + | }
|
357 + | }
|
358 + |
|
359 + | impl ::std::convert::From<ObjectKey> for ::std::string::String {
|
360 + | fn from(value: ObjectKey) -> Self {
|
361 + | value.into_inner()
|
362 + | }
|
363 + | }
|
364 + |
|
365 + | #[allow(missing_docs)] // documentation missing in model
|
366 + | #[derive(
|
367 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
368 + | )]
|
369 + | pub struct Object {
|
370 + | #[allow(missing_docs)] // documentation missing in model
|
371 + | pub key: ::std::option::Option<crate::model::ObjectKey>,
|
372 + | #[allow(missing_docs)] // documentation missing in model
|
373 + | pub last_modified: ::std::option::Option<::aws_smithy_types::DateTime>,
|
374 + | #[allow(missing_docs)] // documentation missing in model
|
375 + | pub e_tag: ::std::option::Option<::std::string::String>,
|
376 + | #[allow(missing_docs)] // documentation missing in model
|
377 + | pub size: ::std::option::Option<i32>,
|
378 + | #[allow(missing_docs)] // documentation missing in model
|
379 + | pub storage_class: ::std::option::Option<crate::model::ObjectStorageClass>,
|
380 + | #[allow(missing_docs)] // documentation missing in model
|
381 + | pub owner: ::std::option::Option<crate::model::Owner>,
|
382 + | }
|
383 + | impl Object {
|
384 + | #[allow(missing_docs)] // documentation missing in model
|
385 + | pub fn key(&self) -> ::std::option::Option<&crate::model::ObjectKey> {
|
386 + | self.key.as_ref()
|
387 + | }
|
338 388 | #[allow(missing_docs)] // documentation missing in model
|
339 389 | pub fn last_modified(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
|
340 390 | self.last_modified.as_ref()
|
341 391 | }
|
342 392 | #[allow(missing_docs)] // documentation missing in model
|
343 393 | pub fn e_tag(&self) -> ::std::option::Option<&str> {
|
344 394 | self.e_tag.as_deref()
|
345 395 | }
|
346 396 | #[allow(missing_docs)] // documentation missing in model
|
347 397 | pub fn size(&self) -> ::std::option::Option<i32> {
|
348 398 | self.size
|
349 399 | }
|
350 400 | #[allow(missing_docs)] // documentation missing in model
|
351 401 | pub fn storage_class(&self) -> ::std::option::Option<&crate::model::ObjectStorageClass> {
|
352 402 | self.storage_class.as_ref()
|
353 403 | }
|
354 404 | #[allow(missing_docs)] // documentation missing in model
|
355 405 | pub fn owner(&self) -> ::std::option::Option<&crate::model::Owner> {
|
356 406 | self.owner.as_ref()
|
357 407 | }
|
358 408 | }
|
359 409 | impl Object {
|
360 410 | /// Creates a new builder-style object to manufacture [`Object`](crate::model::Object).
|
361 411 | pub fn builder() -> crate::model::object::Builder {
|
362 412 | crate::model::object::Builder::default()
|
363 413 | }
|
364 414 | }
|
365 415 |
|
366 416 | #[allow(missing_docs)] // documentation missing in model
|
367 417 | #[derive(
|
368 418 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
369 419 | )]
|
370 - | pub struct Owner {
|
371 - | #[allow(missing_docs)] // documentation missing in model
|
372 - | pub display_name: ::std::option::Option<::std::string::String>,
|
420 + | pub struct CommonPrefix {
|
373 421 | #[allow(missing_docs)] // documentation missing in model
|
374 - | pub id: ::std::option::Option<::std::string::String>,
|
422 + | pub prefix: ::std::option::Option<::std::string::String>,
|
375 423 | }
|
376 - | impl Owner {
|
424 + | impl CommonPrefix {
|
377 425 | #[allow(missing_docs)] // documentation missing in model
|
378 - | pub fn display_name(&self) -> ::std::option::Option<&str> {
|
379 - | self.display_name.as_deref()
|
426 + | pub fn prefix(&self) -> ::std::option::Option<&str> {
|
427 + | self.prefix.as_deref()
|
380 428 | }
|
381 - | #[allow(missing_docs)] // documentation missing in model
|
382 - | pub fn id(&self) -> ::std::option::Option<&str> {
|
383 - | self.id.as_deref()
|
429 + | }
|
430 + | impl CommonPrefix {
|
431 + | /// Creates a new builder-style object to manufacture [`CommonPrefix`](crate::model::CommonPrefix).
|
432 + | pub fn builder() -> crate::model::common_prefix::Builder {
|
433 + | crate::model::common_prefix::Builder::default()
|
384 434 | }
|
385 435 | }
|
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()
|
436 + |
|
437 + | /// Describes one specific validation failure for an input member.
|
438 + | #[derive(
|
439 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
440 + | )]
|
441 + | pub struct ValidationExceptionField {
|
442 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
443 + | pub path: ::std::string::String,
|
444 + | /// A detailed description of the validation failure.
|
445 + | pub message: ::std::string::String,
|
446 + | }
|
447 + | impl ValidationExceptionField {
|
448 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
449 + | pub fn path(&self) -> &str {
|
450 + | use std::ops::Deref;
|
451 + | self.path.deref()
|
452 + | }
|
453 + | /// A detailed description of the validation failure.
|
454 + | pub fn message(&self) -> &str {
|
455 + | use std::ops::Deref;
|
456 + | self.message.deref()
|
457 + | }
|
458 + | }
|
459 + | impl ValidationExceptionField {
|
460 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
461 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
462 + | crate::model::validation_exception_field::Builder::default()
|
390 463 | }
|
391 464 | }
|
392 465 |
|
393 466 | #[allow(missing_docs)] // documentation missing in model
|
394 467 | #[derive(
|
395 468 | ::std::clone::Clone,
|
396 469 | ::std::cmp::Eq,
|
397 470 | ::std::cmp::Ord,
|
398 471 | ::std::cmp::PartialEq,
|
399 472 | ::std::cmp::PartialOrd,
|
509 582 | impl ::std::convert::From<::std::string::String>
|
510 583 | for crate::constrained::MaybeConstrained<crate::model::ObjectStorageClass>
|
511 584 | {
|
512 585 | fn from(value: ::std::string::String) -> Self {
|
513 586 | Self::Unconstrained(value)
|
514 587 | }
|
515 588 | }
|
516 589 |
|
517 590 | #[allow(missing_docs)] // documentation missing in model
|
518 591 | #[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,
|
592 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
526 593 | )]
|
527 - | pub enum RequestPayer {
|
594 + | pub struct Owner {
|
528 595 | #[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 - | }
|
596 + | pub display_name: ::std::option::Option<::std::string::String>,
|
597 + | #[allow(missing_docs)] // documentation missing in model
|
598 + | pub id: ::std::option::Option<::std::string::String>,
|
600 599 | }
|
601 - | impl ::std::convert::AsRef<str> for RequestPayer {
|
602 - | fn as_ref(&self) -> &str {
|
603 - | self.as_str()
|
600 + | impl Owner {
|
601 + | #[allow(missing_docs)] // documentation missing in model
|
602 + | pub fn display_name(&self) -> ::std::option::Option<&str> {
|
603 + | self.display_name.as_deref()
|
604 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)
|
605 + | #[allow(missing_docs)] // documentation missing in model
|
606 + | pub fn id(&self) -> ::std::option::Option<&str> {
|
607 + | self.id.as_deref()
|
615 608 | }
|
616 609 | }
|
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 - | }
|
610 + | impl Owner {
|
611 + | /// Creates a new builder-style object to manufacture [`Owner`](crate::model::Owner).
|
612 + | pub fn builder() -> crate::model::owner::Builder {
|
613 + | crate::model::owner::Builder::default()
|
679 614 | }
|
680 615 | }
|
681 616 | /// See [`ObjectKey`](crate::model::ObjectKey).
|
682 617 | pub mod object_key {
|
683 618 |
|
684 619 | #[derive(Debug, PartialEq)]
|
685 620 | pub enum ConstraintViolation {
|
686 621 | /// Error when a string doesn't satisfy its `@length` requirements.
|
687 622 | Length(usize),
|
688 623 | }
|
689 624 |
|
690 625 | impl ::std::fmt::Display for ConstraintViolation {
|
691 626 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
692 627 | let message = match self {
|
693 628 | Self::Length(length) => {
|
694 629 | 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 630 | }
|
696 631 | };
|
697 632 | write!(f, "{message}")
|
698 633 | }
|
699 634 | }
|
700 635 |
|
701 636 | impl ::std::error::Error for ConstraintViolation {}
|
702 637 | impl ConstraintViolation {
|
703 638 | pub(crate) fn as_validation_exception_field(
|
704 639 | self,
|
705 640 | path: ::std::string::String,
|
706 641 | ) -> crate::model::ValidationExceptionField {
|
707 642 | match self {
|
708 643 | Self::Length(length) => crate::model::ValidationExceptionField {
|
709 644 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 1", length, &path),
|
710 645 | path,
|
711 646 | },
|
712 647 | }
|
713 648 | }
|
714 649 | }
|
715 650 | }
|
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 651 | /// See [`Object`](crate::model::Object).
|
747 652 | pub mod object {
|
748 653 |
|
749 654 | impl ::std::convert::From<Builder> for crate::model::Object {
|
750 655 | fn from(builder: Builder) -> Self {
|
751 656 | builder.build()
|
752 657 | }
|
753 658 | }
|
754 659 | /// A builder for [`Object`](crate::model::Object).
|
755 660 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|