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