79 88 | runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
|
80 89 | }
|
81 90 | runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
|
82 91 | config_override,
|
83 92 | client_config.config.clone(),
|
84 93 | &client_config.runtime_components,
|
85 94 | ));
|
86 95 | }
|
87 96 | runtime_plugins
|
88 97 | }
|
98 + | /* OperationGenerator.kt:85 */
|
89 99 | }
|
100 + | /* OperationRuntimePluginGenerator.kt:55 */
|
90 101 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Structs {
|
91 102 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
92 103 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Structs");
|
93 104 |
|
94 105 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
95 106 | StructsRequestSerializer,
|
96 107 | ));
|
97 108 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
98 109 | StructsResponseDeserializer,
|
99 110 | ));
|
100 111 |
|
101 112 | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
102 113 | ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
|
103 114 | ));
|
104 115 |
|
105 116 | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
|
106 117 | "Structs",
|
107 118 | "NamingObstacleCourseStructs",
|
108 119 | ));
|
109 120 |
|
110 121 | ::std::option::Option::Some(cfg.freeze())
|
111 122 | }
|
112 123 |
|
113 124 | fn runtime_components(
|
114 125 | &self,
|
115 126 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
116 127 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
117 128 | #[allow(unused_mut)]
|
118 129 | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("Structs")
|
119 130 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
120 131 | .with_interceptor(StructsEndpointParamsInterceptor)
|
121 132 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
122 133 | crate::operation::structs::StructsError,
|
123 134 | >::new())
|
124 135 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
125 136 | crate::operation::structs::StructsError,
|
126 137 | >::new());
|
127 138 |
|
128 139 | ::std::borrow::Cow::Owned(rcb)
|
129 140 | }
|
130 141 | }
|
131 142 |
|
143 + | /* ResponseDeserializerGenerator.kt:64 */
|
132 144 | #[derive(Debug)]
|
133 145 | struct StructsResponseDeserializer;
|
134 146 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StructsResponseDeserializer {
|
135 147 | fn deserialize_nonstreaming(
|
136 148 | &self,
|
137 149 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
138 150 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
139 151 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
140 152 | let headers = response.headers();
|
141 153 | let body = response.body().bytes().expect("body loaded");
|
142 154 | #[allow(unused_mut)]
|
143 155 | let mut force_error = false;
|
144 156 |
|
145 157 | let parse_result = if !success && status != 200 || force_error {
|
146 158 | crate::protocol_serde::shape_structs::de_structs_http_error(status, headers, body)
|
147 159 | } else {
|
148 160 | crate::protocol_serde::shape_structs::de_structs_http_response(status, headers, body)
|
149 161 | };
|
150 162 | crate::protocol_serde::type_erase_result(parse_result)
|
151 163 | }
|
152 164 | }
|
165 + | /* RequestSerializerGenerator.kt:67 */
|
153 166 | #[derive(Debug)]
|
154 167 | struct StructsRequestSerializer;
|
155 168 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StructsRequestSerializer {
|
156 169 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
157 170 | fn serialize_input(
|
158 171 | &self,
|
159 172 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
160 173 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
161 174 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
162 175 | let input = input.downcast::<crate::operation::structs::StructsInput>().expect("correct type");
|
163 176 | let _header_serialization_settings = _cfg
|
164 177 | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
165 178 | .cloned()
|
166 179 | .unwrap_or_default();
|
167 180 | let mut request_builder = {
|
168 181 | fn uri_base(
|
169 182 | _input: &crate::operation::structs::StructsInput,
|
170 183 | output: &mut ::std::string::String,
|
171 184 | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
172 185 | use ::std::fmt::Write as _;
|
173 186 | ::std::write!(output, "/").expect("formatting should succeed");
|
174 187 | ::std::result::Result::Ok(())
|
175 188 | }
|
176 189 | #[allow(clippy::unnecessary_wraps)]
|
177 190 | fn update_http_builder(
|
178 191 | input: &crate::operation::structs::StructsInput,
|
179 192 | builder: ::http::request::Builder,
|
180 193 | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
181 194 | let mut uri = ::std::string::String::new();
|
182 195 | uri_base(input, &mut uri)?;
|
183 196 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
184 197 | }
|
185 198 | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
186 199 | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
187 200 | builder = _header_serialization_settings.set_default_header(
|
188 201 | builder,
|
189 202 | ::http::header::HeaderName::from_static("x-amz-target"),
|
190 203 | "NamingObstacleCourseStructs.Structs",
|
191 204 | );
|
192 205 | builder
|
193 206 | };
|
194 207 | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_structs::ser_structs_input(&input)?);
|
195 208 | if let Some(content_length) = body.content_length() {
|
196 209 | let content_length = content_length.to_string();
|
197 210 | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
198 211 | }
|
199 212 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
200 213 | }
|
201 214 | }
|
215 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
202 216 | #[derive(Debug)]
|
203 217 | struct StructsEndpointParamsInterceptor;
|
204 218 |
|
205 219 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StructsEndpointParamsInterceptor {
|
206 220 | fn name(&self) -> &'static str {
|
207 221 | "StructsEndpointParamsInterceptor"
|
208 222 | }
|
209 223 |
|
210 224 | fn read_before_execution(
|
211 225 | &self,
|
212 226 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
213 227 | '_,
|
214 228 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
215 229 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
216 230 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
217 231 | >,
|
218 232 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
219 233 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
220 234 | let _input = context
|
221 235 | .input()
|
222 236 | .downcast_ref::<StructsInput>()
|
223 237 | .ok_or("failed to downcast to StructsInput")?;
|
224 238 |
|
225 239 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
226 240 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
227 241 | })?;
|
228 242 | cfg.interceptor_state()
|
229 243 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
230 244 | ::std::result::Result::Ok(())
|
231 245 | }
|
232 246 | }
|
233 247 |
|
234 248 | // The get_* functions below are generated from JMESPath expressions in the
|
235 249 | // operationContextParams trait. They target the operation's input shape.
|
236 250 |
|
251 + | /* OperationErrorGenerator.kt:79 */
|
237 252 | /// Error type for the `StructsError` operation.
|
253 + | /* RustType.kt:516 */
|
238 254 | #[non_exhaustive]
|
255 + | /* RustType.kt:516 */
|
239 256 | #[derive(::std::fmt::Debug)]
|
240 - | pub enum StructsError {
|
257 + | pub /* OperationErrorGenerator.kt:81 */ enum StructsError {
|
258 + | /* OperationErrorGenerator.kt:88 */
|
241 259 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
242 260 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
243 261 | variable wildcard pattern and check `.code()`:
|
244 262 | \
|
245 263 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
246 264 | \
|
247 265 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StructsError) for what information is available for the error.")]
|
248 266 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
267 + | /* OperationErrorGenerator.kt:81 */
|
249 268 | }
|
269 + | /* OperationErrorGenerator.kt:218 */
|
250 270 | impl StructsError {
|
271 + | /* OperationErrorGenerator.kt:219 */
|
251 272 | /// Creates the `StructsError::Unhandled` variant from any error type.
|
252 273 | pub fn unhandled(
|
253 274 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
254 275 | ) -> Self {
|
255 276 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
256 277 | source: err.into(),
|
257 278 | meta: ::std::default::Default::default(),
|
258 279 | })
|
259 280 | }
|
260 281 |
|
261 282 | /// Creates the `StructsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
262 283 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
263 284 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
264 285 | source: err.clone().into(),
|
265 286 | meta: err,
|
266 287 | })
|
267 288 | }
|
268 - | ///
|
289 + | /// /* OperationErrorGenerator.kt:236 */
|
269 290 | /// Returns error metadata, which includes the error code, message,
|
270 291 | /// request ID, and potentially additional information.
|
271 292 | ///
|
293 + | /* OperationErrorGenerator.kt:242 */
|
272 294 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
295 + | /* OperationErrorGenerator.kt:243 */
|
273 296 | match self {
|
274 - | Self::Unhandled(e) => &e.meta,
|
297 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
298 + | /* OperationErrorGenerator.kt:243 */
|
275 299 | }
|
300 + | /* OperationErrorGenerator.kt:242 */
|
276 301 | }
|
302 + | /* OperationErrorGenerator.kt:218 */
|
277 303 | }
|
304 + | /* OperationErrorGenerator.kt:269 */
|
278 305 | impl ::std::error::Error for StructsError {
|
306 + | /* OperationErrorGenerator.kt:270 */
|
279 307 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
308 + | /* OperationErrorGenerator.kt:318 */
|
280 309 | match self {
|
281 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
310 + | /* OperationErrorGenerator.kt:326 */
|
311 + | Self::Unhandled(_inner) => {
|
312 + | /* OperationErrorGenerator.kt:279 */
|
313 + | ::std::option::Option::Some(&*_inner.source)
|
314 + | /* OperationErrorGenerator.kt:326 */
|
315 + | } /* OperationErrorGenerator.kt:318 */
|
282 316 | }
|
317 + | /* OperationErrorGenerator.kt:270 */
|
283 318 | }
|
319 + | /* OperationErrorGenerator.kt:269 */
|
284 320 | }
|
321 + | /* OperationErrorGenerator.kt:133 */
|
285 322 | impl ::std::fmt::Display for StructsError {
|
323 + | /* OperationErrorGenerator.kt:134 */
|
286 324 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
325 + | /* OperationErrorGenerator.kt:318 */
|
287 326 | match self {
|
327 + | /* OperationErrorGenerator.kt:326 */
|
288 328 | Self::Unhandled(_inner) => {
|
329 + | /* OperationErrorGenerator.kt:139 */
|
289 330 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
290 331 | write!(f, "unhandled error ({code})")
|
291 332 | } else {
|
292 333 | f.write_str("unhandled error")
|
293 334 | }
|
335 + | /* OperationErrorGenerator.kt:326 */
|
336 + | } /* OperationErrorGenerator.kt:318 */
|
294 337 | }
|
338 + | /* OperationErrorGenerator.kt:134 */
|
295 339 | }
|
296 - | }
|
340 + | /* OperationErrorGenerator.kt:133 */
|
297 341 | }
|
342 + | /* OperationErrorGenerator.kt:182 */
|
298 343 | impl ::aws_smithy_types::retry::ProvideErrorKind for StructsError {
|
344 + | /* OperationErrorGenerator.kt:186 */
|
299 345 | fn code(&self) -> ::std::option::Option<&str> {
|
346 + | /* OperationErrorGenerator.kt:187 */
|
300 347 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
348 + | /* OperationErrorGenerator.kt:186 */
|
301 349 | }
|
350 + | /* OperationErrorGenerator.kt:190 */
|
302 351 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
352 + | /* OperationErrorGenerator.kt:197 */
|
303 353 | ::std::option::Option::None
|
354 + | /* OperationErrorGenerator.kt:190 */
|
304 355 | }
|
356 + | /* OperationErrorGenerator.kt:182 */
|
305 357 | }
|
358 + | /* OperationErrorGenerator.kt:163 */
|
306 359 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StructsError {
|
360 + | /* OperationErrorGenerator.kt:164 */
|
307 361 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
362 + | /* OperationErrorGenerator.kt:318 */
|
308 363 | match self {
|
309 - | Self::Unhandled(_inner) => &_inner.meta,
|
364 + | /* OperationErrorGenerator.kt:326 */
|
365 + | Self::Unhandled(_inner) => {
|
366 + | /* OperationErrorGenerator.kt:168 */
|
367 + | &_inner.meta
|
368 + | /* OperationErrorGenerator.kt:326 */
|
369 + | } /* OperationErrorGenerator.kt:318 */
|
310 370 | }
|
371 + | /* OperationErrorGenerator.kt:164 */
|
311 372 | }
|
373 + | /* OperationErrorGenerator.kt:163 */
|
312 374 | }
|
375 + | /* OperationErrorGenerator.kt:109 */
|
313 376 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StructsError {
|
377 + | /* OperationErrorGenerator.kt:110 */
|
314 378 | fn create_unhandled_error(
|
315 379 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
316 380 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
317 381 | ) -> Self {
|
382 + | /* OperationErrorGenerator.kt:121 */
|
318 383 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
319 384 | source,
|
320 385 | meta: meta.unwrap_or_default(),
|
321 386 | })
|
387 + | /* OperationErrorGenerator.kt:110 */
|
322 388 | }
|
389 + | /* OperationErrorGenerator.kt:109 */
|
323 390 | }
|
324 391 |
|
392 + | /* CodegenDelegator.kt:255 */
|
325 393 | pub use crate::operation::structs::_structs_output::StructsOutput;
|
326 394 |
|
395 + | /* CodegenDelegator.kt:255 */
|
327 396 | pub use crate::operation::structs::_structs_input::StructsInput;
|
328 397 |
|
398 + | /* RustModule.kt:172 */
|
329 399 | mod _structs_input;
|
330 400 |
|
401 + | /* RustModule.kt:172 */
|
331 402 | mod _structs_output;
|
332 403 |
|
333 - | /// Builders
|
404 + | /// /* CodegenDelegator.kt:51 */Builders
|
334 405 | pub mod builders;
|