1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* ServerOperationErrorGenerator.kt:63 */
|
2 3 | /// Error type for the `Operation` operation.
|
4 + | /* ServerOperationErrorGenerator.kt:64 */
|
3 5 | /// Each variant represents an error that can occur for the `Operation` operation.
|
6 + | /* RustType.kt:516 */
|
4 7 | #[derive(::std::fmt::Debug)]
|
5 - | pub enum OperationError {
|
8 + | pub /* ServerOperationErrorGenerator.kt:66 */ enum OperationError {
|
9 + | /* ServerOperationErrorGenerator.kt:68 */
|
6 10 | #[allow(missing_docs)] // documentation missing in model
|
11 + | /* ServerOperationErrorGenerator.kt:71 */
|
7 12 | InternalServerError(crate::error::InternalServerError),
|
13 + | /* ServerOperationErrorGenerator.kt:66 */
|
8 14 | }
|
15 + | /* ServerOperationErrorGenerator.kt:75 */
|
9 16 | impl ::std::fmt::Display for OperationError {
|
17 + | /* ServerOperationErrorGenerator.kt:76 */
|
10 18 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
19 + | /* ServerOperationErrorGenerator.kt:139 */
|
11 20 | match &self {
|
12 - | OperationError::InternalServerError(_inner) => _inner.fmt(f),
|
21 + | /* ServerOperationErrorGenerator.kt:142 */
|
22 + | OperationError::InternalServerError(_inner) =>
|
23 + | /* ServerOperationErrorGenerator.kt:78 */
|
24 + | {
|
25 + | _inner.fmt(f)
|
26 + | }
|
27 + | /* ServerOperationErrorGenerator.kt:139 */
|
13 28 | }
|
29 + | /* ServerOperationErrorGenerator.kt:76 */
|
14 30 | }
|
31 + | /* ServerOperationErrorGenerator.kt:75 */
|
15 32 | }
|
33 + | /* ServerOperationErrorGenerator.kt:83 */
|
16 34 | impl OperationError {
|
35 + | /* ServerOperationErrorGenerator.kt:87 */
|
17 36 | /// Returns `true` if the error kind is `OperationError::InternalServerError`.
|
37 + | /* ServerOperationErrorGenerator.kt:88 */
|
18 38 | pub fn is_internal_server_error(&self) -> bool {
|
39 + | /* ServerOperationErrorGenerator.kt:89 */
|
19 40 | matches!(&self, OperationError::InternalServerError(_))
|
41 + | /* ServerOperationErrorGenerator.kt:88 */
|
20 42 | }
|
43 + | /* ServerOperationErrorGenerator.kt:92 */
|
21 44 | /// Returns the error name string by matching the correct variant.
|
45 + | /* ServerOperationErrorGenerator.kt:93 */
|
22 46 | pub fn name(&self) -> &'static str {
|
47 + | /* ServerOperationErrorGenerator.kt:139 */
|
23 48 | match &self {
|
24 - | OperationError::InternalServerError(_inner) => _inner.name(),
|
49 + | /* ServerOperationErrorGenerator.kt:142 */
|
50 + | OperationError::InternalServerError(_inner) =>
|
51 + | /* ServerOperationErrorGenerator.kt:95 */
|
52 + | {
|
53 + | _inner.name()
|
25 54 | }
|
55 + | /* ServerOperationErrorGenerator.kt:139 */
|
26 56 | }
|
57 + | /* ServerOperationErrorGenerator.kt:93 */
|
58 + | }
|
59 + | /* ServerOperationErrorGenerator.kt:83 */
|
27 60 | }
|
61 + | /* ServerOperationErrorGenerator.kt:100 */
|
28 62 | impl ::std::error::Error for OperationError {
|
63 + | /* ServerOperationErrorGenerator.kt:101 */
|
29 64 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
65 + | /* ServerOperationErrorGenerator.kt:139 */
|
30 66 | match &self {
|
31 - | OperationError::InternalServerError(_inner) => Some(_inner),
|
67 + | /* ServerOperationErrorGenerator.kt:142 */
|
68 + | OperationError::InternalServerError(_inner) =>
|
69 + | /* ServerOperationErrorGenerator.kt:103 */
|
70 + | {
|
71 + | Some(_inner)
|
72 + | }
|
73 + | /* ServerOperationErrorGenerator.kt:139 */
|
32 74 | }
|
75 + | /* ServerOperationErrorGenerator.kt:101 */
|
33 76 | }
|
77 + | /* ServerOperationErrorGenerator.kt:100 */
|
34 78 | }
|
79 + | /* ServerOperationErrorGenerator.kt:110 */
|
35 80 | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::OperationError {
|
81 + | /* ServerOperationErrorGenerator.kt:111 */
|
36 82 | fn from(variant: crate::error::InternalServerError) -> crate::error::OperationError {
|
83 + | /* ServerOperationErrorGenerator.kt:112 */
|
37 84 | Self::InternalServerError(variant)
|
85 + | /* ServerOperationErrorGenerator.kt:111 */
|
38 86 | }
|
87 + | /* ServerOperationErrorGenerator.kt:110 */
|
39 88 | }
|
40 89 |
|
90 + | /* TsServerOperationErrorGenerator.kt:34 */
|
41 91 | impl ::std::convert::From<::napi::Error> for crate::error::OperationError {
|
42 92 | fn from(variant: ::napi::Error) -> crate::error::OperationError {
|
43 93 | crate::error::InternalServerError {
|
44 94 | message: variant.to_string(),
|
45 95 | }
|
46 96 | .into()
|
47 97 | }
|
48 98 | }
|
49 99 |
|
100 + | /* RustType.kt:516 */
|
50 101 | #[::napi_derive::napi(constructor)]
|
102 + | /* StructureGenerator.kt:197 */
|
51 103 | #[allow(missing_docs)] // documentation missing in model
|
104 + | /* RustType.kt:516 */
|
52 105 | #[derive(
|
53 106 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
54 107 | )]
|
55 - | pub struct InternalServerError {
|
108 + | pub /* StructureGenerator.kt:201 */ struct InternalServerError {
|
109 + | /* StructureGenerator.kt:231 */
|
56 110 | #[allow(missing_docs)] // documentation missing in model
|
57 111 | pub message: ::std::string::String,
|
112 + | /* StructureGenerator.kt:201 */
|
58 113 | }
|
114 + | /* ErrorImplGenerator.kt:99 */
|
59 115 | impl InternalServerError {
|
116 + | /* ErrorImplGenerator.kt:128 */
|
60 117 | /// Returns the error message.
|
61 118 | pub fn message(&self) -> &str {
|
62 119 | &self.message
|
63 120 | }
|
121 + | /* ErrorImplGenerator.kt:141 */
|
64 122 | #[doc(hidden)]
|
65 123 | /// Returns the error name.
|
66 124 | pub fn name(&self) -> &'static str {
|
67 125 | "InternalServerError"
|
68 126 | }
|
127 + | /* ErrorImplGenerator.kt:99 */
|
69 128 | }
|
129 + | /* ErrorImplGenerator.kt:153 */
|
70 130 | impl ::std::fmt::Display for InternalServerError {
|
131 + | /* ErrorImplGenerator.kt:154 */
|
71 132 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
133 + | /* ErrorImplGenerator.kt:161 */
|
72 134 | ::std::write!(f, "InternalServerError")?;
|
135 + | /* ErrorImplGenerator.kt:166 */
|
73 136 | {
|
137 + | /* ErrorImplGenerator.kt:167 */
|
74 138 | ::std::write!(f, ": {}", &self.message)?;
|
139 + | /* ErrorImplGenerator.kt:166 */
|
75 140 | }
|
141 + | /* ErrorImplGenerator.kt:171 */
|
76 142 | Ok(())
|
143 + | /* ErrorImplGenerator.kt:154 */
|
77 144 | }
|
145 + | /* ErrorImplGenerator.kt:153 */
|
78 146 | }
|
147 + | /* ErrorImplGenerator.kt:175 */
|
79 148 | impl ::std::error::Error for InternalServerError {}
|
149 + | /* ServerCodegenVisitor.kt:370 */
|
80 150 | impl InternalServerError {
|
81 - | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
151 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
152 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
82 153 | pub fn builder() -> crate::error::internal_server_error::Builder {
|
154 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
|
83 155 | crate::error::internal_server_error::Builder::default()
|
156 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
84 157 | }
|
158 + | /* ServerCodegenVisitor.kt:370 */
|
85 159 | }
|
86 - | /// See [`InternalServerError`](crate::error::InternalServerError).
|
160 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`InternalServerError`](crate::error::InternalServerError).
|
87 161 | pub mod internal_server_error {
|
88 162 |
|
163 + | /* RustType.kt:516 */
|
89 164 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
90 - | /// Holds one variant for each of the ways the builder can fail.
|
91 - |
|
165 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
166 + | /* ServerBuilderConstraintViolations.kt:75 */
|
92 167 | #[allow(clippy::enum_variant_names)]
|
93 168 | pub enum ConstraintViolation {
|
94 - | /// `message` was not provided but it is required when building `InternalServerError`.
|
169 + | /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `InternalServerError`.
|
170 + | /* ServerBuilderConstraintViolations.kt:143 */
|
95 171 | MissingMessage,
|
172 + | /* ServerBuilderConstraintViolations.kt:75 */
|
96 173 | }
|
174 + | /* ServerBuilderConstraintViolations.kt:117 */
|
97 175 | impl ::std::fmt::Display for ConstraintViolation {
|
176 + | /* ServerBuilderConstraintViolations.kt:118 */
|
98 177 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
178 + | /* ServerBuilderConstraintViolations.kt:119 */
|
99 179 | match self {
|
100 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
101 - | }
|
180 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
181 + | /* ServerBuilderConstraintViolations.kt:119 */}
|
182 + | /* ServerBuilderConstraintViolations.kt:118 */
|
102 183 | }
|
184 + | /* ServerBuilderConstraintViolations.kt:117 */
|
103 185 | }
|
186 + | /* ServerBuilderConstraintViolations.kt:84 */
|
104 187 | impl ::std::error::Error for ConstraintViolation {}
|
188 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:254 */
|
105 189 | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
106 190 | type Error = ConstraintViolation;
|
107 191 |
|
108 192 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
109 193 | builder.build()
|
110 194 | }
|
111 195 | }
|
112 - | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
196 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`InternalServerError`](crate::error::InternalServerError).
|
197 + | /* RustType.kt:516 */
|
113 198 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
199 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
114 200 | pub struct Builder {
|
201 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
|
115 202 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
203 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
116 204 | }
|
205 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
117 206 | impl Builder {
|
207 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
|
118 208 | #[allow(missing_docs)] // documentation missing in model
|
209 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
119 210 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
120 - | self.message = Some(input);
|
211 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
|
212 + | self.message =
|
213 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */Some(
|
214 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
|
215 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */)
|
216 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
|
121 217 | self
|
218 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
122 219 | }
|
123 - | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
124 - | ///
|
220 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
221 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:152 */
|
125 222 | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
126 223 | ///
|
224 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
|
127 225 | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
128 226 | self.build_enforcing_required_and_enum_traits()
|
129 227 | }
|
228 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
130 229 | fn build_enforcing_required_and_enum_traits(
|
131 230 | self,
|
132 231 | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
133 - | Ok(crate::error::InternalServerError {
|
134 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
135 - | })
|
136 - | }
|
232 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
|
233 + | Ok(
|
234 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
235 + | crate::error::InternalServerError {
|
236 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
|
237 + | message: self
|
238 + | .message
|
239 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:202 */
|
240 + | .ok_or(ConstraintViolation::MissingMessage)?,
|
241 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
242 + | }, /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
|
243 + | )
|
244 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
245 + | }
|
246 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
137 247 | }
|
248 + |
|
249 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
138 250 | }
|