77 86 | runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
|
78 87 | }
|
79 88 | runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
|
80 89 | config_override,
|
81 90 | client_config.config.clone(),
|
82 91 | &client_config.runtime_components,
|
83 92 | ));
|
84 93 | }
|
85 94 | runtime_plugins
|
86 95 | }
|
96 + | /* OperationGenerator.kt:85 */
|
87 97 | }
|
98 + | /* OperationRuntimePluginGenerator.kt:55 */
|
88 99 | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for FractionalSeconds {
|
89 100 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
90 101 | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("FractionalSeconds");
|
91 102 |
|
92 103 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
93 104 | FractionalSecondsRequestSerializer,
|
94 105 | ));
|
95 106 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
96 107 | FractionalSecondsResponseDeserializer,
|
97 108 | ));
|
98 109 |
|
99 110 | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
100 111 | ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
|
101 112 | ));
|
102 113 |
|
103 114 | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
|
104 115 | "FractionalSeconds",
|
105 116 | "RpcV2Protocol",
|
106 117 | ));
|
107 118 |
|
108 119 | ::std::option::Option::Some(cfg.freeze())
|
109 120 | }
|
110 121 |
|
111 122 | fn runtime_components(
|
112 123 | &self,
|
113 124 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
114 125 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
115 126 | #[allow(unused_mut)]
|
116 127 | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("FractionalSeconds")
|
117 128 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
118 129 | .with_interceptor(FractionalSecondsEndpointParamsInterceptor)
|
119 130 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
120 131 | crate::operation::fractional_seconds::FractionalSecondsError,
|
121 132 | >::new())
|
122 133 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
123 134 | crate::operation::fractional_seconds::FractionalSecondsError,
|
124 135 | >::new());
|
125 136 |
|
126 137 | ::std::borrow::Cow::Owned(rcb)
|
127 138 | }
|
128 139 | }
|
129 140 |
|
141 + | /* ResponseDeserializerGenerator.kt:64 */
|
130 142 | #[derive(Debug)]
|
131 143 | struct FractionalSecondsResponseDeserializer;
|
132 144 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for FractionalSecondsResponseDeserializer {
|
133 145 | fn deserialize_nonstreaming(
|
134 146 | &self,
|
135 147 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
136 148 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
137 149 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
138 150 | let headers = response.headers();
|
139 151 | let body = response.body().bytes().expect("body loaded");
|
140 152 | #[allow(unused_mut)]
|
141 153 | let mut force_error = false;
|
142 154 |
|
143 155 | let parse_result = if !success && status != 200 || force_error {
|
144 156 | crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_http_error(status, headers, body)
|
145 157 | } else {
|
146 158 | crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds_http_response(status, headers, body)
|
147 159 | };
|
148 160 | crate::protocol_serde::type_erase_result(parse_result)
|
149 161 | }
|
150 162 | }
|
163 + | /* RequestSerializerGenerator.kt:67 */
|
151 164 | #[derive(Debug)]
|
152 165 | struct FractionalSecondsRequestSerializer;
|
153 166 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for FractionalSecondsRequestSerializer {
|
154 167 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
155 168 | fn serialize_input(
|
156 169 | &self,
|
157 170 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
158 171 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
159 172 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
160 173 | let input = input
|
161 174 | .downcast::<crate::operation::fractional_seconds::FractionalSecondsInput>()
|
162 175 | .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::fractional_seconds::FractionalSecondsInput,
|
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, "/service/RpcV2Protocol/operation/FractionalSeconds").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::fractional_seconds::FractionalSecondsInput,
|
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 =
|
187 200 | _header_serialization_settings.set_default_header(builder, ::http::header::HeaderName::from_static("smithy-protocol"), "rpc-v2-cbor");
|
188 201 | builder =
|
189 202 | _header_serialization_settings.set_default_header(builder, ::http::header::HeaderName::from_static("accept"), "application/cbor");
|
190 203 | builder
|
191 204 | };
|
192 205 | let body = ::aws_smithy_types::body::SdkBody::from("");
|
193 206 | if let Some(content_length) = body.content_length() {
|
194 207 | let content_length = content_length.to_string();
|
195 208 | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
196 209 | }
|
197 210 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
198 211 | }
|
199 212 | }
|
213 + | /* EndpointParamsInterceptorGenerator.kt:86 */
|
200 214 | #[derive(Debug)]
|
201 215 | struct FractionalSecondsEndpointParamsInterceptor;
|
202 216 |
|
203 217 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for FractionalSecondsEndpointParamsInterceptor {
|
204 218 | fn name(&self) -> &'static str {
|
205 219 | "FractionalSecondsEndpointParamsInterceptor"
|
206 220 | }
|
207 221 |
|
208 222 | fn read_before_execution(
|
209 223 | &self,
|
210 224 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
211 225 | '_,
|
212 226 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
213 227 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
214 228 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
215 229 | >,
|
216 230 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
217 231 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
218 232 | let _input = context
|
219 233 | .input()
|
220 234 | .downcast_ref::<FractionalSecondsInput>()
|
221 235 | .ok_or("failed to downcast to FractionalSecondsInput")?;
|
222 236 |
|
223 237 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
224 238 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
225 239 | })?;
|
226 240 | cfg.interceptor_state()
|
227 241 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
228 242 | ::std::result::Result::Ok(())
|
229 243 | }
|
230 244 | }
|
231 245 |
|
232 246 | // The get_* functions below are generated from JMESPath expressions in the
|
233 247 | // operationContextParams trait. They target the operation's input shape.
|
234 248 |
|
249 + | /* RustType.kt:516 */
|
235 250 | #[allow(unreachable_code, unused_variables)]
|
251 + | /* RustType.kt:516 */
|
236 252 | #[cfg(test)]
|
253 + | /* ProtocolTestGenerator.kt:98 */
|
237 254 | mod fractional_seconds_test {
|
238 255 |
|
239 256 | /// Ensures that clients can correctly parse timestamps with fractional seconds
|
240 257 | /// Test ID: RpcV2CborDateTimeWithFractionalSeconds
|
241 258 | #[::tokio::test]
|
242 259 | #[::tracing_test::traced_test]
|
243 260 | async fn rpc_v2_cbor_date_time_with_fractional_seconds_response() {
|
244 261 | let expected_output = crate::operation::fractional_seconds::FractionalSecondsOutput::builder()
|
245 262 | .set_datetime(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(
|
246 263 | 946845296, 0.123_f64,
|
247 264 | )))
|
248 265 | .build();
|
249 266 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
250 267 | ::http::response::Builder::new()
|
251 268 | .header("Content-Type", "application/cbor")
|
252 269 | .header("smithy-protocol", "rpc-v2-cbor")
|
253 270 | .status(200)
|
254 271 | .body(::aws_smithy_types::body::SdkBody::from("v2hkYXRldGltZcH7Qcw32zgPvnf/"))
|
255 272 | .unwrap(),
|
256 273 | )
|
257 274 | .unwrap();
|
258 275 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
259 276 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
260 277 |
|
261 278 | let op = crate::operation::fractional_seconds::FractionalSeconds::new();
|
262 279 | let config = op.config().expect("the operation has config");
|
263 280 | let de = config
|
264 281 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
265 282 | .expect("the config must have a deserializer");
|
266 283 |
|
267 284 | let parsed = de.deserialize_streaming(&mut http_response);
|
268 285 | let parsed = parsed.unwrap_or_else(|| {
|
269 286 | let http_response = http_response.map(|body| {
|
270 287 | ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
|
271 288 | body.bytes().unwrap(),
|
272 289 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
273 290 | )))
|
274 291 | });
|
275 292 | de.deserialize_nonstreaming(&http_response)
|
276 293 | });
|
277 294 | let parsed = parsed
|
278 295 | .expect("should be successful response")
|
279 296 | .downcast::<crate::operation::fractional_seconds::FractionalSecondsOutput>()
|
280 297 | .unwrap();
|
281 298 | ::pretty_assertions::assert_eq!(parsed.datetime, expected_output.datetime, "Unexpected value for `datetime`");
|
282 299 | }
|
300 + |
|
301 + | /* ProtocolTestGenerator.kt:98 */
|
283 302 | }
|
284 303 |
|
304 + | /* OperationErrorGenerator.kt:79 */
|
285 305 | /// Error type for the `FractionalSecondsError` operation.
|
306 + | /* RustType.kt:516 */
|
286 307 | #[non_exhaustive]
|
308 + | /* RustType.kt:516 */
|
287 309 | #[derive(::std::fmt::Debug)]
|
288 - | pub enum FractionalSecondsError {
|
310 + | pub /* OperationErrorGenerator.kt:81 */ enum FractionalSecondsError {
|
311 + | /* OperationErrorGenerator.kt:88 */
|
289 312 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
290 313 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
291 314 | variable wildcard pattern and check `.code()`:
|
292 315 | \
|
293 316 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
294 317 | \
|
295 318 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-FractionalSecondsError) for what information is available for the error.")]
|
296 319 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
320 + | /* OperationErrorGenerator.kt:81 */
|
297 321 | }
|
322 + | /* OperationErrorGenerator.kt:218 */
|
298 323 | impl FractionalSecondsError {
|
324 + | /* OperationErrorGenerator.kt:219 */
|
299 325 | /// Creates the `FractionalSecondsError::Unhandled` variant from any error type.
|
300 326 | pub fn unhandled(
|
301 327 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
302 328 | ) -> Self {
|
303 329 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
304 330 | source: err.into(),
|
305 331 | meta: ::std::default::Default::default(),
|
306 332 | })
|
307 333 | }
|
308 334 |
|
309 335 | /// Creates the `FractionalSecondsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
310 336 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
311 337 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
312 338 | source: err.clone().into(),
|
313 339 | meta: err,
|
314 340 | })
|
315 341 | }
|
316 - | ///
|
342 + | /// /* OperationErrorGenerator.kt:236 */
|
317 343 | /// Returns error metadata, which includes the error code, message,
|
318 344 | /// request ID, and potentially additional information.
|
319 345 | ///
|
346 + | /* OperationErrorGenerator.kt:242 */
|
320 347 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
348 + | /* OperationErrorGenerator.kt:243 */
|
321 349 | match self {
|
322 - | Self::Unhandled(e) => &e.meta,
|
350 + | /* OperationErrorGenerator.kt:251 */ Self::Unhandled(e) => &e.meta,
|
351 + | /* OperationErrorGenerator.kt:243 */
|
323 352 | }
|
353 + | /* OperationErrorGenerator.kt:242 */
|
324 354 | }
|
355 + | /* OperationErrorGenerator.kt:218 */
|
325 356 | }
|
357 + | /* OperationErrorGenerator.kt:269 */
|
326 358 | impl ::std::error::Error for FractionalSecondsError {
|
359 + | /* OperationErrorGenerator.kt:270 */
|
327 360 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
361 + | /* OperationErrorGenerator.kt:318 */
|
328 362 | match self {
|
329 - | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
363 + | /* OperationErrorGenerator.kt:326 */
|
364 + | Self::Unhandled(_inner) => {
|
365 + | /* OperationErrorGenerator.kt:279 */
|
366 + | ::std::option::Option::Some(&*_inner.source)
|
367 + | /* OperationErrorGenerator.kt:326 */
|
368 + | } /* OperationErrorGenerator.kt:318 */
|
330 369 | }
|
370 + | /* OperationErrorGenerator.kt:270 */
|
331 371 | }
|
372 + | /* OperationErrorGenerator.kt:269 */
|
332 373 | }
|
374 + | /* OperationErrorGenerator.kt:133 */
|
333 375 | impl ::std::fmt::Display for FractionalSecondsError {
|
376 + | /* OperationErrorGenerator.kt:134 */
|
334 377 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
378 + | /* OperationErrorGenerator.kt:318 */
|
335 379 | match self {
|
380 + | /* OperationErrorGenerator.kt:326 */
|
336 381 | Self::Unhandled(_inner) => {
|
382 + | /* OperationErrorGenerator.kt:139 */
|
337 383 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
338 384 | write!(f, "unhandled error ({code})")
|
339 385 | } else {
|
340 386 | f.write_str("unhandled error")
|
341 387 | }
|
342 - | }
|
388 + | /* OperationErrorGenerator.kt:326 */
|
389 + | } /* OperationErrorGenerator.kt:318 */
|
343 390 | }
|
391 + | /* OperationErrorGenerator.kt:134 */
|
344 392 | }
|
393 + | /* OperationErrorGenerator.kt:133 */
|
345 394 | }
|
395 + | /* OperationErrorGenerator.kt:182 */
|
346 396 | impl ::aws_smithy_types::retry::ProvideErrorKind for FractionalSecondsError {
|
397 + | /* OperationErrorGenerator.kt:186 */
|
347 398 | fn code(&self) -> ::std::option::Option<&str> {
|
399 + | /* OperationErrorGenerator.kt:187 */
|
348 400 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
401 + | /* OperationErrorGenerator.kt:186 */
|
349 402 | }
|
403 + | /* OperationErrorGenerator.kt:190 */
|
350 404 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
405 + | /* OperationErrorGenerator.kt:197 */
|
351 406 | ::std::option::Option::None
|
407 + | /* OperationErrorGenerator.kt:190 */
|
352 408 | }
|
409 + | /* OperationErrorGenerator.kt:182 */
|
353 410 | }
|
411 + | /* OperationErrorGenerator.kt:163 */
|
354 412 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for FractionalSecondsError {
|
413 + | /* OperationErrorGenerator.kt:164 */
|
355 414 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
415 + | /* OperationErrorGenerator.kt:318 */
|
356 416 | match self {
|
357 - | Self::Unhandled(_inner) => &_inner.meta,
|
417 + | /* OperationErrorGenerator.kt:326 */
|
418 + | Self::Unhandled(_inner) => {
|
419 + | /* OperationErrorGenerator.kt:168 */
|
420 + | &_inner.meta
|
421 + | /* OperationErrorGenerator.kt:326 */
|
422 + | } /* OperationErrorGenerator.kt:318 */
|
358 423 | }
|
424 + | /* OperationErrorGenerator.kt:164 */
|
359 425 | }
|
426 + | /* OperationErrorGenerator.kt:163 */
|
360 427 | }
|
428 + | /* OperationErrorGenerator.kt:109 */
|
361 429 | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for FractionalSecondsError {
|
430 + | /* OperationErrorGenerator.kt:110 */
|
362 431 | fn create_unhandled_error(
|
363 432 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
364 433 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
365 434 | ) -> Self {
|
435 + | /* OperationErrorGenerator.kt:121 */
|
366 436 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
367 437 | source,
|
368 438 | meta: meta.unwrap_or_default(),
|
369 439 | })
|
440 + | /* OperationErrorGenerator.kt:110 */
|
370 441 | }
|
442 + | /* OperationErrorGenerator.kt:109 */
|
371 443 | }
|
372 444 |
|
445 + | /* CodegenDelegator.kt:255 */
|
373 446 | pub use crate::operation::fractional_seconds::_fractional_seconds_output::FractionalSecondsOutput;
|
374 447 |
|
448 + | /* CodegenDelegator.kt:255 */
|
375 449 | pub use crate::operation::fractional_seconds::_fractional_seconds_input::FractionalSecondsInput;
|
376 450 |
|
451 + | /* RustModule.kt:172 */
|
377 452 | mod _fractional_seconds_input;
|
378 453 |
|
454 + | /* RustModule.kt:172 */
|
379 455 | mod _fractional_seconds_output;
|
380 456 |
|
381 - | /// Builders
|
457 + | /// /* CodegenDelegator.kt:51 */Builders
|
382 458 | pub mod builders;
|