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