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_contributor_insights_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_contributor_insights::DescribeContributorInsightsOutput,
|
9 11 | crate::operation::describe_contributor_insights::DescribeContributorInsightsError,
|
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_contributor_insights::DescribeContributorInsightsError::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_contributor_insights::DescribeContributorInsightsError::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" => crate::operation::describe_contributor_insights::DescribeContributorInsightsError::InternalServerError({
|
31 + | /* RustType.kt:516 */
|
23 32 | #[allow(unused_mut)]
|
24 - | let mut tmp = {
|
25 - | #[allow(unused_mut)]
|
26 - | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
27 - | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
28 - | .map_err(crate::operation::describe_contributor_insights::DescribeContributorInsightsError::unhandled)?;
|
29 - | let output = output.meta(generic);
|
30 - | output.build()
|
31 - | };
|
33 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
34 + | /* ProtocolParserGenerator.kt:146 */ {
|
35 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
36 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
37 + | /* 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_contributor_insights::DescribeContributorInsightsError::unhandled)?;
|
38 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
39 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
40 + | /* ProtocolParserGenerator.kt:146 */}
|
41 + | /* ProtocolParserGenerator.kt:145 */;
|
42 + | /* ProtocolParserGenerator.kt:170 */
|
32 43 | if tmp.message.is_none() {
|
33 44 | tmp.message = _error_message;
|
34 45 | }
|
46 + | /* ProtocolParserGenerator.kt:179 */
|
35 47 | tmp
|
48 + | /* ProtocolParserGenerator.kt:139 */
|
36 49 | }),
|
50 + | /* ProtocolParserGenerator.kt:139 */
|
37 51 | "ResourceNotFoundException" => crate::operation::describe_contributor_insights::DescribeContributorInsightsError::ResourceNotFoundError({
|
52 + | /* RustType.kt:516 */
|
38 53 | #[allow(unused_mut)]
|
39 - | let mut tmp = {
|
40 - | #[allow(unused_mut)]
|
41 - | let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
42 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
43 - | .map_err(crate::operation::describe_contributor_insights::DescribeContributorInsightsError::unhandled)?;
|
44 - | let output = output.meta(generic);
|
45 - | output.build()
|
46 - | };
|
54 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
55 + | /* ProtocolParserGenerator.kt:146 */ {
|
56 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
57 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
58 + | /* 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_contributor_insights::DescribeContributorInsightsError::unhandled)?;
|
59 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
60 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
61 + | /* ProtocolParserGenerator.kt:146 */}
|
62 + | /* ProtocolParserGenerator.kt:145 */;
|
63 + | /* ProtocolParserGenerator.kt:170 */
|
47 64 | if tmp.message.is_none() {
|
48 65 | tmp.message = _error_message;
|
49 66 | }
|
67 + | /* ProtocolParserGenerator.kt:179 */
|
50 68 | tmp
|
69 + | /* ProtocolParserGenerator.kt:139 */
|
51 70 | }),
|
52 - | _ => crate::operation::describe_contributor_insights::DescribeContributorInsightsError::generic(generic),
|
71 + | /* ProtocolParserGenerator.kt:182 */
|
72 + | _ => crate::operation::describe_contributor_insights::DescribeContributorInsightsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
53 73 | })
|
74 + | /* ProtocolParserGenerator.kt:99 */
|
54 75 | }
|
55 76 |
|
77 + | /* RustType.kt:516 */
|
56 78 | #[allow(clippy::unnecessary_wraps)]
|
79 + | /* ProtocolParserGenerator.kt:71 */
|
57 80 | pub fn de_describe_contributor_insights_http_response(
|
58 81 | _response_status: u16,
|
59 82 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
60 83 | _response_body: &[u8],
|
61 84 | ) -> std::result::Result<
|
62 85 | crate::operation::describe_contributor_insights::DescribeContributorInsightsOutput,
|
63 86 | crate::operation::describe_contributor_insights::DescribeContributorInsightsError,
|
64 87 | > {
|
88 + | /* ProtocolParserGenerator.kt:77 */
|
65 89 | Ok({
|
90 + | /* RustType.kt:516 */
|
66 91 | #[allow(unused_mut)]
|
92 + | /* ProtocolParserGenerator.kt:240 */
|
67 93 | let mut output = crate::operation::describe_contributor_insights::builders::DescribeContributorInsightsOutputBuilder::default();
|
94 + | /* ProtocolParserGenerator.kt:247 */
|
68 95 | output = crate::protocol_serde::shape_describe_contributor_insights::de_describe_contributor_insights(_response_body, output)
|
69 96 | .map_err(crate::operation::describe_contributor_insights::DescribeContributorInsightsError::unhandled)?;
|
97 + | /* ClientBuilderInstantiator.kt:56 */
|
70 98 | output.build()
|
99 + | /* ProtocolParserGenerator.kt:77 */
|
71 100 | })
|
101 + | /* ProtocolParserGenerator.kt:71 */
|
72 102 | }
|
73 103 |
|
104 + | /* JsonSerializerGenerator.kt:287 */
|
74 105 | pub fn ser_describe_contributor_insights_input(
|
75 106 | input: &crate::operation::describe_contributor_insights::DescribeContributorInsightsInput,
|
76 107 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
108 + | /* JsonSerializerGenerator.kt:291 */
|
77 109 | let mut out = String::new();
|
110 + | /* JsonSerializerGenerator.kt:292 */
|
78 111 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
112 + | /* JsonSerializerGenerator.kt:375 */
|
79 113 | crate::protocol_serde::shape_describe_contributor_insights_input::ser_describe_contributor_insights_input_input(&mut object, input)?;
|
114 + | /* JsonSerializerGenerator.kt:295 */
|
80 115 | object.finish();
|
116 + | /* JsonSerializerGenerator.kt:296 */
|
81 117 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
118 + | /* JsonSerializerGenerator.kt:287 */
|
82 119 | }
|
83 120 |
|
121 + | /* JsonParserGenerator.kt:148 */
|
84 122 | pub(crate) fn de_describe_contributor_insights(
|
85 123 | value: &[u8],
|
86 124 | mut builder: crate::operation::describe_contributor_insights::builders::DescribeContributorInsightsOutputBuilder,
|
87 125 | ) -> ::std::result::Result<
|
88 126 | crate::operation::describe_contributor_insights::builders::DescribeContributorInsightsOutputBuilder,
|
89 127 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
90 128 | > {
|
129 + | /* JsonParserGenerator.kt:153 */
|
91 130 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
92 131 | let tokens = &mut tokens_owned;
|
93 132 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
133 + | /* JsonParserGenerator.kt:684 */
|
94 134 | loop {
|
135 + | /* JsonParserGenerator.kt:685 */
|
95 136 | match tokens.next().transpose()? {
|
96 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
97 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
137 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
138 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
139 + | /* JsonParserGenerator.kt:260 */
|
140 + | match key.to_unescaped()?.as_ref() {
|
141 + | /* JsonParserGenerator.kt:262 */
|
98 142 | "TableName" => {
|
143 + | /* JsonParserGenerator.kt:265 */
|
99 144 | builder = builder.set_table_name(
|
145 + | /* JsonParserGenerator.kt:354 */
|
100 146 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
101 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
102 - | .transpose()?,
|
147 + | .map(|s|
|
148 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
149 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
150 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
151 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
103 152 | );
|
153 + | /* JsonParserGenerator.kt:262 */
|
104 154 | }
|
155 + | /* JsonParserGenerator.kt:262 */
|
105 156 | "IndexName" => {
|
157 + | /* JsonParserGenerator.kt:265 */
|
106 158 | builder = builder.set_index_name(
|
159 + | /* JsonParserGenerator.kt:354 */
|
107 160 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
108 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
109 - | .transpose()?,
|
161 + | .map(|s|
|
162 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
163 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
164 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
165 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
110 166 | );
|
167 + | /* JsonParserGenerator.kt:262 */
|
111 168 | }
|
169 + | /* JsonParserGenerator.kt:262 */
|
112 170 | "ContributorInsightsRuleList" => {
|
171 + | /* JsonParserGenerator.kt:265 */
|
113 172 | builder = builder.set_contributor_insights_rule_list(
|
114 - | crate::protocol_serde::shape_contributor_insights_rule_list::de_contributor_insights_rule_list(tokens)?,
|
115 - | );
|
173 + | /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_contributor_insights_rule_list::de_contributor_insights_rule_list(tokens)?
|
174 + | /* JsonParserGenerator.kt:265 */);
|
175 + | /* JsonParserGenerator.kt:262 */
|
116 176 | }
|
177 + | /* JsonParserGenerator.kt:262 */
|
117 178 | "ContributorInsightsStatus" => {
|
179 + | /* JsonParserGenerator.kt:265 */
|
118 180 | builder = builder.set_contributor_insights_status(
|
181 + | /* JsonParserGenerator.kt:354 */
|
119 182 | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
120 - | .map(|s| s.to_unescaped().map(|u| crate::types::ContributorInsightsStatus::from(u.as_ref())))
|
121 - | .transpose()?,
|
183 + | .map(|s|
|
184 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
185 + | /* JsonParserGenerator.kt:345 */crate::types::ContributorInsightsStatus::from(u.as_ref())
|
186 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
187 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
122 188 | );
|
189 + | /* JsonParserGenerator.kt:262 */
|
123 190 | }
|
191 + | /* JsonParserGenerator.kt:262 */
|
124 192 | "LastUpdateDateTime" => {
|
125 - | builder = builder.set_last_update_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
193 + | /* JsonParserGenerator.kt:265 */
|
194 + | builder = builder.set_last_update_date_time(
|
195 + | /* JsonParserGenerator.kt:384 */
|
196 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
126 197 | tokens.next(),
|
127 198 | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
128 - | )?);
|
199 + | )?, /* JsonParserGenerator.kt:265 */
|
200 + | );
|
201 + | /* JsonParserGenerator.kt:262 */
|
129 202 | }
|
203 + | /* JsonParserGenerator.kt:262 */
|
130 204 | "FailureException" => {
|
131 - | builder = builder.set_failure_exception(crate::protocol_serde::shape_failure_exception::de_failure_exception(tokens)?);
|
205 + | /* JsonParserGenerator.kt:265 */
|
206 + | builder = builder.set_failure_exception(
|
207 + | /* JsonParserGenerator.kt:544 */
|
208 + | crate::protocol_serde::shape_failure_exception::de_failure_exception(tokens)?, /* JsonParserGenerator.kt:265 */
|
209 + | );
|
210 + | /* JsonParserGenerator.kt:262 */
|
132 211 | }
|
133 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
134 - | },
|
212 + | /* JsonParserGenerator.kt:290 */
|
213 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
214 + | }
|
215 + | /* JsonParserGenerator.kt:686 */
|
216 + | }
|
217 + | /* JsonParserGenerator.kt:695 */
|
135 218 | other => {
|
136 219 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
137 220 | "expected object key or end object, found: {:?}",
|
138 221 | other
|
139 222 | )))
|
223 + | } /* JsonParserGenerator.kt:685 */
|
140 224 | }
|
225 + | /* JsonParserGenerator.kt:684 */
|
141 226 | }
|
142 - | }
|
227 + | /* JsonParserGenerator.kt:250 */
|
143 228 | if tokens.next().is_some() {
|
229 + | /* JsonParserGenerator.kt:251 */
|
144 230 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
145 231 | "found more JSON tokens after completing parsing",
|
146 232 | ));
|
233 + | /* JsonParserGenerator.kt:250 */
|
147 234 | }
|
235 + | /* JsonParserGenerator.kt:163 */
|
148 236 | Ok(builder)
|
237 + | /* JsonParserGenerator.kt:148 */
|
149 238 | }
|