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