1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// When writing a match expression against `ValidationExceptionReason`, it is important to ensure
|
2 + | /* ClientEnumGenerator.kt:234 */
|
3 + | /// /* ClientEnumGenerator.kt:234 */When writing a match expression against `ValidationExceptionReason`, it is important to ensure
|
4 4 | /// your code is forward-compatible. That is, if a match arm handles a case for a
|
5 5 | /// feature that is supported by the service but has not been represented as an enum
|
6 6 | /// variant in a current version of SDK, your code should continue to work when you
|
7 7 | /// upgrade SDK to a future version in which the enum does include a variant for that
|
8 8 | /// feature.
|
9 - | ///
|
10 - | /// Here is an example of how you can make a match expression forward-compatible:
|
11 - | ///
|
12 - | /// ```text
|
9 + | /// /* ClientEnumGenerator.kt:244 */
|
10 + | /// /* ClientEnumGenerator.kt:245 */Here is an example of how you can make a match expression forward-compatible:
|
11 + | /// /* ClientEnumGenerator.kt:246 */
|
12 + | /// /* ClientEnumGenerator.kt:247 */```text
|
13 + | /* ClientEnumGenerator.kt:248 */
|
13 14 | /// # let validationexceptionreason = unimplemented!();
|
15 + | /* ClientEnumGenerator.kt:249 */
|
14 16 | /// match validationexceptionreason {
|
17 + | /* ClientEnumGenerator.kt:251 */
|
15 18 | /// ValidationExceptionReason::InvalidBlock => { /* ... */ },
|
19 + | /* ClientEnumGenerator.kt:251 */
|
16 20 | /// ValidationExceptionReason::InvalidBlockToken => { /* ... */ },
|
21 + | /* ClientEnumGenerator.kt:251 */
|
17 22 | /// ValidationExceptionReason::InvalidContentEncoding => { /* ... */ },
|
23 + | /* ClientEnumGenerator.kt:251 */
|
18 24 | /// ValidationExceptionReason::InvalidCustomerKey => { /* ... */ },
|
25 + | /* ClientEnumGenerator.kt:251 */
|
19 26 | /// ValidationExceptionReason::InvalidDependencyRequest => { /* ... */ },
|
27 + | /* ClientEnumGenerator.kt:251 */
|
20 28 | /// ValidationExceptionReason::InvalidPageToken => { /* ... */ },
|
29 + | /* ClientEnumGenerator.kt:251 */
|
21 30 | /// ValidationExceptionReason::InvalidParameterValue => { /* ... */ },
|
31 + | /* ClientEnumGenerator.kt:251 */
|
22 32 | /// ValidationExceptionReason::InvalidSnapshotId => { /* ... */ },
|
33 + | /* ClientEnumGenerator.kt:251 */
|
23 34 | /// ValidationExceptionReason::InvalidTag => { /* ... */ },
|
35 + | /* ClientEnumGenerator.kt:251 */
|
24 36 | /// ValidationExceptionReason::InvalidVolumeSize => { /* ... */ },
|
37 + | /* ClientEnumGenerator.kt:251 */
|
25 38 | /// ValidationExceptionReason::UnrelatedSnapshots => { /* ... */ },
|
39 + | /* ClientEnumGenerator.kt:253 */
|
26 40 | /// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
|
41 + | /* ClientEnumGenerator.kt:254 */
|
27 42 | /// _ => { /* ... */ },
|
43 + | /* ClientEnumGenerator.kt:255 */
|
28 44 | /// }
|
29 - | /// ```
|
30 - | /// The above code demonstrates that when `validationexceptionreason` represents
|
45 + | /// /* ClientEnumGenerator.kt:256 */```
|
46 + | /// /* ClientEnumGenerator.kt:257 */The above code demonstrates that when `validationexceptionreason` represents
|
31 47 | /// `NewFeature`, the execution path will lead to the second last match arm,
|
32 48 | /// even though the enum does not contain a variant `ValidationExceptionReason::NewFeature`
|
33 49 | /// in the current version of SDK. The reason is that the variable `other`,
|
34 50 | /// created by the `@` operator, is bound to
|
35 51 | /// `ValidationExceptionReason::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
|
36 52 | /// and calling `as_str` on it yields `"NewFeature"`.
|
37 53 | /// This match expression is forward-compatible when executed with a newer
|
38 54 | /// version of SDK where the variant `ValidationExceptionReason::NewFeature` is defined.
|
39 55 | /// Specifically, when `validationexceptionreason` represents `NewFeature`,
|
40 56 | /// the execution path will hit the second last match arm as before by virtue of
|
41 57 | /// calling `as_str` on `ValidationExceptionReason::NewFeature` also yielding `"NewFeature"`.
|
42 - | ///
|
43 - | /// Explicitly matching on the `Unknown` variant should
|
58 + | /// /* ClientEnumGenerator.kt:273 */
|
59 + | /// /* ClientEnumGenerator.kt:274 */Explicitly matching on the `Unknown` variant should
|
44 60 | /// be avoided for two reasons:
|
45 61 | /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
|
46 62 | /// - It might inadvertently shadow other intended match arms.
|
47 - | ///
|
63 + | /// /* ClientEnumGenerator.kt:282 */
|
64 + | /* EnumGenerator.kt:154 */
|
48 65 | #[allow(missing_docs)] // documentation missing in model
|
66 + | /* RustType.kt:516 */
|
49 67 | #[non_exhaustive]
|
68 + | /* RustType.kt:516 */
|
50 69 | #[derive(
|
51 70 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
|
52 71 | )]
|
53 - | pub enum ValidationExceptionReason {
|
54 - | #[allow(missing_docs)] // documentation missing in model
|
72 + | pub /* EnumGenerator.kt:267 */ enum ValidationExceptionReason {
|
73 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
74 + | /* EnumGenerator.kt:143 */
|
55 75 | InvalidBlock,
|
56 - | #[allow(missing_docs)] // documentation missing in model
|
76 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
77 + | /* EnumGenerator.kt:143 */
|
57 78 | InvalidBlockToken,
|
79 + | /* EnumGenerator.kt:154 */
|
58 80 | #[allow(missing_docs)] // documentation missing in model
|
81 + | /* EnumGenerator.kt:143 */
|
59 82 | InvalidContentEncoding,
|
60 - | #[allow(missing_docs)] // documentation missing in model
|
83 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
84 + | /* EnumGenerator.kt:143 */
|
61 85 | InvalidCustomerKey,
|
86 + | /* EnumGenerator.kt:154 */
|
62 87 | #[allow(missing_docs)] // documentation missing in model
|
88 + | /* EnumGenerator.kt:143 */
|
63 89 | InvalidDependencyRequest,
|
64 - | #[allow(missing_docs)] // documentation missing in model
|
90 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
91 + | /* EnumGenerator.kt:143 */
|
65 92 | InvalidPageToken,
|
93 + | /* EnumGenerator.kt:154 */
|
66 94 | #[allow(missing_docs)] // documentation missing in model
|
95 + | /* EnumGenerator.kt:143 */
|
67 96 | InvalidParameterValue,
|
68 - | #[allow(missing_docs)] // documentation missing in model
|
97 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
98 + | /* EnumGenerator.kt:143 */
|
69 99 | InvalidSnapshotId,
|
70 - | #[allow(missing_docs)] // documentation missing in model
|
100 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
101 + | /* EnumGenerator.kt:143 */
|
71 102 | InvalidTag,
|
72 - | #[allow(missing_docs)] // documentation missing in model
|
103 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
104 + | /* EnumGenerator.kt:143 */
|
73 105 | InvalidVolumeSize,
|
74 - | #[allow(missing_docs)] // documentation missing in model
|
106 + | /* EnumGenerator.kt:154 */ #[allow(missing_docs)] // documentation missing in model
|
107 + | /* EnumGenerator.kt:143 */
|
75 108 | UnrelatedSnapshots,
|
76 - | /// `Unknown` contains new variants that have been added since this code was generated.
|
109 + | /// /* ClientEnumGenerator.kt:175 */`Unknown` contains new variants that have been added since this code was generated.
|
110 + | /* ClientEnumGenerator.kt:176 */
|
77 111 | #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
|
78 - | Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
|
112 + | /* ClientEnumGenerator.kt:179 */
|
113 + | Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), /* EnumGenerator.kt:267 */
|
79 114 | }
|
115 + | /* ClientEnumGenerator.kt:42 */
|
80 116 | impl ::std::convert::From<&str> for ValidationExceptionReason {
|
81 117 | fn from(s: &str) -> Self {
|
82 118 | match s {
|
83 119 | "INVALID_BLOCK" => ValidationExceptionReason::InvalidBlock,
|
84 120 | "INVALID_BLOCK_TOKEN" => ValidationExceptionReason::InvalidBlockToken,
|
85 121 | "INVALID_CONTENT_ENCODING" => ValidationExceptionReason::InvalidContentEncoding,
|
86 122 | "INVALID_CUSTOMER_KEY" => ValidationExceptionReason::InvalidCustomerKey,
|
87 123 | "INVALID_DEPENDENCY_REQUEST" => ValidationExceptionReason::InvalidDependencyRequest,
|
88 124 | "INVALID_PAGE_TOKEN" => ValidationExceptionReason::InvalidPageToken,
|
89 125 | "INVALID_PARAMETER_VALUE" => ValidationExceptionReason::InvalidParameterValue,
|
90 126 | "INVALID_SNAPSHOT_ID" => ValidationExceptionReason::InvalidSnapshotId,
|
91 127 | "INVALID_TAG" => ValidationExceptionReason::InvalidTag,
|
92 128 | "INVALID_VOLUME_SIZE" => ValidationExceptionReason::InvalidVolumeSize,
|
93 129 | "UNRELATED_SNAPSHOTS" => ValidationExceptionReason::UnrelatedSnapshots,
|
94 130 | other => ValidationExceptionReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
|
95 131 | }
|
96 132 | }
|
97 133 | }
|
134 + | /* ClientEnumGenerator.kt:68 */
|
98 135 | impl ::std::str::FromStr for ValidationExceptionReason {
|
99 136 | type Err = ::std::convert::Infallible;
|
100 137 |
|
101 138 | fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
|
102 139 | ::std::result::Result::Ok(ValidationExceptionReason::from(s))
|
103 140 | }
|
104 141 | }
|
142 + | /* EnumGenerator.kt:274 */
|
105 143 | impl ValidationExceptionReason {
|
106 144 | /// Returns the `&str` value of the enum member.
|
107 145 | pub fn as_str(&self) -> &str {
|
108 146 | match self {
|
109 147 | ValidationExceptionReason::InvalidBlock => "INVALID_BLOCK",
|
110 148 | ValidationExceptionReason::InvalidBlockToken => "INVALID_BLOCK_TOKEN",
|
111 149 | ValidationExceptionReason::InvalidContentEncoding => "INVALID_CONTENT_ENCODING",
|
112 150 | ValidationExceptionReason::InvalidCustomerKey => "INVALID_CUSTOMER_KEY",
|
113 151 | ValidationExceptionReason::InvalidDependencyRequest => "INVALID_DEPENDENCY_REQUEST",
|
114 152 | ValidationExceptionReason::InvalidPageToken => "INVALID_PAGE_TOKEN",
|
115 153 | ValidationExceptionReason::InvalidParameterValue => "INVALID_PARAMETER_VALUE",
|
116 154 | ValidationExceptionReason::InvalidSnapshotId => "INVALID_SNAPSHOT_ID",
|
117 155 | ValidationExceptionReason::InvalidTag => "INVALID_TAG",
|
118 156 | ValidationExceptionReason::InvalidVolumeSize => "INVALID_VOLUME_SIZE",
|
119 157 | ValidationExceptionReason::UnrelatedSnapshots => "UNRELATED_SNAPSHOTS",
|
120 158 | ValidationExceptionReason::Unknown(value) => value.as_str(),
|
121 159 | }
|
122 160 | }
|
123 161 | /// Returns all the `&str` representations of the enum members.
|
124 162 | pub const fn values() -> &'static [&'static str] {
|
125 163 | &[
|
126 164 | "INVALID_BLOCK",
|
127 165 | "INVALID_BLOCK_TOKEN",
|
128 166 | "INVALID_CONTENT_ENCODING",
|
129 167 | "INVALID_CUSTOMER_KEY",
|
130 168 | "INVALID_DEPENDENCY_REQUEST",
|
131 169 | "INVALID_PAGE_TOKEN",
|
132 170 | "INVALID_PARAMETER_VALUE",
|
133 171 | "INVALID_SNAPSHOT_ID",
|
134 172 | "INVALID_TAG",
|
135 173 | "INVALID_VOLUME_SIZE",
|
136 174 | "UNRELATED_SNAPSHOTS",
|
137 175 | ]
|
138 176 | }
|
139 177 | }
|
178 + | /* EnumGenerator.kt:223 */
|
140 179 | impl ::std::convert::AsRef<str> for ValidationExceptionReason {
|
141 180 | fn as_ref(&self) -> &str {
|
142 181 | self.as_str()
|
143 182 | }
|
144 183 | }
|
184 + | /* ClientEnumGenerator.kt:117 */
|
145 185 | impl ValidationExceptionReason {
|
146 186 | /// Parses the enum value while disallowing unknown variants.
|
147 187 | ///
|
148 188 | /// Unknown variants will result in an error.
|
149 189 | pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
|
150 190 | match Self::from(value) {
|
151 191 | #[allow(deprecated)]
|
152 192 | Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
|
153 193 | known => Ok(known),
|
154 194 | }
|
155 195 | }
|
156 196 | }
|
197 + | /* ClientEnumGenerator.kt:136 */
|
157 198 | impl ::std::fmt::Display for ValidationExceptionReason {
|
158 199 | fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
159 200 | match self {
|
160 201 | ValidationExceptionReason::InvalidBlock => write!(f, "INVALID_BLOCK"),
|
161 202 | ValidationExceptionReason::InvalidBlockToken => write!(f, "INVALID_BLOCK_TOKEN"),
|
162 203 | ValidationExceptionReason::InvalidContentEncoding => write!(f, "INVALID_CONTENT_ENCODING"),
|
163 204 | ValidationExceptionReason::InvalidCustomerKey => write!(f, "INVALID_CUSTOMER_KEY"),
|
164 205 | ValidationExceptionReason::InvalidDependencyRequest => write!(f, "INVALID_DEPENDENCY_REQUEST"),
|
165 206 | ValidationExceptionReason::InvalidPageToken => write!(f, "INVALID_PAGE_TOKEN"),
|
166 207 | ValidationExceptionReason::InvalidParameterValue => write!(f, "INVALID_PARAMETER_VALUE"),
|