127 132 | ::std::borrow::Cow::Owned(rcb)
|
128 133 | }
|
129 134 | }
|
130 135 |
|
131 136 | #[derive(Debug)]
|
132 137 | struct ListContributorInsightsResponseDeserializer;
|
133 138 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListContributorInsightsResponseDeserializer {
|
134 139 | fn deserialize_nonstreaming(
|
135 140 | &self,
|
136 141 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
142 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
137 143 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
138 144 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
139 - | let headers = response.headers();
|
140 - | let body = response.body().bytes().expect("body loaded");
|
141 145 | #[allow(unused_mut)]
|
142 146 | let mut force_error = false;
|
143 147 |
|
144 - | let parse_result = if !success && status != 200 || force_error {
|
145 - | crate::protocol_serde::shape_list_contributor_insights::de_list_contributor_insights_http_error(status, headers, body)
|
148 + | if !success && status != 200 || force_error {
|
149 + | let headers = response.headers();
|
150 + | let body = response.body().bytes().expect("body loaded");
|
151 + | #[allow(unused_mut)]
|
152 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
153 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
154 + | })?;
|
155 + |
|
156 + | let generic = generic_builder.build();
|
157 + | let error_code = match generic.code() {
|
158 + | ::std::option::Option::Some(code) => code,
|
159 + | ::std::option::Option::None => {
|
160 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
161 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
162 + | crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled(generic),
|
163 + | ),
|
164 + | ))
|
165 + | }
|
166 + | };
|
167 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
168 + | let protocol = _cfg
|
169 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
170 + | .expect("a SharedClientProtocol is required");
|
171 + | let err = match error_code {
|
172 + | "InternalServerError" => crate::operation::list_contributor_insights::ListContributorInsightsError::InternalServerError({
|
173 + | let mut tmp = match protocol
|
174 + | .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
|
175 + | .and_then(|mut deser| {
|
176 + | crate::types::error::InternalServerError::deserialize_with_response(
|
177 + | &mut *deser,
|
178 + | response.headers(),
|
179 + | response.status().into(),
|
180 + | body,
|
181 + | )
|
182 + | }) {
|
183 + | ::std::result::Result::Ok(val) => val,
|
184 + | ::std::result::Result::Err(e) => {
|
185 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
186 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
187 + | ))
|
188 + | }
|
189 + | };
|
190 + | tmp.meta = generic;
|
191 + | if tmp.message.is_none() {
|
192 + | tmp.message = _error_message;
|
193 + | }
|
194 + | tmp
|
195 + | }),
|
196 + | "ResourceNotFoundException" => crate::operation::list_contributor_insights::ListContributorInsightsError::ResourceNotFoundError({
|
197 + | let mut tmp = match protocol
|
198 + | .deserialize_response(response, crate::types::error::ResourceNotFoundError::SCHEMA, _cfg)
|
199 + | .and_then(|mut deser| {
|
200 + | crate::types::error::ResourceNotFoundError::deserialize_with_response(
|
201 + | &mut *deser,
|
202 + | response.headers(),
|
203 + | response.status().into(),
|
204 + | body,
|
205 + | )
|
206 + | }) {
|
207 + | ::std::result::Result::Ok(val) => val,
|
208 + | ::std::result::Result::Err(e) => {
|
209 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
210 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
211 + | ))
|
212 + | }
|
213 + | };
|
214 + | tmp.meta = generic;
|
215 + | if tmp.message.is_none() {
|
216 + | tmp.message = _error_message;
|
217 + | }
|
218 + | tmp
|
219 + | }),
|
220 + | _ => crate::operation::list_contributor_insights::ListContributorInsightsError::generic(generic),
|
221 + | };
|
222 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
223 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
224 + | ))
|
146 225 | } else {
|
147 - | crate::protocol_serde::shape_list_contributor_insights::de_list_contributor_insights_http_response(status, headers, body)
|
148 - | };
|
149 - | crate::protocol_serde::type_erase_result(parse_result)
|
226 + | let protocol = _cfg
|
227 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
228 + | .expect("a SharedClientProtocol is required");
|
229 + | let mut deser = protocol
|
230 + | .deserialize_response(response, ListContributorInsights::OUTPUT_SCHEMA, _cfg)
|
231 + | .map_err(|e| {
|
232 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
233 + | })?;
|
234 + | let body = response.body().bytes().expect("body loaded");
|
235 + | let output = crate::operation::list_contributor_insights::ListContributorInsightsOutput::deserialize_with_response(
|
236 + | &mut *deser,
|
237 + | response.headers(),
|
238 + | response.status().into(),
|
239 + | body,
|
240 + | )
|
241 + | .map_err(|e| {
|
242 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
243 + | })?;
|
244 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
245 + | }
|
150 246 | }
|
151 247 | }
|
152 248 | #[derive(Debug)]
|
153 249 | struct ListContributorInsightsRequestSerializer;
|
154 250 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListContributorInsightsRequestSerializer {
|
155 251 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
156 252 | fn serialize_input(
|
157 253 | &self,
|
158 254 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
159 255 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
160 256 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
161 257 | let input = input
|
162 258 | .downcast::<crate::operation::list_contributor_insights::ListContributorInsightsInput>()
|
163 259 | .expect("correct type");
|
164 - | let _header_serialization_settings = _cfg
|
165 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
166 - | .cloned()
|
167 - | .unwrap_or_default();
|
168 - | let mut request_builder = {
|
169 - | #[allow(clippy::uninlined_format_args)]
|
170 - | fn uri_base(
|
171 - | _input: &crate::operation::list_contributor_insights::ListContributorInsightsInput,
|
172 - | output: &mut ::std::string::String,
|
173 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
174 - | use ::std::fmt::Write as _;
|
175 - | ::std::write!(output, "/").expect("formatting should succeed");
|
176 - | ::std::result::Result::Ok(())
|
177 - | }
|
178 - | #[allow(clippy::unnecessary_wraps)]
|
179 - | fn update_http_builder(
|
180 - | input: &crate::operation::list_contributor_insights::ListContributorInsightsInput,
|
181 - | builder: ::http_1x::request::Builder,
|
182 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
183 - | let mut uri = ::std::string::String::new();
|
184 - | uri_base(input, &mut uri)?;
|
185 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
186 - | }
|
187 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
188 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
189 - | builder = _header_serialization_settings.set_default_header(
|
190 - | builder,
|
191 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
192 - | "DynamoDB_20120810.ListContributorInsights",
|
193 - | );
|
194 - | builder
|
195 - | };
|
196 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
197 - | crate::protocol_serde::shape_list_contributor_insights::ser_list_contributor_insights_input(&input)?,
|
198 - | );
|
199 - | if let Some(content_length) = body.content_length() {
|
200 - | let content_length = content_length.to_string();
|
201 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
202 - | }
|
203 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
260 + | let protocol = _cfg
|
261 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
262 + | .expect("a SharedClientProtocol is required");
|
263 + | let mut request = protocol
|
264 + | .serialize_request(&input, ListContributorInsights::INPUT_SCHEMA, "", _cfg)
|
265 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
266 + |
|
267 + | return ::std::result::Result::Ok(request);
|
204 268 | }
|
205 269 | }
|
206 270 | #[derive(Debug)]
|
207 271 | struct ListContributorInsightsEndpointParamsInterceptor;
|
208 272 |
|
209 273 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListContributorInsightsEndpointParamsInterceptor {
|
210 274 | fn name(&self) -> &'static str {
|
211 275 | "ListContributorInsightsEndpointParamsInterceptor"
|
212 276 | }
|
213 277 |
|