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.
|
2 + | /* StructureGenerator.kt:197 */
|
3 + | /// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
|
4 + | /* RustType.kt:516 */
|
4 5 | #[derive(
|
5 6 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
6 7 | )]
|
7 - | pub struct ValidationExceptionField {
|
8 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
8 + | pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
|
9 + | /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 10 | pub path: ::std::string::String,
|
10 - | /// A detailed description of the validation failure.
|
11 + | /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
|
11 12 | pub message: ::std::string::String,
|
13 + | /* StructureGenerator.kt:201 */
|
12 14 | }
|
15 + | /* StructureGenerator.kt:135 */
|
13 16 | impl ValidationExceptionField {
|
14 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
17 + | /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
18 + | /* StructureGenerator.kt:166 */
|
15 19 | pub fn path(&self) -> &str {
|
20 + | /* StructureGenerator.kt:171 */
|
16 21 | use std::ops::Deref;
|
17 22 | self.path.deref()
|
23 + | /* StructureGenerator.kt:166 */
|
18 24 | }
|
19 - | /// A detailed description of the validation failure.
|
25 + | /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
|
26 + | /* StructureGenerator.kt:166 */
|
20 27 | pub fn message(&self) -> &str {
|
28 + | /* StructureGenerator.kt:171 */
|
21 29 | use std::ops::Deref;
|
22 30 | self.message.deref()
|
31 + | /* StructureGenerator.kt:166 */
|
23 32 | }
|
33 + | /* StructureGenerator.kt:135 */
|
24 34 | }
|
35 + | /* ServerCodegenVisitor.kt:345 */
|
25 36 | impl ValidationExceptionField {
|
26 - | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
37 + | /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
38 + | /* ServerBuilderGenerator.kt:295 */
|
27 39 | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
40 + | /* ServerBuilderGenerator.kt:296 */
|
28 41 | crate::model::validation_exception_field::Builder::default()
|
42 + | /* ServerBuilderGenerator.kt:295 */
|
29 43 | }
|
44 + | /* ServerCodegenVisitor.kt:345 */
|
30 45 | }
|
31 46 |
|
47 + | /* ConstrainedStringGenerator.kt:82 */
|
32 48 | #[allow(missing_docs)] // documentation missing in model
|
33 - | ///
|
49 + | /// /* ConstrainedStringGenerator.kt:83 */
|
34 50 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
35 51 | /// [constraint traits]. Use [`ErrorMessage::try_from`] to construct values of this type.
|
36 52 | ///
|
37 53 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
38 54 | ///
|
55 + | /* RustType.kt:516 */
|
39 56 | #[derive(
|
40 57 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
41 58 | )]
|
42 - | pub struct ErrorMessage(pub(crate) ::std::string::String);
|
59 + | pub /* ConstrainedStringGenerator.kt:86 */ struct ErrorMessage(pub(crate) ::std::string::String);
|
60 + | /* ConstrainedStringGenerator.kt:90 */
|
43 61 | impl ErrorMessage {
|
44 62 | /// Extracts a string slice containing the entire underlying `String`.
|
45 63 | pub fn as_str(&self) -> &str {
|
46 64 | &self.0
|
47 65 | }
|
48 66 |
|
49 67 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
50 68 | pub fn inner(&self) -> &::std::string::String {
|
51 69 | &self.0
|
52 70 | }
|
53 71 |
|
54 72 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
55 73 | pub fn into_inner(self) -> ::std::string::String {
|
56 74 | self.0
|
57 75 | }
|
58 76 | }
|
77 + | /* TraitInfo.kt:41 */
|
59 78 | impl ErrorMessage {
|
60 79 | fn check_length(
|
61 80 | string: &str,
|
62 81 | ) -> ::std::result::Result<(), crate::model::error_message::ConstraintViolation> {
|
63 82 | let length = string.chars().count();
|
64 83 |
|
65 84 | if (0..=256).contains(&length) {
|
66 85 | Ok(())
|
67 86 | } else {
|
68 87 | Err(crate::model::error_message::ConstraintViolation::Length(
|
69 88 | length,
|
70 89 | ))
|
71 90 | }
|
72 91 | }
|
73 92 | }
|
93 + | /* TraitInfo.kt:57 */
|
74 94 | impl ::std::convert::TryFrom<::std::string::String> for ErrorMessage {
|
75 95 | type Error = crate::model::error_message::ConstraintViolation;
|
76 96 |
|
77 97 | /// Constructs a `ErrorMessage` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
78 98 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
79 99 | Self::check_length(&value)?;
|
80 100 |
|
81 101 | Ok(Self(value))
|
82 102 | }
|
83 103 | }
|
104 + | /* ConstrainedStringGenerator.kt:112 */
|
84 105 | impl crate::constrained::Constrained for ErrorMessage {
|
85 106 | type Unconstrained = ::std::string::String;
|
86 107 | }
|
87 108 |
|
88 109 | impl ::std::convert::From<::std::string::String>
|
89 110 | for crate::constrained::MaybeConstrained<crate::model::ErrorMessage>
|
90 111 | {
|
91 112 | fn from(value: ::std::string::String) -> Self {
|
92 113 | Self::Unconstrained(value)
|
93 114 | }
|
94 115 | }
|
95 116 |
|
96 117 | impl ::std::fmt::Display for ErrorMessage {
|
97 118 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
98 119 | self.0.fmt(f)
|
99 120 | }
|
100 121 | }
|
101 122 |
|
102 123 | impl ::std::convert::From<ErrorMessage> for ::std::string::String {
|
103 124 | fn from(value: ErrorMessage) -> Self {
|
104 125 | value.into_inner()
|
105 126 | }
|
106 127 | }
|
107 128 |
|
129 + | /* EnumGenerator.kt:154 */
|
108 130 | #[allow(missing_docs)] // documentation missing in model
|
131 + | /* RustType.kt:516 */
|
109 132 | #[derive(
|
110 133 | ::std::clone::Clone,
|
111 134 | ::std::cmp::Eq,
|
112 135 | ::std::cmp::Ord,
|
113 136 | ::std::cmp::PartialEq,
|
114 137 | ::std::cmp::PartialOrd,
|
115 138 | ::std::fmt::Debug,
|
116 139 | ::std::hash::Hash,
|
117 140 | )]
|
118 - | pub enum ServiceQuotaExceededExceptionReason {
|
141 + | pub /* EnumGenerator.kt:267 */ enum ServiceQuotaExceededExceptionReason {
|
142 + | /* EnumGenerator.kt:154 */
|
119 143 | #[allow(missing_docs)] // documentation missing in model
|
144 + | /* EnumGenerator.kt:143 */
|
120 145 | DependencyServiceQuotaExceeded,
|
146 + | /* EnumGenerator.kt:267 */
|
121 147 | }
|
122 - | /// See [`ServiceQuotaExceededExceptionReason`](crate::model::ServiceQuotaExceededExceptionReason).
|
148 + | /// /* CodegenDelegator.kt:51 */See [`ServiceQuotaExceededExceptionReason`](crate::model::ServiceQuotaExceededExceptionReason).
|
123 149 | pub mod service_quota_exceeded_exception_reason {
|
124 150 | #[derive(Debug, PartialEq)]
|
125 151 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
126 152 |
|
127 153 | impl ::std::fmt::Display for ConstraintViolation {
|
128 154 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
129 155 | write!(
|
130 156 | f,
|
131 157 | r#"Value provided for 'com.amazonaws.ebs#ServiceQuotaExceededExceptionReason' failed to satisfy constraint: Member must satisfy enum value set: [DEPENDENCY_SERVICE_QUOTA_EXCEEDED]"#
|
132 158 | )
|
133 159 | }
|
134 160 | }
|
135 161 |
|
136 162 | impl ::std::error::Error for ConstraintViolation {}
|
163 + |
|
164 + | /* ServerEnumGenerator.kt:46 */
|
137 165 | }
|
166 + | /* ServerEnumGenerator.kt:85 */
|
138 167 | impl ::std::convert::TryFrom<&str> for ServiceQuotaExceededExceptionReason {
|
139 168 | type Error = crate::model::service_quota_exceeded_exception_reason::ConstraintViolation;
|
140 169 | fn try_from(
|
141 170 | s: &str,
|
142 171 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
143 172 | match s {
|
144 173 | "DEPENDENCY_SERVICE_QUOTA_EXCEEDED" => {
|
145 174 | Ok(ServiceQuotaExceededExceptionReason::DependencyServiceQuotaExceeded)
|
146 175 | }
|
147 176 | _ => Err(
|
148 177 | crate::model::service_quota_exceeded_exception_reason::ConstraintViolation(
|
149 178 | s.to_owned(),
|
150 179 | ),
|
151 180 | ),
|
152 181 | }
|
153 182 | }
|
154 183 | }
|
155 184 | impl ::std::convert::TryFrom<::std::string::String> for ServiceQuotaExceededExceptionReason {
|
156 185 | type Error = crate::model::service_quota_exceeded_exception_reason::ConstraintViolation;
|
157 186 | fn try_from(
|
158 187 | s: ::std::string::String,
|
159 188 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
160 189 | {
|
161 190 | s.as_str().try_into()
|
162 191 | }
|
163 192 | }
|
193 + | /* ServerEnumGenerator.kt:145 */
|
164 194 | impl std::str::FromStr for ServiceQuotaExceededExceptionReason {
|
165 195 | type Err = crate::model::service_quota_exceeded_exception_reason::ConstraintViolation;
|
166 196 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
167 197 | Self::try_from(s)
|
168 198 | }
|
169 199 | }
|
200 + | /* EnumGenerator.kt:274 */
|
170 201 | impl ServiceQuotaExceededExceptionReason {
|
171 202 | /// Returns the `&str` value of the enum member.
|
172 203 | pub fn as_str(&self) -> &str {
|
173 204 | match self {
|
174 205 | ServiceQuotaExceededExceptionReason::DependencyServiceQuotaExceeded => {
|
175 206 | "DEPENDENCY_SERVICE_QUOTA_EXCEEDED"
|
176 207 | }
|
177 208 | }
|
178 209 | }
|
179 210 | /// Returns all the `&str` representations of the enum members.
|
180 211 | pub const fn values() -> &'static [&'static str] {
|
181 212 | &["DEPENDENCY_SERVICE_QUOTA_EXCEEDED"]
|
182 213 | }
|
183 214 | }
|
215 + | /* EnumGenerator.kt:223 */
|
184 216 | impl ::std::convert::AsRef<str> for ServiceQuotaExceededExceptionReason {
|
185 217 | fn as_ref(&self) -> &str {
|
186 218 | self.as_str()
|
187 219 | }
|
188 220 | }
|
221 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
189 222 | impl crate::constrained::Constrained for ServiceQuotaExceededExceptionReason {
|
190 223 | type Unconstrained = ::std::string::String;
|
191 224 | }
|
192 225 |
|
193 226 | impl ::std::convert::From<::std::string::String>
|
194 227 | for crate::constrained::MaybeConstrained<crate::model::ServiceQuotaExceededExceptionReason>
|
195 228 | {
|
196 229 | fn from(value: ::std::string::String) -> Self {
|
197 230 | Self::Unconstrained(value)
|
198 231 | }
|
199 232 | }
|
200 233 |
|
234 + | /* EnumGenerator.kt:154 */
|
201 235 | #[allow(missing_docs)] // documentation missing in model
|
236 + | /* RustType.kt:516 */
|
202 237 | #[derive(
|
203 238 | ::std::clone::Clone,
|
204 239 | ::std::cmp::Eq,
|
205 240 | ::std::cmp::Ord,
|
206 241 | ::std::cmp::PartialEq,
|
207 242 | ::std::cmp::PartialOrd,
|
208 243 | ::std::fmt::Debug,
|
209 244 | ::std::hash::Hash,
|
210 245 | )]
|
211 - | pub enum RequestThrottledExceptionReason {
|
246 + | pub /* EnumGenerator.kt:267 */ enum RequestThrottledExceptionReason {
|
247 + | /* EnumGenerator.kt:154 */
|
212 248 | #[allow(missing_docs)] // documentation missing in model
|
249 + | /* EnumGenerator.kt:143 */
|
213 250 | AccountThrottled,
|
251 + | /* EnumGenerator.kt:154 */
|
214 252 | #[allow(missing_docs)] // documentation missing in model
|
253 + | /* EnumGenerator.kt:143 */
|
215 254 | DependencyRequestThrottled,
|
255 + | /* EnumGenerator.kt:267 */
|
216 256 | }
|
217 - | /// See [`RequestThrottledExceptionReason`](crate::model::RequestThrottledExceptionReason).
|
257 + | /// /* CodegenDelegator.kt:51 */See [`RequestThrottledExceptionReason`](crate::model::RequestThrottledExceptionReason).
|
218 258 | pub mod request_throttled_exception_reason {
|
219 259 | #[derive(Debug, PartialEq)]
|
220 260 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
221 261 |
|
222 262 | impl ::std::fmt::Display for ConstraintViolation {
|
223 263 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
224 264 | write!(
|
225 265 | f,
|
226 266 | r#"Value provided for 'com.amazonaws.ebs#RequestThrottledExceptionReason' failed to satisfy constraint: Member must satisfy enum value set: [ACCOUNT_THROTTLED, DEPENDENCY_REQUEST_THROTTLED]"#
|
227 267 | )
|
228 268 | }
|
229 269 | }
|
230 270 |
|
231 271 | impl ::std::error::Error for ConstraintViolation {}
|
272 + |
|
273 + | /* ServerEnumGenerator.kt:46 */
|
232 274 | }
|
275 + | /* ServerEnumGenerator.kt:85 */
|
233 276 | impl ::std::convert::TryFrom<&str> for RequestThrottledExceptionReason {
|
234 277 | type Error = crate::model::request_throttled_exception_reason::ConstraintViolation;
|
235 278 | fn try_from(
|
236 279 | s: &str,
|
237 280 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
238 281 | match s {
|
239 282 | "ACCOUNT_THROTTLED" => Ok(RequestThrottledExceptionReason::AccountThrottled),
|
240 283 | "DEPENDENCY_REQUEST_THROTTLED" => {
|
241 284 | Ok(RequestThrottledExceptionReason::DependencyRequestThrottled)
|
242 285 | }
|
243 286 | _ => Err(
|
244 287 | crate::model::request_throttled_exception_reason::ConstraintViolation(s.to_owned()),
|
245 288 | ),
|
246 289 | }
|
247 290 | }
|
248 291 | }
|
249 292 | impl ::std::convert::TryFrom<::std::string::String> for RequestThrottledExceptionReason {
|
250 293 | type Error = crate::model::request_throttled_exception_reason::ConstraintViolation;
|
251 294 | fn try_from(
|
252 295 | s: ::std::string::String,
|
253 296 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
254 297 | {
|
255 298 | s.as_str().try_into()
|
256 299 | }
|
257 300 | }
|
301 + | /* ServerEnumGenerator.kt:145 */
|
258 302 | impl std::str::FromStr for RequestThrottledExceptionReason {
|
259 303 | type Err = crate::model::request_throttled_exception_reason::ConstraintViolation;
|
260 304 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
261 305 | Self::try_from(s)
|
262 306 | }
|
263 307 | }
|
308 + | /* EnumGenerator.kt:274 */
|
264 309 | impl RequestThrottledExceptionReason {
|
265 310 | /// Returns the `&str` value of the enum member.
|
266 311 | pub fn as_str(&self) -> &str {
|
267 312 | match self {
|
268 313 | RequestThrottledExceptionReason::AccountThrottled => "ACCOUNT_THROTTLED",
|
269 314 | RequestThrottledExceptionReason::DependencyRequestThrottled => {
|
270 315 | "DEPENDENCY_REQUEST_THROTTLED"
|
271 316 | }
|
272 317 | }
|
273 318 | }
|
274 319 | /// Returns all the `&str` representations of the enum members.
|
275 320 | pub const fn values() -> &'static [&'static str] {
|
276 321 | &["ACCOUNT_THROTTLED", "DEPENDENCY_REQUEST_THROTTLED"]
|
277 322 | }
|
278 323 | }
|
324 + | /* EnumGenerator.kt:223 */
|
279 325 | impl ::std::convert::AsRef<str> for RequestThrottledExceptionReason {
|
280 326 | fn as_ref(&self) -> &str {
|
281 327 | self.as_str()
|
282 328 | }
|
283 329 | }
|
330 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
284 331 | impl crate::constrained::Constrained for RequestThrottledExceptionReason {
|
285 332 | type Unconstrained = ::std::string::String;
|
286 333 | }
|
287 334 |
|
288 335 | impl ::std::convert::From<::std::string::String>
|
289 336 | for crate::constrained::MaybeConstrained<crate::model::RequestThrottledExceptionReason>
|
290 337 | {
|
291 338 | fn from(value: ::std::string::String) -> Self {
|
292 339 | Self::Unconstrained(value)
|
293 340 | }
|
294 341 | }
|
295 342 |
|
343 + | /* EnumGenerator.kt:154 */
|
296 344 | #[allow(missing_docs)] // documentation missing in model
|
345 + | /* RustType.kt:516 */
|
297 346 | #[derive(
|
298 347 | ::std::clone::Clone,
|
299 348 | ::std::cmp::Eq,
|
300 349 | ::std::cmp::Ord,
|
301 350 | ::std::cmp::PartialEq,
|
302 351 | ::std::cmp::PartialOrd,
|
303 352 | ::std::fmt::Debug,
|
304 353 | ::std::hash::Hash,
|
305 354 | )]
|
306 - | pub enum AccessDeniedExceptionReason {
|
355 + | pub /* EnumGenerator.kt:267 */ enum AccessDeniedExceptionReason {
|
356 + | /* EnumGenerator.kt:154 */
|
307 357 | #[allow(missing_docs)] // documentation missing in model
|
358 + | /* EnumGenerator.kt:143 */
|
308 359 | DependencyAccessDenied,
|
360 + | /* EnumGenerator.kt:154 */
|
309 361 | #[allow(missing_docs)] // documentation missing in model
|
362 + | /* EnumGenerator.kt:143 */
|
310 363 | UnauthorizedAccount,
|
364 + | /* EnumGenerator.kt:267 */
|
311 365 | }
|
312 - | /// See [`AccessDeniedExceptionReason`](crate::model::AccessDeniedExceptionReason).
|
366 + | /// /* CodegenDelegator.kt:51 */See [`AccessDeniedExceptionReason`](crate::model::AccessDeniedExceptionReason).
|
313 367 | pub mod access_denied_exception_reason {
|
314 368 | #[derive(Debug, PartialEq)]
|
315 369 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
316 370 |
|
317 371 | impl ::std::fmt::Display for ConstraintViolation {
|
318 372 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
319 373 | write!(
|
320 374 | f,
|
321 375 | r#"Value provided for 'com.amazonaws.ebs#AccessDeniedExceptionReason' failed to satisfy constraint: Member must satisfy enum value set: [UNAUTHORIZED_ACCOUNT, DEPENDENCY_ACCESS_DENIED]"#
|
322 376 | )
|
323 377 | }
|
324 378 | }
|
325 379 |
|
326 380 | impl ::std::error::Error for ConstraintViolation {}
|
381 + |
|
382 + | /* ServerEnumGenerator.kt:46 */
|
327 383 | }
|
384 + | /* ServerEnumGenerator.kt:85 */
|
328 385 | impl ::std::convert::TryFrom<&str> for AccessDeniedExceptionReason {
|
329 386 | type Error = crate::model::access_denied_exception_reason::ConstraintViolation;
|
330 387 | fn try_from(
|
331 388 | s: &str,
|
332 389 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
333 390 | match s {
|
334 391 | "DEPENDENCY_ACCESS_DENIED" => Ok(AccessDeniedExceptionReason::DependencyAccessDenied),
|
335 392 | "UNAUTHORIZED_ACCOUNT" => Ok(AccessDeniedExceptionReason::UnauthorizedAccount),
|
336 393 | _ => {
|
337 394 | Err(crate::model::access_denied_exception_reason::ConstraintViolation(s.to_owned()))
|
338 395 | }
|
339 396 | }
|
340 397 | }
|
341 398 | }
|
342 399 | impl ::std::convert::TryFrom<::std::string::String> for AccessDeniedExceptionReason {
|
343 400 | type Error = crate::model::access_denied_exception_reason::ConstraintViolation;
|
344 401 | fn try_from(
|
345 402 | s: ::std::string::String,
|
346 403 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
347 404 | {
|
348 405 | s.as_str().try_into()
|
349 406 | }
|
350 407 | }
|
408 + | /* ServerEnumGenerator.kt:145 */
|
351 409 | impl std::str::FromStr for AccessDeniedExceptionReason {
|
352 410 | type Err = crate::model::access_denied_exception_reason::ConstraintViolation;
|
353 411 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
354 412 | Self::try_from(s)
|
355 413 | }
|
356 414 | }
|
415 + | /* EnumGenerator.kt:274 */
|
357 416 | impl AccessDeniedExceptionReason {
|
358 417 | /// Returns the `&str` value of the enum member.
|
359 418 | pub fn as_str(&self) -> &str {
|
360 419 | match self {
|
361 420 | AccessDeniedExceptionReason::DependencyAccessDenied => "DEPENDENCY_ACCESS_DENIED",
|
362 421 | AccessDeniedExceptionReason::UnauthorizedAccount => "UNAUTHORIZED_ACCOUNT",
|
363 422 | }
|
364 423 | }
|
365 424 | /// Returns all the `&str` representations of the enum members.
|
366 425 | pub const fn values() -> &'static [&'static str] {
|
367 426 | &["DEPENDENCY_ACCESS_DENIED", "UNAUTHORIZED_ACCOUNT"]
|
368 427 | }
|
369 428 | }
|
429 + | /* EnumGenerator.kt:223 */
|
370 430 | impl ::std::convert::AsRef<str> for AccessDeniedExceptionReason {
|
371 431 | fn as_ref(&self) -> &str {
|
372 432 | self.as_str()
|
373 433 | }
|
374 434 | }
|
435 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
375 436 | impl crate::constrained::Constrained for AccessDeniedExceptionReason {
|
376 437 | type Unconstrained = ::std::string::String;
|
377 438 | }
|
378 439 |
|
379 440 | impl ::std::convert::From<::std::string::String>
|
380 441 | for crate::constrained::MaybeConstrained<crate::model::AccessDeniedExceptionReason>
|
381 442 | {
|
382 443 | fn from(value: ::std::string::String) -> Self {
|
383 444 | Self::Unconstrained(value)
|
384 445 | }
|
385 446 | }
|
386 447 |
|
448 + | /* EnumGenerator.kt:154 */
|
387 449 | #[allow(missing_docs)] // documentation missing in model
|
450 + | /* RustType.kt:516 */
|
388 451 | #[derive(
|
389 452 | ::std::clone::Clone,
|
390 453 | ::std::cmp::Eq,
|
391 454 | ::std::cmp::Ord,
|
392 455 | ::std::cmp::PartialEq,
|
393 456 | ::std::cmp::PartialOrd,
|
394 457 | ::std::fmt::Debug,
|
395 458 | ::std::hash::Hash,
|
396 459 | )]
|
397 - | pub enum ResourceNotFoundExceptionReason {
|
460 + | pub /* EnumGenerator.kt:267 */ enum ResourceNotFoundExceptionReason {
|
461 + | /* EnumGenerator.kt:154 */
|
398 462 | #[allow(missing_docs)] // documentation missing in model
|
463 + | /* EnumGenerator.kt:143 */
|
399 464 | DependencyResourceNotFound,
|
465 + | /* EnumGenerator.kt:154 */
|
400 466 | #[allow(missing_docs)] // documentation missing in model
|
467 + | /* EnumGenerator.kt:143 */
|
401 468 | SnapshotNotFound,
|
469 + | /* EnumGenerator.kt:267 */
|
402 470 | }
|
403 - | /// See [`ResourceNotFoundExceptionReason`](crate::model::ResourceNotFoundExceptionReason).
|
471 + | /// /* CodegenDelegator.kt:51 */See [`ResourceNotFoundExceptionReason`](crate::model::ResourceNotFoundExceptionReason).
|
404 472 | pub mod resource_not_found_exception_reason {
|
405 473 | #[derive(Debug, PartialEq)]
|
406 474 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
407 475 |
|
408 476 | impl ::std::fmt::Display for ConstraintViolation {
|
409 477 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
410 478 | write!(
|
411 479 | f,
|
412 480 | r#"Value provided for 'com.amazonaws.ebs#ResourceNotFoundExceptionReason' failed to satisfy constraint: Member must satisfy enum value set: [SNAPSHOT_NOT_FOUND, DEPENDENCY_RESOURCE_NOT_FOUND]"#
|
413 481 | )
|
414 482 | }
|
415 483 | }
|
416 484 |
|
417 485 | impl ::std::error::Error for ConstraintViolation {}
|
486 + |
|
487 + | /* ServerEnumGenerator.kt:46 */
|
418 488 | }
|
489 + | /* ServerEnumGenerator.kt:85 */
|
419 490 | impl ::std::convert::TryFrom<&str> for ResourceNotFoundExceptionReason {
|
420 491 | type Error = crate::model::resource_not_found_exception_reason::ConstraintViolation;
|
421 492 | fn try_from(
|
422 493 | s: &str,
|
423 494 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
424 495 | match s {
|
425 496 | "DEPENDENCY_RESOURCE_NOT_FOUND" => {
|
426 497 | Ok(ResourceNotFoundExceptionReason::DependencyResourceNotFound)
|
427 498 | }
|
428 499 | "SNAPSHOT_NOT_FOUND" => Ok(ResourceNotFoundExceptionReason::SnapshotNotFound),
|
429 500 | _ => Err(
|
430 501 | crate::model::resource_not_found_exception_reason::ConstraintViolation(
|
431 502 | s.to_owned(),
|
432 503 | ),
|
433 504 | ),
|
434 505 | }
|
435 506 | }
|
436 507 | }
|
437 508 | impl ::std::convert::TryFrom<::std::string::String> for ResourceNotFoundExceptionReason {
|
438 509 | type Error = crate::model::resource_not_found_exception_reason::ConstraintViolation;
|
439 510 | fn try_from(
|
440 511 | s: ::std::string::String,
|
441 512 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
442 513 | {
|
443 514 | s.as_str().try_into()
|
444 515 | }
|
445 516 | }
|
517 + | /* ServerEnumGenerator.kt:145 */
|
446 518 | impl std::str::FromStr for ResourceNotFoundExceptionReason {
|
447 519 | type Err = crate::model::resource_not_found_exception_reason::ConstraintViolation;
|
448 520 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
449 521 | Self::try_from(s)
|
450 522 | }
|
451 523 | }
|
524 + | /* EnumGenerator.kt:274 */
|
452 525 | impl ResourceNotFoundExceptionReason {
|
453 526 | /// Returns the `&str` value of the enum member.
|
454 527 | pub fn as_str(&self) -> &str {
|
455 528 | match self {
|
456 529 | ResourceNotFoundExceptionReason::DependencyResourceNotFound => {
|
457 530 | "DEPENDENCY_RESOURCE_NOT_FOUND"
|
458 531 | }
|
459 532 | ResourceNotFoundExceptionReason::SnapshotNotFound => "SNAPSHOT_NOT_FOUND",
|
460 533 | }
|
461 534 | }
|
462 535 | /// Returns all the `&str` representations of the enum members.
|
463 536 | pub const fn values() -> &'static [&'static str] {
|
464 537 | &["DEPENDENCY_RESOURCE_NOT_FOUND", "SNAPSHOT_NOT_FOUND"]
|
465 538 | }
|
466 539 | }
|
540 + | /* EnumGenerator.kt:223 */
|
467 541 | impl ::std::convert::AsRef<str> for ResourceNotFoundExceptionReason {
|
468 542 | fn as_ref(&self) -> &str {
|
469 543 | self.as_str()
|
470 544 | }
|
471 545 | }
|
546 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
472 547 | impl crate::constrained::Constrained for ResourceNotFoundExceptionReason {
|
473 548 | type Unconstrained = ::std::string::String;
|
474 549 | }
|
475 550 |
|
476 551 | impl ::std::convert::From<::std::string::String>
|
477 552 | for crate::constrained::MaybeConstrained<crate::model::ResourceNotFoundExceptionReason>
|
478 553 | {
|
479 554 | fn from(value: ::std::string::String) -> Self {
|
480 555 | Self::Unconstrained(value)
|
481 556 | }
|
482 557 | }
|
483 558 |
|
559 + | /* EnumGenerator.kt:154 */
|
484 560 | #[allow(missing_docs)] // documentation missing in model
|
561 + | /* RustType.kt:516 */
|
485 562 | #[derive(
|
486 563 | ::std::clone::Clone,
|
487 564 | ::std::cmp::Eq,
|
488 565 | ::std::cmp::Ord,
|
489 566 | ::std::cmp::PartialEq,
|
490 567 | ::std::cmp::PartialOrd,
|
491 568 | ::std::fmt::Debug,
|
492 569 | ::std::hash::Hash,
|
493 570 | )]
|
494 - | pub enum Status {
|
571 + | pub /* EnumGenerator.kt:267 */ enum Status {
|
572 + | /* EnumGenerator.kt:154 */
|
495 573 | #[allow(missing_docs)] // documentation missing in model
|
574 + | /* EnumGenerator.kt:143 */
|
496 575 | Completed,
|
576 + | /* EnumGenerator.kt:154 */
|
497 577 | #[allow(missing_docs)] // documentation missing in model
|
578 + | /* EnumGenerator.kt:143 */
|
498 579 | Error,
|
580 + | /* EnumGenerator.kt:154 */
|
499 581 | #[allow(missing_docs)] // documentation missing in model
|
582 + | /* EnumGenerator.kt:143 */
|
500 583 | Pending,
|
584 + | /* EnumGenerator.kt:267 */
|
501 585 | }
|
502 - | /// See [`Status`](crate::model::Status).
|
586 + | /// /* CodegenDelegator.kt:51 */See [`Status`](crate::model::Status).
|
503 587 | pub mod status {
|
504 588 | #[derive(Debug, PartialEq)]
|
505 589 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
506 590 |
|
507 591 | impl ::std::fmt::Display for ConstraintViolation {
|
508 592 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
509 593 | write!(
|
510 594 | f,
|
511 595 | r#"Value provided for 'com.amazonaws.ebs#Status' failed to satisfy constraint: Member must satisfy enum value set: [completed, pending, error]"#
|
512 596 | )
|
513 597 | }
|
514 598 | }
|
515 599 |
|
516 600 | impl ::std::error::Error for ConstraintViolation {}
|
601 + |
|
602 + | /* ServerEnumGenerator.kt:46 */
|
517 603 | }
|
604 + | /* ServerEnumGenerator.kt:85 */
|
518 605 | impl ::std::convert::TryFrom<&str> for Status {
|
519 606 | type Error = crate::model::status::ConstraintViolation;
|
520 607 | fn try_from(
|
521 608 | s: &str,
|
522 609 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
523 610 | match s {
|
524 611 | "completed" => Ok(Status::Completed),
|
525 612 | "error" => Ok(Status::Error),
|
526 613 | "pending" => Ok(Status::Pending),
|
527 614 | _ => Err(crate::model::status::ConstraintViolation(s.to_owned())),
|
528 615 | }
|
529 616 | }
|
530 617 | }
|
531 618 | impl ::std::convert::TryFrom<::std::string::String> for Status {
|
532 619 | type Error = crate::model::status::ConstraintViolation;
|
533 620 | fn try_from(
|
534 621 | s: ::std::string::String,
|
535 622 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
536 623 | {
|
537 624 | s.as_str().try_into()
|
538 625 | }
|
539 626 | }
|
627 + | /* ServerEnumGenerator.kt:145 */
|
540 628 | impl std::str::FromStr for Status {
|
541 629 | type Err = crate::model::status::ConstraintViolation;
|
542 630 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
543 631 | Self::try_from(s)
|
544 632 | }
|
545 633 | }
|
634 + | /* EnumGenerator.kt:274 */
|
546 635 | impl Status {
|
547 636 | /// Returns the `&str` value of the enum member.
|
548 637 | pub fn as_str(&self) -> &str {
|
549 638 | match self {
|
550 639 | Status::Completed => "completed",
|
551 640 | Status::Error => "error",
|
552 641 | Status::Pending => "pending",
|
553 642 | }
|
554 643 | }
|
555 644 | /// Returns all the `&str` representations of the enum members.
|
556 645 | pub const fn values() -> &'static [&'static str] {
|
557 646 | &["completed", "error", "pending"]
|
558 647 | }
|
559 648 | }
|
649 + | /* EnumGenerator.kt:223 */
|
560 650 | impl ::std::convert::AsRef<str> for Status {
|
561 651 | fn as_ref(&self) -> &str {
|
562 652 | self.as_str()
|
563 653 | }
|
564 654 | }
|
655 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
565 656 | impl crate::constrained::Constrained for Status {
|
566 657 | type Unconstrained = ::std::string::String;
|
567 658 | }
|
568 659 |
|
569 660 | impl ::std::convert::From<::std::string::String>
|
570 661 | for crate::constrained::MaybeConstrained<crate::model::Status>
|
571 662 | {
|
572 663 | fn from(value: ::std::string::String) -> Self {
|
573 664 | Self::Unconstrained(value)
|
574 665 | }
|
575 666 | }
|
576 667 |
|
668 + | /* ConstrainedStringGenerator.kt:82 */
|
577 669 | #[allow(missing_docs)] // documentation missing in model
|
578 - | ///
|
670 + | /// /* ConstrainedStringGenerator.kt:83 */
|
579 671 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
580 672 | /// [constraint traits]. Use [`SnapshotId::try_from`] to construct values of this type.
|
581 673 | ///
|
582 674 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
583 675 | ///
|
676 + | /* RustType.kt:516 */
|
584 677 | #[derive(
|
585 678 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
586 679 | )]
|
587 - | pub struct SnapshotId(pub(crate) ::std::string::String);
|
680 + | pub /* ConstrainedStringGenerator.kt:86 */ struct SnapshotId(pub(crate) ::std::string::String);
|
681 + | /* ConstrainedStringGenerator.kt:90 */
|
588 682 | impl SnapshotId {
|
589 683 | /// Extracts a string slice containing the entire underlying `String`.
|
590 684 | pub fn as_str(&self) -> &str {
|
591 685 | &self.0
|
592 686 | }
|
593 687 |
|
594 688 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
595 689 | pub fn inner(&self) -> &::std::string::String {
|
596 690 | &self.0
|
597 691 | }
|
598 692 |
|
599 693 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
600 694 | pub fn into_inner(self) -> ::std::string::String {
|
601 695 | self.0
|
602 696 | }
|
603 697 | }
|
698 + | /* TraitInfo.kt:41 */
|
604 699 | impl SnapshotId {
|
605 700 | fn check_length(
|
606 701 | string: &str,
|
607 702 | ) -> ::std::result::Result<(), crate::model::snapshot_id::ConstraintViolation> {
|
608 703 | let length = string.chars().count();
|
609 704 |
|
610 705 | if (1..=64).contains(&length) {
|
611 706 | Ok(())
|
612 707 | } else {
|
613 708 | Err(crate::model::snapshot_id::ConstraintViolation::Length(
|
614 709 | length,
|
615 710 | ))
|
616 711 | }
|
617 712 | }
|
618 713 |
|
619 714 | fn check_pattern(
|
620 715 | string: ::std::string::String,
|
621 716 | ) -> ::std::result::Result<::std::string::String, crate::model::snapshot_id::ConstraintViolation>
|
622 717 | {
|
623 718 | let regex = Self::compile_regex();
|
624 719 |
|
625 720 | if regex.is_match(&string) {
|
626 721 | Ok(string)
|
627 722 | } else {
|
628 723 | Err(crate::model::snapshot_id::ConstraintViolation::Pattern(
|
629 724 | string,
|
630 725 | ))
|
631 726 | }
|
632 727 | }
|
633 728 |
|
634 729 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
635 730 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
636 731 | pub fn compile_regex() -> &'static ::regex::Regex {
|
637 732 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
638 733 | ::regex::Regex::new(r#"^snap-[0-9a-f]+$"#).expect(r#"The regular expression ^snap-[0-9a-f]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
639 734 | });
|
640 735 |
|
641 736 | ®EX
|
642 737 | }
|
643 738 | }
|
739 + | /* TraitInfo.kt:57 */
|
644 740 | impl ::std::convert::TryFrom<::std::string::String> for SnapshotId {
|
645 741 | type Error = crate::model::snapshot_id::ConstraintViolation;
|
646 742 |
|
647 743 | /// Constructs a `SnapshotId` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
648 744 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
649 745 | Self::check_length(&value)?;
|
650 746 |
|
651 747 | let value = Self::check_pattern(value)?;
|
652 748 |
|
653 749 | Ok(Self(value))
|
654 750 | }
|
655 751 | }
|
752 + | /* ConstrainedStringGenerator.kt:112 */
|
656 753 | impl crate::constrained::Constrained for SnapshotId {
|
657 754 | type Unconstrained = ::std::string::String;
|
658 755 | }
|
659 756 |
|
660 757 | impl ::std::convert::From<::std::string::String>
|
661 758 | for crate::constrained::MaybeConstrained<crate::model::SnapshotId>
|
662 759 | {
|
663 760 | fn from(value: ::std::string::String) -> Self {
|
664 761 | Self::Unconstrained(value)
|
665 762 | }
|
666 763 | }
|
667 764 |
|
668 765 | impl ::std::fmt::Display for SnapshotId {
|
669 766 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
670 767 | self.0.fmt(f)
|
671 768 | }
|
672 769 | }
|
673 770 |
|
674 771 | impl ::std::convert::From<SnapshotId> for ::std::string::String {
|
675 772 | fn from(value: SnapshotId) -> Self {
|
676 773 | value.into_inner()
|
677 774 | }
|
678 775 | }
|
679 776 |
|
777 + | /* RustType.kt:516 */
|
680 778 | #[cfg(test)]
|
779 + | /* ConstrainedStringGenerator.kt:205 */
|
681 780 | mod test_snapshot_id {
|
682 781 | #[test]
|
683 782 | fn regex_compiles() {
|
684 783 | crate::model::SnapshotId::compile_regex();
|
685 784 | }
|
785 + |
|
786 + | /* ConstrainedStringGenerator.kt:205 */
|
686 787 | }
|
687 788 |
|
789 + | /* ConstrainedStringGenerator.kt:82 */
|
688 790 | #[allow(missing_docs)] // documentation missing in model
|
689 - | ///
|
791 + | /// /* ConstrainedStringGenerator.kt:83 */
|
690 792 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
691 793 | /// [constraint traits]. Use [`Description::try_from`] to construct values of this type.
|
692 794 | ///
|
693 795 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
694 796 | ///
|
797 + | /* RustType.kt:516 */
|
695 798 | #[derive(
|
696 799 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
697 800 | )]
|
698 - | pub struct Description(pub(crate) ::std::string::String);
|
801 + | pub /* ConstrainedStringGenerator.kt:86 */ struct Description(pub(crate) ::std::string::String);
|
802 + | /* ConstrainedStringGenerator.kt:90 */
|
699 803 | impl Description {
|
700 804 | /// Extracts a string slice containing the entire underlying `String`.
|
701 805 | pub fn as_str(&self) -> &str {
|
702 806 | &self.0
|
703 807 | }
|
704 808 |
|
705 809 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
706 810 | pub fn inner(&self) -> &::std::string::String {
|
707 811 | &self.0
|
708 812 | }
|
709 813 |
|
710 814 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
711 815 | pub fn into_inner(self) -> ::std::string::String {
|
712 816 | self.0
|
713 817 | }
|
714 818 | }
|
819 + | /* TraitInfo.kt:41 */
|
715 820 | impl Description {
|
716 821 | fn check_length(
|
717 822 | string: &str,
|
718 823 | ) -> ::std::result::Result<(), crate::model::description::ConstraintViolation> {
|
719 824 | let length = string.chars().count();
|
720 825 |
|
721 826 | if (0..=255).contains(&length) {
|
722 827 | Ok(())
|
723 828 | } else {
|
724 829 | Err(crate::model::description::ConstraintViolation::Length(
|
725 830 | length,
|
726 831 | ))
|
727 832 | }
|
728 833 | }
|
729 834 |
|
730 835 | fn check_pattern(
|
731 836 | string: ::std::string::String,
|
732 837 | ) -> ::std::result::Result<::std::string::String, crate::model::description::ConstraintViolation>
|
733 838 | {
|
734 839 | let regex = Self::compile_regex();
|
735 840 |
|
736 841 | if regex.is_match(&string) {
|
737 842 | Ok(string)
|
738 843 | } else {
|
739 844 | Err(crate::model::description::ConstraintViolation::Pattern(
|
740 845 | string,
|
741 846 | ))
|
742 847 | }
|
743 848 | }
|
744 849 |
|
745 850 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
746 851 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
747 852 | pub fn compile_regex() -> &'static ::regex::Regex {
|
748 853 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
749 854 | ::regex::Regex::new(r#"^[\S\s]+$"#).expect(r#"The regular expression ^[\S\s]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
750 855 | });
|
751 856 |
|
752 857 | ®EX
|
753 858 | }
|
754 859 | }
|
860 + | /* TraitInfo.kt:57 */
|
755 861 | impl ::std::convert::TryFrom<::std::string::String> for Description {
|
756 862 | type Error = crate::model::description::ConstraintViolation;
|
757 863 |
|
758 864 | /// Constructs a `Description` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
759 865 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
760 866 | Self::check_length(&value)?;
|
761 867 |
|
762 868 | let value = Self::check_pattern(value)?;
|
763 869 |
|
764 870 | Ok(Self(value))
|
765 871 | }
|
766 872 | }
|
873 + | /* ConstrainedStringGenerator.kt:112 */
|
767 874 | impl crate::constrained::Constrained for Description {
|
768 875 | type Unconstrained = ::std::string::String;
|
769 876 | }
|
770 877 |
|
771 878 | impl ::std::convert::From<::std::string::String>
|
772 879 | for crate::constrained::MaybeConstrained<crate::model::Description>
|
773 880 | {
|
774 881 | fn from(value: ::std::string::String) -> Self {
|
775 882 | Self::Unconstrained(value)
|
776 883 | }
|
777 884 | }
|
778 885 |
|
779 886 | impl ::std::fmt::Display for Description {
|
780 887 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
781 888 | self.0.fmt(f)
|
782 889 | }
|
783 890 | }
|
784 891 |
|
785 892 | impl ::std::convert::From<Description> for ::std::string::String {
|
786 893 | fn from(value: Description) -> Self {
|
787 894 | value.into_inner()
|
788 895 | }
|
789 896 | }
|
790 897 |
|
898 + | /* RustType.kt:516 */
|
791 899 | #[cfg(test)]
|
900 + | /* ConstrainedStringGenerator.kt:205 */
|
792 901 | mod test_description {
|
793 902 | #[test]
|
794 903 | fn regex_compiles() {
|
795 904 | crate::model::Description::compile_regex();
|
796 905 | }
|
906 + |
|
907 + | /* ConstrainedStringGenerator.kt:205 */
|
797 908 | }
|
798 909 |
|
910 + | /* ConstrainedNumberGenerator.kt:82 */
|
799 911 | #[allow(missing_docs)] // documentation missing in model
|
800 - | ///
|
912 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
801 913 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
802 914 | /// [constraint traits]. Use [`VolumeSize::try_from`] to construct values of this type.
|
803 915 | ///
|
804 916 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
805 917 | ///
|
918 + | /* RustType.kt:516 */
|
806 919 | #[derive(
|
807 920 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
808 921 | )]
|
809 - | pub struct VolumeSize(pub(crate) i64);
|
922 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct VolumeSize(pub(crate) i64);
|
923 + | /* ConstrainedNumberGenerator.kt:91 */
|
810 924 | impl VolumeSize {
|
811 925 | /// Returns an immutable reference to the underlying [`i64`].
|
812 926 | pub fn inner(&self) -> &i64 {
|
813 927 | &self.0
|
814 928 | }
|
815 929 |
|
816 930 | /// Consumes the value, returning the underlying [`i64`].
|
817 931 | pub fn into_inner(self) -> i64 {
|
818 932 | self.0
|
819 933 | }
|
820 934 | }
|
821 935 |
|
822 936 | impl crate::constrained::Constrained for VolumeSize {
|
823 937 | type Unconstrained = i64;
|
824 938 | }
|
825 939 |
|
826 940 | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::VolumeSize> {
|
827 941 | fn from(value: i64) -> Self {
|
828 942 | Self::Unconstrained(value)
|
829 943 | }
|
830 944 | }
|
831 945 |
|
832 946 | impl ::std::fmt::Display for VolumeSize {
|
833 947 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
834 948 | self.0.fmt(f)
|
835 949 | }
|
836 950 | }
|
837 951 |
|
838 952 | impl ::std::convert::From<VolumeSize> for i64 {
|
839 953 | fn from(value: VolumeSize) -> Self {
|
840 954 | value.into_inner()
|
841 955 | }
|
842 956 | }
|
957 + | /* TraitInfo.kt:41 */
|
843 958 | impl VolumeSize {
|
844 959 | fn check_range(
|
845 960 | value: i64,
|
846 961 | ) -> ::std::result::Result<(), crate::model::volume_size::ConstraintViolation> {
|
847 962 | if 1 <= value {
|
848 963 | Ok(())
|
849 964 | } else {
|
850 965 | Err(crate::model::volume_size::ConstraintViolation::Range(value))
|
851 966 | }
|
852 967 | }
|
853 968 | }
|
969 + | /* TraitInfo.kt:57 */
|
854 970 | impl ::std::convert::TryFrom<i64> for VolumeSize {
|
855 971 | type Error = crate::model::volume_size::ConstraintViolation;
|
856 972 |
|
857 973 | /// Constructs a `VolumeSize` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
858 974 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
859 975 | Self::check_range(value)?;
|
860 976 |
|
861 977 | Ok(Self(value))
|
862 978 | }
|
863 979 | }
|
864 980 |
|
981 + | /* ConstrainedStringGenerator.kt:82 */
|
865 982 | #[allow(missing_docs)] // documentation missing in model
|
866 - | ///
|
983 + | /// /* ConstrainedStringGenerator.kt:83 */
|
867 984 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
868 985 | /// [constraint traits]. Use [`OwnerId::try_from`] to construct values of this type.
|
869 986 | ///
|
870 987 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
871 988 | ///
|
989 + | /* RustType.kt:516 */
|
872 990 | #[derive(
|
873 991 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
874 992 | )]
|
875 - | pub struct OwnerId(pub(crate) ::std::string::String);
|
993 + | pub /* ConstrainedStringGenerator.kt:86 */ struct OwnerId(pub(crate) ::std::string::String);
|
994 + | /* ConstrainedStringGenerator.kt:90 */
|
876 995 | impl OwnerId {
|
877 996 | /// Extracts a string slice containing the entire underlying `String`.
|
878 997 | pub fn as_str(&self) -> &str {
|
879 998 | &self.0
|
880 999 | }
|
881 1000 |
|
882 1001 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
883 1002 | pub fn inner(&self) -> &::std::string::String {
|
884 1003 | &self.0
|
885 1004 | }
|
886 1005 |
|
887 1006 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
888 1007 | pub fn into_inner(self) -> ::std::string::String {
|
889 1008 | self.0
|
890 1009 | }
|
891 1010 | }
|
1011 + | /* TraitInfo.kt:41 */
|
892 1012 | impl OwnerId {
|
893 1013 | fn check_length(
|
894 1014 | string: &str,
|
895 1015 | ) -> ::std::result::Result<(), crate::model::owner_id::ConstraintViolation> {
|
896 1016 | let length = string.chars().count();
|
897 1017 |
|
898 1018 | if (1..=24).contains(&length) {
|
899 1019 | Ok(())
|
900 1020 | } else {
|
901 1021 | Err(crate::model::owner_id::ConstraintViolation::Length(length))
|
902 1022 | }
|
903 1023 | }
|
904 1024 |
|
905 1025 | fn check_pattern(
|
906 1026 | string: ::std::string::String,
|
907 1027 | ) -> ::std::result::Result<::std::string::String, crate::model::owner_id::ConstraintViolation>
|
908 1028 | {
|
909 1029 | let regex = Self::compile_regex();
|
910 1030 |
|
911 1031 | if regex.is_match(&string) {
|
912 1032 | Ok(string)
|
913 1033 | } else {
|
914 1034 | Err(crate::model::owner_id::ConstraintViolation::Pattern(string))
|
915 1035 | }
|
916 1036 | }
|
917 1037 |
|
918 1038 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
919 1039 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
920 1040 | pub fn compile_regex() -> &'static ::regex::Regex {
|
921 1041 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
922 1042 | ::regex::Regex::new(r#"\S+"#).expect(r#"The regular expression \S+ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
923 1043 | });
|
924 1044 |
|
925 1045 | ®EX
|
926 1046 | }
|
927 1047 | }
|
1048 + | /* TraitInfo.kt:57 */
|
928 1049 | impl ::std::convert::TryFrom<::std::string::String> for OwnerId {
|
929 1050 | type Error = crate::model::owner_id::ConstraintViolation;
|
930 1051 |
|
931 1052 | /// Constructs a `OwnerId` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
932 1053 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
933 1054 | Self::check_length(&value)?;
|
934 1055 |
|
935 1056 | let value = Self::check_pattern(value)?;
|
936 1057 |
|
937 1058 | Ok(Self(value))
|
938 1059 | }
|
939 1060 | }
|
1061 + | /* ConstrainedStringGenerator.kt:112 */
|
940 1062 | impl crate::constrained::Constrained for OwnerId {
|
941 1063 | type Unconstrained = ::std::string::String;
|
942 1064 | }
|
943 1065 |
|
944 1066 | impl ::std::convert::From<::std::string::String>
|
945 1067 | for crate::constrained::MaybeConstrained<crate::model::OwnerId>
|
946 1068 | {
|
947 1069 | fn from(value: ::std::string::String) -> Self {
|
948 1070 | Self::Unconstrained(value)
|
949 1071 | }
|
950 1072 | }
|
951 1073 |
|
952 1074 | impl ::std::fmt::Display for OwnerId {
|
953 1075 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
954 1076 | self.0.fmt(f)
|
955 1077 | }
|
956 1078 | }
|
957 1079 |
|
958 1080 | impl ::std::convert::From<OwnerId> for ::std::string::String {
|
959 1081 | fn from(value: OwnerId) -> Self {
|
960 1082 | value.into_inner()
|
961 1083 | }
|
962 1084 | }
|
963 1085 |
|
1086 + | /* RustType.kt:516 */
|
964 1087 | #[cfg(test)]
|
1088 + | /* ConstrainedStringGenerator.kt:205 */
|
965 1089 | mod test_owner_id {
|
966 1090 | #[test]
|
967 1091 | fn regex_compiles() {
|
968 1092 | crate::model::OwnerId::compile_regex();
|
969 1093 | }
|
1094 + |
|
1095 + | /* ConstrainedStringGenerator.kt:205 */
|
970 1096 | }
|
971 1097 |
|
1098 + | /* ConstrainedStringGenerator.kt:82 */
|
972 1099 | #[allow(missing_docs)] // documentation missing in model
|
973 - | ///
|
1100 + | /// /* ConstrainedStringGenerator.kt:83 */
|
974 1101 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
975 1102 | /// [constraint traits]. Use [`KmsKeyArn::try_from`] to construct values of this type.
|
976 1103 | ///
|
977 1104 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
978 1105 | ///
|
1106 + | /* RustType.kt:516 */
|
979 1107 | #[derive(
|
980 1108 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
981 1109 | )]
|
982 - | pub struct KmsKeyArn(pub(crate) ::std::string::String);
|
1110 + | pub /* ConstrainedStringGenerator.kt:86 */ struct KmsKeyArn(pub(crate) ::std::string::String);
|
1111 + | /* ConstrainedStringGenerator.kt:90 */
|
983 1112 | impl KmsKeyArn {
|
984 1113 | /// Extracts a string slice containing the entire underlying `String`.
|
985 1114 | pub fn as_str(&self) -> &str {
|
986 1115 | &self.0
|
987 1116 | }
|
988 1117 |
|
989 1118 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
990 1119 | pub fn inner(&self) -> &::std::string::String {
|
991 1120 | &self.0
|
992 1121 | }
|
993 1122 |
|
994 1123 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
995 1124 | pub fn into_inner(self) -> ::std::string::String {
|
996 1125 | self.0
|
997 1126 | }
|
998 1127 | }
|
1128 + | /* TraitInfo.kt:41 */
|
999 1129 | impl KmsKeyArn {
|
1000 1130 | fn check_length(
|
1001 1131 | string: &str,
|
1002 1132 | ) -> ::std::result::Result<(), crate::model::kms_key_arn::ConstraintViolation> {
|
1003 1133 | let length = string.chars().count();
|
1004 1134 |
|
1005 1135 | if (1..=2048).contains(&length) {
|
1006 1136 | Ok(())
|
1007 1137 | } else {
|
1008 1138 | Err(crate::model::kms_key_arn::ConstraintViolation::Length(
|
1009 1139 | length,
|
1010 1140 | ))
|
1011 1141 | }
|
1012 1142 | }
|
1013 1143 |
|
1014 1144 | fn check_pattern(
|
1015 1145 | string: ::std::string::String,
|
1016 1146 | ) -> ::std::result::Result<::std::string::String, crate::model::kms_key_arn::ConstraintViolation>
|
1017 1147 | {
|
1018 1148 | let regex = Self::compile_regex();
|
1019 1149 |
|
1020 1150 | if regex.is_match(&string) {
|
1021 1151 | Ok(string)
|
1022 1152 | } else {
|
1023 1153 | Err(crate::model::kms_key_arn::ConstraintViolation::Pattern(
|
1024 1154 | string,
|
1025 1155 | ))
|
1026 1156 | }
|
1027 1157 | }
|
1028 1158 |
|
1029 1159 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
1030 1160 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
1031 1161 | pub fn compile_regex() -> &'static ::regex::Regex {
|
1032 1162 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
1033 1163 | ::regex::Regex::new(r#"arn:aws[a-z\-]*:kms:.*:[0-9]{12}:key/.*"#).expect(r#"The regular expression arn:aws[a-z\-]*:kms:.*:[0-9]{12}:key/.* is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
1034 1164 | });
|
1035 1165 |
|
1036 1166 | ®EX
|
1037 1167 | }
|
1038 1168 | }
|
1169 + | /* TraitInfo.kt:57 */
|
1039 1170 | impl ::std::convert::TryFrom<::std::string::String> for KmsKeyArn {
|
1040 1171 | type Error = crate::model::kms_key_arn::ConstraintViolation;
|
1041 1172 |
|
1042 1173 | /// Constructs a `KmsKeyArn` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1043 1174 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1044 1175 | Self::check_length(&value)?;
|
1045 1176 |
|
1046 1177 | let value = Self::check_pattern(value)?;
|
1047 1178 |
|
1048 1179 | Ok(Self(value))
|
1049 1180 | }
|
1050 1181 | }
|
1182 + | /* ConstrainedStringGenerator.kt:112 */
|
1051 1183 | impl crate::constrained::Constrained for KmsKeyArn {
|
1052 1184 | type Unconstrained = ::std::string::String;
|
1053 1185 | }
|
1054 1186 |
|
1055 1187 | impl ::std::convert::From<::std::string::String>
|
1056 1188 | for crate::constrained::MaybeConstrained<crate::model::KmsKeyArn>
|
1057 1189 | {
|
1058 1190 | fn from(value: ::std::string::String) -> Self {
|
1059 1191 | Self::Unconstrained(value)
|
1060 1192 | }
|
1061 1193 | }
|
1062 1194 |
|
1063 1195 | impl ::std::fmt::Display for KmsKeyArn {
|
1064 1196 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1065 1197 | "*** Sensitive Data Redacted ***".fmt(f)
|
1066 1198 | }
|
1067 1199 | }
|
1068 1200 |
|
1069 1201 | impl ::std::convert::From<KmsKeyArn> for ::std::string::String {
|
1070 1202 | fn from(value: KmsKeyArn) -> Self {
|
1071 1203 | value.into_inner()
|
1072 1204 | }
|
1073 1205 | }
|
1074 1206 |
|
1207 + | /* RustType.kt:516 */
|
1075 1208 | #[cfg(test)]
|
1209 + | /* ConstrainedStringGenerator.kt:205 */
|
1076 1210 | mod test_kms_key_arn {
|
1077 1211 | #[test]
|
1078 1212 | fn regex_compiles() {
|
1079 1213 | crate::model::KmsKeyArn::compile_regex();
|
1080 1214 | }
|
1215 + |
|
1216 + | /* ConstrainedStringGenerator.kt:205 */
|
1081 1217 | }
|
1082 1218 |
|
1083 - | /// <p>Describes a tag.</p>
|
1219 + | /// /* StructureGenerator.kt:197 */<p>Describes a tag.</p>
|
1220 + | /* RustType.kt:516 */
|
1084 1221 | #[derive(
|
1085 1222 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1086 1223 | )]
|
1087 - | pub struct Tag {
|
1088 - | /// <p>The key of the tag.</p>
|
1224 + | pub /* StructureGenerator.kt:201 */ struct Tag {
|
1225 + | /// /* StructureGenerator.kt:231 */<p>The key of the tag.</p>
|
1089 1226 | pub key: ::std::option::Option<crate::model::TagKey>,
|
1090 - | /// <p>The value of the tag.</p>
|
1227 + | /// /* StructureGenerator.kt:231 */<p>The value of the tag.</p>
|
1091 1228 | pub value: ::std::option::Option<crate::model::TagValue>,
|
1229 + | /* StructureGenerator.kt:201 */
|
1092 1230 | }
|
1231 + | /* StructureGenerator.kt:135 */
|
1093 1232 | impl Tag {
|
1094 - | /// <p>The key of the tag.</p>
|
1233 + | /// /* StructureGenerator.kt:231 */<p>The key of the tag.</p>
|
1234 + | /* StructureGenerator.kt:166 */
|
1095 1235 | pub fn key(&self) -> ::std::option::Option<&crate::model::TagKey> {
|
1236 + | /* StructureGenerator.kt:170 */
|
1096 1237 | self.key.as_ref()
|
1238 + | /* StructureGenerator.kt:166 */
|
1097 1239 | }
|
1098 - | /// <p>The value of the tag.</p>
|
1240 + | /// /* StructureGenerator.kt:231 */<p>The value of the tag.</p>
|
1241 + | /* StructureGenerator.kt:166 */
|
1099 1242 | pub fn value(&self) -> ::std::option::Option<&crate::model::TagValue> {
|
1243 + | /* StructureGenerator.kt:170 */
|
1100 1244 | self.value.as_ref()
|
1245 + | /* StructureGenerator.kt:166 */
|
1101 1246 | }
|
1247 + | /* StructureGenerator.kt:135 */
|
1102 1248 | }
|
1249 + | /* ServerCodegenVisitor.kt:345 */
|
1103 1250 | impl Tag {
|
1104 - | /// Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
|
1251 + | /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`Tag`](crate::model::Tag).
|
1252 + | /* ServerBuilderGenerator.kt:295 */
|
1105 1253 | pub fn builder() -> crate::model::tag::Builder {
|
1254 + | /* ServerBuilderGenerator.kt:296 */
|
1106 1255 | crate::model::tag::Builder::default()
|
1256 + | /* ServerBuilderGenerator.kt:295 */
|
1107 1257 | }
|
1258 + | /* ServerCodegenVisitor.kt:345 */
|
1108 1259 | }
|
1260 + | /* ServerStructureConstrainedTraitImpl.kt:21 */
|
1109 1261 | impl crate::constrained::Constrained for crate::model::Tag {
|
1110 1262 | type Unconstrained = crate::model::tag::Builder;
|
1111 1263 | }
|
1112 1264 |
|
1265 + | /* ConstrainedStringGenerator.kt:82 */
|
1113 1266 | #[allow(missing_docs)] // documentation missing in model
|
1114 - | ///
|
1267 + | /// /* ConstrainedStringGenerator.kt:83 */
|
1115 1268 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1116 1269 | /// [constraint traits]. Use [`TagValue::try_from`] to construct values of this type.
|
1117 1270 | ///
|
1118 1271 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1119 1272 | ///
|
1273 + | /* RustType.kt:516 */
|
1120 1274 | #[derive(
|
1121 1275 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1122 1276 | )]
|
1123 - | pub struct TagValue(pub(crate) ::std::string::String);
|
1277 + | pub /* ConstrainedStringGenerator.kt:86 */ struct TagValue(pub(crate) ::std::string::String);
|
1278 + | /* ConstrainedStringGenerator.kt:90 */
|
1124 1279 | impl TagValue {
|
1125 1280 | /// Extracts a string slice containing the entire underlying `String`.
|
1126 1281 | pub fn as_str(&self) -> &str {
|
1127 1282 | &self.0
|
1128 1283 | }
|
1129 1284 |
|
1130 1285 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1131 1286 | pub fn inner(&self) -> &::std::string::String {
|
1132 1287 | &self.0
|
1133 1288 | }
|
1134 1289 |
|
1135 1290 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1136 1291 | pub fn into_inner(self) -> ::std::string::String {
|
1137 1292 | self.0
|
1138 1293 | }
|
1139 1294 | }
|
1295 + | /* TraitInfo.kt:41 */
|
1140 1296 | impl TagValue {
|
1141 1297 | fn check_length(
|
1142 1298 | string: &str,
|
1143 1299 | ) -> ::std::result::Result<(), crate::model::tag_value::ConstraintViolation> {
|
1144 1300 | let length = string.chars().count();
|
1145 1301 |
|
1146 1302 | if (0..=255).contains(&length) {
|
1147 1303 | Ok(())
|
1148 1304 | } else {
|
1149 1305 | Err(crate::model::tag_value::ConstraintViolation::Length(length))
|
1150 1306 | }
|
1151 1307 | }
|
1152 1308 |
|
1153 1309 | fn check_pattern(
|
1154 1310 | string: ::std::string::String,
|
1155 1311 | ) -> ::std::result::Result<::std::string::String, crate::model::tag_value::ConstraintViolation>
|
1156 1312 | {
|
1157 1313 | let regex = Self::compile_regex();
|
1158 1314 |
|
1159 1315 | if regex.is_match(&string) {
|
1160 1316 | Ok(string)
|
1161 1317 | } else {
|
1162 1318 | Err(crate::model::tag_value::ConstraintViolation::Pattern(
|
1163 1319 | string,
|
1164 1320 | ))
|
1165 1321 | }
|
1166 1322 | }
|
1167 1323 |
|
1168 1324 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
1169 1325 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
1170 1326 | pub fn compile_regex() -> &'static ::regex::Regex {
|
1171 1327 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
1172 1328 | ::regex::Regex::new(r#"^[\S\s]+$"#).expect(r#"The regular expression ^[\S\s]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
1173 1329 | });
|
1174 1330 |
|
1175 1331 | ®EX
|
1176 1332 | }
|
1177 1333 | }
|
1334 + | /* TraitInfo.kt:57 */
|
1178 1335 | impl ::std::convert::TryFrom<::std::string::String> for TagValue {
|
1179 1336 | type Error = crate::model::tag_value::ConstraintViolation;
|
1180 1337 |
|
1181 1338 | /// Constructs a `TagValue` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1182 1339 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1183 1340 | Self::check_length(&value)?;
|
1184 1341 |
|
1185 1342 | let value = Self::check_pattern(value)?;
|
1186 1343 |
|
1187 1344 | Ok(Self(value))
|
1188 1345 | }
|
1189 1346 | }
|
1347 + | /* ConstrainedStringGenerator.kt:112 */
|
1190 1348 | impl crate::constrained::Constrained for TagValue {
|
1191 1349 | type Unconstrained = ::std::string::String;
|
1192 1350 | }
|
1193 1351 |
|
1194 1352 | impl ::std::convert::From<::std::string::String>
|
1195 1353 | for crate::constrained::MaybeConstrained<crate::model::TagValue>
|
1196 1354 | {
|
1197 1355 | fn from(value: ::std::string::String) -> Self {
|
1198 1356 | Self::Unconstrained(value)
|
1199 1357 | }
|
1200 1358 | }
|
1201 1359 |
|
1202 1360 | impl ::std::fmt::Display for TagValue {
|
1203 1361 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1204 1362 | self.0.fmt(f)
|
1205 1363 | }
|
1206 1364 | }
|
1207 1365 |
|
1208 1366 | impl ::std::convert::From<TagValue> for ::std::string::String {
|
1209 1367 | fn from(value: TagValue) -> Self {
|
1210 1368 | value.into_inner()
|
1211 1369 | }
|
1212 1370 | }
|
1213 1371 |
|
1372 + | /* RustType.kt:516 */
|
1214 1373 | #[cfg(test)]
|
1374 + | /* ConstrainedStringGenerator.kt:205 */
|
1215 1375 | mod test_tag_value {
|
1216 1376 | #[test]
|
1217 1377 | fn regex_compiles() {
|
1218 1378 | crate::model::TagValue::compile_regex();
|
1219 1379 | }
|
1380 + |
|
1381 + | /* ConstrainedStringGenerator.kt:205 */
|
1220 1382 | }
|
1221 1383 |
|
1384 + | /* ConstrainedStringGenerator.kt:82 */
|
1222 1385 | #[allow(missing_docs)] // documentation missing in model
|
1223 - | ///
|
1386 + | /// /* ConstrainedStringGenerator.kt:83 */
|
1224 1387 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1225 1388 | /// [constraint traits]. Use [`TagKey::try_from`] to construct values of this type.
|
1226 1389 | ///
|
1227 1390 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1228 1391 | ///
|
1392 + | /* RustType.kt:516 */
|
1229 1393 | #[derive(
|
1230 1394 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1231 1395 | )]
|
1232 - | pub struct TagKey(pub(crate) ::std::string::String);
|
1396 + | pub /* ConstrainedStringGenerator.kt:86 */ struct TagKey(pub(crate) ::std::string::String);
|
1397 + | /* ConstrainedStringGenerator.kt:90 */
|
1233 1398 | impl TagKey {
|
1234 1399 | /// Extracts a string slice containing the entire underlying `String`.
|
1235 1400 | pub fn as_str(&self) -> &str {
|
1236 1401 | &self.0
|
1237 1402 | }
|
1238 1403 |
|
1239 1404 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1240 1405 | pub fn inner(&self) -> &::std::string::String {
|
1241 1406 | &self.0
|
1242 1407 | }
|
1243 1408 |
|
1244 1409 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1245 1410 | pub fn into_inner(self) -> ::std::string::String {
|
1246 1411 | self.0
|
1247 1412 | }
|
1248 1413 | }
|
1414 + | /* TraitInfo.kt:41 */
|
1249 1415 | impl TagKey {
|
1250 1416 | fn check_length(
|
1251 1417 | string: &str,
|
1252 1418 | ) -> ::std::result::Result<(), crate::model::tag_key::ConstraintViolation> {
|
1253 1419 | let length = string.chars().count();
|
1254 1420 |
|
1255 1421 | if (0..=127).contains(&length) {
|
1256 1422 | Ok(())
|
1257 1423 | } else {
|
1258 1424 | Err(crate::model::tag_key::ConstraintViolation::Length(length))
|
1259 1425 | }
|
1260 1426 | }
|
1261 1427 |
|
1262 1428 | fn check_pattern(
|
1263 1429 | string: ::std::string::String,
|
1264 1430 | ) -> ::std::result::Result<::std::string::String, crate::model::tag_key::ConstraintViolation>
|
1265 1431 | {
|
1266 1432 | let regex = Self::compile_regex();
|
1267 1433 |
|
1268 1434 | if regex.is_match(&string) {
|
1269 1435 | Ok(string)
|
1270 1436 | } else {
|
1271 1437 | Err(crate::model::tag_key::ConstraintViolation::Pattern(string))
|
1272 1438 | }
|
1273 1439 | }
|
1274 1440 |
|
1275 1441 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
1276 1442 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
1277 1443 | pub fn compile_regex() -> &'static ::regex::Regex {
|
1278 1444 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
1279 1445 | ::regex::Regex::new(r#"^[\S\s]+$"#).expect(r#"The regular expression ^[\S\s]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
1280 1446 | });
|
1281 1447 |
|
1282 1448 | ®EX
|
1283 1449 | }
|
1284 1450 | }
|
1451 + | /* TraitInfo.kt:57 */
|
1285 1452 | impl ::std::convert::TryFrom<::std::string::String> for TagKey {
|
1286 1453 | type Error = crate::model::tag_key::ConstraintViolation;
|
1287 1454 |
|
1288 1455 | /// Constructs a `TagKey` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1289 1456 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1290 1457 | Self::check_length(&value)?;
|
1291 1458 |
|
1292 1459 | let value = Self::check_pattern(value)?;
|
1293 1460 |
|
1294 1461 | Ok(Self(value))
|
1295 1462 | }
|
1296 1463 | }
|
1464 + | /* ConstrainedStringGenerator.kt:112 */
|
1297 1465 | impl crate::constrained::Constrained for TagKey {
|
1298 1466 | type Unconstrained = ::std::string::String;
|
1299 1467 | }
|
1300 1468 |
|
1301 1469 | impl ::std::convert::From<::std::string::String>
|
1302 1470 | for crate::constrained::MaybeConstrained<crate::model::TagKey>
|
1303 1471 | {
|
1304 1472 | fn from(value: ::std::string::String) -> Self {
|
1305 1473 | Self::Unconstrained(value)
|
1306 1474 | }
|
1307 1475 | }
|
1308 1476 |
|
1309 1477 | impl ::std::fmt::Display for TagKey {
|
1310 1478 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1311 1479 | self.0.fmt(f)
|
1312 1480 | }
|
1313 1481 | }
|
1314 1482 |
|
1315 1483 | impl ::std::convert::From<TagKey> for ::std::string::String {
|
1316 1484 | fn from(value: TagKey) -> Self {
|
1317 1485 | value.into_inner()
|
1318 1486 | }
|
1319 1487 | }
|
1320 1488 |
|
1489 + | /* RustType.kt:516 */
|
1321 1490 | #[cfg(test)]
|
1491 + | /* ConstrainedStringGenerator.kt:205 */
|
1322 1492 | mod test_tag_key {
|
1323 1493 | #[test]
|
1324 1494 | fn regex_compiles() {
|
1325 1495 | crate::model::TagKey::compile_regex();
|
1326 1496 | }
|
1497 + |
|
1498 + | /* ConstrainedStringGenerator.kt:205 */
|
1327 1499 | }
|
1328 1500 |
|
1501 + | /* ConstrainedStringGenerator.kt:82 */
|
1329 1502 | #[allow(missing_docs)] // documentation missing in model
|
1330 - | ///
|
1503 + | /// /* ConstrainedStringGenerator.kt:83 */
|
1331 1504 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1332 1505 | /// [constraint traits]. Use [`IdempotencyToken::try_from`] to construct values of this type.
|
1333 1506 | ///
|
1334 1507 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1335 1508 | ///
|
1509 + | /* RustType.kt:516 */
|
1336 1510 | #[derive(
|
1337 1511 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1338 1512 | )]
|
1339 - | pub struct IdempotencyToken(pub(crate) ::std::string::String);
|
1513 + | pub /* ConstrainedStringGenerator.kt:86 */ struct IdempotencyToken(
|
1514 + | pub(crate) ::std::string::String,
|
1515 + | );
|
1516 + | /* ConstrainedStringGenerator.kt:90 */
|
1340 1517 | impl IdempotencyToken {
|
1341 1518 | /// Extracts a string slice containing the entire underlying `String`.
|
1342 1519 | pub fn as_str(&self) -> &str {
|
1343 1520 | &self.0
|
1344 1521 | }
|
1345 1522 |
|
1346 1523 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1347 1524 | pub fn inner(&self) -> &::std::string::String {
|
1348 1525 | &self.0
|
1349 1526 | }
|
1350 1527 |
|
1351 1528 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1352 1529 | pub fn into_inner(self) -> ::std::string::String {
|
1353 1530 | self.0
|
1354 1531 | }
|
1355 1532 | }
|
1533 + | /* TraitInfo.kt:41 */
|
1356 1534 | impl IdempotencyToken {
|
1357 1535 | fn check_length(
|
1358 1536 | string: &str,
|
1359 1537 | ) -> ::std::result::Result<(), crate::model::idempotency_token::ConstraintViolation> {
|
1360 1538 | let length = string.chars().count();
|
1361 1539 |
|
1362 1540 | if (0..=255).contains(&length) {
|
1363 1541 | Ok(())
|
1364 1542 | } else {
|
1365 1543 | Err(crate::model::idempotency_token::ConstraintViolation::Length(length))
|
1366 1544 | }
|
1367 1545 | }
|
1368 1546 |
|
1369 1547 | fn check_pattern(
|
1370 1548 | string: ::std::string::String,
|
1371 1549 | ) -> ::std::result::Result<
|
1372 1550 | ::std::string::String,
|
1373 1551 | crate::model::idempotency_token::ConstraintViolation,
|
1374 1552 | > {
|
1375 1553 | let regex = Self::compile_regex();
|
1376 1554 |
|
1377 1555 | if regex.is_match(&string) {
|
1378 1556 | Ok(string)
|
1379 1557 | } else {
|
1380 1558 | Err(crate::model::idempotency_token::ConstraintViolation::Pattern(string))
|
1381 1559 | }
|
1382 1560 | }
|
1383 1561 |
|
1384 1562 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
1385 1563 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
1386 1564 | pub fn compile_regex() -> &'static ::regex::Regex {
|
1387 1565 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
1388 1566 | ::regex::Regex::new(r#"^[\S]+$"#).expect(r#"The regular expression ^[\S]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
1389 1567 | });
|
1390 1568 |
|
1391 1569 | ®EX
|
1392 1570 | }
|
1393 1571 | }
|
1572 + | /* TraitInfo.kt:57 */
|
1394 1573 | impl ::std::convert::TryFrom<::std::string::String> for IdempotencyToken {
|
1395 1574 | type Error = crate::model::idempotency_token::ConstraintViolation;
|
1396 1575 |
|
1397 1576 | /// Constructs a `IdempotencyToken` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1398 1577 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1399 1578 | Self::check_length(&value)?;
|
1400 1579 |
|
1401 1580 | let value = Self::check_pattern(value)?;
|
1402 1581 |
|
1403 1582 | Ok(Self(value))
|
1404 1583 | }
|
1405 1584 | }
|
1585 + | /* ConstrainedStringGenerator.kt:112 */
|
1406 1586 | impl crate::constrained::Constrained for IdempotencyToken {
|
1407 1587 | type Unconstrained = ::std::string::String;
|
1408 1588 | }
|
1409 1589 |
|
1410 1590 | impl ::std::convert::From<::std::string::String>
|
1411 1591 | for crate::constrained::MaybeConstrained<crate::model::IdempotencyToken>
|
1412 1592 | {
|
1413 1593 | fn from(value: ::std::string::String) -> Self {
|
1414 1594 | Self::Unconstrained(value)
|
1415 1595 | }
|
1416 1596 | }
|
1417 1597 |
|
1418 1598 | impl ::std::fmt::Display for IdempotencyToken {
|
1419 1599 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1420 1600 | self.0.fmt(f)
|
1421 1601 | }
|
1422 1602 | }
|
1423 1603 |
|
1424 1604 | impl ::std::convert::From<IdempotencyToken> for ::std::string::String {
|
1425 1605 | fn from(value: IdempotencyToken) -> Self {
|
1426 1606 | value.into_inner()
|
1427 1607 | }
|
1428 1608 | }
|
1429 1609 |
|
1610 + | /* RustType.kt:516 */
|
1430 1611 | #[cfg(test)]
|
1612 + | /* ConstrainedStringGenerator.kt:205 */
|
1431 1613 | mod test_idempotency_token {
|
1432 1614 | #[test]
|
1433 1615 | fn regex_compiles() {
|
1434 1616 | crate::model::IdempotencyToken::compile_regex();
|
1435 1617 | }
|
1618 + |
|
1619 + | /* ConstrainedStringGenerator.kt:205 */
|
1436 1620 | }
|
1437 1621 |
|
1622 + | /* ConstrainedNumberGenerator.kt:82 */
|
1438 1623 | #[allow(missing_docs)] // documentation missing in model
|
1439 - | ///
|
1624 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1440 1625 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1441 1626 | /// [constraint traits]. Use [`Timeout::try_from`] to construct values of this type.
|
1442 1627 | ///
|
1443 1628 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1444 1629 | ///
|
1630 + | /* RustType.kt:516 */
|
1445 1631 | #[derive(
|
1446 1632 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1447 1633 | )]
|
1448 - | pub struct Timeout(pub(crate) i32);
|
1634 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct Timeout(pub(crate) i32);
|
1635 + | /* ConstrainedNumberGenerator.kt:91 */
|
1449 1636 | impl Timeout {
|
1450 1637 | /// Returns an immutable reference to the underlying [`i32`].
|
1451 1638 | pub fn inner(&self) -> &i32 {
|
1452 1639 | &self.0
|
1453 1640 | }
|
1454 1641 |
|
1455 1642 | /// Consumes the value, returning the underlying [`i32`].
|
1456 1643 | pub fn into_inner(self) -> i32 {
|
1457 1644 | self.0
|
1458 1645 | }
|
1459 1646 | }
|
1460 1647 |
|
1461 1648 | impl crate::constrained::Constrained for Timeout {
|
1462 1649 | type Unconstrained = i32;
|
1463 1650 | }
|
1464 1651 |
|
1465 1652 | impl ::std::convert::From<i32> for crate::constrained::MaybeConstrained<crate::model::Timeout> {
|
1466 1653 | fn from(value: i32) -> Self {
|
1467 1654 | Self::Unconstrained(value)
|
1468 1655 | }
|
1469 1656 | }
|
1470 1657 |
|
1471 1658 | impl ::std::fmt::Display for Timeout {
|
1472 1659 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1473 1660 | self.0.fmt(f)
|
1474 1661 | }
|
1475 1662 | }
|
1476 1663 |
|
1477 1664 | impl ::std::convert::From<Timeout> for i32 {
|
1478 1665 | fn from(value: Timeout) -> Self {
|
1479 1666 | value.into_inner()
|
1480 1667 | }
|
1481 1668 | }
|
1669 + | /* TraitInfo.kt:41 */
|
1482 1670 | impl Timeout {
|
1483 1671 | fn check_range(
|
1484 1672 | value: i32,
|
1485 1673 | ) -> ::std::result::Result<(), crate::model::timeout::ConstraintViolation> {
|
1486 1674 | if (10..=60).contains(&value) {
|
1487 1675 | Ok(())
|
1488 1676 | } else {
|
1489 1677 | Err(crate::model::timeout::ConstraintViolation::Range(value))
|
1490 1678 | }
|
1491 1679 | }
|
1492 1680 | }
|
1681 + | /* TraitInfo.kt:57 */
|
1493 1682 | impl ::std::convert::TryFrom<i32> for Timeout {
|
1494 1683 | type Error = crate::model::timeout::ConstraintViolation;
|
1495 1684 |
|
1496 1685 | /// Constructs a `Timeout` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
1497 1686 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
1498 1687 | Self::check_range(value)?;
|
1499 1688 |
|
1500 1689 | Ok(Self(value))
|
1501 1690 | }
|
1502 1691 | }
|
1503 1692 |
|
1693 + | /* ConstrainedStringGenerator.kt:82 */
|
1504 1694 | #[allow(missing_docs)] // documentation missing in model
|
1505 - | ///
|
1695 + | /// /* ConstrainedStringGenerator.kt:83 */
|
1506 1696 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1507 1697 | /// [constraint traits]. Use [`Checksum::try_from`] to construct values of this type.
|
1508 1698 | ///
|
1509 1699 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1510 1700 | ///
|
1701 + | /* RustType.kt:516 */
|
1511 1702 | #[derive(
|
1512 1703 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1513 1704 | )]
|
1514 - | pub struct Checksum(pub(crate) ::std::string::String);
|
1705 + | pub /* ConstrainedStringGenerator.kt:86 */ struct Checksum(pub(crate) ::std::string::String);
|
1706 + | /* ConstrainedStringGenerator.kt:90 */
|
1515 1707 | impl Checksum {
|
1516 1708 | /// Extracts a string slice containing the entire underlying `String`.
|
1517 1709 | pub fn as_str(&self) -> &str {
|
1518 1710 | &self.0
|
1519 1711 | }
|
1520 1712 |
|
1521 1713 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1522 1714 | pub fn inner(&self) -> &::std::string::String {
|
1523 1715 | &self.0
|
1524 1716 | }
|
1525 1717 |
|
1526 1718 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1527 1719 | pub fn into_inner(self) -> ::std::string::String {
|
1528 1720 | self.0
|
1529 1721 | }
|
1530 1722 | }
|
1723 + | /* TraitInfo.kt:41 */
|
1531 1724 | impl Checksum {
|
1532 1725 | fn check_length(
|
1533 1726 | string: &str,
|
1534 1727 | ) -> ::std::result::Result<(), crate::model::checksum::ConstraintViolation> {
|
1535 1728 | let length = string.chars().count();
|
1536 1729 |
|
1537 1730 | if (0..=64).contains(&length) {
|
1538 1731 | Ok(())
|
1539 1732 | } else {
|
1540 1733 | Err(crate::model::checksum::ConstraintViolation::Length(length))
|
1541 1734 | }
|
1542 1735 | }
|
1543 1736 |
|
1544 1737 | fn check_pattern(
|
1545 1738 | string: ::std::string::String,
|
1546 1739 | ) -> ::std::result::Result<::std::string::String, crate::model::checksum::ConstraintViolation>
|
1547 1740 | {
|
1548 1741 | let regex = Self::compile_regex();
|
1549 1742 |
|
1550 1743 | if regex.is_match(&string) {
|
1551 1744 | Ok(string)
|
1552 1745 | } else {
|
1553 1746 | Err(crate::model::checksum::ConstraintViolation::Pattern(string))
|
1554 1747 | }
|
1555 1748 | }
|
1556 1749 |
|
1557 1750 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
1558 1751 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
1559 1752 | pub fn compile_regex() -> &'static ::regex::Regex {
|
1560 1753 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
1561 1754 | ::regex::Regex::new(r#"^[A-Za-z0-9+/=]+$"#).expect(r#"The regular expression ^[A-Za-z0-9+/=]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
1562 1755 | });
|
1563 1756 |
|
1564 1757 | ®EX
|
1565 1758 | }
|
1566 1759 | }
|
1760 + | /* TraitInfo.kt:57 */
|
1567 1761 | impl ::std::convert::TryFrom<::std::string::String> for Checksum {
|
1568 1762 | type Error = crate::model::checksum::ConstraintViolation;
|
1569 1763 |
|
1570 1764 | /// Constructs a `Checksum` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1571 1765 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1572 1766 | Self::check_length(&value)?;
|
1573 1767 |
|
1574 1768 | let value = Self::check_pattern(value)?;
|
1575 1769 |
|
1576 1770 | Ok(Self(value))
|
1577 1771 | }
|
1578 1772 | }
|
1773 + | /* ConstrainedStringGenerator.kt:112 */
|
1579 1774 | impl crate::constrained::Constrained for Checksum {
|
1580 1775 | type Unconstrained = ::std::string::String;
|
1581 1776 | }
|
1582 1777 |
|
1583 1778 | impl ::std::convert::From<::std::string::String>
|
1584 1779 | for crate::constrained::MaybeConstrained<crate::model::Checksum>
|
1585 1780 | {
|
1586 1781 | fn from(value: ::std::string::String) -> Self {
|
1587 1782 | Self::Unconstrained(value)
|
1588 1783 | }
|
1589 1784 | }
|
1590 1785 |
|
1591 1786 | impl ::std::fmt::Display for Checksum {
|
1592 1787 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1593 1788 | self.0.fmt(f)
|
1594 1789 | }
|
1595 1790 | }
|
1596 1791 |
|
1597 1792 | impl ::std::convert::From<Checksum> for ::std::string::String {
|
1598 1793 | fn from(value: Checksum) -> Self {
|
1599 1794 | value.into_inner()
|
1600 1795 | }
|
1601 1796 | }
|
1602 1797 |
|
1798 + | /* RustType.kt:516 */
|
1603 1799 | #[cfg(test)]
|
1800 + | /* ConstrainedStringGenerator.kt:205 */
|
1604 1801 | mod test_checksum {
|
1605 1802 | #[test]
|
1606 1803 | fn regex_compiles() {
|
1607 1804 | crate::model::Checksum::compile_regex();
|
1608 1805 | }
|
1806 + |
|
1807 + | /* ConstrainedStringGenerator.kt:205 */
|
1609 1808 | }
|
1610 1809 |
|
1810 + | /* EnumGenerator.kt:154 */
|
1611 1811 | #[allow(missing_docs)] // documentation missing in model
|
1812 + | /* RustType.kt:516 */
|
1612 1813 | #[derive(
|
1613 1814 | ::std::clone::Clone,
|
1614 1815 | ::std::cmp::Eq,
|
1615 1816 | ::std::cmp::Ord,
|
1616 1817 | ::std::cmp::PartialEq,
|
1617 1818 | ::std::cmp::PartialOrd,
|
1618 1819 | ::std::fmt::Debug,
|
1619 1820 | ::std::hash::Hash,
|
1620 1821 | )]
|
1621 - | pub enum ChecksumAlgorithm {
|
1822 + | pub /* EnumGenerator.kt:267 */ enum ChecksumAlgorithm {
|
1823 + | /* EnumGenerator.kt:154 */
|
1622 1824 | #[allow(missing_docs)] // documentation missing in model
|
1825 + | /* EnumGenerator.kt:143 */
|
1623 1826 | ChecksumAlgorithmSha256,
|
1827 + | /* EnumGenerator.kt:267 */
|
1624 1828 | }
|
1625 - | /// See [`ChecksumAlgorithm`](crate::model::ChecksumAlgorithm).
|
1829 + | /// /* CodegenDelegator.kt:51 */See [`ChecksumAlgorithm`](crate::model::ChecksumAlgorithm).
|
1626 1830 | pub mod checksum_algorithm {
|
1627 1831 | #[derive(Debug, PartialEq)]
|
1628 1832 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
1629 1833 |
|
1630 1834 | impl ::std::fmt::Display for ConstraintViolation {
|
1631 1835 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1632 1836 | write!(
|
1633 1837 | f,
|
1634 1838 | r#"Value provided for 'com.amazonaws.ebs#ChecksumAlgorithm' failed to satisfy constraint: Member must satisfy enum value set: [SHA256]"#
|
1635 1839 | )
|
1636 1840 | }
|
1637 1841 | }
|
1638 1842 |
|
1639 1843 | impl ::std::error::Error for ConstraintViolation {}
|
1640 1844 | impl ConstraintViolation {
|
1641 1845 | pub(crate) fn as_validation_exception_field(
|
1642 1846 | self,
|
1643 1847 | path: ::std::string::String,
|
1644 1848 | ) -> crate::model::ValidationExceptionField {
|
1645 1849 | crate::model::ValidationExceptionField {
|
1646 1850 | message: format!(
|
1647 1851 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [SHA256]"#,
|
1648 1852 | &path
|
1649 1853 | ),
|
1650 1854 | path,
|
1651 1855 | }
|
1652 1856 | }
|
1653 1857 | }
|
1858 + |
|
1859 + | /* ServerEnumGenerator.kt:46 */
|
1654 1860 | }
|
1861 + | /* ServerEnumGenerator.kt:85 */
|
1655 1862 | impl ::std::convert::TryFrom<&str> for ChecksumAlgorithm {
|
1656 1863 | type Error = crate::model::checksum_algorithm::ConstraintViolation;
|
1657 1864 | fn try_from(
|
1658 1865 | s: &str,
|
1659 1866 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
1660 1867 | match s {
|
1661 1868 | "SHA256" => Ok(ChecksumAlgorithm::ChecksumAlgorithmSha256),
|
1662 1869 | _ => Err(crate::model::checksum_algorithm::ConstraintViolation(
|
1663 1870 | s.to_owned(),
|
1664 1871 | )),
|
1665 1872 | }
|
1666 1873 | }
|
1667 1874 | }
|
1668 1875 | impl ::std::convert::TryFrom<::std::string::String> for ChecksumAlgorithm {
|
1669 1876 | type Error = crate::model::checksum_algorithm::ConstraintViolation;
|
1670 1877 | fn try_from(
|
1671 1878 | s: ::std::string::String,
|
1672 1879 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
1673 1880 | {
|
1674 1881 | s.as_str().try_into()
|
1675 1882 | }
|
1676 1883 | }
|
1884 + | /* ServerEnumGenerator.kt:145 */
|
1677 1885 | impl std::str::FromStr for ChecksumAlgorithm {
|
1678 1886 | type Err = crate::model::checksum_algorithm::ConstraintViolation;
|
1679 1887 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
1680 1888 | Self::try_from(s)
|
1681 1889 | }
|
1682 1890 | }
|
1891 + | /* EnumGenerator.kt:274 */
|
1683 1892 | impl ChecksumAlgorithm {
|
1684 1893 | /// Returns the `&str` value of the enum member.
|
1685 1894 | pub fn as_str(&self) -> &str {
|
1686 1895 | match self {
|
1687 1896 | ChecksumAlgorithm::ChecksumAlgorithmSha256 => "SHA256",
|
1688 1897 | }
|
1689 1898 | }
|
1690 1899 | /// Returns all the `&str` representations of the enum members.
|
1691 1900 | pub const fn values() -> &'static [&'static str] {
|
1692 1901 | &["SHA256"]
|
1693 1902 | }
|
1694 1903 | }
|
1904 + | /* EnumGenerator.kt:223 */
|
1695 1905 | impl ::std::convert::AsRef<str> for ChecksumAlgorithm {
|
1696 1906 | fn as_ref(&self) -> &str {
|
1697 1907 | self.as_str()
|
1698 1908 | }
|
1699 1909 | }
|
1910 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
1700 1911 | impl crate::constrained::Constrained for ChecksumAlgorithm {
|
1701 1912 | type Unconstrained = ::std::string::String;
|
1702 1913 | }
|
1703 1914 |
|
1704 1915 | impl ::std::convert::From<::std::string::String>
|
1705 1916 | for crate::constrained::MaybeConstrained<crate::model::ChecksumAlgorithm>
|
1706 1917 | {
|
1707 1918 | fn from(value: ::std::string::String) -> Self {
|
1708 1919 | Self::Unconstrained(value)
|
1709 1920 | }
|
1710 1921 | }
|
1711 1922 |
|
1923 + | /* ConstrainedNumberGenerator.kt:82 */
|
1712 1924 | #[allow(missing_docs)] // documentation missing in model
|
1713 - | ///
|
1925 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1714 1926 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1715 1927 | /// [constraint traits]. Use [`Progress::try_from`] to construct values of this type.
|
1716 1928 | ///
|
1717 1929 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1718 1930 | ///
|
1931 + | /* RustType.kt:516 */
|
1719 1932 | #[derive(
|
1720 1933 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1721 1934 | )]
|
1722 - | pub struct Progress(pub(crate) i32);
|
1935 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct Progress(pub(crate) i32);
|
1936 + | /* ConstrainedNumberGenerator.kt:91 */
|
1723 1937 | impl Progress {
|
1724 1938 | /// Returns an immutable reference to the underlying [`i32`].
|
1725 1939 | pub fn inner(&self) -> &i32 {
|
1726 1940 | &self.0
|
1727 1941 | }
|
1728 1942 |
|
1729 1943 | /// Consumes the value, returning the underlying [`i32`].
|
1730 1944 | pub fn into_inner(self) -> i32 {
|
1731 1945 | self.0
|
1732 1946 | }
|
1733 1947 | }
|
1734 1948 |
|
1735 1949 | impl crate::constrained::Constrained for Progress {
|
1736 1950 | type Unconstrained = i32;
|
1737 1951 | }
|
1738 1952 |
|
1739 1953 | impl ::std::convert::From<i32> for crate::constrained::MaybeConstrained<crate::model::Progress> {
|
1740 1954 | fn from(value: i32) -> Self {
|
1741 1955 | Self::Unconstrained(value)
|
1742 1956 | }
|
1743 1957 | }
|
1744 1958 |
|
1745 1959 | impl ::std::fmt::Display for Progress {
|
1746 1960 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1747 1961 | self.0.fmt(f)
|
1748 1962 | }
|
1749 1963 | }
|
1750 1964 |
|
1751 1965 | impl ::std::convert::From<Progress> for i32 {
|
1752 1966 | fn from(value: Progress) -> Self {
|
1753 1967 | value.into_inner()
|
1754 1968 | }
|
1755 1969 | }
|
1970 + | /* TraitInfo.kt:41 */
|
1756 1971 | impl Progress {
|
1757 1972 | fn check_range(
|
1758 1973 | value: i32,
|
1759 1974 | ) -> ::std::result::Result<(), crate::model::progress::ConstraintViolation> {
|
1760 1975 | if (0..=100).contains(&value) {
|
1761 1976 | Ok(())
|
1762 1977 | } else {
|
1763 1978 | Err(crate::model::progress::ConstraintViolation::Range(value))
|
1764 1979 | }
|
1765 1980 | }
|
1766 1981 | }
|
1982 + | /* TraitInfo.kt:57 */
|
1767 1983 | impl ::std::convert::TryFrom<i32> for Progress {
|
1768 1984 | type Error = crate::model::progress::ConstraintViolation;
|
1769 1985 |
|
1770 1986 | /// Constructs a `Progress` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
1771 1987 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
1772 1988 | Self::check_range(value)?;
|
1773 1989 |
|
1774 1990 | Ok(Self(value))
|
1775 1991 | }
|
1776 1992 | }
|
1777 1993 |
|
1994 + | /* ConstrainedNumberGenerator.kt:82 */
|
1778 1995 | #[allow(missing_docs)] // documentation missing in model
|
1779 - | ///
|
1996 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
1780 1997 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1781 1998 | /// [constraint traits]. Use [`BlockIndex::try_from`] to construct values of this type.
|
1782 1999 | ///
|
1783 2000 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1784 2001 | ///
|
2002 + | /* RustType.kt:516 */
|
1785 2003 | #[derive(
|
1786 2004 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1787 2005 | )]
|
1788 - | pub struct BlockIndex(pub(crate) i32);
|
2006 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct BlockIndex(pub(crate) i32);
|
2007 + | /* ConstrainedNumberGenerator.kt:91 */
|
1789 2008 | impl BlockIndex {
|
1790 2009 | /// Returns an immutable reference to the underlying [`i32`].
|
1791 2010 | pub fn inner(&self) -> &i32 {
|
1792 2011 | &self.0
|
1793 2012 | }
|
1794 2013 |
|
1795 2014 | /// Consumes the value, returning the underlying [`i32`].
|
1796 2015 | pub fn into_inner(self) -> i32 {
|
1797 2016 | self.0
|
1798 2017 | }
|
1799 2018 | }
|
1800 2019 |
|
1801 2020 | impl crate::constrained::Constrained for BlockIndex {
|
1802 2021 | type Unconstrained = i32;
|
1803 2022 | }
|
1804 2023 |
|
1805 2024 | impl ::std::convert::From<i32> for crate::constrained::MaybeConstrained<crate::model::BlockIndex> {
|
1806 2025 | fn from(value: i32) -> Self {
|
1807 2026 | Self::Unconstrained(value)
|
1808 2027 | }
|
1809 2028 | }
|
1810 2029 |
|
1811 2030 | impl ::std::fmt::Display for BlockIndex {
|
1812 2031 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1813 2032 | self.0.fmt(f)
|
1814 2033 | }
|
1815 2034 | }
|
1816 2035 |
|
1817 2036 | impl ::std::convert::From<BlockIndex> for i32 {
|
1818 2037 | fn from(value: BlockIndex) -> Self {
|
1819 2038 | value.into_inner()
|
1820 2039 | }
|
1821 2040 | }
|
2041 + | /* TraitInfo.kt:41 */
|
1822 2042 | impl BlockIndex {
|
1823 2043 | fn check_range(
|
1824 2044 | value: i32,
|
1825 2045 | ) -> ::std::result::Result<(), crate::model::block_index::ConstraintViolation> {
|
1826 2046 | if 0 <= value {
|
1827 2047 | Ok(())
|
1828 2048 | } else {
|
1829 2049 | Err(crate::model::block_index::ConstraintViolation::Range(value))
|
1830 2050 | }
|
1831 2051 | }
|
1832 2052 | }
|
2053 + | /* TraitInfo.kt:57 */
|
1833 2054 | impl ::std::convert::TryFrom<i32> for BlockIndex {
|
1834 2055 | type Error = crate::model::block_index::ConstraintViolation;
|
1835 2056 |
|
1836 2057 | /// Constructs a `BlockIndex` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
1837 2058 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
1838 2059 | Self::check_range(value)?;
|
1839 2060 |
|
1840 2061 | Ok(Self(value))
|
1841 2062 | }
|
1842 2063 | }
|
1843 2064 |
|
1844 - | /// <p>A block of data in an Amazon Elastic Block Store snapshot.</p>
|
2065 + | /// /* StructureGenerator.kt:197 */<p>A block of data in an Amazon Elastic Block Store snapshot.</p>
|
2066 + | /* RustType.kt:516 */
|
1845 2067 | #[derive(
|
1846 2068 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1847 2069 | )]
|
1848 - | pub struct Block {
|
1849 - | /// <p>The block token for the block index.</p>
|
2070 + | pub /* StructureGenerator.kt:201 */ struct Block {
|
2071 + | /// /* StructureGenerator.kt:231 */<p>The block token for the block index.</p>
|
1850 2072 | pub block_token: ::std::option::Option<crate::model::BlockToken>,
|
1851 - | /// <p>The block index.</p>
|
2073 + | /// /* StructureGenerator.kt:231 */<p>The block index.</p>
|
1852 2074 | pub block_index: ::std::option::Option<crate::model::BlockIndex>,
|
2075 + | /* StructureGenerator.kt:201 */
|
1853 2076 | }
|
2077 + | /* StructureGenerator.kt:135 */
|
1854 2078 | impl Block {
|
1855 - | /// <p>The block token for the block index.</p>
|
2079 + | /// /* StructureGenerator.kt:231 */<p>The block token for the block index.</p>
|
2080 + | /* StructureGenerator.kt:166 */
|
1856 2081 | pub fn block_token(&self) -> ::std::option::Option<&crate::model::BlockToken> {
|
2082 + | /* StructureGenerator.kt:170 */
|
1857 2083 | self.block_token.as_ref()
|
2084 + | /* StructureGenerator.kt:166 */
|
1858 2085 | }
|
1859 - | /// <p>The block index.</p>
|
2086 + | /// /* StructureGenerator.kt:231 */<p>The block index.</p>
|
2087 + | /* StructureGenerator.kt:166 */
|
1860 2088 | pub fn block_index(&self) -> ::std::option::Option<&crate::model::BlockIndex> {
|
2089 + | /* StructureGenerator.kt:170 */
|
1861 2090 | self.block_index.as_ref()
|
2091 + | /* StructureGenerator.kt:166 */
|
1862 2092 | }
|
2093 + | /* StructureGenerator.kt:135 */
|
1863 2094 | }
|
2095 + | /* ServerCodegenVisitor.kt:345 */
|
1864 2096 | impl Block {
|
1865 - | /// Creates a new builder-style object to manufacture [`Block`](crate::model::Block).
|
2097 + | /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`Block`](crate::model::Block).
|
2098 + | /* ServerBuilderGenerator.kt:295 */
|
1866 2099 | pub fn builder() -> crate::model::block::Builder {
|
2100 + | /* ServerBuilderGenerator.kt:296 */
|
1867 2101 | crate::model::block::Builder::default()
|
2102 + | /* ServerBuilderGenerator.kt:295 */
|
1868 2103 | }
|
2104 + | /* ServerCodegenVisitor.kt:345 */
|
1869 2105 | }
|
1870 2106 |
|
2107 + | /* ConstrainedStringGenerator.kt:82 */
|
1871 2108 | #[allow(missing_docs)] // documentation missing in model
|
1872 - | ///
|
2109 + | /// /* ConstrainedStringGenerator.kt:83 */
|
1873 2110 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1874 2111 | /// [constraint traits]. Use [`BlockToken::try_from`] to construct values of this type.
|
1875 2112 | ///
|
1876 2113 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1877 2114 | ///
|
2115 + | /* RustType.kt:516 */
|
1878 2116 | #[derive(
|
1879 2117 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1880 2118 | )]
|
1881 - | pub struct BlockToken(pub(crate) ::std::string::String);
|
2119 + | pub /* ConstrainedStringGenerator.kt:86 */ struct BlockToken(pub(crate) ::std::string::String);
|
2120 + | /* ConstrainedStringGenerator.kt:90 */
|
1882 2121 | impl BlockToken {
|
1883 2122 | /// Extracts a string slice containing the entire underlying `String`.
|
1884 2123 | pub fn as_str(&self) -> &str {
|
1885 2124 | &self.0
|
1886 2125 | }
|
1887 2126 |
|
1888 2127 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1889 2128 | pub fn inner(&self) -> &::std::string::String {
|
1890 2129 | &self.0
|
1891 2130 | }
|
1892 2131 |
|
1893 2132 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1894 2133 | pub fn into_inner(self) -> ::std::string::String {
|
1895 2134 | self.0
|
1896 2135 | }
|
1897 2136 | }
|
2137 + | /* TraitInfo.kt:41 */
|
1898 2138 | impl BlockToken {
|
1899 2139 | fn check_length(
|
1900 2140 | string: &str,
|
1901 2141 | ) -> ::std::result::Result<(), crate::model::block_token::ConstraintViolation> {
|
1902 2142 | let length = string.chars().count();
|
1903 2143 |
|
1904 2144 | if (0..=256).contains(&length) {
|
1905 2145 | Ok(())
|
1906 2146 | } else {
|
1907 2147 | Err(crate::model::block_token::ConstraintViolation::Length(
|
1908 2148 | length,
|
1909 2149 | ))
|
1910 2150 | }
|
1911 2151 | }
|
1912 2152 |
|
1913 2153 | fn check_pattern(
|
1914 2154 | string: ::std::string::String,
|
1915 2155 | ) -> ::std::result::Result<::std::string::String, crate::model::block_token::ConstraintViolation>
|
1916 2156 | {
|
1917 2157 | let regex = Self::compile_regex();
|
1918 2158 |
|
1919 2159 | if regex.is_match(&string) {
|
1920 2160 | Ok(string)
|
1921 2161 | } else {
|
1922 2162 | Err(crate::model::block_token::ConstraintViolation::Pattern(
|
1923 2163 | string,
|
1924 2164 | ))
|
1925 2165 | }
|
1926 2166 | }
|
1927 2167 |
|
1928 2168 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
1929 2169 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
1930 2170 | pub fn compile_regex() -> &'static ::regex::Regex {
|
1931 2171 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
1932 2172 | ::regex::Regex::new(r#"^[A-Za-z0-9+/=]+$"#).expect(r#"The regular expression ^[A-Za-z0-9+/=]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
1933 2173 | });
|
1934 2174 |
|
1935 2175 | ®EX
|
1936 2176 | }
|
1937 2177 | }
|
2178 + | /* TraitInfo.kt:57 */
|
1938 2179 | impl ::std::convert::TryFrom<::std::string::String> for BlockToken {
|
1939 2180 | type Error = crate::model::block_token::ConstraintViolation;
|
1940 2181 |
|
1941 2182 | /// Constructs a `BlockToken` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1942 2183 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1943 2184 | Self::check_length(&value)?;
|
1944 2185 |
|
1945 2186 | let value = Self::check_pattern(value)?;
|
1946 2187 |
|
1947 2188 | Ok(Self(value))
|
1948 2189 | }
|
1949 2190 | }
|
2191 + | /* ConstrainedStringGenerator.kt:112 */
|
1950 2192 | impl crate::constrained::Constrained for BlockToken {
|
1951 2193 | type Unconstrained = ::std::string::String;
|
1952 2194 | }
|
1953 2195 |
|
1954 2196 | impl ::std::convert::From<::std::string::String>
|
1955 2197 | for crate::constrained::MaybeConstrained<crate::model::BlockToken>
|
1956 2198 | {
|
1957 2199 | fn from(value: ::std::string::String) -> Self {
|
1958 2200 | Self::Unconstrained(value)
|
1959 2201 | }
|
1960 2202 | }
|
1961 2203 |
|
1962 2204 | impl ::std::fmt::Display for BlockToken {
|
1963 2205 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1964 2206 | self.0.fmt(f)
|
1965 2207 | }
|
1966 2208 | }
|
1967 2209 |
|
1968 2210 | impl ::std::convert::From<BlockToken> for ::std::string::String {
|
1969 2211 | fn from(value: BlockToken) -> Self {
|
1970 2212 | value.into_inner()
|
1971 2213 | }
|
1972 2214 | }
|
1973 2215 |
|
2216 + | /* RustType.kt:516 */
|
1974 2217 | #[cfg(test)]
|
2218 + | /* ConstrainedStringGenerator.kt:205 */
|
1975 2219 | mod test_block_token {
|
1976 2220 | #[test]
|
1977 2221 | fn regex_compiles() {
|
1978 2222 | crate::model::BlockToken::compile_regex();
|
1979 2223 | }
|
2224 + |
|
2225 + | /* ConstrainedStringGenerator.kt:205 */
|
1980 2226 | }
|
1981 2227 |
|
2228 + | /* ConstrainedStringGenerator.kt:82 */
|
1982 2229 | #[allow(missing_docs)] // documentation missing in model
|
1983 - | ///
|
2230 + | /// /* ConstrainedStringGenerator.kt:83 */
|
1984 2231 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1985 2232 | /// [constraint traits]. Use [`PageToken::try_from`] to construct values of this type.
|
1986 2233 | ///
|
1987 2234 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1988 2235 | ///
|
2236 + | /* RustType.kt:516 */
|
1989 2237 | #[derive(
|
1990 2238 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1991 2239 | )]
|
1992 - | pub struct PageToken(pub(crate) ::std::string::String);
|
2240 + | pub /* ConstrainedStringGenerator.kt:86 */ struct PageToken(pub(crate) ::std::string::String);
|
2241 + | /* ConstrainedStringGenerator.kt:90 */
|
1993 2242 | impl PageToken {
|
1994 2243 | /// Extracts a string slice containing the entire underlying `String`.
|
1995 2244 | pub fn as_str(&self) -> &str {
|
1996 2245 | &self.0
|
1997 2246 | }
|
1998 2247 |
|
1999 2248 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2000 2249 | pub fn inner(&self) -> &::std::string::String {
|
2001 2250 | &self.0
|
2002 2251 | }
|
2003 2252 |
|
2004 2253 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2005 2254 | pub fn into_inner(self) -> ::std::string::String {
|
2006 2255 | self.0
|
2007 2256 | }
|
2008 2257 | }
|
2258 + | /* TraitInfo.kt:41 */
|
2009 2259 | impl PageToken {
|
2010 2260 | fn check_length(
|
2011 2261 | string: &str,
|
2012 2262 | ) -> ::std::result::Result<(), crate::model::page_token::ConstraintViolation> {
|
2013 2263 | let length = string.chars().count();
|
2014 2264 |
|
2015 2265 | if (0..=256).contains(&length) {
|
2016 2266 | Ok(())
|
2017 2267 | } else {
|
2018 2268 | Err(crate::model::page_token::ConstraintViolation::Length(
|
2019 2269 | length,
|
2020 2270 | ))
|
2021 2271 | }
|
2022 2272 | }
|
2023 2273 |
|
2024 2274 | fn check_pattern(
|
2025 2275 | string: ::std::string::String,
|
2026 2276 | ) -> ::std::result::Result<::std::string::String, crate::model::page_token::ConstraintViolation>
|
2027 2277 | {
|
2028 2278 | let regex = Self::compile_regex();
|
2029 2279 |
|
2030 2280 | if regex.is_match(&string) {
|
2031 2281 | Ok(string)
|
2032 2282 | } else {
|
2033 2283 | Err(crate::model::page_token::ConstraintViolation::Pattern(
|
2034 2284 | string,
|
2035 2285 | ))
|
2036 2286 | }
|
2037 2287 | }
|
2038 2288 |
|
2039 2289 | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
2040 2290 | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
2041 2291 | pub fn compile_regex() -> &'static ::regex::Regex {
|
2042 2292 | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
2043 2293 | ::regex::Regex::new(r#"^[A-Za-z0-9+/=]+$"#).expect(r#"The regular expression ^[A-Za-z0-9+/=]+$ is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
2044 2294 | });
|
2045 2295 |
|
2046 2296 | ®EX
|
2047 2297 | }
|
2048 2298 | }
|
2299 + | /* TraitInfo.kt:57 */
|
2049 2300 | impl ::std::convert::TryFrom<::std::string::String> for PageToken {
|
2050 2301 | type Error = crate::model::page_token::ConstraintViolation;
|
2051 2302 |
|
2052 2303 | /// Constructs a `PageToken` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2053 2304 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2054 2305 | Self::check_length(&value)?;
|
2055 2306 |
|
2056 2307 | let value = Self::check_pattern(value)?;
|
2057 2308 |
|
2058 2309 | Ok(Self(value))
|
2059 2310 | }
|
2060 2311 | }
|
2312 + | /* ConstrainedStringGenerator.kt:112 */
|
2061 2313 | impl crate::constrained::Constrained for PageToken {
|
2062 2314 | type Unconstrained = ::std::string::String;
|
2063 2315 | }
|
2064 2316 |
|
2065 2317 | impl ::std::convert::From<::std::string::String>
|
2066 2318 | for crate::constrained::MaybeConstrained<crate::model::PageToken>
|
2067 2319 | {
|
2068 2320 | fn from(value: ::std::string::String) -> Self {
|
2069 2321 | Self::Unconstrained(value)
|
2070 2322 | }
|
2071 2323 | }
|
2072 2324 |
|
2073 2325 | impl ::std::fmt::Display for PageToken {
|
2074 2326 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2075 2327 | self.0.fmt(f)
|
2076 2328 | }
|
2077 2329 | }
|
2078 2330 |
|
2079 2331 | impl ::std::convert::From<PageToken> for ::std::string::String {
|
2080 2332 | fn from(value: PageToken) -> Self {
|
2081 2333 | value.into_inner()
|
2082 2334 | }
|
2083 2335 | }
|
2084 2336 |
|
2337 + | /* RustType.kt:516 */
|
2085 2338 | #[cfg(test)]
|
2339 + | /* ConstrainedStringGenerator.kt:205 */
|
2086 2340 | mod test_page_token {
|
2087 2341 | #[test]
|
2088 2342 | fn regex_compiles() {
|
2089 2343 | crate::model::PageToken::compile_regex();
|
2090 2344 | }
|
2345 + |
|
2346 + | /* ConstrainedStringGenerator.kt:205 */
|
2091 2347 | }
|
2092 2348 |
|
2349 + | /* ConstrainedNumberGenerator.kt:82 */
|
2093 2350 | #[allow(missing_docs)] // documentation missing in model
|
2094 - | ///
|
2351 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2095 2352 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2096 2353 | /// [constraint traits]. Use [`MaxResults::try_from`] to construct values of this type.
|
2097 2354 | ///
|
2098 2355 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2099 2356 | ///
|
2357 + | /* RustType.kt:516 */
|
2100 2358 | #[derive(
|
2101 2359 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2102 2360 | )]
|
2103 - | pub struct MaxResults(pub(crate) i32);
|
2361 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct MaxResults(pub(crate) i32);
|
2362 + | /* ConstrainedNumberGenerator.kt:91 */
|
2104 2363 | impl MaxResults {
|
2105 2364 | /// Returns an immutable reference to the underlying [`i32`].
|
2106 2365 | pub fn inner(&self) -> &i32 {
|
2107 2366 | &self.0
|
2108 2367 | }
|
2109 2368 |
|
2110 2369 | /// Consumes the value, returning the underlying [`i32`].
|
2111 2370 | pub fn into_inner(self) -> i32 {
|
2112 2371 | self.0
|
2113 2372 | }
|
2114 2373 | }
|
2115 2374 |
|
2116 2375 | impl crate::constrained::Constrained for MaxResults {
|
2117 2376 | type Unconstrained = i32;
|
2118 2377 | }
|
2119 2378 |
|
2120 2379 | impl ::std::convert::From<i32> for crate::constrained::MaybeConstrained<crate::model::MaxResults> {
|
2121 2380 | fn from(value: i32) -> Self {
|
2122 2381 | Self::Unconstrained(value)
|
2123 2382 | }
|
2124 2383 | }
|
2125 2384 |
|
2126 2385 | impl ::std::fmt::Display for MaxResults {
|
2127 2386 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2128 2387 | self.0.fmt(f)
|
2129 2388 | }
|
2130 2389 | }
|
2131 2390 |
|
2132 2391 | impl ::std::convert::From<MaxResults> for i32 {
|
2133 2392 | fn from(value: MaxResults) -> Self {
|
2134 2393 | value.into_inner()
|
2135 2394 | }
|
2136 2395 | }
|
2396 + | /* TraitInfo.kt:41 */
|
2137 2397 | impl MaxResults {
|
2138 2398 | fn check_range(
|
2139 2399 | value: i32,
|
2140 2400 | ) -> ::std::result::Result<(), crate::model::max_results::ConstraintViolation> {
|
2141 2401 | if (100..=10000).contains(&value) {
|
2142 2402 | Ok(())
|
2143 2403 | } else {
|
2144 2404 | Err(crate::model::max_results::ConstraintViolation::Range(value))
|
2145 2405 | }
|
2146 2406 | }
|
2147 2407 | }
|
2408 + | /* TraitInfo.kt:57 */
|
2148 2409 | impl ::std::convert::TryFrom<i32> for MaxResults {
|
2149 2410 | type Error = crate::model::max_results::ConstraintViolation;
|
2150 2411 |
|
2151 2412 | /// Constructs a `MaxResults` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2152 2413 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2153 2414 | Self::check_range(value)?;
|
2154 2415 |
|
2155 2416 | Ok(Self(value))
|
2156 2417 | }
|
2157 2418 | }
|
2158 2419 |
|
2159 - | /// <p>A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of the same volume/snapshot lineage.</p>
|
2420 + | /// /* StructureGenerator.kt:197 */<p>A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of the same volume/snapshot lineage.</p>
|
2421 + | /* RustType.kt:516 */
|
2160 2422 | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
2161 - | pub struct ChangedBlock {
|
2162 - | /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
|
2423 + | pub /* StructureGenerator.kt:201 */ struct ChangedBlock {
|
2424 + | /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
|
2163 2425 | pub first_block_token: ::std::option::Option<crate::model::BlockToken>,
|
2164 - | /// <p>The block index.</p>
|
2426 + | /// /* StructureGenerator.kt:231 */<p>The block index.</p>
|
2165 2427 | pub block_index: ::std::option::Option<crate::model::BlockIndex>,
|
2166 - | /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
|
2428 + | /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
|
2167 2429 | pub second_block_token: ::std::option::Option<crate::model::BlockToken>,
|
2430 + | /* StructureGenerator.kt:201 */
|
2168 2431 | }
|
2432 + | /* StructureGenerator.kt:135 */
|
2169 2433 | impl ChangedBlock {
|
2170 - | /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
|
2434 + | /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
|
2435 + | /* StructureGenerator.kt:166 */
|
2171 2436 | pub fn first_block_token(&self) -> ::std::option::Option<&crate::model::BlockToken> {
|
2437 + | /* StructureGenerator.kt:170 */
|
2172 2438 | self.first_block_token.as_ref()
|
2439 + | /* StructureGenerator.kt:166 */
|
2173 2440 | }
|
2174 - | /// <p>The block index.</p>
|
2441 + | /// /* StructureGenerator.kt:231 */<p>The block index.</p>
|
2442 + | /* StructureGenerator.kt:166 */
|
2175 2443 | pub fn block_index(&self) -> ::std::option::Option<&crate::model::BlockIndex> {
|
2444 + | /* StructureGenerator.kt:170 */
|
2176 2445 | self.block_index.as_ref()
|
2446 + | /* StructureGenerator.kt:166 */
|
2177 2447 | }
|
2178 - | /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
|
2448 + | /// /* StructureGenerator.kt:231 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
|
2449 + | /* StructureGenerator.kt:166 */
|
2179 2450 | pub fn second_block_token(&self) -> ::std::option::Option<&crate::model::BlockToken> {
|
2451 + | /* StructureGenerator.kt:170 */
|
2180 2452 | self.second_block_token.as_ref()
|
2453 + | /* StructureGenerator.kt:166 */
|
2181 2454 | }
|
2455 + | /* StructureGenerator.kt:135 */
|
2182 2456 | }
|
2457 + | /* StructureGenerator.kt:101 */
|
2183 2458 | impl ::std::fmt::Debug for ChangedBlock {
|
2459 + | /* StructureGenerator.kt:105 */
|
2184 2460 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2461 + | /* StructureGenerator.kt:106 */
|
2185 2462 | let mut formatter = f.debug_struct("ChangedBlock");
|
2463 + | /* StructureGenerator.kt:121 */
|
2186 2464 | formatter.field("first_block_token", &"*** Sensitive Data Redacted ***");
|
2465 + | /* StructureGenerator.kt:121 */
|
2187 2466 | formatter.field("block_index", &"*** Sensitive Data Redacted ***");
|
2467 + | /* StructureGenerator.kt:121 */
|
2188 2468 | formatter.field("second_block_token", &"*** Sensitive Data Redacted ***");
|
2469 + | /* StructureGenerator.kt:126 */
|
2189 2470 | formatter.finish()
|
2471 + | /* StructureGenerator.kt:105 */
|
2190 2472 | }
|
2473 + | /* StructureGenerator.kt:101 */
|
2191 2474 | }
|
2475 + | /* ServerCodegenVisitor.kt:345 */
|
2192 2476 | impl ChangedBlock {
|
2193 - | /// Creates a new builder-style object to manufacture [`ChangedBlock`](crate::model::ChangedBlock).
|
2477 + | /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ChangedBlock`](crate::model::ChangedBlock).
|
2478 + | /* ServerBuilderGenerator.kt:295 */
|
2194 2479 | pub fn builder() -> crate::model::changed_block::Builder {
|
2480 + | /* ServerBuilderGenerator.kt:296 */
|
2195 2481 | crate::model::changed_block::Builder::default()
|
2482 + | /* ServerBuilderGenerator.kt:295 */
|
2196 2483 | }
|
2484 + | /* ServerCodegenVisitor.kt:345 */
|
2197 2485 | }
|
2198 2486 |
|
2487 + | /* EnumGenerator.kt:154 */
|
2199 2488 | #[allow(missing_docs)] // documentation missing in model
|
2489 + | /* RustType.kt:516 */
|
2200 2490 | #[derive(
|
2201 2491 | ::std::clone::Clone,
|
2202 2492 | ::std::cmp::Eq,
|
2203 2493 | ::std::cmp::Ord,
|
2204 2494 | ::std::cmp::PartialEq,
|
2205 2495 | ::std::cmp::PartialOrd,
|
2206 2496 | ::std::fmt::Debug,
|
2207 2497 | ::std::hash::Hash,
|
2208 2498 | )]
|
2209 - | pub enum ChecksumAggregationMethod {
|
2499 + | pub /* EnumGenerator.kt:267 */ enum ChecksumAggregationMethod {
|
2500 + | /* EnumGenerator.kt:154 */
|
2210 2501 | #[allow(missing_docs)] // documentation missing in model
|
2502 + | /* EnumGenerator.kt:143 */
|
2211 2503 | ChecksumAggregationLinear,
|
2504 + | /* EnumGenerator.kt:267 */
|
2212 2505 | }
|
2213 - | /// See [`ChecksumAggregationMethod`](crate::model::ChecksumAggregationMethod).
|
2506 + | /// /* CodegenDelegator.kt:51 */See [`ChecksumAggregationMethod`](crate::model::ChecksumAggregationMethod).
|
2214 2507 | pub mod checksum_aggregation_method {
|
2215 2508 | #[derive(Debug, PartialEq)]
|
2216 2509 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
2217 2510 |
|
2218 2511 | impl ::std::fmt::Display for ConstraintViolation {
|
2219 2512 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2220 2513 | write!(
|
2221 2514 | f,
|
2222 2515 | r#"Value provided for 'com.amazonaws.ebs#ChecksumAggregationMethod' failed to satisfy constraint: Member must satisfy enum value set: [LINEAR]"#
|
2223 2516 | )
|
2224 2517 | }
|
2225 2518 | }
|
2226 2519 |
|
2227 2520 | impl ::std::error::Error for ConstraintViolation {}
|
2228 2521 | impl ConstraintViolation {
|
2229 2522 | pub(crate) fn as_validation_exception_field(
|
2230 2523 | self,
|
2231 2524 | path: ::std::string::String,
|
2232 2525 | ) -> crate::model::ValidationExceptionField {
|
2233 2526 | crate::model::ValidationExceptionField {
|
2234 2527 | message: format!(
|
2235 2528 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [LINEAR]"#,
|
2236 2529 | &path
|
2237 2530 | ),
|
2238 2531 | path,
|
2239 2532 | }
|
2240 2533 | }
|
2241 2534 | }
|
2535 + |
|
2536 + | /* ServerEnumGenerator.kt:46 */
|
2242 2537 | }
|
2538 + | /* ServerEnumGenerator.kt:85 */
|
2243 2539 | impl ::std::convert::TryFrom<&str> for ChecksumAggregationMethod {
|
2244 2540 | type Error = crate::model::checksum_aggregation_method::ConstraintViolation;
|
2245 2541 | fn try_from(
|
2246 2542 | s: &str,
|
2247 2543 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
2248 2544 | match s {
|
2249 2545 | "LINEAR" => Ok(ChecksumAggregationMethod::ChecksumAggregationLinear),
|
2250 2546 | _ => Err(crate::model::checksum_aggregation_method::ConstraintViolation(s.to_owned())),
|
2251 2547 | }
|
2252 2548 | }
|
2253 2549 | }
|
2254 2550 | impl ::std::convert::TryFrom<::std::string::String> for ChecksumAggregationMethod {
|
2255 2551 | type Error = crate::model::checksum_aggregation_method::ConstraintViolation;
|
2256 2552 | fn try_from(
|
2257 2553 | s: ::std::string::String,
|
2258 2554 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
2259 2555 | {
|
2260 2556 | s.as_str().try_into()
|
2261 2557 | }
|
2262 2558 | }
|
2559 + | /* ServerEnumGenerator.kt:145 */
|
2263 2560 | impl std::str::FromStr for ChecksumAggregationMethod {
|
2264 2561 | type Err = crate::model::checksum_aggregation_method::ConstraintViolation;
|
2265 2562 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
2266 2563 | Self::try_from(s)
|
2267 2564 | }
|
2268 2565 | }
|
2566 + | /* EnumGenerator.kt:274 */
|
2269 2567 | impl ChecksumAggregationMethod {
|
2270 2568 | /// Returns the `&str` value of the enum member.
|
2271 2569 | pub fn as_str(&self) -> &str {
|
2272 2570 | match self {
|
2273 2571 | ChecksumAggregationMethod::ChecksumAggregationLinear => "LINEAR",
|
2274 2572 | }
|
2275 2573 | }
|
2276 2574 | /// Returns all the `&str` representations of the enum members.
|
2277 2575 | pub const fn values() -> &'static [&'static str] {
|
2278 2576 | &["LINEAR"]
|
2279 2577 | }
|
2280 2578 | }
|
2579 + | /* EnumGenerator.kt:223 */
|
2281 2580 | impl ::std::convert::AsRef<str> for ChecksumAggregationMethod {
|
2282 2581 | fn as_ref(&self) -> &str {
|
2283 2582 | self.as_str()
|
2284 2583 | }
|
2285 2584 | }
|
2585 + | /* ConstrainedTraitForEnumGenerator.kt:36 */
|
2286 2586 | impl crate::constrained::Constrained for ChecksumAggregationMethod {
|
2287 2587 | type Unconstrained = ::std::string::String;
|
2288 2588 | }
|
2289 2589 |
|
2290 2590 | impl ::std::convert::From<::std::string::String>
|
2291 2591 | for crate::constrained::MaybeConstrained<crate::model::ChecksumAggregationMethod>
|
2292 2592 | {
|
2293 2593 | fn from(value: ::std::string::String) -> Self {
|
2294 2594 | Self::Unconstrained(value)
|
2295 2595 | }
|
2296 2596 | }
|
2297 2597 |
|
2598 + | /* ConstrainedNumberGenerator.kt:82 */
|
2298 2599 | #[allow(missing_docs)] // documentation missing in model
|
2299 - | ///
|
2600 + | /// /* ConstrainedNumberGenerator.kt:83 */
|
2300 2601 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2301 2602 | /// [constraint traits]. Use [`ChangedBlocksCount::try_from`] to construct values of this type.
|
2302 2603 | ///
|
2303 2604 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2304 2605 | ///
|
2606 + | /* RustType.kt:516 */
|
2305 2607 | #[derive(
|
2306 2608 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2307 2609 | )]
|
2308 - | pub struct ChangedBlocksCount(pub(crate) i32);
|
2610 + | pub /* ConstrainedNumberGenerator.kt:86 */ struct ChangedBlocksCount(pub(crate) i32);
|
2611 + | /* ConstrainedNumberGenerator.kt:91 */
|
2309 2612 | impl ChangedBlocksCount {
|
2310 2613 | /// Returns an immutable reference to the underlying [`i32`].
|
2311 2614 | pub fn inner(&self) -> &i32 {
|
2312 2615 | &self.0
|
2313 2616 | }
|
2314 2617 |
|
2315 2618 | /// Consumes the value, returning the underlying [`i32`].
|
2316 2619 | pub fn into_inner(self) -> i32 {
|
2317 2620 | self.0
|
2318 2621 | }
|
2319 2622 | }
|
2320 2623 |
|
2321 2624 | impl crate::constrained::Constrained for ChangedBlocksCount {
|
2322 2625 | type Unconstrained = i32;
|
2323 2626 | }
|
2324 2627 |
|
2325 2628 | impl ::std::convert::From<i32>
|
2326 2629 | for crate::constrained::MaybeConstrained<crate::model::ChangedBlocksCount>
|
2327 2630 | {
|
2328 2631 | fn from(value: i32) -> Self {
|
2329 2632 | Self::Unconstrained(value)
|
2330 2633 | }
|
2331 2634 | }
|
2332 2635 |
|
2333 2636 | impl ::std::fmt::Display for ChangedBlocksCount {
|
2334 2637 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2335 2638 | self.0.fmt(f)
|
2336 2639 | }
|
2337 2640 | }
|
2338 2641 |
|
2339 2642 | impl ::std::convert::From<ChangedBlocksCount> for i32 {
|
2340 2643 | fn from(value: ChangedBlocksCount) -> Self {
|
2341 2644 | value.into_inner()
|
2342 2645 | }
|
2343 2646 | }
|
2647 + | /* TraitInfo.kt:41 */
|
2344 2648 | impl ChangedBlocksCount {
|
2345 2649 | fn check_range(
|
2346 2650 | value: i32,
|
2347 2651 | ) -> ::std::result::Result<(), crate::model::changed_blocks_count::ConstraintViolation> {
|
2348 2652 | if 0 <= value {
|
2349 2653 | Ok(())
|
2350 2654 | } else {
|
2351 2655 | Err(crate::model::changed_blocks_count::ConstraintViolation::Range(value))
|
2352 2656 | }
|
2353 2657 | }
|
2354 2658 | }
|
2659 + | /* TraitInfo.kt:57 */
|
2355 2660 | impl ::std::convert::TryFrom<i32> for ChangedBlocksCount {
|
2356 2661 | type Error = crate::model::changed_blocks_count::ConstraintViolation;
|
2357 2662 |
|
2358 2663 | /// Constructs a `ChangedBlocksCount` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2359 2664 | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2360 2665 | Self::check_range(value)?;
|
2361 2666 |
|
2362 2667 | Ok(Self(value))
|
2363 2668 | }
|
2364 2669 | }
|
2365 2670 |
|
2366 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2671 + | /// /* ServerBuilderGenerator.kt:171 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2367 2672 | pub mod validation_exception_field {
|
2368 2673 |
|
2674 + | /* RustType.kt:516 */
|
2369 2675 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2370 - | /// Holds one variant for each of the ways the builder can fail.
|
2676 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
2677 + | /* RustType.kt:516 */
|
2371 2678 | #[non_exhaustive]
|
2679 + | /* ServerBuilderConstraintViolations.kt:75 */
|
2372 2680 | #[allow(clippy::enum_variant_names)]
|
2373 2681 | pub enum ConstraintViolation {
|
2374 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
2682 + | /// /* ServerBuilderConstraintViolations.kt:138 */`path` was not provided but it is required when building `ValidationExceptionField`.
|
2683 + | /* ServerBuilderConstraintViolations.kt:143 */
|
2375 2684 | MissingPath,
|
2376 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
2685 + | /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationExceptionField`.
|
2686 + | /* ServerBuilderConstraintViolations.kt:143 */
|
2377 2687 | MissingMessage,
|
2688 + | /* ServerBuilderConstraintViolations.kt:75 */
|
2378 2689 | }
|
2690 + | /* ServerBuilderConstraintViolations.kt:117 */
|
2379 2691 | impl ::std::fmt::Display for ConstraintViolation {
|
2692 + | /* ServerBuilderConstraintViolations.kt:118 */
|
2380 2693 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2694 + | /* ServerBuilderConstraintViolations.kt:119 */
|
2381 2695 | match self {
|
2382 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
2383 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
2384 - | }
|
2696 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
2697 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
2698 + | /* ServerBuilderConstraintViolations.kt:119 */}
|
2699 + | /* ServerBuilderConstraintViolations.kt:118 */
|
2385 2700 | }
|
2701 + | /* ServerBuilderConstraintViolations.kt:117 */
|
2386 2702 | }
|
2703 + | /* ServerBuilderConstraintViolations.kt:84 */
|
2387 2704 | impl ::std::error::Error for ConstraintViolation {}
|
2705 + | /* ServerBuilderGenerator.kt:446 */
|
2388 2706 | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
2389 2707 | type Error = ConstraintViolation;
|
2390 2708 |
|
2391 2709 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2392 2710 | builder.build()
|
2393 2711 | }
|
2394 2712 | }
|
2395 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2713 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2714 + | /* RustType.kt:516 */
|
2396 2715 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2716 + | /* ServerBuilderGenerator.kt:211 */
|
2397 2717 | pub struct Builder {
|
2718 + | /* ServerBuilderGenerator.kt:308 */
|
2398 2719 | pub(crate) path: ::std::option::Option<::std::string::String>,
|
2720 + | /* ServerBuilderGenerator.kt:308 */
|
2399 2721 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
2722 + | /* ServerBuilderGenerator.kt:211 */
|
2400 2723 | }
|
2724 + | /* ServerBuilderGenerator.kt:215 */
|
2401 2725 | impl Builder {
|
2402 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
2726 + | /// /* ServerBuilderGenerator.kt:331 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
2727 + | /* ServerBuilderGenerator.kt:343 */
|
2403 2728 | pub fn path(mut self, input: ::std::string::String) -> Self {
|
2404 - | self.path = Some(input);
|
2729 + | /* ServerBuilderGenerator.kt:344 */
|
2730 + | self.path =
|
2731 + | /* ServerBuilderGenerator.kt:345 */Some(
|
2732 + | /* ServerBuilderGenerator.kt:376 */input
|
2733 + | /* ServerBuilderGenerator.kt:345 */)
|
2734 + | /* ServerBuilderGenerator.kt:344 */;
|
2405 2735 | self
|
2736 + | /* ServerBuilderGenerator.kt:343 */
|
2406 2737 | }
|
2407 - | /// A detailed description of the validation failure.
|
2738 + | /// /* ServerBuilderGenerator.kt:331 */A detailed description of the validation failure.
|
2739 + | /* ServerBuilderGenerator.kt:343 */
|
2408 2740 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
2409 - | self.message = Some(input);
|
2741 + | /* ServerBuilderGenerator.kt:344 */
|
2742 + | self.message =
|
2743 + | /* ServerBuilderGenerator.kt:345 */Some(
|
2744 + | /* ServerBuilderGenerator.kt:376 */input
|
2745 + | /* ServerBuilderGenerator.kt:345 */)
|
2746 + | /* ServerBuilderGenerator.kt:344 */;
|
2410 2747 | self
|
2748 + | /* ServerBuilderGenerator.kt:343 */
|
2411 2749 | }
|
2412 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2413 - | ///
|
2750 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2751 + | /// /* ServerBuilderGenerator.kt:260 */
|
2414 2752 | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
2415 2753 | ///
|
2416 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2754 + | /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
2755 + | /* ServerBuilderGenerator.kt:271 */
|
2417 2756 | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
2418 2757 | self.build_enforcing_all_constraints()
|
2419 2758 | }
|
2759 + | /* ServerBuilderGenerator.kt:283 */
|
2420 2760 | fn build_enforcing_all_constraints(
|
2421 2761 | self,
|
2422 2762 | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
2423 - | Ok(crate::model::ValidationExceptionField {
|
2424 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
2425 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
2426 - | })
|
2763 + | /* ServerBuilderGenerator.kt:287 */
|
2764 + | Ok(
|
2765 + | /* ServerBuilderGenerator.kt:542 */
|
2766 + | crate::model::ValidationExceptionField {
|
2767 + | /* ServerBuilderGenerator.kt:546 */
|
2768 + | path: self
|
2769 + | .path
|
2770 + | /* ServerBuilderGenerator.kt:569 */
|
2771 + | .ok_or(ConstraintViolation::MissingPath)?,
|
2772 + | /* ServerBuilderGenerator.kt:546 */
|
2773 + | message: self
|
2774 + | .message
|
2775 + | /* ServerBuilderGenerator.kt:569 */
|
2776 + | .ok_or(ConstraintViolation::MissingMessage)?,
|
2777 + | /* ServerBuilderGenerator.kt:542 */
|
2778 + | }, /* ServerBuilderGenerator.kt:287 */
|
2779 + | )
|
2780 + | /* ServerBuilderGenerator.kt:283 */
|
2427 2781 | }
|
2782 + | /* ServerBuilderGenerator.kt:215 */
|
2428 2783 | }
|
2784 + |
|
2785 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2429 2786 | }
|
2430 - | /// See [`ErrorMessage`](crate::model::ErrorMessage).
|
2787 + | /// /* CodegenDelegator.kt:51 */See [`ErrorMessage`](crate::model::ErrorMessage).
|
2431 2788 | pub mod error_message {
|
2432 2789 |
|
2790 + | /* ConstrainedStringGenerator.kt:155 */
|
2433 2791 | #[derive(Debug, PartialEq)]
|
2434 2792 | pub enum ConstraintViolation {
|
2435 2793 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2436 2794 | Length(usize),
|
2437 2795 | }
|
2438 2796 |
|
2439 2797 | impl ::std::fmt::Display for ConstraintViolation {
|
2440 2798 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2441 2799 | let message = match self {
|
2442 2800 | Self::Length(length) => {
|
2443 2801 | format!("Value with length {} provided for 'com.amazonaws.ebs#ErrorMessage' failed to satisfy constraint: Member must have length between 0 and 256, inclusive", length)
|
2444 2802 | }
|
2445 2803 | };
|
2446 2804 | write!(f, "{message}")
|
2447 2805 | }
|
2448 2806 | }
|
2449 2807 |
|
2450 2808 | impl ::std::error::Error for ConstraintViolation {}
|
2809 + |
|
2810 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2451 2811 | }
|
2452 - | /// See [`SnapshotId`](crate::model::SnapshotId).
|
2812 + | /// /* CodegenDelegator.kt:51 */See [`SnapshotId`](crate::model::SnapshotId).
|
2453 2813 | pub mod snapshot_id {
|
2454 2814 |
|
2815 + | /* ConstrainedStringGenerator.kt:155 */
|
2455 2816 | #[derive(Debug, PartialEq)]
|
2456 2817 | pub enum ConstraintViolation {
|
2457 2818 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2458 2819 | Length(usize),
|
2459 2820 | /// Error when a string doesn't satisfy its `@pattern`.
|
2460 2821 | /// Contains the String that failed the pattern.
|
2461 2822 | Pattern(String),
|
2462 2823 | }
|
2463 2824 |
|
2464 2825 | impl ::std::fmt::Display for ConstraintViolation {
|
2465 2826 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2466 2827 | let message = match self {
|
2467 2828 | Self::Length(length) => {
|
2468 2829 | format!("Value with length {} provided for 'com.amazonaws.ebs#SnapshotId' failed to satisfy constraint: Member must have length between 1 and 64, inclusive", length)
|
2469 2830 | }
|
2470 2831 | Self::Pattern(_) => {
|
2471 2832 | format!(
|
2472 2833 | r#"Value provided for `com.amazonaws.ebs#SnapshotId` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2473 2834 | r#"^snap-[0-9a-f]+$"#
|
2474 2835 | )
|
2475 2836 | }
|
2476 2837 | };
|
2477 2838 | write!(f, "{message}")
|
2478 2839 | }
|
2479 2840 | }
|
2480 2841 |
|
2481 2842 | impl ::std::error::Error for ConstraintViolation {}
|
2843 + | /* ConstrainedStringGenerator.kt:180 */
|
2482 2844 | impl ConstraintViolation {
|
2483 2845 | pub(crate) fn as_validation_exception_field(
|
2484 2846 | self,
|
2485 2847 | path: ::std::string::String,
|
2486 2848 | ) -> crate::model::ValidationExceptionField {
|
2487 2849 | match self {
|
2488 2850 | Self::Length(length) => crate::model::ValidationExceptionField {
|
2489 2851 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 64, inclusive", length, &path),
|
2490 2852 | path,
|
2491 2853 | },
|
2492 2854 |
|
2493 2855 | #[allow(unused_variables)]
|
2494 2856 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
2495 2857 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^snap-[0-9a-f]+$"#),
|
2496 2858 | path
|
2497 2859 | },
|
2498 2860 | }
|
2499 2861 | }
|
2500 2862 | }
|
2863 + |
|
2864 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2501 2865 | }
|
2502 - | /// See [`Description`](crate::model::Description).
|
2866 + | /// /* CodegenDelegator.kt:51 */See [`Description`](crate::model::Description).
|
2503 2867 | pub mod description {
|
2504 2868 |
|
2869 + | /* ConstrainedStringGenerator.kt:155 */
|
2505 2870 | #[derive(Debug, PartialEq)]
|
2506 2871 | pub enum ConstraintViolation {
|
2507 2872 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2508 2873 | Length(usize),
|
2509 2874 | /// Error when a string doesn't satisfy its `@pattern`.
|
2510 2875 | /// Contains the String that failed the pattern.
|
2511 2876 | Pattern(String),
|
2512 2877 | }
|
2513 2878 |
|
2514 2879 | impl ::std::fmt::Display for ConstraintViolation {
|
2515 2880 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2516 2881 | let message = match self {
|
2517 2882 | Self::Length(length) => {
|
2518 2883 | format!("Value with length {} provided for 'com.amazonaws.ebs#Description' failed to satisfy constraint: Member must have length between 0 and 255, inclusive", length)
|
2519 2884 | }
|
2520 2885 | Self::Pattern(_) => {
|
2521 2886 | format!(
|
2522 2887 | r#"Value provided for `com.amazonaws.ebs#Description` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2523 2888 | r#"^[\S\s]+$"#
|
2524 2889 | )
|
2525 2890 | }
|
2526 2891 | };
|
2527 2892 | write!(f, "{message}")
|
2528 2893 | }
|
2529 2894 | }
|
2530 2895 |
|
2531 2896 | impl ::std::error::Error for ConstraintViolation {}
|
2897 + | /* ConstrainedStringGenerator.kt:180 */
|
2532 2898 | impl ConstraintViolation {
|
2533 2899 | pub(crate) fn as_validation_exception_field(
|
2534 2900 | self,
|
2535 2901 | path: ::std::string::String,
|
2536 2902 | ) -> crate::model::ValidationExceptionField {
|
2537 2903 | match self {
|
2538 2904 | Self::Length(length) => crate::model::ValidationExceptionField {
|
2539 2905 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 255, inclusive", length, &path),
|
2540 2906 | path,
|
2541 2907 | },
|
2542 2908 |
|
2543 2909 | #[allow(unused_variables)]
|
2544 2910 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
2545 2911 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[\S\s]+$"#),
|
2546 2912 | path
|
2547 2913 | },
|
2548 2914 | }
|
2549 2915 | }
|
2550 2916 | }
|
2917 + |
|
2918 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2551 2919 | }
|
2552 - | /// See [`VolumeSize`](crate::model::VolumeSize).
|
2920 + | /// /* CodegenDelegator.kt:51 */See [`VolumeSize`](crate::model::VolumeSize).
|
2553 2921 | pub mod volume_size {
|
2554 2922 |
|
2923 + | /* ConstrainedNumberGenerator.kt:139 */
|
2555 2924 | #[derive(Debug, PartialEq)]
|
2556 2925 | pub enum ConstraintViolation {
|
2557 2926 | Range(i64),
|
2558 2927 | }
|
2559 2928 |
|
2560 2929 | impl ::std::fmt::Display for ConstraintViolation {
|
2561 2930 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2562 2931 | write!(f, "Value for `com.amazonaws.ebs#VolumeSize`failed to satisfy constraint: Member must be greater than or equal to 1")
|
2563 2932 | }
|
2564 2933 | }
|
2565 2934 |
|
2566 2935 | impl ::std::error::Error for ConstraintViolation {}
|
2936 + | /* ConstrainedNumberGenerator.kt:159 */
|
2567 2937 | impl ConstraintViolation {
|
2568 2938 | pub(crate) fn as_validation_exception_field(
|
2569 2939 | self,
|
2570 2940 | path: ::std::string::String,
|
2571 2941 | ) -> crate::model::ValidationExceptionField {
|
2572 2942 | match self {
|
2573 2943 | Self::Range(_) => crate::model::ValidationExceptionField {
|
2574 2944 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 1", &path),
|
2575 2945 | path,
|
2576 2946 | },
|
2577 2947 | }
|
2578 2948 | }
|
2579 2949 | }
|
2950 + |
|
2951 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2580 2952 | }
|
2581 - | /// See [`OwnerId`](crate::model::OwnerId).
|
2953 + | /// /* CodegenDelegator.kt:51 */See [`OwnerId`](crate::model::OwnerId).
|
2582 2954 | pub mod owner_id {
|
2583 2955 |
|
2956 + | /* ConstrainedStringGenerator.kt:155 */
|
2584 2957 | #[derive(Debug, PartialEq)]
|
2585 2958 | pub enum ConstraintViolation {
|
2586 2959 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2587 2960 | Length(usize),
|
2588 2961 | /// Error when a string doesn't satisfy its `@pattern`.
|
2589 2962 | /// Contains the String that failed the pattern.
|
2590 2963 | Pattern(String),
|
2591 2964 | }
|
2592 2965 |
|
2593 2966 | impl ::std::fmt::Display for ConstraintViolation {
|
2594 2967 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2595 2968 | let message = match self {
|
2596 2969 | Self::Length(length) => {
|
2597 2970 | format!("Value with length {} provided for 'com.amazonaws.ebs#OwnerId' failed to satisfy constraint: Member must have length between 1 and 24, inclusive", length)
|
2598 2971 | }
|
2599 2972 | Self::Pattern(_) => {
|
2600 2973 | format!(
|
2601 2974 | r#"Value provided for `com.amazonaws.ebs#OwnerId` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2602 2975 | r#"\S+"#
|
2603 2976 | )
|
2604 2977 | }
|
2605 2978 | };
|
2606 2979 | write!(f, "{message}")
|
2607 2980 | }
|
2608 2981 | }
|
2609 2982 |
|
2610 2983 | impl ::std::error::Error for ConstraintViolation {}
|
2984 + |
|
2985 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2611 2986 | }
|
2612 - | /// See [`KmsKeyArn`](crate::model::KmsKeyArn).
|
2987 + | /// /* CodegenDelegator.kt:51 */See [`KmsKeyArn`](crate::model::KmsKeyArn).
|
2613 2988 | pub mod kms_key_arn {
|
2614 2989 |
|
2990 + | /* ConstrainedStringGenerator.kt:155 */
|
2615 2991 | #[derive(Debug, PartialEq)]
|
2616 2992 | pub enum ConstraintViolation {
|
2617 2993 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2618 2994 | Length(usize),
|
2619 2995 | /// Error when a string doesn't satisfy its `@pattern`.
|
2620 2996 | /// Contains the String that failed the pattern.
|
2621 2997 | Pattern(String),
|
2622 2998 | }
|
2623 2999 |
|
2624 3000 | impl ::std::fmt::Display for ConstraintViolation {
|
2625 3001 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2626 3002 | let message = match self {
|
2627 3003 | Self::Length(length) => {
|
2628 3004 | format!("Value with length {} provided for 'com.amazonaws.ebs#KmsKeyArn' failed to satisfy constraint: Member must have length between 1 and 2048, inclusive", length)
|
2629 3005 | }
|
2630 3006 | Self::Pattern(_) => {
|
2631 3007 | format!(
|
2632 3008 | r#"Value provided for `com.amazonaws.ebs#KmsKeyArn` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2633 3009 | r#"arn:aws[a-z\-]*:kms:.*:[0-9]{12}:key/.*"#
|
2634 3010 | )
|
2635 3011 | }
|
2636 3012 | };
|
2637 3013 | write!(f, "{message}")
|
2638 3014 | }
|
2639 3015 | }
|
2640 3016 |
|
2641 3017 | impl ::std::error::Error for ConstraintViolation {}
|
3018 + | /* ConstrainedStringGenerator.kt:180 */
|
2642 3019 | impl ConstraintViolation {
|
2643 3020 | pub(crate) fn as_validation_exception_field(
|
2644 3021 | self,
|
2645 3022 | path: ::std::string::String,
|
2646 3023 | ) -> crate::model::ValidationExceptionField {
|
2647 3024 | match self {
|
2648 3025 | Self::Length(length) => crate::model::ValidationExceptionField {
|
2649 3026 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 2048, inclusive", length, &path),
|
2650 3027 | path,
|
2651 3028 | },
|
2652 3029 |
|
2653 3030 | #[allow(unused_variables)]
|
2654 3031 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
2655 3032 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"arn:aws[a-z\-]*:kms:.*:[0-9]{12}:key/.*"#),
|
2656 3033 | path
|
2657 3034 | },
|
2658 3035 | }
|
2659 3036 | }
|
2660 3037 | }
|
3038 + |
|
3039 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2661 3040 | }
|
2662 3041 | pub mod tags {
|
2663 3042 |
|
3043 + | /* CollectionConstraintViolationGenerator.kt:78 */
|
2664 3044 | #[allow(clippy::enum_variant_names)]
|
2665 3045 | #[derive(Debug, PartialEq)]
|
2666 3046 | pub enum ConstraintViolation {
|
2667 3047 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
2668 3048 | /// The first component of the tuple is the index in the collection where the
|
2669 3049 | /// first constraint violation was found.
|
2670 3050 | #[doc(hidden)]
|
2671 3051 | Member(usize, crate::model::tag::ConstraintViolation),
|
2672 3052 | }
|
2673 3053 |
|
2674 3054 | impl ::std::fmt::Display for ConstraintViolation {
|
2675 3055 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2676 3056 | let message = match self {
|
2677 3057 | Self::Member(index, failing_member) => format!(
|
2678 3058 | "Value at index {index} failed to satisfy constraint. {}",
|
2679 3059 | failing_member
|
2680 3060 | ),
|
2681 3061 | };
|
2682 3062 | write!(f, "{message}")
|
2683 3063 | }
|
2684 3064 | }
|
2685 3065 |
|
2686 3066 | impl ::std::error::Error for ConstraintViolation {}
|
3067 + | /* CollectionConstraintViolationGenerator.kt:104 */
|
2687 3068 | impl ConstraintViolation {
|
2688 3069 | pub(crate) fn as_validation_exception_field(
|
2689 3070 | self,
|
2690 3071 | path: ::std::string::String,
|
2691 3072 | ) -> crate::model::ValidationExceptionField {
|
2692 3073 | match self {
|
2693 3074 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
2694 3075 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
2695 3076 | }
|
2696 3077 | }
|
2697 3078 | }
|
3079 + |
|
3080 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2698 3081 | }
|
2699 - | /// See [`Tag`](crate::model::Tag).
|
3082 + | /// /* ServerBuilderGenerator.kt:171 */See [`Tag`](crate::model::Tag).
|
2700 3083 | pub mod tag {
|
2701 3084 |
|
3085 + | /* RustType.kt:516 */
|
2702 3086 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2703 - | /// Holds one variant for each of the ways the builder can fail.
|
3087 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
3088 + | /* RustType.kt:516 */
|
2704 3089 | #[non_exhaustive]
|
3090 + | /* ServerBuilderConstraintViolations.kt:75 */
|
2705 3091 | #[allow(clippy::enum_variant_names)]
|
2706 3092 | pub enum ConstraintViolation {
|
2707 - | /// Constraint violation occurred building member `key` when building `Tag`.
|
3093 + | /// /* ServerBuilderConstraintViolations.kt:158 */Constraint violation occurred building member `key` when building `Tag`.
|
3094 + | /* RustType.kt:516 */
|
2708 3095 | #[doc(hidden)]
|
3096 + | /* ServerBuilderConstraintViolations.kt:164 */
|
2709 3097 | Key(crate::model::tag_key::ConstraintViolation),
|
2710 - | /// Constraint violation occurred building member `value` when building `Tag`.
|
3098 + | /// /* ServerBuilderConstraintViolations.kt:158 */Constraint violation occurred building member `value` when building `Tag`.
|
3099 + | /* RustType.kt:516 */
|
2711 3100 | #[doc(hidden)]
|
3101 + | /* ServerBuilderConstraintViolations.kt:164 */
|
2712 3102 | Value(crate::model::tag_value::ConstraintViolation),
|
3103 + | /* ServerBuilderConstraintViolations.kt:75 */
|
2713 3104 | }
|
3105 + | /* ServerBuilderConstraintViolations.kt:117 */
|
2714 3106 | impl ::std::fmt::Display for ConstraintViolation {
|
3107 + | /* ServerBuilderConstraintViolations.kt:118 */
|
2715 3108 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3109 + | /* ServerBuilderConstraintViolations.kt:119 */
|
2716 3110 | match self {
|
3111 + | /* ServerBuilderConstraintViolations.kt:127 */
|
2717 3112 | ConstraintViolation::Key(_) => write!(
|
2718 3113 | f,
|
2719 3114 | "constraint violation occurred building member `key` when building `Tag`"
|
2720 3115 | ),
|
3116 + | /* ServerBuilderConstraintViolations.kt:127 */
|
2721 3117 | ConstraintViolation::Value(_) => write!(
|
2722 3118 | f,
|
2723 3119 | "constraint violation occurred building member `value` when building `Tag`"
|
2724 3120 | ),
|
3121 + | /* ServerBuilderConstraintViolations.kt:119 */
|
2725 3122 | }
|
3123 + | /* ServerBuilderConstraintViolations.kt:118 */
|
2726 3124 | }
|
3125 + | /* ServerBuilderConstraintViolations.kt:117 */
|
2727 3126 | }
|
3127 + | /* ServerBuilderConstraintViolations.kt:84 */
|
2728 3128 | impl ::std::error::Error for ConstraintViolation {}
|
3129 + | /* ServerBuilderConstraintViolations.kt:171 */
|
2729 3130 | impl ConstraintViolation {
|
2730 3131 | pub(crate) fn as_validation_exception_field(
|
2731 3132 | self,
|
2732 3133 | path: ::std::string::String,
|
2733 3134 | ) -> crate::model::ValidationExceptionField {
|
2734 3135 | match self {
|
2735 3136 | ConstraintViolation::Key(inner) => {
|
2736 3137 | inner.as_validation_exception_field(path + "/Key")
|
2737 3138 | }
|
2738 3139 | ConstraintViolation::Value(inner) => {
|
2739 3140 | inner.as_validation_exception_field(path + "/Value")
|
2740 3141 | }
|
2741 3142 | }
|
2742 3143 | }
|
2743 3144 | }
|
3145 + | /* ServerBuilderGenerator.kt:244 */
|
2744 3146 | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::Tag> {
|
2745 3147 | fn from(builder: Builder) -> Self {
|
2746 3148 | Self::Unconstrained(builder)
|
2747 3149 | }
|
2748 3150 | }
|
3151 + | /* ServerBuilderGenerator.kt:446 */
|
2749 3152 | impl ::std::convert::TryFrom<Builder> for crate::model::Tag {
|
2750 3153 | type Error = ConstraintViolation;
|
2751 3154 |
|
2752 3155 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2753 3156 | builder.build()
|
2754 3157 | }
|
2755 3158 | }
|
2756 - | /// A builder for [`Tag`](crate::model::Tag).
|
3159 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`Tag`](crate::model::Tag).
|
3160 + | /* RustType.kt:516 */
|
2757 3161 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3162 + | /* ServerBuilderGenerator.kt:211 */
|
2758 3163 | pub struct Builder {
|
3164 + | /* ServerBuilderGenerator.kt:308 */
|
2759 3165 | pub(crate) key:
|
2760 3166 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::TagKey>>,
|
3167 + | /* ServerBuilderGenerator.kt:308 */
|
2761 3168 | pub(crate) value:
|
2762 3169 | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::TagValue>>,
|
3170 + | /* ServerBuilderGenerator.kt:211 */
|
2763 3171 | }
|
3172 + | /* ServerBuilderGenerator.kt:215 */
|
2764 3173 | impl Builder {
|
2765 - | /// <p>The key of the tag.</p>
|
3174 + | /// /* ServerBuilderGenerator.kt:331 */<p>The key of the tag.</p>
|
3175 + | /* ServerBuilderGenerator.kt:343 */
|
2766 3176 | pub fn key(mut self, input: ::std::option::Option<crate::model::TagKey>) -> Self {
|
2767 - | self.key = input.map(
|
2768 - | #[allow(clippy::redundant_closure)]
|
2769 - | |v| crate::constrained::MaybeConstrained::Constrained(v),
|
2770 - | );
|
3177 + | /* ServerBuilderGenerator.kt:344 */
|
3178 + | self.key =
|
3179 + | /* ServerBuilderGenerator.kt:367 */input.map(crate::constrained::MaybeConstrained::Constrained)
|
3180 + | /* ServerBuilderGenerator.kt:344 */;
|
2771 3181 | self
|
3182 + | /* ServerBuilderGenerator.kt:343 */
|
2772 3183 | }
|
2773 - | /// <p>The key of the tag.</p>
|
3184 + | /// /* ServerBuilderGenerator.kt:426 */<p>The key of the tag.</p>
|
3185 + | /* ServerBuilderGenerator.kt:428 */
|
2774 3186 | pub(crate) fn set_key(
|
2775 3187 | mut self,
|
2776 3188 | input: Option<
|
2777 3189 | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::TagKey>>,
|
2778 3190 | >,
|
2779 3191 | ) -> Self {
|
3192 + | /* ServerBuilderGenerator.kt:429 */
|
2780 3193 | self.key = input.map(|v| v.into());
|
2781 3194 | self
|
3195 + | /* ServerBuilderGenerator.kt:428 */
|
2782 3196 | }
|
2783 - | /// <p>The value of the tag.</p>
|
3197 + | /// /* ServerBuilderGenerator.kt:331 */<p>The value of the tag.</p>
|
3198 + | /* ServerBuilderGenerator.kt:343 */
|
2784 3199 | pub fn value(mut self, input: ::std::option::Option<crate::model::TagValue>) -> Self {
|
2785 - | self.value = input.map(
|
2786 - | #[allow(clippy::redundant_closure)]
|
2787 - | |v| crate::constrained::MaybeConstrained::Constrained(v),
|
2788 - | );
|
3200 + | /* ServerBuilderGenerator.kt:344 */
|
3201 + | self.value =
|
3202 + | /* ServerBuilderGenerator.kt:367 */input.map(crate::constrained::MaybeConstrained::Constrained)
|
3203 + | /* ServerBuilderGenerator.kt:344 */;
|
2789 3204 | self
|
3205 + | /* ServerBuilderGenerator.kt:343 */
|
2790 3206 | }
|
2791 - | /// <p>The value of the tag.</p>
|
3207 + | /// /* ServerBuilderGenerator.kt:426 */<p>The value of the tag.</p>
|
3208 + | /* ServerBuilderGenerator.kt:428 */
|
2792 3209 | pub(crate) fn set_value(
|
2793 3210 | mut self,
|
2794 3211 | input: Option<
|
2795 3212 | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::TagValue>>,
|
2796 3213 | >,
|
2797 3214 | ) -> Self {
|
3215 + | /* ServerBuilderGenerator.kt:429 */
|
2798 3216 | self.value = input.map(|v| v.into());
|
2799 3217 | self
|
3218 + | /* ServerBuilderGenerator.kt:428 */
|
2800 3219 | }
|
2801 - | /// Consumes the builder and constructs a [`Tag`](crate::model::Tag).
|
2802 - | ///
|
3220 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Tag`](crate::model::Tag).
|
3221 + | /// /* ServerBuilderGenerator.kt:260 */
|
2803 3222 | /// The builder fails to construct a [`Tag`](crate::model::Tag) if a [`ConstraintViolation`] occurs.
|
2804 3223 | ///
|
2805 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
3224 + | /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
3225 + | /* ServerBuilderGenerator.kt:271 */
|
2806 3226 | pub fn build(self) -> Result<crate::model::Tag, ConstraintViolation> {
|
2807 3227 | self.build_enforcing_all_constraints()
|
2808 3228 | }
|
3229 + | /* ServerBuilderGenerator.kt:283 */
|
2809 3230 | fn build_enforcing_all_constraints(self) -> Result<crate::model::Tag, ConstraintViolation> {
|
2810 - | Ok(crate::model::Tag {
|
3231 + | /* ServerBuilderGenerator.kt:287 */
|
3232 + | Ok(
|
3233 + | /* ServerBuilderGenerator.kt:542 */
|
3234 + | crate::model::Tag {
|
3235 + | /* ServerBuilderGenerator.kt:546 */
|
2811 3236 | key: self
|
2812 3237 | .key
|
3238 + | /* ServerBuilderGenerator.kt:602 */
|
2813 3239 | .map(|v| match v {
|
2814 3240 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2815 3241 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2816 3242 | })
|
3243 + | /* ServerBuilderGenerator.kt:614 */
|
2817 3244 | .map(|res| res.map_err(ConstraintViolation::Key))
|
2818 3245 | .transpose()?,
|
3246 + | /* ServerBuilderGenerator.kt:546 */
|
2819 3247 | value: self
|
2820 3248 | .value
|
3249 + | /* ServerBuilderGenerator.kt:602 */
|
2821 3250 | .map(|v| match v {
|
2822 3251 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2823 3252 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2824 3253 | })
|
3254 + | /* ServerBuilderGenerator.kt:614 */
|
2825 3255 | .map(|res| res.map_err(ConstraintViolation::Value))
|
2826 3256 | .transpose()?,
|
2827 - | })
|
3257 + | /* ServerBuilderGenerator.kt:542 */
|
3258 + | }, /* ServerBuilderGenerator.kt:287 */
|
3259 + | )
|
3260 + | /* ServerBuilderGenerator.kt:283 */
|
2828 3261 | }
|
3262 + | /* ServerBuilderGenerator.kt:215 */
|
2829 3263 | }
|
3264 + |
|
3265 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2830 3266 | }
|
2831 - | /// See [`TagValue`](crate::model::TagValue).
|
3267 + | /// /* CodegenDelegator.kt:51 */See [`TagValue`](crate::model::TagValue).
|
2832 3268 | pub mod tag_value {
|
2833 3269 |
|
3270 + | /* ConstrainedStringGenerator.kt:155 */
|
2834 3271 | #[derive(Debug, PartialEq)]
|
2835 3272 | pub enum ConstraintViolation {
|
2836 3273 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2837 3274 | Length(usize),
|
2838 3275 | /// Error when a string doesn't satisfy its `@pattern`.
|
2839 3276 | /// Contains the String that failed the pattern.
|
2840 3277 | Pattern(String),
|
2841 3278 | }
|
2842 3279 |
|
2843 3280 | impl ::std::fmt::Display for ConstraintViolation {
|
2844 3281 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2845 3282 | let message = match self {
|
2846 3283 | Self::Length(length) => {
|
2847 3284 | format!("Value with length {} provided for 'com.amazonaws.ebs#TagValue' failed to satisfy constraint: Member must have length between 0 and 255, inclusive", length)
|
2848 3285 | }
|
2849 3286 | Self::Pattern(_) => {
|
2850 3287 | format!(
|
2851 3288 | r#"Value provided for `com.amazonaws.ebs#TagValue` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2852 3289 | r#"^[\S\s]+$"#
|
2853 3290 | )
|
2854 3291 | }
|
2855 3292 | };
|
2856 3293 | write!(f, "{message}")
|
2857 3294 | }
|
2858 3295 | }
|
2859 3296 |
|
2860 3297 | impl ::std::error::Error for ConstraintViolation {}
|
3298 + | /* ConstrainedStringGenerator.kt:180 */
|
2861 3299 | impl ConstraintViolation {
|
2862 3300 | pub(crate) fn as_validation_exception_field(
|
2863 3301 | self,
|
2864 3302 | path: ::std::string::String,
|
2865 3303 | ) -> crate::model::ValidationExceptionField {
|
2866 3304 | match self {
|
2867 3305 | Self::Length(length) => crate::model::ValidationExceptionField {
|
2868 3306 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 255, inclusive", length, &path),
|
2869 3307 | path,
|
2870 3308 | },
|
2871 3309 |
|
2872 3310 | #[allow(unused_variables)]
|
2873 3311 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
2874 3312 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[\S\s]+$"#),
|
2875 3313 | path
|
2876 3314 | },
|
2877 3315 | }
|
2878 3316 | }
|
2879 3317 | }
|
3318 + |
|
3319 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2880 3320 | }
|
2881 - | /// See [`TagKey`](crate::model::TagKey).
|
3321 + | /// /* CodegenDelegator.kt:51 */See [`TagKey`](crate::model::TagKey).
|
2882 3322 | pub mod tag_key {
|
2883 3323 |
|
3324 + | /* ConstrainedStringGenerator.kt:155 */
|
2884 3325 | #[derive(Debug, PartialEq)]
|
2885 3326 | pub enum ConstraintViolation {
|
2886 3327 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2887 3328 | Length(usize),
|
2888 3329 | /// Error when a string doesn't satisfy its `@pattern`.
|
2889 3330 | /// Contains the String that failed the pattern.
|
2890 3331 | Pattern(String),
|
2891 3332 | }
|
2892 3333 |
|
2893 3334 | impl ::std::fmt::Display for ConstraintViolation {
|
2894 3335 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2895 3336 | let message = match self {
|
2896 3337 | Self::Length(length) => {
|
2897 3338 | format!("Value with length {} provided for 'com.amazonaws.ebs#TagKey' failed to satisfy constraint: Member must have length between 0 and 127, inclusive", length)
|
2898 3339 | }
|
2899 3340 | Self::Pattern(_) => {
|
2900 3341 | format!(
|
2901 3342 | r#"Value provided for `com.amazonaws.ebs#TagKey` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2902 3343 | r#"^[\S\s]+$"#
|
2903 3344 | )
|
2904 3345 | }
|
2905 3346 | };
|
2906 3347 | write!(f, "{message}")
|
2907 3348 | }
|
2908 3349 | }
|
2909 3350 |
|
2910 3351 | impl ::std::error::Error for ConstraintViolation {}
|
3352 + | /* ConstrainedStringGenerator.kt:180 */
|
2911 3353 | impl ConstraintViolation {
|
2912 3354 | pub(crate) fn as_validation_exception_field(
|
2913 3355 | self,
|
2914 3356 | path: ::std::string::String,
|
2915 3357 | ) -> crate::model::ValidationExceptionField {
|
2916 3358 | match self {
|
2917 3359 | Self::Length(length) => crate::model::ValidationExceptionField {
|
2918 3360 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 127, inclusive", length, &path),
|
2919 3361 | path,
|
2920 3362 | },
|
2921 3363 |
|
2922 3364 | #[allow(unused_variables)]
|
2923 3365 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
2924 3366 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[\S\s]+$"#),
|
2925 3367 | path
|
2926 3368 | },
|
2927 3369 | }
|
2928 3370 | }
|
2929 3371 | }
|
3372 + |
|
3373 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2930 3374 | }
|
2931 - | /// See [`IdempotencyToken`](crate::model::IdempotencyToken).
|
3375 + | /// /* CodegenDelegator.kt:51 */See [`IdempotencyToken`](crate::model::IdempotencyToken).
|
2932 3376 | pub mod idempotency_token {
|
2933 3377 |
|
3378 + | /* ConstrainedStringGenerator.kt:155 */
|
2934 3379 | #[derive(Debug, PartialEq)]
|
2935 3380 | pub enum ConstraintViolation {
|
2936 3381 | /// Error when a string doesn't satisfy its `@length` requirements.
|
2937 3382 | Length(usize),
|
2938 3383 | /// Error when a string doesn't satisfy its `@pattern`.
|
2939 3384 | /// Contains the String that failed the pattern.
|
2940 3385 | Pattern(String),
|
2941 3386 | }
|
2942 3387 |
|
2943 3388 | impl ::std::fmt::Display for ConstraintViolation {
|
2944 3389 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2945 3390 | let message = match self {
|
2946 3391 | Self::Length(length) => {
|
2947 3392 | format!("Value with length {} provided for 'com.amazonaws.ebs#IdempotencyToken' failed to satisfy constraint: Member must have length between 0 and 255, inclusive", length)
|
2948 3393 | }
|
2949 3394 | Self::Pattern(_) => {
|
2950 3395 | format!(
|
2951 3396 | r#"Value provided for `com.amazonaws.ebs#IdempotencyToken` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
2952 3397 | r#"^[\S]+$"#
|
2953 3398 | )
|
2954 3399 | }
|
2955 3400 | };
|
2956 3401 | write!(f, "{message}")
|
2957 3402 | }
|
2958 3403 | }
|
2959 3404 |
|
2960 3405 | impl ::std::error::Error for ConstraintViolation {}
|
3406 + | /* ConstrainedStringGenerator.kt:180 */
|
2961 3407 | impl ConstraintViolation {
|
2962 3408 | pub(crate) fn as_validation_exception_field(
|
2963 3409 | self,
|
2964 3410 | path: ::std::string::String,
|
2965 3411 | ) -> crate::model::ValidationExceptionField {
|
2966 3412 | match self {
|
2967 3413 | Self::Length(length) => crate::model::ValidationExceptionField {
|
2968 3414 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 255, inclusive", length, &path),
|
2969 3415 | path,
|
2970 3416 | },
|
2971 3417 |
|
2972 3418 | #[allow(unused_variables)]
|
2973 3419 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
2974 3420 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[\S]+$"#),
|
2975 3421 | path
|
2976 3422 | },
|
2977 3423 | }
|
2978 3424 | }
|
2979 3425 | }
|
3426 + |
|
3427 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
2980 3428 | }
|
2981 - | /// See [`Timeout`](crate::model::Timeout).
|
3429 + | /// /* CodegenDelegator.kt:51 */See [`Timeout`](crate::model::Timeout).
|
2982 3430 | pub mod timeout {
|
2983 3431 |
|
3432 + | /* ConstrainedNumberGenerator.kt:139 */
|
2984 3433 | #[derive(Debug, PartialEq)]
|
2985 3434 | pub enum ConstraintViolation {
|
2986 3435 | Range(i32),
|
2987 3436 | }
|
2988 3437 |
|
2989 3438 | impl ::std::fmt::Display for ConstraintViolation {
|
2990 3439 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2991 3440 | write!(f, "Value for `com.amazonaws.ebs#Timeout`failed to satisfy constraint: Member must be between 10 and 60, inclusive")
|
2992 3441 | }
|
2993 3442 | }
|
2994 3443 |
|
2995 3444 | impl ::std::error::Error for ConstraintViolation {}
|
3445 + | /* ConstrainedNumberGenerator.kt:159 */
|
2996 3446 | impl ConstraintViolation {
|
2997 3447 | pub(crate) fn as_validation_exception_field(
|
2998 3448 | self,
|
2999 3449 | path: ::std::string::String,
|
3000 3450 | ) -> crate::model::ValidationExceptionField {
|
3001 3451 | match self {
|
3002 3452 | Self::Range(_) => crate::model::ValidationExceptionField {
|
3003 3453 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 60, inclusive", &path),
|
3004 3454 | path,
|
3005 3455 | },
|
3006 3456 | }
|
3007 3457 | }
|
3008 3458 | }
|
3459 + |
|
3460 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3009 3461 | }
|
3010 - | /// See [`Checksum`](crate::model::Checksum).
|
3462 + | /// /* CodegenDelegator.kt:51 */See [`Checksum`](crate::model::Checksum).
|
3011 3463 | pub mod checksum {
|
3012 3464 |
|
3465 + | /* ConstrainedStringGenerator.kt:155 */
|
3013 3466 | #[derive(Debug, PartialEq)]
|
3014 3467 | pub enum ConstraintViolation {
|
3015 3468 | /// Error when a string doesn't satisfy its `@length` requirements.
|
3016 3469 | Length(usize),
|
3017 3470 | /// Error when a string doesn't satisfy its `@pattern`.
|
3018 3471 | /// Contains the String that failed the pattern.
|
3019 3472 | Pattern(String),
|
3020 3473 | }
|
3021 3474 |
|
3022 3475 | impl ::std::fmt::Display for ConstraintViolation {
|
3023 3476 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3024 3477 | let message = match self {
|
3025 3478 | Self::Length(length) => {
|
3026 3479 | format!("Value with length {} provided for 'com.amazonaws.ebs#Checksum' failed to satisfy constraint: Member must have length between 0 and 64, inclusive", length)
|
3027 3480 | }
|
3028 3481 | Self::Pattern(_) => {
|
3029 3482 | format!(
|
3030 3483 | r#"Value provided for `com.amazonaws.ebs#Checksum` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
3031 3484 | r#"^[A-Za-z0-9+/=]+$"#
|
3032 3485 | )
|
3033 3486 | }
|
3034 3487 | };
|
3035 3488 | write!(f, "{message}")
|
3036 3489 | }
|
3037 3490 | }
|
3038 3491 |
|
3039 3492 | impl ::std::error::Error for ConstraintViolation {}
|
3493 + | /* ConstrainedStringGenerator.kt:180 */
|
3040 3494 | impl ConstraintViolation {
|
3041 3495 | pub(crate) fn as_validation_exception_field(
|
3042 3496 | self,
|
3043 3497 | path: ::std::string::String,
|
3044 3498 | ) -> crate::model::ValidationExceptionField {
|
3045 3499 | match self {
|
3046 3500 | Self::Length(length) => crate::model::ValidationExceptionField {
|
3047 3501 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 64, inclusive", length, &path),
|
3048 3502 | path,
|
3049 3503 | },
|
3050 3504 |
|
3051 3505 | #[allow(unused_variables)]
|
3052 3506 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
3053 3507 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[A-Za-z0-9+/=]+$"#),
|
3054 3508 | path
|
3055 3509 | },
|
3056 3510 | }
|
3057 3511 | }
|
3058 3512 | }
|
3513 + |
|
3514 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3059 3515 | }
|
3060 - | /// See [`Progress`](crate::model::Progress).
|
3516 + | /// /* CodegenDelegator.kt:51 */See [`Progress`](crate::model::Progress).
|
3061 3517 | pub mod progress {
|
3062 3518 |
|
3519 + | /* ConstrainedNumberGenerator.kt:139 */
|
3063 3520 | #[derive(Debug, PartialEq)]
|
3064 3521 | pub enum ConstraintViolation {
|
3065 3522 | Range(i32),
|
3066 3523 | }
|
3067 3524 |
|
3068 3525 | impl ::std::fmt::Display for ConstraintViolation {
|
3069 3526 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3070 3527 | write!(f, "Value for `com.amazonaws.ebs#Progress`failed to satisfy constraint: Member must be between 0 and 100, inclusive")
|
3071 3528 | }
|
3072 3529 | }
|
3073 3530 |
|
3074 3531 | impl ::std::error::Error for ConstraintViolation {}
|
3532 + | /* ConstrainedNumberGenerator.kt:159 */
|
3075 3533 | impl ConstraintViolation {
|
3076 3534 | pub(crate) fn as_validation_exception_field(
|
3077 3535 | self,
|
3078 3536 | path: ::std::string::String,
|
3079 3537 | ) -> crate::model::ValidationExceptionField {
|
3080 3538 | match self {
|
3081 3539 | Self::Range(_) => crate::model::ValidationExceptionField {
|
3082 3540 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 100, inclusive", &path),
|
3083 3541 | path,
|
3084 3542 | },
|
3085 3543 | }
|
3086 3544 | }
|
3087 3545 | }
|
3546 + |
|
3547 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3088 3548 | }
|
3089 - | /// See [`BlockIndex`](crate::model::BlockIndex).
|
3549 + | /// /* CodegenDelegator.kt:51 */See [`BlockIndex`](crate::model::BlockIndex).
|
3090 3550 | pub mod block_index {
|
3091 3551 |
|
3552 + | /* ConstrainedNumberGenerator.kt:139 */
|
3092 3553 | #[derive(Debug, PartialEq)]
|
3093 3554 | pub enum ConstraintViolation {
|
3094 3555 | Range(i32),
|
3095 3556 | }
|
3096 3557 |
|
3097 3558 | impl ::std::fmt::Display for ConstraintViolation {
|
3098 3559 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3099 3560 | write!(f, "Value for `com.amazonaws.ebs#BlockIndex`failed to satisfy constraint: Member must be greater than or equal to 0")
|
3100 3561 | }
|
3101 3562 | }
|
3102 3563 |
|
3103 3564 | impl ::std::error::Error for ConstraintViolation {}
|
3565 + | /* ConstrainedNumberGenerator.kt:159 */
|
3104 3566 | impl ConstraintViolation {
|
3105 3567 | pub(crate) fn as_validation_exception_field(
|
3106 3568 | self,
|
3107 3569 | path: ::std::string::String,
|
3108 3570 | ) -> crate::model::ValidationExceptionField {
|
3109 3571 | match self {
|
3110 3572 | Self::Range(_) => crate::model::ValidationExceptionField {
|
3111 3573 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 0", &path),
|
3112 3574 | path,
|
3113 3575 | },
|
3114 3576 | }
|
3115 3577 | }
|
3116 3578 | }
|
3579 + |
|
3580 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3117 3581 | }
|
3118 - | /// See [`Block`](crate::model::Block).
|
3582 + | /// /* ServerBuilderGenerator.kt:171 */See [`Block`](crate::model::Block).
|
3119 3583 | pub mod block {
|
3120 3584 |
|
3585 + | /* ServerBuilderGenerator.kt:461 */
|
3121 3586 | impl ::std::convert::From<Builder> for crate::model::Block {
|
3122 3587 | fn from(builder: Builder) -> Self {
|
3123 3588 | builder.build()
|
3124 3589 | }
|
3125 3590 | }
|
3126 - | /// A builder for [`Block`](crate::model::Block).
|
3591 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`Block`](crate::model::Block).
|
3592 + | /* RustType.kt:516 */
|
3127 3593 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3594 + | /* ServerBuilderGenerator.kt:211 */
|
3128 3595 | pub struct Builder {
|
3596 + | /* ServerBuilderGenerator.kt:308 */
|
3129 3597 | pub(crate) block_token: ::std::option::Option<crate::model::BlockToken>,
|
3598 + | /* ServerBuilderGenerator.kt:308 */
|
3130 3599 | pub(crate) block_index: ::std::option::Option<crate::model::BlockIndex>,
|
3600 + | /* ServerBuilderGenerator.kt:211 */
|
3131 3601 | }
|
3602 + | /* ServerBuilderGenerator.kt:215 */
|
3132 3603 | impl Builder {
|
3133 - | /// <p>The block token for the block index.</p>
|
3604 + | /// /* ServerBuilderGenerator.kt:331 */<p>The block token for the block index.</p>
|
3605 + | /* ServerBuilderGenerator.kt:343 */
|
3134 3606 | pub fn block_token(
|
3135 3607 | mut self,
|
3136 3608 | input: ::std::option::Option<crate::model::BlockToken>,
|
3137 3609 | ) -> Self {
|
3138 - | self.block_token = input;
|
3610 + | /* ServerBuilderGenerator.kt:344 */
|
3611 + | self.block_token =
|
3612 + | /* ServerBuilderGenerator.kt:376 */input
|
3613 + | /* ServerBuilderGenerator.kt:344 */;
|
3139 3614 | self
|
3615 + | /* ServerBuilderGenerator.kt:343 */
|
3140 3616 | }
|
3141 - | /// <p>The block index.</p>
|
3617 + | /// /* ServerBuilderGenerator.kt:331 */<p>The block index.</p>
|
3618 + | /* ServerBuilderGenerator.kt:343 */
|
3142 3619 | pub fn block_index(
|
3143 3620 | mut self,
|
3144 3621 | input: ::std::option::Option<crate::model::BlockIndex>,
|
3145 3622 | ) -> Self {
|
3146 - | self.block_index = input;
|
3623 + | /* ServerBuilderGenerator.kt:344 */
|
3624 + | self.block_index =
|
3625 + | /* ServerBuilderGenerator.kt:376 */input
|
3626 + | /* ServerBuilderGenerator.kt:344 */;
|
3147 3627 | self
|
3628 + | /* ServerBuilderGenerator.kt:343 */
|
3148 3629 | }
|
3149 - | /// Consumes the builder and constructs a [`Block`](crate::model::Block).
|
3630 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Block`](crate::model::Block).
|
3631 + | /* ServerBuilderGenerator.kt:271 */
|
3150 3632 | pub fn build(self) -> crate::model::Block {
|
3151 3633 | self.build_enforcing_all_constraints()
|
3152 3634 | }
|
3635 + | /* ServerBuilderGenerator.kt:283 */
|
3153 3636 | fn build_enforcing_all_constraints(self) -> crate::model::Block {
|
3637 + | /* ServerBuilderGenerator.kt:542 */
|
3154 3638 | crate::model::Block {
|
3639 + | /* ServerBuilderGenerator.kt:546 */
|
3155 3640 | block_token: self.block_token,
|
3641 + | /* ServerBuilderGenerator.kt:546 */
|
3156 3642 | block_index: self.block_index,
|
3643 + | /* ServerBuilderGenerator.kt:542 */
|
3157 3644 | }
|
3645 + | /* ServerBuilderGenerator.kt:283 */
|
3158 3646 | }
|
3647 + | /* ServerBuilderGenerator.kt:215 */
|
3159 3648 | }
|
3649 + |
|
3650 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3160 3651 | }
|
3161 - | /// See [`BlockToken`](crate::model::BlockToken).
|
3652 + | /// /* CodegenDelegator.kt:51 */See [`BlockToken`](crate::model::BlockToken).
|
3162 3653 | pub mod block_token {
|
3163 3654 |
|
3655 + | /* ConstrainedStringGenerator.kt:155 */
|
3164 3656 | #[derive(Debug, PartialEq)]
|
3165 3657 | pub enum ConstraintViolation {
|
3166 3658 | /// Error when a string doesn't satisfy its `@length` requirements.
|
3167 3659 | Length(usize),
|
3168 3660 | /// Error when a string doesn't satisfy its `@pattern`.
|
3169 3661 | /// Contains the String that failed the pattern.
|
3170 3662 | Pattern(String),
|
3171 3663 | }
|
3172 3664 |
|
3173 3665 | impl ::std::fmt::Display for ConstraintViolation {
|
3174 3666 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3175 3667 | let message = match self {
|
3176 3668 | Self::Length(length) => {
|
3177 3669 | format!("Value with length {} provided for 'com.amazonaws.ebs#BlockToken' failed to satisfy constraint: Member must have length between 0 and 256, inclusive", length)
|
3178 3670 | }
|
3179 3671 | Self::Pattern(_) => {
|
3180 3672 | format!(
|
3181 3673 | r#"Value provided for `com.amazonaws.ebs#BlockToken` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
3182 3674 | r#"^[A-Za-z0-9+/=]+$"#
|
3183 3675 | )
|
3184 3676 | }
|
3185 3677 | };
|
3186 3678 | write!(f, "{message}")
|
3187 3679 | }
|
3188 3680 | }
|
3189 3681 |
|
3190 3682 | impl ::std::error::Error for ConstraintViolation {}
|
3683 + | /* ConstrainedStringGenerator.kt:180 */
|
3191 3684 | impl ConstraintViolation {
|
3192 3685 | pub(crate) fn as_validation_exception_field(
|
3193 3686 | self,
|
3194 3687 | path: ::std::string::String,
|
3195 3688 | ) -> crate::model::ValidationExceptionField {
|
3196 3689 | match self {
|
3197 3690 | Self::Length(length) => crate::model::ValidationExceptionField {
|
3198 3691 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 256, inclusive", length, &path),
|
3199 3692 | path,
|
3200 3693 | },
|
3201 3694 |
|
3202 3695 | #[allow(unused_variables)]
|
3203 3696 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
3204 3697 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[A-Za-z0-9+/=]+$"#),
|
3205 3698 | path
|
3206 3699 | },
|
3207 3700 | }
|
3208 3701 | }
|
3209 3702 | }
|
3703 + |
|
3704 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3210 3705 | }
|
3211 - | /// See [`PageToken`](crate::model::PageToken).
|
3706 + | /// /* CodegenDelegator.kt:51 */See [`PageToken`](crate::model::PageToken).
|
3212 3707 | pub mod page_token {
|
3213 3708 |
|
3709 + | /* ConstrainedStringGenerator.kt:155 */
|
3214 3710 | #[derive(Debug, PartialEq)]
|
3215 3711 | pub enum ConstraintViolation {
|
3216 3712 | /// Error when a string doesn't satisfy its `@length` requirements.
|
3217 3713 | Length(usize),
|
3218 3714 | /// Error when a string doesn't satisfy its `@pattern`.
|
3219 3715 | /// Contains the String that failed the pattern.
|
3220 3716 | Pattern(String),
|
3221 3717 | }
|
3222 3718 |
|
3223 3719 | impl ::std::fmt::Display for ConstraintViolation {
|
3224 3720 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3225 3721 | let message = match self {
|
3226 3722 | Self::Length(length) => {
|
3227 3723 | format!("Value with length {} provided for 'com.amazonaws.ebs#PageToken' failed to satisfy constraint: Member must have length between 0 and 256, inclusive", length)
|
3228 3724 | }
|
3229 3725 | Self::Pattern(_) => {
|
3230 3726 | format!(
|
3231 3727 | r#"Value provided for `com.amazonaws.ebs#PageToken` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
3232 3728 | r#"^[A-Za-z0-9+/=]+$"#
|
3233 3729 | )
|
3234 3730 | }
|
3235 3731 | };
|
3236 3732 | write!(f, "{message}")
|
3237 3733 | }
|
3238 3734 | }
|
3239 3735 |
|
3240 3736 | impl ::std::error::Error for ConstraintViolation {}
|
3737 + | /* ConstrainedStringGenerator.kt:180 */
|
3241 3738 | impl ConstraintViolation {
|
3242 3739 | pub(crate) fn as_validation_exception_field(
|
3243 3740 | self,
|
3244 3741 | path: ::std::string::String,
|
3245 3742 | ) -> crate::model::ValidationExceptionField {
|
3246 3743 | match self {
|
3247 3744 | Self::Length(length) => crate::model::ValidationExceptionField {
|
3248 3745 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 0 and 256, inclusive", length, &path),
|
3249 3746 | path,
|
3250 3747 | },
|
3251 3748 |
|
3252 3749 | #[allow(unused_variables)]
|
3253 3750 | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
3254 3751 | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"^[A-Za-z0-9+/=]+$"#),
|
3255 3752 | path
|
3256 3753 | },
|
3257 3754 | }
|
3258 3755 | }
|
3259 3756 | }
|
3757 + |
|
3758 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3260 3759 | }
|
3261 - | /// See [`MaxResults`](crate::model::MaxResults).
|
3760 + | /// /* CodegenDelegator.kt:51 */See [`MaxResults`](crate::model::MaxResults).
|
3262 3761 | pub mod max_results {
|
3263 3762 |
|
3763 + | /* ConstrainedNumberGenerator.kt:139 */
|
3264 3764 | #[derive(Debug, PartialEq)]
|
3265 3765 | pub enum ConstraintViolation {
|
3266 3766 | Range(i32),
|
3267 3767 | }
|
3268 3768 |
|
3269 3769 | impl ::std::fmt::Display for ConstraintViolation {
|
3270 3770 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3271 3771 | write!(f, "Value for `com.amazonaws.ebs#MaxResults`failed to satisfy constraint: Member must be between 100 and 10000, inclusive")
|
3272 3772 | }
|
3273 3773 | }
|
3274 3774 |
|
3275 3775 | impl ::std::error::Error for ConstraintViolation {}
|
3776 + | /* ConstrainedNumberGenerator.kt:159 */
|
3276 3777 | impl ConstraintViolation {
|
3277 3778 | pub(crate) fn as_validation_exception_field(
|
3278 3779 | self,
|
3279 3780 | path: ::std::string::String,
|
3280 3781 | ) -> crate::model::ValidationExceptionField {
|
3281 3782 | match self {
|
3282 3783 | Self::Range(_) => crate::model::ValidationExceptionField {
|
3283 3784 | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 100 and 10000, inclusive", &path),
|
3284 3785 | path,
|
3285 3786 | },
|
3286 3787 | }
|
3287 3788 | }
|
3288 3789 | }
|
3790 + |
|
3791 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3289 3792 | }
|
3290 - | /// See [`ChangedBlock`](crate::model::ChangedBlock).
|
3793 + | /// /* ServerBuilderGenerator.kt:171 */See [`ChangedBlock`](crate::model::ChangedBlock).
|
3291 3794 | pub mod changed_block {
|
3292 3795 |
|
3796 + | /* ServerBuilderGenerator.kt:461 */
|
3293 3797 | impl ::std::convert::From<Builder> for crate::model::ChangedBlock {
|
3294 3798 | fn from(builder: Builder) -> Self {
|
3295 3799 | builder.build()
|
3296 3800 | }
|
3297 3801 | }
|
3298 - | /// A builder for [`ChangedBlock`](crate::model::ChangedBlock).
|
3802 + | /// /* ServerBuilderGenerator.kt:201 */A builder for [`ChangedBlock`](crate::model::ChangedBlock).
|
3803 + | /* RustType.kt:516 */
|
3299 3804 | #[derive(::std::clone::Clone, ::std::default::Default)]
|
3805 + | /* ServerBuilderGenerator.kt:211 */
|
3300 3806 | pub struct Builder {
|
3807 + | /* ServerBuilderGenerator.kt:308 */
|
3301 3808 | pub(crate) first_block_token: ::std::option::Option<crate::model::BlockToken>,
|
3809 + | /* ServerBuilderGenerator.kt:308 */
|
3302 3810 | pub(crate) block_index: ::std::option::Option<crate::model::BlockIndex>,
|
3811 + | /* ServerBuilderGenerator.kt:308 */
|
3303 3812 | pub(crate) second_block_token: ::std::option::Option<crate::model::BlockToken>,
|
3813 + | /* ServerBuilderGenerator.kt:211 */
|
3304 3814 | }
|
3815 + | /* ServerBuilderGenerator.kt:215 */
|
3305 3816 | impl Builder {
|
3306 - | /// <p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
|
3817 + | /// /* ServerBuilderGenerator.kt:331 */<p>The block token for the block index of the <code>FirstSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.</p>
|
3818 + | /* ServerBuilderGenerator.kt:343 */
|
3307 3819 | pub fn first_block_token(
|
3308 3820 | mut self,
|
3309 3821 | input: ::std::option::Option<crate::model::BlockToken>,
|
3310 3822 | ) -> Self {
|
3311 - | self.first_block_token = input;
|
3823 + | /* ServerBuilderGenerator.kt:344 */
|
3824 + | self.first_block_token =
|
3825 + | /* ServerBuilderGenerator.kt:376 */input
|
3826 + | /* ServerBuilderGenerator.kt:344 */;
|
3312 3827 | self
|
3828 + | /* ServerBuilderGenerator.kt:343 */
|
3313 3829 | }
|
3314 - | /// <p>The block index.</p>
|
3830 + | /// /* ServerBuilderGenerator.kt:331 */<p>The block index.</p>
|
3831 + | /* ServerBuilderGenerator.kt:343 */
|
3315 3832 | pub fn block_index(
|
3316 3833 | mut self,
|
3317 3834 | input: ::std::option::Option<crate::model::BlockIndex>,
|
3318 3835 | ) -> Self {
|
3319 - | self.block_index = input;
|
3836 + | /* ServerBuilderGenerator.kt:344 */
|
3837 + | self.block_index =
|
3838 + | /* ServerBuilderGenerator.kt:376 */input
|
3839 + | /* ServerBuilderGenerator.kt:344 */;
|
3320 3840 | self
|
3841 + | /* ServerBuilderGenerator.kt:343 */
|
3321 3842 | }
|
3322 - | /// <p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
|
3843 + | /// /* ServerBuilderGenerator.kt:331 */<p>The block token for the block index of the <code>SecondSnapshotId</code> specified in the <code>ListChangedBlocks</code> operation.</p>
|
3844 + | /* ServerBuilderGenerator.kt:343 */
|
3323 3845 | pub fn second_block_token(
|
3324 3846 | mut self,
|
3325 3847 | input: ::std::option::Option<crate::model::BlockToken>,
|
3326 3848 | ) -> Self {
|
3327 - | self.second_block_token = input;
|
3849 + | /* ServerBuilderGenerator.kt:344 */
|
3850 + | self.second_block_token =
|
3851 + | /* ServerBuilderGenerator.kt:376 */input
|
3852 + | /* ServerBuilderGenerator.kt:344 */;
|
3328 3853 | self
|
3854 + | /* ServerBuilderGenerator.kt:343 */
|
3329 3855 | }
|
3330 - | /// Consumes the builder and constructs a [`ChangedBlock`](crate::model::ChangedBlock).
|
3856 + | /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ChangedBlock`](crate::model::ChangedBlock).
|
3857 + | /* ServerBuilderGenerator.kt:271 */
|
3331 3858 | pub fn build(self) -> crate::model::ChangedBlock {
|
3332 3859 | self.build_enforcing_all_constraints()
|
3333 3860 | }
|
3861 + | /* ServerBuilderGenerator.kt:283 */
|
3334 3862 | fn build_enforcing_all_constraints(self) -> crate::model::ChangedBlock {
|
3863 + | /* ServerBuilderGenerator.kt:542 */
|
3335 3864 | crate::model::ChangedBlock {
|
3865 + | /* ServerBuilderGenerator.kt:546 */
|
3336 3866 | first_block_token: self.first_block_token,
|
3867 + | /* ServerBuilderGenerator.kt:546 */
|
3337 3868 | block_index: self.block_index,
|
3869 + | /* ServerBuilderGenerator.kt:546 */
|
3338 3870 | second_block_token: self.second_block_token,
|
3871 + | /* ServerBuilderGenerator.kt:542 */
|
3339 3872 | }
|
3873 + | /* ServerBuilderGenerator.kt:283 */
|
3340 3874 | }
|
3875 + | /* ServerBuilderGenerator.kt:215 */
|
3341 3876 | }
|
3877 + | /* ServerBuilderGenerator.kt:474 */
|
3342 3878 | impl ::std::fmt::Debug for Builder {
|
3879 + | /* ServerBuilderGenerator.kt:475 */
|
3343 3880 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
3881 + | /* ServerBuilderGenerator.kt:476 */
|
3344 3882 | let mut formatter = f.debug_struct("Builder");
|
3883 + | /* ServerBuilderGenerator.kt:481 */
|
3345 3884 | formatter.field("first_block_token", &self.first_block_token);
|
3885 + | /* ServerBuilderGenerator.kt:481 */
|
3346 3886 | formatter.field("block_index", &self.block_index);
|
3887 + | /* ServerBuilderGenerator.kt:481 */
|
3347 3888 | formatter.field("second_block_token", &self.second_block_token);
|
3889 + | /* ServerBuilderGenerator.kt:485 */
|
3348 3890 | formatter.finish()
|
3891 + | /* ServerBuilderGenerator.kt:475 */
|
3349 3892 | }
|
3893 + | /* ServerBuilderGenerator.kt:474 */
|
3350 3894 | }
|
3895 + |
|
3896 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3351 3897 | }
|
3352 - | /// See [`ChangedBlocksCount`](crate::model::ChangedBlocksCount).
|
3898 + | /// /* CodegenDelegator.kt:51 */See [`ChangedBlocksCount`](crate::model::ChangedBlocksCount).
|
3353 3899 | pub mod changed_blocks_count {
|
3354 3900 |
|
3901 + | /* ConstrainedNumberGenerator.kt:139 */
|
3355 3902 | #[derive(Debug, PartialEq)]
|
3356 3903 | pub enum ConstraintViolation {
|
3357 3904 | Range(i32),
|
3358 3905 | }
|
3359 3906 |
|
3360 3907 | impl ::std::fmt::Display for ConstraintViolation {
|
3361 3908 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3362 3909 | write!(f, "Value for `com.amazonaws.ebs#ChangedBlocksCount`failed to satisfy constraint: Member must be greater than or equal to 0")
|
3363 3910 | }
|
3364 3911 | }
|
3365 3912 |
|
3366 3913 | impl ::std::error::Error for ConstraintViolation {}
|
3914 + | /* ConstrainedNumberGenerator.kt:159 */
|
3367 3915 | impl ConstraintViolation {
|
3368 3916 | pub(crate) fn as_validation_exception_field(
|
3369 3917 | self,
|
3370 3918 | path: ::std::string::String,
|
3371 3919 | ) -> crate::model::ValidationExceptionField {
|
3372 3920 | match self {
|
3373 3921 | Self::Range(_) => crate::model::ValidationExceptionField {
|
3374 3922 | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to 0", &path),
|
3375 3923 | path,
|
3376 3924 | },
|
3377 3925 | }
|
3378 3926 | }
|
3379 3927 | }
|
3928 + |
|
3929 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
3380 3930 | }
|