1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ProtocolParserGenerator.kt:99 */
|
3 5 | pub fn de_disable_kinesis_streaming_destination_http_error(
|
4 6 | _response_status: u16,
|
5 7 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 8 | _response_body: &[u8],
|
7 9 | ) -> std::result::Result<
|
8 10 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationOutput,
|
9 11 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError,
|
10 12 | > {
|
13 + | /* RustType.kt:516 */
|
11 14 | #[allow(unused_mut)]
|
15 + | /* ProtocolParserGenerator.kt:106 */
|
12 16 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 17 | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
18 + | /* ProtocolParserGenerator.kt:120 */
|
14 19 | let generic = generic_builder.build();
|
20 + | /* ProtocolParserGenerator.kt:122 */
|
15 21 | let error_code = match generic.code() {
|
16 22 | Some(code) => code,
|
17 23 | None => return Err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled(generic)),
|
18 24 | };
|
19 25 |
|
20 26 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
27 + | /* ProtocolParserGenerator.kt:133 */
|
21 28 | Err(match error_code {
|
29 + | /* ProtocolParserGenerator.kt:139 */
|
22 30 | "InternalServerError" => {
|
23 31 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::InternalServerError({
|
32 + | /* RustType.kt:516 */
|
24 33 | #[allow(unused_mut)]
|
25 - | let mut tmp = {
|
26 - | #[allow(unused_mut)]
|
27 - | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
28 - | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
29 - | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
30 - | let output = output.meta(generic);
|
31 - | output.build()
|
32 - | };
|
34 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
35 + | /* ProtocolParserGenerator.kt:146 */ {
|
36 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
37 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
38 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output).map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
39 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
40 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
41 + | /* ProtocolParserGenerator.kt:146 */}
|
42 + | /* ProtocolParserGenerator.kt:145 */;
|
43 + | /* ProtocolParserGenerator.kt:170 */
|
33 44 | if tmp.message.is_none() {
|
34 45 | tmp.message = _error_message;
|
35 46 | }
|
47 + | /* ProtocolParserGenerator.kt:179 */
|
36 48 | tmp
|
49 + | /* ProtocolParserGenerator.kt:139 */
|
37 50 | })
|
38 51 | }
|
52 + | /* ProtocolParserGenerator.kt:139 */
|
39 53 | "InvalidEndpointException" => {
|
40 54 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::InvalidEndpointError({
|
55 + | /* RustType.kt:516 */
|
41 56 | #[allow(unused_mut)]
|
42 - | let mut tmp = {
|
43 - | #[allow(unused_mut)]
|
44 - | let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
|
45 - | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
46 - | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
47 - | let output = output.meta(generic);
|
48 - | output.build()
|
49 - | };
|
57 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
58 + | /* ProtocolParserGenerator.kt:146 */ {
|
59 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
60 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
|
61 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output).map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
62 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
63 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
64 + | /* ProtocolParserGenerator.kt:146 */}
|
65 + | /* ProtocolParserGenerator.kt:145 */;
|
66 + | /* ProtocolParserGenerator.kt:170 */
|
50 67 | if tmp.message.is_none() {
|
51 68 | tmp.message = _error_message;
|
52 69 | }
|
70 + | /* ProtocolParserGenerator.kt:179 */
|
53 71 | tmp
|
72 + | /* ProtocolParserGenerator.kt:139 */
|
54 73 | })
|
55 74 | }
|
75 + | /* ProtocolParserGenerator.kt:139 */
|
56 76 | "LimitExceededException" => {
|
57 77 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::LimitExceededError({
|
78 + | /* RustType.kt:516 */
|
58 79 | #[allow(unused_mut)]
|
59 - | let mut tmp = {
|
60 - | #[allow(unused_mut)]
|
61 - | let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
|
62 - | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
63 - | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
64 - | let output = output.meta(generic);
|
65 - | output.build()
|
66 - | };
|
80 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
81 + | /* ProtocolParserGenerator.kt:146 */ {
|
82 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
83 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
|
84 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
85 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
86 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
87 + | /* ProtocolParserGenerator.kt:146 */}
|
88 + | /* ProtocolParserGenerator.kt:145 */;
|
89 + | /* ProtocolParserGenerator.kt:170 */
|
67 90 | if tmp.message.is_none() {
|
68 91 | tmp.message = _error_message;
|
69 92 | }
|
93 + | /* ProtocolParserGenerator.kt:179 */
|
70 94 | tmp
|
95 + | /* ProtocolParserGenerator.kt:139 */
|
71 96 | })
|
72 97 | }
|
98 + | /* ProtocolParserGenerator.kt:139 */
|
73 99 | "ResourceInUseException" => {
|
74 100 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::ResourceInUseError({
|
101 + | /* RustType.kt:516 */
|
75 102 | #[allow(unused_mut)]
|
76 - | let mut tmp = {
|
77 - | #[allow(unused_mut)]
|
78 - | let mut output = crate::types::error::builders::ResourceInUseErrorBuilder::default();
|
79 - | output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output)
|
80 - | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
81 - | let output = output.meta(generic);
|
82 - | output.build()
|
83 - | };
|
103 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
104 + | /* ProtocolParserGenerator.kt:146 */ {
|
105 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
106 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceInUseErrorBuilder::default();
|
107 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output).map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
108 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
109 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
110 + | /* ProtocolParserGenerator.kt:146 */}
|
111 + | /* ProtocolParserGenerator.kt:145 */;
|
112 + | /* ProtocolParserGenerator.kt:170 */
|
84 113 | if tmp.message.is_none() {
|
85 114 | tmp.message = _error_message;
|
86 115 | }
|
116 + | /* ProtocolParserGenerator.kt:179 */
|
87 117 | tmp
|
118 + | /* ProtocolParserGenerator.kt:139 */
|
88 119 | })
|
89 120 | }
|
121 + | /* ProtocolParserGenerator.kt:139 */
|
90 122 | "ResourceNotFoundException" => {
|
91 123 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::ResourceNotFoundError({
|
124 + | /* RustType.kt:516 */
|
92 125 | #[allow(unused_mut)]
|
93 - | let mut tmp = {
|
94 - | #[allow(unused_mut)]
|
95 - | let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
96 - | output =
|
97 - | crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
98 - | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
99 - | let output = output.meta(generic);
|
100 - | output.build()
|
101 - | };
|
126 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
127 + | /* ProtocolParserGenerator.kt:146 */ {
|
128 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
129 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
130 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
131 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
132 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
133 + | /* ProtocolParserGenerator.kt:146 */}
|
134 + | /* ProtocolParserGenerator.kt:145 */;
|
135 + | /* ProtocolParserGenerator.kt:170 */
|
102 136 | if tmp.message.is_none() {
|
103 137 | tmp.message = _error_message;
|
104 138 | }
|
139 + | /* ProtocolParserGenerator.kt:179 */
|
105 140 | tmp
|
141 + | /* ProtocolParserGenerator.kt:139 */
|
106 142 | })
|
107 143 | }
|
108 - | _ => crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::generic(generic),
|
144 + | /* ProtocolParserGenerator.kt:182 */
|
145 + | _ => crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
109 146 | })
|
147 + | /* ProtocolParserGenerator.kt:99 */
|
110 148 | }
|
111 149 |
|
150 + | /* RustType.kt:516 */
|
112 151 | #[allow(clippy::unnecessary_wraps)]
|
152 + | /* ProtocolParserGenerator.kt:71 */
|
113 153 | pub fn de_disable_kinesis_streaming_destination_http_response(
|
114 154 | _response_status: u16,
|
115 155 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
116 156 | _response_body: &[u8],
|
117 157 | ) -> std::result::Result<
|
118 158 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationOutput,
|
119 159 | crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError,
|
120 160 | > {
|
161 + | /* ProtocolParserGenerator.kt:77 */
|
121 162 | Ok({
|
163 + | /* RustType.kt:516 */
|
122 164 | #[allow(unused_mut)]
|
165 + | /* ProtocolParserGenerator.kt:240 */
|
123 166 | let mut output =
|
124 167 | crate::operation::disable_kinesis_streaming_destination::builders::DisableKinesisStreamingDestinationOutputBuilder::default();
|
168 + | /* ProtocolParserGenerator.kt:247 */
|
125 169 | output = crate::protocol_serde::shape_disable_kinesis_streaming_destination::de_disable_kinesis_streaming_destination(_response_body, output)
|
126 170 | .map_err(crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationError::unhandled)?;
|
171 + | /* ClientBuilderInstantiator.kt:56 */
|
127 172 | output.build()
|
173 + | /* ProtocolParserGenerator.kt:77 */
|
128 174 | })
|
175 + | /* ProtocolParserGenerator.kt:71 */
|
129 176 | }
|
130 177 |
|
178 + | /* JsonSerializerGenerator.kt:287 */
|
131 179 | pub fn ser_disable_kinesis_streaming_destination_input(
|
132 180 | input: &crate::operation::disable_kinesis_streaming_destination::DisableKinesisStreamingDestinationInput,
|
133 181 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
182 + | /* JsonSerializerGenerator.kt:291 */
|
134 183 | let mut out = String::new();
|
184 + | /* JsonSerializerGenerator.kt:292 */
|
135 185 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
186 + | /* JsonSerializerGenerator.kt:375 */
|
136 187 | crate::protocol_serde::shape_disable_kinesis_streaming_destination_input::ser_disable_kinesis_streaming_destination_input_input(
|
137 188 | &mut object,
|
138 189 | input,
|
139 190 | )?;
|
191 + | /* JsonSerializerGenerator.kt:295 */
|
140 192 | object.finish();
|
193 + | /* JsonSerializerGenerator.kt:296 */
|
141 194 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
195 + | /* JsonSerializerGenerator.kt:287 */
|
142 196 | }
|
143 197 |
|
198 + | /* JsonParserGenerator.kt:148 */
|
144 199 | pub(crate) fn de_disable_kinesis_streaming_destination(
|
145 200 | value: &[u8],
|
146 201 | mut builder: crate::operation::disable_kinesis_streaming_destination::builders::DisableKinesisStreamingDestinationOutputBuilder,
|
147 202 | ) -> ::std::result::Result<
|
148 203 | crate::operation::disable_kinesis_streaming_destination::builders::DisableKinesisStreamingDestinationOutputBuilder,
|
149 204 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
150 205 | > {
|
206 + | /* JsonParserGenerator.kt:153 */
|
151 207 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
152 208 | let tokens = &mut tokens_owned;
|
153 209 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
210 + | /* JsonParserGenerator.kt:684 */
|
154 211 | loop {
|
212 + | /* JsonParserGenerator.kt:685 */
|
155 213 | match tokens.next().transpose()? {
|
156 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
157 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
214 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
215 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
216 + | /* JsonParserGenerator.kt:260 */
|
217 + | match key.to_unescaped()?.as_ref() {
|
218 + | /* JsonParserGenerator.kt:262 */
|
158 219 | "TableName" => {
|
220 + | /* JsonParserGenerator.kt:265 */
|
159 221 | builder = builder.set_table_name(
|
222 + | /* JsonParserGenerator.kt:354 */
|
160 223 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
161 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
162 - | .transpose()?,
|
224 + | .map(|s|
|
225 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
226 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
227 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
228 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
163 229 | );
|
230 + | /* JsonParserGenerator.kt:262 */
|
164 231 | }
|
232 + | /* JsonParserGenerator.kt:262 */
|
165 233 | "StreamArn" => {
|
234 + | /* JsonParserGenerator.kt:265 */
|
166 235 | builder = builder.set_stream_arn(
|
236 + | /* JsonParserGenerator.kt:354 */
|
167 237 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
168 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
169 - | .transpose()?,
|
238 + | .map(|s|
|
239 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
240 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
241 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
242 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
170 243 | );
|
244 + | /* JsonParserGenerator.kt:262 */
|
171 245 | }
|
246 + | /* JsonParserGenerator.kt:262 */
|
172 247 | "DestinationStatus" => {
|
248 + | /* JsonParserGenerator.kt:265 */
|
173 249 | builder = builder.set_destination_status(
|
250 + | /* JsonParserGenerator.kt:354 */
|
174 251 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
175 - | .map(|s| s.to_unescaped().map(|u| crate::types::DestinationStatus::from(u.as_ref())))
|
176 - | .transpose()?,
|
252 + | .map(|s|
|
253 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
254 + | /* JsonParserGenerator.kt:345 */crate::types::DestinationStatus::from(u.as_ref())
|
255 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
256 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
177 257 | );
|
258 + | /* JsonParserGenerator.kt:262 */
|
259 + | }
|
260 + | /* JsonParserGenerator.kt:290 */
|
261 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
178 262 | }
|
179 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
180 - | },
|
263 + | /* JsonParserGenerator.kt:686 */
|
264 + | }
|
265 + | /* JsonParserGenerator.kt:695 */
|
181 266 | other => {
|
182 267 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
183 268 | "expected object key or end object, found: {:?}",
|
184 269 | other
|
185 270 | )))
|
271 + | } /* JsonParserGenerator.kt:685 */
|
186 272 | }
|
273 + | /* JsonParserGenerator.kt:684 */
|
187 274 | }
|
188 - | }
|
275 + | /* JsonParserGenerator.kt:250 */
|
189 276 | if tokens.next().is_some() {
|
277 + | /* JsonParserGenerator.kt:251 */
|
190 278 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
191 279 | "found more JSON tokens after completing parsing",
|
192 280 | ));
|
281 + | /* JsonParserGenerator.kt:250 */
|
193 282 | }
|
283 + | /* JsonParserGenerator.kt:163 */
|
194 284 | Ok(builder)
|
285 + | /* JsonParserGenerator.kt:148 */
|
195 286 | }
|