3 3 | pub fn de_update_scheduled_query_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<
|
8 8 | crate::operation::update_scheduled_query::UpdateScheduledQueryOutput,
|
9 9 | crate::operation::update_scheduled_query::UpdateScheduledQueryError,
|
10 10 | > {
|
11 11 | #[allow(unused_mut)]
|
12 12 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 13 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
14 14 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 15 | let generic = generic_builder.build();
|
16 16 | let error_code = match generic.code() {
|
17 17 | Some(code) => code,
|
18 18 | None => return Err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled(generic)),
|
19 19 | };
|
20 20 |
|
21 21 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 22 | Err(match error_code {
|
23 23 | "AccessDeniedException" => crate::operation::update_scheduled_query::UpdateScheduledQueryError::AccessDeniedException({
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut tmp = {
|
26 26 | #[allow(unused_mut)]
|
27 27 | let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
|
28 28 | output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
|
29 29 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
30 30 | let output = output.meta(generic);
|
31 31 | output.build()
|
32 32 | };
|
33 - | if tmp.message.is_none() {
|
34 - | tmp.message = _error_message;
|
35 - | }
|
36 33 | tmp
|
37 34 | }),
|
38 35 | "InternalServerException" => crate::operation::update_scheduled_query::UpdateScheduledQueryError::InternalServerException({
|
39 36 | #[allow(unused_mut)]
|
40 37 | let mut tmp = {
|
41 38 | #[allow(unused_mut)]
|
42 39 | let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
|
43 40 | output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
|
44 41 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
45 42 | let output = output.meta(generic);
|
46 43 | output.build()
|
47 44 | };
|
48 - | if tmp.message.is_none() {
|
49 - | tmp.message = _error_message;
|
50 - | }
|
51 45 | tmp
|
52 46 | }),
|
53 47 | "InvalidEndpointException" => crate::operation::update_scheduled_query::UpdateScheduledQueryError::InvalidEndpointException({
|
54 48 | #[allow(unused_mut)]
|
55 49 | let mut tmp = {
|
56 50 | #[allow(unused_mut)]
|
57 51 | let mut output = crate::types::error::builders::InvalidEndpointExceptionBuilder::default();
|
58 52 | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
59 53 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
60 54 | let output = output.meta(generic);
|
61 55 | output.build()
|
62 56 | };
|
63 - | if tmp.message.is_none() {
|
64 - | tmp.message = _error_message;
|
65 - | }
|
66 57 | tmp
|
67 58 | }),
|
68 59 | "ResourceNotFoundException" => crate::operation::update_scheduled_query::UpdateScheduledQueryError::ResourceNotFoundException({
|
69 60 | #[allow(unused_mut)]
|
70 61 | let mut tmp = {
|
71 62 | #[allow(unused_mut)]
|
72 63 | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
73 64 | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
74 65 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
75 66 | let output = output.meta(generic);
|
76 67 | output.build()
|
77 68 | };
|
78 - | if tmp.message.is_none() {
|
79 - | tmp.message = _error_message;
|
80 - | }
|
81 69 | tmp
|
82 70 | }),
|
83 71 | "ThrottlingException" => crate::operation::update_scheduled_query::UpdateScheduledQueryError::ThrottlingException({
|
84 72 | #[allow(unused_mut)]
|
85 73 | let mut tmp = {
|
86 74 | #[allow(unused_mut)]
|
87 75 | let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
|
88 76 | output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
|
89 77 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
90 78 | let output = output.meta(generic);
|
91 79 | output.build()
|
92 80 | };
|
93 - | if tmp.message.is_none() {
|
94 - | tmp.message = _error_message;
|
95 - | }
|
96 81 | tmp
|
97 82 | }),
|
98 83 | "ValidationException" => crate::operation::update_scheduled_query::UpdateScheduledQueryError::ValidationException({
|
99 84 | #[allow(unused_mut)]
|
100 85 | let mut tmp = {
|
101 86 | #[allow(unused_mut)]
|
102 87 | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
103 88 | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
104 89 | .map_err(crate::operation::update_scheduled_query::UpdateScheduledQueryError::unhandled)?;
|
105 90 | let output = output.meta(generic);
|
106 91 | output.build()
|
107 92 | };
|
108 - | if tmp.message.is_none() {
|
109 - | tmp.message = _error_message;
|
110 - | }
|
111 93 | tmp
|
112 94 | }),
|
113 95 | _ => crate::operation::update_scheduled_query::UpdateScheduledQueryError::generic(generic),
|
114 96 | })
|
115 97 | }
|
116 98 |
|
117 99 | #[allow(clippy::unnecessary_wraps)]
|
118 100 | pub fn de_update_scheduled_query_http_response(
|
119 101 | _response_status: u16,
|
120 102 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
121 103 | _response_body: &[u8],
|
122 104 | ) -> std::result::Result<
|
123 105 | crate::operation::update_scheduled_query::UpdateScheduledQueryOutput,
|
124 106 | crate::operation::update_scheduled_query::UpdateScheduledQueryError,
|
125 107 | > {
|
126 108 | Ok({
|
127 109 | #[allow(unused_mut)]
|
128 110 | let mut output = crate::operation::update_scheduled_query::builders::UpdateScheduledQueryOutputBuilder::default();
|
129 111 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
130 112 | output.build()
|
131 113 | })
|
132 114 | }
|
133 115 |
|
134 116 | pub fn ser_update_scheduled_query_input(
|
135 117 | input: &crate::operation::update_scheduled_query::UpdateScheduledQueryInput,
|
136 118 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
137 119 | let mut out = String::new();
|
138 120 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
139 121 | crate::protocol_serde::shape_update_scheduled_query_input::ser_update_scheduled_query_input_input(&mut object, input)?;
|
140 122 | object.finish();
|