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 `DoNothing` operation.
|
4 + | /* ServerOperationErrorGenerator.kt:64 */
|
3 5 | /// Each variant represents an error that can occur for the `DoNothing` operation.
|
6 + | /* RustType.kt:516 */
|
4 7 | #[derive(::std::fmt::Debug)]
|
5 - | pub enum DoNothingError {
|
8 + | pub /* ServerOperationErrorGenerator.kt:66 */ enum DoNothingError {
|
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 DoNothingError {
|
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 - | DoNothingError::InternalServerError(_inner) => _inner.fmt(f),
|
21 + | /* ServerOperationErrorGenerator.kt:142 */
|
22 + | DoNothingError::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 DoNothingError {
|
35 + | /* ServerOperationErrorGenerator.kt:87 */
|
17 36 | /// Returns `true` if the error kind is `DoNothingError::InternalServerError`.
|
37 + | /* ServerOperationErrorGenerator.kt:88 */
|
18 38 | pub fn is_internal_server_error(&self) -> bool {
|
39 + | /* ServerOperationErrorGenerator.kt:89 */
|
19 40 | matches!(&self, DoNothingError::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 - | DoNothingError::InternalServerError(_inner) => _inner.name(),
|
49 + | /* ServerOperationErrorGenerator.kt:142 */
|
50 + | DoNothingError::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 DoNothingError {
|
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 - | DoNothingError::InternalServerError(_inner) => Some(_inner),
|
67 + | /* ServerOperationErrorGenerator.kt:142 */
|
68 + | DoNothingError::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::DoNothingError {
|
81 + | /* ServerOperationErrorGenerator.kt:111 */
|
36 82 | fn from(variant: crate::error::InternalServerError) -> crate::error::DoNothingError {
|
83 + | /* ServerOperationErrorGenerator.kt:112 */
|
37 84 | Self::InternalServerError(variant)
|
85 + | /* ServerOperationErrorGenerator.kt:111 */
|
38 86 | }
|
87 + | /* ServerOperationErrorGenerator.kt:110 */
|
39 88 | }
|
40 89 |
|
90 + | /* PythonServerOperationErrorGenerator.kt:38 */
|
41 91 | impl ::std::convert::From<::pyo3::PyErr> for crate::error::DoNothingError {
|
42 92 | fn from(variant: ::pyo3::PyErr) -> crate::error::DoNothingError {
|
43 93 | ::pyo3::Python::with_gil(|py| {
|
44 94 | let error = variant.value(py);
|
45 95 |
|
46 96 | crate::error::InternalServerError {
|
47 97 | message: error.to_string(),
|
48 98 | }
|
49 99 | .into()
|
50 100 | })
|
51 101 | }
|
52 102 | }
|
53 103 |
|
104 + | /* RustType.kt:516 */
|
54 105 | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
106 + | /* PythonServerStructureGenerator.kt:63 */
|
55 107 | /// :param message str:
|
56 108 | /// :rtype None:
|
109 + | /* StructureGenerator.kt:197 */
|
57 110 | #[allow(missing_docs)] // documentation missing in model
|
111 + | /* RustType.kt:516 */
|
58 112 | #[derive(
|
59 113 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
60 114 | )]
|
61 - | pub struct InternalServerError {
|
115 + | pub /* StructureGenerator.kt:201 */ struct InternalServerError {
|
116 + | /* RustType.kt:516 */
|
62 117 | #[pyo3(get, set)]
|
118 + | /* PythonServerStructureGenerator.kt:80 */
|
63 119 | /// :type str:
|
120 + | /* StructureGenerator.kt:231 */
|
64 121 | #[allow(missing_docs)] // documentation missing in model
|
65 122 | pub message: ::std::string::String,
|
123 + | /* StructureGenerator.kt:201 */
|
66 124 | }
|
125 + | /* RustType.kt:516 */
|
67 126 | #[allow(clippy::new_without_default)]
|
127 + | /* RustType.kt:516 */
|
68 128 | #[allow(clippy::too_many_arguments)]
|
129 + | /* RustType.kt:516 */
|
69 130 | #[::pyo3::pymethods]
|
131 + | /* PythonServerStructureGenerator.kt:88 */
|
70 132 | impl InternalServerError {
|
71 133 | #[new]
|
72 134 | pub fn new(message: ::std::string::String) -> Self {
|
73 135 | Self { message }
|
74 136 | }
|
75 137 | fn __repr__(&self) -> String {
|
76 138 | format!("{self:?}")
|
77 139 | }
|
78 140 | fn __str__(&self) -> String {
|
79 141 | format!("{self:?}")
|
80 142 | }
|
81 143 | }
|
144 + | /* ErrorImplGenerator.kt:99 */
|
82 145 | impl InternalServerError {
|
146 + | /* ErrorImplGenerator.kt:128 */
|
83 147 | /// Returns the error message.
|
84 148 | pub fn message(&self) -> &str {
|
85 149 | &self.message
|
86 150 | }
|
151 + | /* ErrorImplGenerator.kt:141 */
|
87 152 | #[doc(hidden)]
|
88 153 | /// Returns the error name.
|
89 154 | pub fn name(&self) -> &'static str {
|
90 155 | "InternalServerError"
|
91 156 | }
|
157 + | /* ErrorImplGenerator.kt:99 */
|
92 158 | }
|
159 + | /* ErrorImplGenerator.kt:153 */
|
93 160 | impl ::std::fmt::Display for InternalServerError {
|
161 + | /* ErrorImplGenerator.kt:154 */
|
94 162 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
163 + | /* ErrorImplGenerator.kt:161 */
|
95 164 | ::std::write!(f, "InternalServerError")?;
|
165 + | /* ErrorImplGenerator.kt:166 */
|
96 166 | {
|
167 + | /* ErrorImplGenerator.kt:167 */
|
97 168 | ::std::write!(f, ": {}", &self.message)?;
|
169 + | /* ErrorImplGenerator.kt:166 */
|
98 170 | }
|
171 + | /* ErrorImplGenerator.kt:171 */
|
99 172 | Ok(())
|
173 + | /* ErrorImplGenerator.kt:154 */
|
100 174 | }
|
175 + | /* ErrorImplGenerator.kt:153 */
|
101 176 | }
|
177 + | /* ErrorImplGenerator.kt:175 */
|
102 178 | impl ::std::error::Error for InternalServerError {}
|
179 + | /* ServerCodegenVisitor.kt:370 */
|
103 180 | impl InternalServerError {
|
104 - | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
181 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:211 */Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
182 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
105 183 | pub fn builder() -> crate::error::internal_server_error::Builder {
|
184 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:213 */
|
106 185 | crate::error::internal_server_error::Builder::default()
|
186 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:212 */
|
107 187 | }
|
188 + | /* ServerCodegenVisitor.kt:370 */
|
108 189 | }
|
109 - | /// See [`InternalServerError`](crate::error::InternalServerError).
|
190 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:110 */See [`InternalServerError`](crate::error::InternalServerError).
|
110 191 | pub mod internal_server_error {
|
111 192 |
|
193 + | /* RustType.kt:516 */
|
112 194 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
113 - | /// Holds one variant for each of the ways the builder can fail.
|
114 - |
|
195 + | /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
|
196 + | /* ServerBuilderConstraintViolations.kt:75 */
|
115 197 | #[allow(clippy::enum_variant_names)]
|
116 198 | pub enum ConstraintViolation {
|
117 - | /// `message` was not provided but it is required when building `InternalServerError`.
|
199 + | /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `InternalServerError`.
|
200 + | /* ServerBuilderConstraintViolations.kt:143 */
|
118 201 | MissingMessage,
|
202 + | /* ServerBuilderConstraintViolations.kt:75 */
|
119 203 | }
|
204 + | /* ServerBuilderConstraintViolations.kt:117 */
|
120 205 | impl ::std::fmt::Display for ConstraintViolation {
|
206 + | /* ServerBuilderConstraintViolations.kt:118 */
|
121 207 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
208 + | /* ServerBuilderConstraintViolations.kt:119 */
|
122 209 | match self {
|
123 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
124 - | }
|
210 + | /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
211 + | /* ServerBuilderConstraintViolations.kt:119 */}
|
212 + | /* ServerBuilderConstraintViolations.kt:118 */
|
125 213 | }
|
214 + | /* ServerBuilderConstraintViolations.kt:117 */
|
126 215 | }
|
216 + | /* ServerBuilderConstraintViolations.kt:84 */
|
127 217 | impl ::std::error::Error for ConstraintViolation {}
|
218 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:254 */
|
128 219 | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
129 220 | type Error = ConstraintViolation;
|
130 221 |
|
131 222 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
132 223 | builder.build()
|
133 224 | }
|
134 225 | }
|
135 - | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
226 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:130 */A builder for [`InternalServerError`](crate::error::InternalServerError).
|
227 + | /* RustType.kt:516 */
|
136 228 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
229 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
137 230 | pub struct Builder {
|
231 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:225 */
|
138 232 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
233 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:137 */
|
139 234 | }
|
235 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
140 236 | impl Builder {
|
237 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:241 */
|
141 238 | #[allow(missing_docs)] // documentation missing in model
|
239 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
142 240 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
143 - | self.message = Some(input);
|
241 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */
|
242 + | self.message =
|
243 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */Some(
|
244 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:247 */input
|
245 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:246 */)
|
246 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:245 */;
|
144 247 | self
|
248 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:244 */
|
145 249 | }
|
146 - | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
147 - | ///
|
250 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:150 */Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
251 + | /// /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:152 */
|
148 252 | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
149 253 | ///
|
254 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:159 */
|
150 255 | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
151 256 | self.build_enforcing_required_and_enum_traits()
|
152 257 | }
|
258 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
153 259 | fn build_enforcing_required_and_enum_traits(
|
154 260 | self,
|
155 261 | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
156 - | Ok(crate::error::InternalServerError {
|
157 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
158 - | })
|
262 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
|
263 + | Ok(
|
264 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
265 + | crate::error::InternalServerError {
|
266 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:186 */
|
267 + | message: self
|
268 + | .message
|
269 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:202 */
|
270 + | .ok_or(ConstraintViolation::MissingMessage)?,
|
271 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:182 */
|
272 + | }, /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:175 */
|
273 + | )
|
274 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:171 */
|
159 275 | }
|
276 + | /* ServerBuilderGeneratorWithoutPublicConstrainedTypes.kt:141 */
|
160 277 | }
|
278 + |
|
279 + | /* RustCrateInlineModuleComposingWriter.kt:299 */
|
161 280 | }
|