1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(clippy::unnecessary_wraps)]
|
3 3 | pub fn de_describe_job_http_error(
|
4 4 | _response_status: u16,
|
5 5 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<crate::operation::describe_job::DescribeJobOutput, crate::operation::describe_job::DescribeJobError> {
|
8 8 | #[allow(unused_mut)]
|
9 9 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 10 | .map_err(crate::operation::describe_job::DescribeJobError::unhandled)?;
|
11 11 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
12 12 | let generic = generic_builder.build();
|
13 13 | let error_code = match generic.code() {
|
14 14 | Some(code) => code,
|
15 15 | None => return Err(crate::operation::describe_job::DescribeJobError::unhandled(generic)),
|
16 16 | };
|
17 17 |
|
18 18 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
19 19 | Err(match error_code {
|
20 20 | "BadRequestException" => crate::operation::describe_job::DescribeJobError::BadRequestException({
|
21 21 | #[allow(unused_mut)]
|
22 22 | let mut tmp = {
|
23 23 | #[allow(unused_mut)]
|
24 24 | let mut output = crate::types::error::builders::BadRequestExceptionBuilder::default();
|
25 25 | output = crate::protocol_serde::shape_bad_request_exception::de_bad_request_exception_xml_err(_response_body, output)
|
26 26 | .map_err(crate::operation::describe_job::DescribeJobError::unhandled)?;
|
27 27 | let output = output.meta(generic);
|
28 28 | output.build()
|
29 29 | };
|
30 - | if tmp.message.is_none() {
|
31 - | tmp.message = _error_message;
|
32 - | }
|
33 30 | tmp
|
34 31 | }),
|
35 32 | "InternalServiceException" => crate::operation::describe_job::DescribeJobError::InternalServiceException({
|
36 33 | #[allow(unused_mut)]
|
37 34 | let mut tmp = {
|
38 35 | #[allow(unused_mut)]
|
39 36 | let mut output = crate::types::error::builders::InternalServiceExceptionBuilder::default();
|
40 37 | output = crate::protocol_serde::shape_internal_service_exception::de_internal_service_exception_xml_err(_response_body, output)
|
41 38 | .map_err(crate::operation::describe_job::DescribeJobError::unhandled)?;
|
42 39 | let output = output.meta(generic);
|
43 40 | output.build()
|
44 41 | };
|
45 - | if tmp.message.is_none() {
|
46 - | tmp.message = _error_message;
|
47 - | }
|
48 42 | tmp
|
49 43 | }),
|
50 44 | "NotFoundException" => crate::operation::describe_job::DescribeJobError::NotFoundException({
|
51 45 | #[allow(unused_mut)]
|
52 46 | let mut tmp = {
|
53 47 | #[allow(unused_mut)]
|
54 48 | let mut output = crate::types::error::builders::NotFoundExceptionBuilder::default();
|
55 49 | output = crate::protocol_serde::shape_not_found_exception::de_not_found_exception_xml_err(_response_body, output)
|
56 50 | .map_err(crate::operation::describe_job::DescribeJobError::unhandled)?;
|
57 51 | let output = output.meta(generic);
|
58 52 | output.build()
|
59 53 | };
|
60 - | if tmp.message.is_none() {
|
61 - | tmp.message = _error_message;
|
62 - | }
|
63 54 | tmp
|
64 55 | }),
|
65 56 | "TooManyRequestsException" => crate::operation::describe_job::DescribeJobError::TooManyRequestsException({
|
66 57 | #[allow(unused_mut)]
|
67 58 | let mut tmp = {
|
68 59 | #[allow(unused_mut)]
|
69 60 | let mut output = crate::types::error::builders::TooManyRequestsExceptionBuilder::default();
|
70 61 | output = crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_xml_err(_response_body, output)
|
71 62 | .map_err(crate::operation::describe_job::DescribeJobError::unhandled)?;
|
72 63 | let output = output.meta(generic);
|
73 64 | output.build()
|
74 65 | };
|
75 - | if tmp.message.is_none() {
|
76 - | tmp.message = _error_message;
|
77 - | }
|
78 66 | tmp
|
79 67 | }),
|
80 68 | _ => crate::operation::describe_job::DescribeJobError::generic(generic),
|
81 69 | })
|
82 70 | }
|
83 71 |
|
84 72 | #[allow(clippy::unnecessary_wraps)]
|
85 73 | pub fn de_describe_job_http_response(
|
86 74 | _response_status: u16,
|
87 75 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
88 76 | _response_body: &[u8],
|
89 77 | ) -> std::result::Result<crate::operation::describe_job::DescribeJobOutput, crate::operation::describe_job::DescribeJobError> {
|
90 78 | Ok({
|
91 79 | #[allow(unused_mut)]
|
92 80 | let mut output = crate::operation::describe_job::builders::DescribeJobOutputBuilder::default();
|
93 81 | output = crate::protocol_serde::shape_describe_job::de_describe_job(_response_body, output)
|
94 82 | .map_err(crate::operation::describe_job::DescribeJobError::unhandled)?;
|
95 83 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
96 84 | output.build()
|
97 85 | })
|
98 86 | }
|
99 87 |
|
100 88 | pub fn ser_describe_job_headers(
|
101 89 | input: &crate::operation::describe_job::DescribeJobInput,
|
102 90 | mut builder: ::http::request::Builder,
|
103 91 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
104 92 | if let ::std::option::Option::Some(inner_1) = &input.account_id {
|
105 93 | let formatted_2 = inner_1.as_str();
|
106 94 | let header_value = formatted_2;
|
107 95 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|