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_describe_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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationOutput,
|
9 11 | crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError,
|
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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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 | "ResourceNotFoundException" => {
|
57 77 | crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::ResourceNotFoundError({
|
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::ResourceNotFoundErrorBuilder::default();
|
62 - | output =
|
63 - | crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
64 - | .map_err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled)?;
|
65 - | let output = output.meta(generic);
|
66 - | output.build()
|
67 - | };
|
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::ResourceNotFoundErrorBuilder::default();
|
84 + | /* 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::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::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 */
|
68 90 | if tmp.message.is_none() {
|
69 91 | tmp.message = _error_message;
|
70 92 | }
|
93 + | /* ProtocolParserGenerator.kt:179 */
|
71 94 | tmp
|
95 + | /* ProtocolParserGenerator.kt:139 */
|
72 96 | })
|
73 97 | }
|
74 - | _ => crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::generic(generic),
|
98 + | /* ProtocolParserGenerator.kt:182 */
|
99 + | _ => crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
75 100 | })
|
101 + | /* ProtocolParserGenerator.kt:99 */
|
76 102 | }
|
77 103 |
|
104 + | /* RustType.kt:516 */
|
78 105 | #[allow(clippy::unnecessary_wraps)]
|
106 + | /* ProtocolParserGenerator.kt:71 */
|
79 107 | pub fn de_describe_kinesis_streaming_destination_http_response(
|
80 108 | _response_status: u16,
|
81 109 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
82 110 | _response_body: &[u8],
|
83 111 | ) -> std::result::Result<
|
84 112 | crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationOutput,
|
85 113 | crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError,
|
86 114 | > {
|
115 + | /* ProtocolParserGenerator.kt:77 */
|
87 116 | Ok({
|
117 + | /* RustType.kt:516 */
|
88 118 | #[allow(unused_mut)]
|
119 + | /* ProtocolParserGenerator.kt:240 */
|
89 120 | let mut output =
|
90 121 | crate::operation::describe_kinesis_streaming_destination::builders::DescribeKinesisStreamingDestinationOutputBuilder::default();
|
122 + | /* ProtocolParserGenerator.kt:247 */
|
91 123 | output =
|
92 124 | crate::protocol_serde::shape_describe_kinesis_streaming_destination::de_describe_kinesis_streaming_destination(_response_body, output)
|
93 125 | .map_err(crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationError::unhandled)?;
|
126 + | /* ClientBuilderInstantiator.kt:56 */
|
94 127 | output.build()
|
128 + | /* ProtocolParserGenerator.kt:77 */
|
95 129 | })
|
130 + | /* ProtocolParserGenerator.kt:71 */
|
96 131 | }
|
97 132 |
|
133 + | /* JsonSerializerGenerator.kt:287 */
|
98 134 | pub fn ser_describe_kinesis_streaming_destination_input(
|
99 135 | input: &crate::operation::describe_kinesis_streaming_destination::DescribeKinesisStreamingDestinationInput,
|
100 136 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
137 + | /* JsonSerializerGenerator.kt:291 */
|
101 138 | let mut out = String::new();
|
139 + | /* JsonSerializerGenerator.kt:292 */
|
102 140 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
141 + | /* JsonSerializerGenerator.kt:375 */
|
103 142 | crate::protocol_serde::shape_describe_kinesis_streaming_destination_input::ser_describe_kinesis_streaming_destination_input_input(
|
104 143 | &mut object,
|
105 144 | input,
|
106 145 | )?;
|
146 + | /* JsonSerializerGenerator.kt:295 */
|
107 147 | object.finish();
|
148 + | /* JsonSerializerGenerator.kt:296 */
|
108 149 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
150 + | /* JsonSerializerGenerator.kt:287 */
|
109 151 | }
|
110 152 |
|
153 + | /* JsonParserGenerator.kt:148 */
|
111 154 | pub(crate) fn de_describe_kinesis_streaming_destination(
|
112 155 | value: &[u8],
|
113 156 | mut builder: crate::operation::describe_kinesis_streaming_destination::builders::DescribeKinesisStreamingDestinationOutputBuilder,
|
114 157 | ) -> ::std::result::Result<
|
115 158 | crate::operation::describe_kinesis_streaming_destination::builders::DescribeKinesisStreamingDestinationOutputBuilder,
|
116 159 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
117 160 | > {
|
161 + | /* JsonParserGenerator.kt:153 */
|
118 162 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
119 163 | let tokens = &mut tokens_owned;
|
120 164 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
165 + | /* JsonParserGenerator.kt:684 */
|
121 166 | loop {
|
167 + | /* JsonParserGenerator.kt:685 */
|
122 168 | match tokens.next().transpose()? {
|
123 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
124 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
125 - | "TableName" => {
|
126 - | builder = builder.set_table_name(
|
127 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
128 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
129 - | .transpose()?,
|
130 - | );
|
169 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
170 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
171 + | /* JsonParserGenerator.kt:260 */
|
172 + | match key.to_unescaped()?.as_ref() {
|
173 + | /* JsonParserGenerator.kt:262 */
|
174 + | "TableName" => {
|
175 + | /* JsonParserGenerator.kt:265 */
|
176 + | builder = builder.set_table_name(
|
177 + | /* JsonParserGenerator.kt:354 */
|
178 + | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
179 + | .map(|s|
|
180 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
181 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
182 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
183 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
184 + | );
|
185 + | /* JsonParserGenerator.kt:262 */
|
186 + | }
|
187 + | /* JsonParserGenerator.kt:262 */
|
188 + | "KinesisDataStreamDestinations" => {
|
189 + | /* JsonParserGenerator.kt:265 */
|
190 + | builder = builder.set_kinesis_data_stream_destinations(
|
191 + | /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_kinesis_data_stream_destinations::de_kinesis_data_stream_destinations(tokens)?
|
192 + | /* JsonParserGenerator.kt:265 */);
|
193 + | /* JsonParserGenerator.kt:262 */
|
194 + | }
|
195 + | /* JsonParserGenerator.kt:290 */
|
196 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
131 197 | }
|
132 - | "KinesisDataStreamDestinations" => {
|
133 - | builder = builder.set_kinesis_data_stream_destinations(
|
134 - | crate::protocol_serde::shape_kinesis_data_stream_destinations::de_kinesis_data_stream_destinations(tokens)?,
|
135 - | );
|
136 - | }
|
137 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
138 - | },
|
198 + | /* JsonParserGenerator.kt:686 */
|
199 + | }
|
200 + | /* JsonParserGenerator.kt:695 */
|
139 201 | other => {
|
140 202 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
141 203 | "expected object key or end object, found: {:?}",
|
142 204 | other
|
143 205 | )))
|
144 - | }
|
206 + | } /* JsonParserGenerator.kt:685 */
|
145 207 | }
|
208 + | /* JsonParserGenerator.kt:684 */
|
146 209 | }
|
210 + | /* JsonParserGenerator.kt:250 */
|
147 211 | if tokens.next().is_some() {
|
212 + | /* JsonParserGenerator.kt:251 */
|
148 213 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
149 214 | "found more JSON tokens after completing parsing",
|
150 215 | ));
|
216 + | /* JsonParserGenerator.kt:250 */
|
151 217 | }
|
218 + | /* JsonParserGenerator.kt:163 */
|
152 219 | Ok(builder)
|
220 + | /* JsonParserGenerator.kt:148 */
|
153 221 | }
|