3 3 | pub fn de_restore_table_to_point_in_time_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::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
|
9 9 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
|
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::restore_table_to_point_in_time::RestoreTableToPointInTimeError::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::restore_table_to_point_in_time::RestoreTableToPointInTimeError::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 | "InternalServerError" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InternalServerError({
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut tmp = {
|
26 26 | #[allow(unused_mut)]
|
27 27 | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
28 28 | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
29 29 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::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 | "InvalidEndpointException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidEndpointException({
|
39 36 | #[allow(unused_mut)]
|
40 37 | let mut tmp = {
|
41 38 | #[allow(unused_mut)]
|
42 39 | let mut output = crate::types::error::builders::InvalidEndpointExceptionBuilder::default();
|
43 40 | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
44 41 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::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 | "InvalidRestoreTimeException" => {
|
54 48 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::InvalidRestoreTimeException({
|
55 49 | #[allow(unused_mut)]
|
56 50 | let mut tmp = {
|
57 51 | #[allow(unused_mut)]
|
58 52 | let mut output = crate::types::error::builders::InvalidRestoreTimeExceptionBuilder::default();
|
59 53 | output = crate::protocol_serde::shape_invalid_restore_time_exception::de_invalid_restore_time_exception_json_err(
|
60 54 | _response_body,
|
61 55 | output,
|
62 56 | )
|
63 57 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
64 58 | let output = output.meta(generic);
|
65 59 | output.build()
|
66 60 | };
|
67 - | if tmp.message.is_none() {
|
68 - | tmp.message = _error_message;
|
69 - | }
|
70 61 | tmp
|
71 62 | })
|
72 63 | }
|
73 64 | "LimitExceededException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::LimitExceededException({
|
74 65 | #[allow(unused_mut)]
|
75 66 | let mut tmp = {
|
76 67 | #[allow(unused_mut)]
|
77 68 | let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
|
78 69 | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
79 70 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
80 71 | let output = output.meta(generic);
|
81 72 | output.build()
|
82 73 | };
|
83 - | if tmp.message.is_none() {
|
84 - | tmp.message = _error_message;
|
85 - | }
|
86 74 | tmp
|
87 75 | }),
|
88 76 | "PointInTimeRecoveryUnavailableException" => {
|
89 77 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::PointInTimeRecoveryUnavailableException({
|
90 78 | #[allow(unused_mut)]
|
91 79 | let mut tmp = {
|
92 80 | #[allow(unused_mut)]
|
93 81 | let mut output = crate::types::error::builders::PointInTimeRecoveryUnavailableExceptionBuilder::default();
|
94 82 | output = crate::protocol_serde::shape_point_in_time_recovery_unavailable_exception::de_point_in_time_recovery_unavailable_exception_json_err(_response_body, output).map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
95 83 | let output = output.meta(generic);
|
96 84 | output.build()
|
97 85 | };
|
98 - | if tmp.message.is_none() {
|
99 - | tmp.message = _error_message;
|
100 - | }
|
101 86 | tmp
|
102 87 | })
|
103 88 | }
|
104 89 | "TableAlreadyExistsException" => {
|
105 90 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableAlreadyExistsException({
|
106 91 | #[allow(unused_mut)]
|
107 92 | let mut tmp = {
|
108 93 | #[allow(unused_mut)]
|
109 94 | let mut output = crate::types::error::builders::TableAlreadyExistsExceptionBuilder::default();
|
110 95 | output = crate::protocol_serde::shape_table_already_exists_exception::de_table_already_exists_exception_json_err(
|
111 96 | _response_body,
|
112 97 | output,
|
113 98 | )
|
114 99 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
115 100 | let output = output.meta(generic);
|
116 101 | output.build()
|
117 102 | };
|
118 - | if tmp.message.is_none() {
|
119 - | tmp.message = _error_message;
|
120 - | }
|
121 103 | tmp
|
122 104 | })
|
123 105 | }
|
124 106 | "TableInUseException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableInUseException({
|
125 107 | #[allow(unused_mut)]
|
126 108 | let mut tmp = {
|
127 109 | #[allow(unused_mut)]
|
128 110 | let mut output = crate::types::error::builders::TableInUseExceptionBuilder::default();
|
129 111 | output = crate::protocol_serde::shape_table_in_use_exception::de_table_in_use_exception_json_err(_response_body, output)
|
130 112 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
131 113 | let output = output.meta(generic);
|
132 114 | output.build()
|
133 115 | };
|
134 - | if tmp.message.is_none() {
|
135 - | tmp.message = _error_message;
|
136 - | }
|
137 116 | tmp
|
138 117 | }),
|
139 118 | "TableNotFoundException" => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::TableNotFoundException({
|
140 119 | #[allow(unused_mut)]
|
141 120 | let mut tmp = {
|
142 121 | #[allow(unused_mut)]
|
143 122 | let mut output = crate::types::error::builders::TableNotFoundExceptionBuilder::default();
|
144 123 | output = crate::protocol_serde::shape_table_not_found_exception::de_table_not_found_exception_json_err(_response_body, output)
|
145 124 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
146 125 | let output = output.meta(generic);
|
147 126 | output.build()
|
148 127 | };
|
149 - | if tmp.message.is_none() {
|
150 - | tmp.message = _error_message;
|
151 - | }
|
152 128 | tmp
|
153 129 | }),
|
154 130 | _ => crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::generic(generic),
|
155 131 | })
|
156 132 | }
|
157 133 |
|
158 134 | #[allow(clippy::unnecessary_wraps)]
|
159 135 | pub fn de_restore_table_to_point_in_time_http_response(
|
160 136 | _response_status: u16,
|
161 137 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
162 138 | _response_body: &[u8],
|
163 139 | ) -> std::result::Result<
|
164 140 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeOutput,
|
165 141 | crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError,
|
166 142 | > {
|
167 143 | Ok({
|
168 144 | #[allow(unused_mut)]
|
169 145 | let mut output = crate::operation::restore_table_to_point_in_time::builders::RestoreTableToPointInTimeOutputBuilder::default();
|
170 146 | output = crate::protocol_serde::shape_restore_table_to_point_in_time::de_restore_table_to_point_in_time(_response_body, output)
|
171 147 | .map_err(crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeError::unhandled)?;
|
172 148 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
173 149 | output.build()
|
174 150 | })
|
175 151 | }
|
176 152 |
|
177 153 | pub fn ser_restore_table_to_point_in_time_input(
|
178 154 | input: &crate::operation::restore_table_to_point_in_time::RestoreTableToPointInTimeInput,
|
179 155 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
180 156 | let mut out = String::new();
|
181 157 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|