131 135 | ::std::borrow::Cow::Owned(rcb)
|
132 136 | }
|
133 137 | }
|
134 138 |
|
135 139 | #[derive(Debug)]
|
136 140 | struct ListWorkflowRunsResponseDeserializer;
|
137 141 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListWorkflowRunsResponseDeserializer {
|
138 142 | fn deserialize_nonstreaming(
|
139 143 | &self,
|
140 144 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
145 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
141 146 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
142 147 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
143 - | let headers = response.headers();
|
144 - | let body = response.body().bytes().expect("body loaded");
|
145 148 | #[allow(unused_mut)]
|
146 149 | let mut force_error = false;
|
147 150 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
148 - | let parse_result = if !success && status != 200 || force_error {
|
149 - | crate::protocol_serde::shape_list_workflow_runs::de_list_workflow_runs_http_error(status, headers, body)
|
150 - | } else {
|
151 - | crate::protocol_serde::shape_list_workflow_runs::de_list_workflow_runs_http_response(status, headers, body)
|
151 + | if !success && status != 200 || force_error {
|
152 + | let headers = response.headers();
|
153 + | let body = response.body().bytes().expect("body loaded");
|
154 + | #[allow(unused_mut)]
|
155 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
156 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
157 + | })?;
|
158 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
159 + | let generic = generic_builder.build();
|
160 + | let error_code = match generic.code() {
|
161 + | ::std::option::Option::Some(code) => code,
|
162 + | ::std::option::Option::None => {
|
163 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
164 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::list_workflow_runs::ListWorkflowRunsError::unhandled(
|
165 + | generic,
|
166 + | )),
|
167 + | ))
|
168 + | }
|
169 + | };
|
170 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
171 + | let protocol = _cfg
|
172 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
173 + | .expect("a SharedClientProtocol is required");
|
174 + | let err = match error_code {
|
175 + | "AccessDeniedException" => crate::operation::list_workflow_runs::ListWorkflowRunsError::AccessDeniedException({
|
176 + | let mut tmp = match protocol
|
177 + | .deserialize_response(response, crate::types::error::AccessDeniedException::SCHEMA, _cfg)
|
178 + | .and_then(|mut deser| {
|
179 + | crate::types::error::AccessDeniedException::deserialize_with_response(
|
180 + | &mut *deser,
|
181 + | response.headers(),
|
182 + | response.status().into(),
|
183 + | body,
|
184 + | )
|
185 + | }) {
|
186 + | ::std::result::Result::Ok(val) => val,
|
187 + | ::std::result::Result::Err(e) => {
|
188 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
189 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
190 + | ))
|
191 + | }
|
192 + | };
|
193 + | tmp.meta = generic;
|
194 + | tmp
|
195 + | }),
|
196 + | "ConflictException" => crate::operation::list_workflow_runs::ListWorkflowRunsError::ConflictException({
|
197 + | let mut tmp = match protocol
|
198 + | .deserialize_response(response, crate::types::error::ConflictException::SCHEMA, _cfg)
|
199 + | .and_then(|mut deser| {
|
200 + | crate::types::error::ConflictException::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 + | tmp
|
216 + | }),
|
217 + | "ResourceNotFoundException" => crate::operation::list_workflow_runs::ListWorkflowRunsError::ResourceNotFoundException({
|
218 + | let mut tmp = match protocol
|
219 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
220 + | .and_then(|mut deser| {
|
221 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
222 + | &mut *deser,
|
223 + | response.headers(),
|
224 + | response.status().into(),
|
225 + | body,
|
226 + | )
|
227 + | }) {
|
228 + | ::std::result::Result::Ok(val) => val,
|
229 + | ::std::result::Result::Err(e) => {
|
230 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
231 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
232 + | ))
|
233 + | }
|
234 + | };
|
235 + | tmp.meta = generic;
|
236 + | tmp
|
237 + | }),
|
238 + | "ServiceQuotaExceededException" => crate::operation::list_workflow_runs::ListWorkflowRunsError::ServiceQuotaExceededException({
|
239 + | let mut tmp = match protocol
|
240 + | .deserialize_response(response, crate::types::error::ServiceQuotaExceededException::SCHEMA, _cfg)
|
241 + | .and_then(|mut deser| {
|
242 + | crate::types::error::ServiceQuotaExceededException::deserialize_with_response(
|
243 + | &mut *deser,
|
244 + | response.headers(),
|
245 + | response.status().into(),
|
246 + | body,
|
247 + | )
|
248 + | }) {
|
249 + | ::std::result::Result::Ok(val) => val,
|
250 + | ::std::result::Result::Err(e) => {
|
251 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
252 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
253 + | ))
|
254 + | }
|
255 + | };
|
256 + | tmp.meta = generic;
|
257 + | tmp
|
258 + | }),
|
259 + | "ThrottlingException" => crate::operation::list_workflow_runs::ListWorkflowRunsError::ThrottlingException({
|
260 + | let mut tmp = match protocol
|
261 + | .deserialize_response(response, crate::types::error::ThrottlingException::SCHEMA, _cfg)
|
262 + | .and_then(|mut deser| {
|
263 + | crate::types::error::ThrottlingException::deserialize_with_response(
|
264 + | &mut *deser,
|
265 + | response.headers(),
|
266 + | response.status().into(),
|
267 + | body,
|
268 + | )
|
269 + | }) {
|
270 + | ::std::result::Result::Ok(val) => val,
|
271 + | ::std::result::Result::Err(e) => {
|
272 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
273 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
274 + | ))
|
275 + | }
|
276 + | };
|
277 + | tmp.meta = generic;
|
278 + | tmp
|
279 + | }),
|
280 + | "ValidationException" => crate::operation::list_workflow_runs::ListWorkflowRunsError::ValidationException({
|
281 + | let mut tmp = match protocol
|
282 + | .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
|
283 + | .and_then(|mut deser| {
|
284 + | crate::types::error::ValidationException::deserialize_with_response(
|
285 + | &mut *deser,
|
286 + | response.headers(),
|
287 + | response.status().into(),
|
288 + | body,
|
289 + | )
|
290 + | }) {
|
291 + | ::std::result::Result::Ok(val) => val,
|
292 + | ::std::result::Result::Err(e) => {
|
293 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
294 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
295 + | ))
|
296 + | }
|
152 297 | };
|
153 - | crate::protocol_serde::type_erase_result(parse_result)
|
298 + | tmp.meta = generic;
|
299 + | tmp
|
300 + | }),
|
301 + | _ => crate::operation::list_workflow_runs::ListWorkflowRunsError::generic(generic),
|
302 + | };
|
303 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
304 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
305 + | ))
|
306 + | } else {
|
307 + | let protocol = _cfg
|
308 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
309 + | .expect("a SharedClientProtocol is required");
|
310 + | let mut deser = protocol
|
311 + | .deserialize_response(response, ListWorkflowRuns::OUTPUT_SCHEMA, _cfg)
|
312 + | .map_err(|e| {
|
313 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
314 + | })?;
|
315 + | let body = response.body().bytes().expect("body loaded");
|
316 + | let output = crate::operation::list_workflow_runs::ListWorkflowRunsOutput::deserialize_with_response(
|
317 + | &mut *deser,
|
318 + | response.headers(),
|
319 + | response.status().into(),
|
320 + | body,
|
321 + | )
|
322 + | .map_err(|e| {
|
323 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
324 + | })?;
|
325 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
326 + | }
|
154 327 | }
|
155 328 | }
|
156 329 | #[derive(Debug)]
|
157 330 | struct ListWorkflowRunsRequestSerializer;
|
158 331 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListWorkflowRunsRequestSerializer {
|
159 332 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
160 333 | fn serialize_input(
|
161 334 | &self,
|
162 335 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
163 336 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
164 337 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
165 338 | let input = input
|
166 339 | .downcast::<crate::operation::list_workflow_runs::ListWorkflowRunsInput>()
|
167 340 | .expect("correct type");
|
168 - | let _header_serialization_settings = _cfg
|
169 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
170 - | .cloned()
|
171 - | .unwrap_or_default();
|
172 - | let mut request_builder = {
|
173 - | #[allow(clippy::uninlined_format_args)]
|
174 - | fn uri_base(
|
175 - | _input: &crate::operation::list_workflow_runs::ListWorkflowRunsInput,
|
176 - | output: &mut ::std::string::String,
|
177 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
178 - | use ::std::fmt::Write as _;
|
179 - | let input_1 = &_input.space_name;
|
180 - | let input_1 = input_1
|
181 - | .as_ref()
|
182 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("space_name", "cannot be empty or unset"))?;
|
183 - | let space_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
184 - | if space_name.is_empty() {
|
185 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
186 - | "space_name",
|
187 - | "cannot be empty or unset",
|
188 - | ));
|
189 - | }
|
190 - | let input_2 = &_input.project_name;
|
191 - | let input_2 = input_2
|
192 - | .as_ref()
|
193 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("project_name", "cannot be empty or unset"))?;
|
194 - | let project_name = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default);
|
195 - | if project_name.is_empty() {
|
196 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
197 - | "project_name",
|
198 - | "cannot be empty or unset",
|
199 - | ));
|
200 - | }
|
201 - | ::std::write!(
|
202 - | output,
|
203 - | "/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns",
|
204 - | spaceName = space_name,
|
205 - | projectName = project_name
|
206 - | )
|
207 - | .expect("formatting should succeed");
|
208 - | ::std::result::Result::Ok(())
|
209 - | }
|
210 - | fn uri_query(
|
211 - | _input: &crate::operation::list_workflow_runs::ListWorkflowRunsInput,
|
212 - | mut output: &mut ::std::string::String,
|
213 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
214 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
215 - | if let ::std::option::Option::Some(inner_3) = &_input.workflow_id {
|
216 - | {
|
217 - | query.push_kv("workflowId", &::aws_smithy_http::query::fmt_string(inner_3));
|
218 - | }
|
219 - | }
|
220 - | if let ::std::option::Option::Some(inner_4) = &_input.next_token {
|
341 + | let protocol = _cfg
|
342 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
343 + | .expect("a SharedClientProtocol is required");
|
344 + | if protocol.supports_http_bindings() {
|
345 + | let mut request = protocol
|
346 + | .serialize_body(&input, ListWorkflowRuns::INPUT_SCHEMA, "", _cfg)
|
347 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
221 348 | {
|
222 - | query.push_kv("nextToken", &::aws_smithy_http::query::fmt_string(inner_4));
|
223 - | }
|
224 - | }
|
225 - | if let ::std::option::Option::Some(inner_5) = &_input.max_results {
|
226 - | {
|
227 - | query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_5).encode());
|
228 - | }
|
349 + | let mut uri = "/v1/spaces/{spaceName}/projects/{projectName}/workflowRuns".to_string();
|
350 + | let mut query_params: Vec<(String, String)> = Vec::new();
|
351 + | if let Some(ref val) = input.space_name {
|
352 + | uri = uri.replace("{spaceName}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
|
353 + | }
|
354 + | if let Some(ref val) = input.workflow_id {
|
355 + | query_params.push(("workflowId".to_string(), val.to_string()));
|
356 + | }
|
357 + | if let Some(ref val) = input.project_name {
|
358 + | uri = uri.replace("{projectName}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
|
359 + | }
|
360 + | if let Some(ref val) = input.next_token {
|
361 + | query_params.push(("nextToken".to_string(), val.to_string()));
|
362 + | }
|
363 + | if let Some(ref val) = input.max_results {
|
364 + | query_params.push(("maxResults".to_string(), val.to_string()));
|
365 + | }
|
366 + | if !query_params.is_empty() {
|
367 + | uri.push(if uri.contains('?') { '&' } else { '?' });
|
368 + | let pairs: Vec<String> = query_params
|
369 + | .iter()
|
370 + | .map(|(k, v)| {
|
371 + | format!(
|
372 + | "{}={}",
|
373 + | ::aws_smithy_schema::http_protocol::percent_encode(k),
|
374 + | ::aws_smithy_schema::http_protocol::percent_encode(v)
|
375 + | )
|
376 + | })
|
377 + | .collect();
|
378 + | uri.push_str(&pairs.join("&"));
|
229 379 | }
|
230 - | ::std::result::Result::Ok(())
|
380 + | request.set_uri(uri.as_str()).expect("valid URI");
|
231 381 | }
|
232 - | #[allow(clippy::unnecessary_wraps)]
|
233 - | fn update_http_builder(
|
234 - | input: &crate::operation::list_workflow_runs::ListWorkflowRunsInput,
|
235 - | builder: ::http_1x::request::Builder,
|
236 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
237 - | let mut uri = ::std::string::String::new();
|
238 - | uri_base(input, &mut uri)?;
|
239 - | uri_query(input, &mut uri)?;
|
240 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
241 - | }
|
242 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
243 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
|
244 - | builder
|
245 - | };
|
246 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_workflow_runs::ser_list_workflow_runs_input(&input)?);
|
247 - | if let Some(content_length) = body.content_length() {
|
248 - | let content_length = content_length.to_string();
|
249 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
382 + |
|
383 + | return ::std::result::Result::Ok(request);
|
384 + | } else {
|
385 + | let mut request = protocol
|
386 + | .serialize_request(&input, ListWorkflowRuns::INPUT_SCHEMA, "", _cfg)
|
387 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
388 + |
|
389 + | return ::std::result::Result::Ok(request);
|
250 390 | }
|
251 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
252 391 | }
|
253 392 | }
|
254 393 | #[derive(Debug)]
|
255 394 | struct ListWorkflowRunsEndpointParamsInterceptor;
|
256 395 |
|
257 396 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListWorkflowRunsEndpointParamsInterceptor {
|
258 397 | fn name(&self) -> &'static str {
|
259 398 | "ListWorkflowRunsEndpointParamsInterceptor"
|
260 399 | }
|
261 400 |
|