1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | /// Orchestration and serialization glue logic for `HttpRequestWithFloatLabels`.
|
3 3 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4 4 | #[non_exhaustive]
|
5 5 | pub struct HttpRequestWithFloatLabels;
|
6 6 | impl HttpRequestWithFloatLabels {
|
7 7 | /// Creates a new `HttpRequestWithFloatLabels`
|
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::http_request_with_float_labels::HttpRequestWithFloatLabelsInput::SCHEMA;
|
14 + | /// The schema for this operation's output shape.
|
15 + | pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema =
|
16 + | crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput::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::http_request_with_float_labels::HttpRequestWithFloatLabelsInput,
|
14 20 | ) -> ::std::result::Result<
|
15 21 | crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput,
|
16 22 | ::aws_smithy_runtime_api::client::result::SdkError<
|
17 23 | crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError,
|
18 24 | ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
19 25 | >,
|
20 26 | > {
|
130 136 | crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsError,
|
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 HttpRequestWithFloatLabelsResponseDeserializer;
|
139 145 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpRequestWithFloatLabelsResponseDeserializer {
|
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());
|
152 + | #[allow(unused_mut)]
|
153 + | let mut force_error = false;
|
154 + |
|
155 + | if !success && status != 200 || force_error {
|
145 156 | let headers = response.headers();
|
146 157 | let body = response.body().bytes().expect("body loaded");
|
147 158 | #[allow(unused_mut)]
|
148 - | let mut force_error = false;
|
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 + | })?;
|
149 162 |
|
150 - | let parse_result = if !success && status != 200 || force_error {
|
151 - | crate::protocol_serde::shape_http_request_with_float_labels::de_http_request_with_float_labels_http_error(status, headers, body)
|
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::http_request_with_float_labels::HttpRequestWithFloatLabelsError::generic(generic),
|
167 + | ),
|
168 + | ))
|
152 169 | } else {
|
153 - | crate::protocol_serde::shape_http_request_with_float_labels::de_http_request_with_float_labels_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, HttpRequestWithFloatLabels::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::http_request_with_float_labels::HttpRequestWithFloatLabelsOutput::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 HttpRequestWithFloatLabelsRequestSerializer;
|
160 194 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpRequestWithFloatLabelsRequestSerializer {
|
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::http_request_with_float_labels::HttpRequestWithFloatLabelsInput>()
|
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::http_request_with_float_labels::HttpRequestWithFloatLabelsInput,
|
178 - | output: &mut ::std::string::String,
|
179 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
180 - | use ::std::fmt::Write as _;
|
181 - | let input_1 = &_input.float;
|
182 - | let input_1 = input_1
|
183 - | .as_ref()
|
184 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("float", "cannot be empty or unset"))?;
|
185 - | let mut float_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_1);
|
186 - | let float = float_encoder.encode();
|
187 - | if float.is_empty() {
|
188 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
189 - | "float",
|
190 - | "cannot be empty or unset",
|
191 - | ));
|
192 - | }
|
193 - | let input_2 = &_input.double;
|
194 - | let input_2 = input_2
|
195 - | .as_ref()
|
196 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("double", "cannot be empty or unset"))?;
|
197 - | let mut double_encoder = ::aws_smithy_types::primitive::Encoder::from(*input_2);
|
198 - | let double = double_encoder.encode();
|
199 - | if double.is_empty() {
|
200 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
201 - | "double",
|
202 - | "cannot be empty or unset",
|
203 - | ));
|
204 - | }
|
205 - | ::std::write!(output, "/FloatHttpLabels/{float}/{double}", float = float, double = double).expect("formatting should succeed");
|
206 - | ::std::result::Result::Ok(())
|
207 - | }
|
208 - | #[allow(clippy::unnecessary_wraps)]
|
209 - | fn update_http_builder(
|
210 - | input: &crate::operation::http_request_with_float_labels::HttpRequestWithFloatLabelsInput,
|
211 - | builder: ::http_1x::request::Builder,
|
212 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
213 - | let mut uri = ::std::string::String::new();
|
214 - | uri_base(input, &mut uri)?;
|
215 - | ::std::result::Result::Ok(builder.method("GET").uri(uri))
|
216 - | }
|
217 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
218 - | builder
|
219 - | };
|
220 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
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, HttpRequestWithFloatLabels::INPUT_SCHEMA, "", _cfg)
|
209 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
221 210 |
|
222 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
211 + | return ::std::result::Result::Ok(request);
|
223 212 | }
|
224 213 | }
|
225 214 | #[derive(Debug)]
|
226 215 | struct HttpRequestWithFloatLabelsEndpointParamsInterceptor;
|
227 216 |
|
228 217 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpRequestWithFloatLabelsEndpointParamsInterceptor {
|
229 218 | fn name(&self) -> &'static str {
|
230 219 | "HttpRequestWithFloatLabelsEndpointParamsInterceptor"
|
231 220 | }
|
232 221 |
|