1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | /// Orchestration and serialization glue logic for `MalformedTimestampBodyDefault`.
|
3 3 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4 4 | #[non_exhaustive]
|
5 5 | pub struct MalformedTimestampBodyDefault;
|
6 6 | impl MalformedTimestampBodyDefault {
|
7 7 | /// Creates a new `MalformedTimestampBodyDefault`
|
8 8 | pub fn new() -> Self {
|
9 9 | Self
|
10 10 | }
|
11 + | /// The schema for this operation's input shape.
|
12 + | pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
|
13 + | crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultInput::SCHEMA;
|
14 + | /// The schema for this operation's output shape.
|
15 + | pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
|
16 + | crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultOutput::SCHEMA;
|
11 17 | pub(crate) async fn orchestrate(
|
12 18 | runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
13 19 | input: crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultInput,
|
14 20 | ) -> ::std::result::Result<
|
15 21 | crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultOutput,
|
16 22 | ::aws_smithy_runtime_api::client::result::SdkError<
|
17 23 | crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultError,
|
18 24 | ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
19 25 | >,
|
20 26 | > {
|
130 136 | crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultError,
|
131 137 | >::new());
|
132 138 |
|
133 139 | ::std::borrow::Cow::Owned(rcb)
|
134 140 | }
|
135 141 | }
|
136 142 |
|
137 143 | #[derive(Debug)]
|
138 144 | struct MalformedTimestampBodyDefaultResponseDeserializer;
|
139 145 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MalformedTimestampBodyDefaultResponseDeserializer {
|
140 - | fn deserialize_nonstreaming(
|
146 + | fn deserialize_nonstreaming_with_config(
|
141 147 | &self,
|
142 148 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
149 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
143 150 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
144 151 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
145 - | let headers = response.headers();
|
146 - | let body = response.body().bytes().expect("body loaded");
|
147 152 | #[allow(unused_mut)]
|
148 153 | let mut force_error = false;
|
149 154 |
|
150 - | let parse_result = if !success && status != 200 || force_error {
|
151 - | crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_default_http_error(status, headers, body)
|
155 + | if !success && status != 200 || force_error {
|
156 + | let headers = response.headers();
|
157 + | let body = response.body().bytes().expect("body loaded");
|
158 + | #[allow(unused_mut)]
|
159 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
160 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
161 + | })?;
|
162 + |
|
163 + | let generic = generic_builder.build();
|
164 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
165 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
|
166 + | crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultError::generic(generic),
|
167 + | ),
|
168 + | ))
|
152 169 | } else {
|
153 - | crate::protocol_serde::shape_malformed_timestamp_body_default::de_malformed_timestamp_body_default_http_response(status, headers, body)
|
154 - | };
|
155 - | crate::protocol_serde::type_erase_result(parse_result)
|
170 + | let protocol = _cfg
|
171 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
172 + | .expect("a SharedClientProtocol is required");
|
173 + | let mut deser = protocol
|
174 + | .deserialize_response(response, MalformedTimestampBodyDefault::OUTPUT_SCHEMA, _cfg)
|
175 + | .map_err(|e| {
|
176 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
177 + | })?;
|
178 + | let body = response.body().bytes().expect("body loaded");
|
179 + | let output = crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultOutput::deserialize_with_response(
|
180 + | &mut *deser,
|
181 + | response.headers(),
|
182 + | response.status().into(),
|
183 + | body,
|
184 + | )
|
185 + | .map_err(|e| {
|
186 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
187 + | })?;
|
188 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
189 + | }
|
156 190 | }
|
157 191 | }
|
158 192 | #[derive(Debug)]
|
159 193 | struct MalformedTimestampBodyDefaultRequestSerializer;
|
160 194 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for MalformedTimestampBodyDefaultRequestSerializer {
|
161 195 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
162 196 | fn serialize_input(
|
163 197 | &self,
|
164 198 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
165 199 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
166 200 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
167 201 | let input = input
|
168 202 | .downcast::<crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultInput>()
|
169 203 | .expect("correct type");
|
170 - | let _header_serialization_settings = _cfg
|
171 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
172 - | .cloned()
|
173 - | .unwrap_or_default();
|
174 - | let mut request_builder = {
|
175 - | #[allow(clippy::uninlined_format_args)]
|
176 - | fn uri_base(
|
177 - | _input: &crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultInput,
|
178 - | output: &mut ::std::string::String,
|
179 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
180 - | use ::std::fmt::Write as _;
|
181 - | ::std::write!(output, "/MalformedTimestampBodyDefault").expect("formatting should succeed");
|
182 - | ::std::result::Result::Ok(())
|
183 - | }
|
184 - | #[allow(clippy::unnecessary_wraps)]
|
185 - | fn update_http_builder(
|
186 - | input: &crate::operation::malformed_timestamp_body_default::MalformedTimestampBodyDefaultInput,
|
187 - | builder: ::http_1x::request::Builder,
|
188 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
189 - | let mut uri = ::std::string::String::new();
|
190 - | uri_base(input, &mut uri)?;
|
191 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
192 - | }
|
193 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
194 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
|
195 - | builder
|
196 - | };
|
197 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
198 - | crate::protocol_serde::shape_malformed_timestamp_body_default::ser_malformed_timestamp_body_default_input(&input)?,
|
199 - | );
|
200 - | if let Some(content_length) = body.content_length() {
|
201 - | let content_length = content_length.to_string();
|
202 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
203 - | }
|
204 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
204 + | let protocol = _cfg
|
205 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
206 + | .expect("a SharedClientProtocol is required");
|
207 + | let mut request = protocol
|
208 + | .serialize_request(&input, MalformedTimestampBodyDefault::INPUT_SCHEMA, "", _cfg)
|
209 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
210 + |
|
211 + | return ::std::result::Result::Ok(request);
|
205 212 | }
|
206 213 | }
|
207 214 | #[derive(Debug)]
|
208 215 | struct MalformedTimestampBodyDefaultEndpointParamsInterceptor;
|
209 216 |
|
210 217 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MalformedTimestampBodyDefaultEndpointParamsInterceptor {
|
211 218 | fn name(&self) -> &'static str {
|
212 219 | "MalformedTimestampBodyDefaultEndpointParamsInterceptor"
|
213 220 | }
|
214 221 |
|