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_list_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::list_contributor_insights::ListContributorInsightsOutput,
|
9 11 | crate::operation::list_contributor_insights::ListContributorInsightsError,
|
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::list_contributor_insights::ListContributorInsightsError::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 => {
|
18 24 | return Err(crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled(
|
19 25 | generic,
|
20 26 | ))
|
21 27 | }
|
22 28 | };
|
23 29 |
|
24 30 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
31 + | /* ProtocolParserGenerator.kt:133 */
|
25 32 | Err(match error_code {
|
33 + | /* ProtocolParserGenerator.kt:139 */
|
26 34 | "InternalServerError" => crate::operation::list_contributor_insights::ListContributorInsightsError::InternalServerError({
|
35 + | /* RustType.kt:516 */
|
27 36 | #[allow(unused_mut)]
|
28 - | let mut tmp = {
|
29 - | #[allow(unused_mut)]
|
30 - | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
31 - | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
32 - | .map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled)?;
|
33 - | let output = output.meta(generic);
|
34 - | output.build()
|
35 - | };
|
37 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
38 + | /* ProtocolParserGenerator.kt:146 */ {
|
39 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
40 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
41 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output).map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled)?;
|
42 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
43 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
44 + | /* ProtocolParserGenerator.kt:146 */}
|
45 + | /* ProtocolParserGenerator.kt:145 */;
|
46 + | /* ProtocolParserGenerator.kt:170 */
|
36 47 | if tmp.message.is_none() {
|
37 48 | tmp.message = _error_message;
|
38 49 | }
|
50 + | /* ProtocolParserGenerator.kt:179 */
|
39 51 | tmp
|
52 + | /* ProtocolParserGenerator.kt:139 */
|
40 53 | }),
|
54 + | /* ProtocolParserGenerator.kt:139 */
|
41 55 | "ResourceNotFoundException" => crate::operation::list_contributor_insights::ListContributorInsightsError::ResourceNotFoundError({
|
56 + | /* RustType.kt:516 */
|
42 57 | #[allow(unused_mut)]
|
43 - | let mut tmp = {
|
44 - | #[allow(unused_mut)]
|
45 - | let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
46 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
47 - | .map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled)?;
|
48 - | let output = output.meta(generic);
|
49 - | output.build()
|
50 - | };
|
58 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
59 + | /* ProtocolParserGenerator.kt:146 */ {
|
60 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
61 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
62 + | /* 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::list_contributor_insights::ListContributorInsightsError::unhandled)?;
|
63 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
64 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
65 + | /* ProtocolParserGenerator.kt:146 */}
|
66 + | /* ProtocolParserGenerator.kt:145 */;
|
67 + | /* ProtocolParserGenerator.kt:170 */
|
51 68 | if tmp.message.is_none() {
|
52 69 | tmp.message = _error_message;
|
53 70 | }
|
71 + | /* ProtocolParserGenerator.kt:179 */
|
54 72 | tmp
|
73 + | /* ProtocolParserGenerator.kt:139 */
|
55 74 | }),
|
56 - | _ => crate::operation::list_contributor_insights::ListContributorInsightsError::generic(generic),
|
75 + | /* ProtocolParserGenerator.kt:182 */
|
76 + | _ => crate::operation::list_contributor_insights::ListContributorInsightsError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
57 77 | })
|
78 + | /* ProtocolParserGenerator.kt:99 */
|
58 79 | }
|
59 80 |
|
81 + | /* RustType.kt:516 */
|
60 82 | #[allow(clippy::unnecessary_wraps)]
|
83 + | /* ProtocolParserGenerator.kt:71 */
|
61 84 | pub fn de_list_contributor_insights_http_response(
|
62 85 | _response_status: u16,
|
63 86 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
64 87 | _response_body: &[u8],
|
65 88 | ) -> std::result::Result<
|
66 89 | crate::operation::list_contributor_insights::ListContributorInsightsOutput,
|
67 90 | crate::operation::list_contributor_insights::ListContributorInsightsError,
|
68 91 | > {
|
92 + | /* ProtocolParserGenerator.kt:77 */
|
69 93 | Ok({
|
94 + | /* RustType.kt:516 */
|
70 95 | #[allow(unused_mut)]
|
96 + | /* ProtocolParserGenerator.kt:240 */
|
71 97 | let mut output = crate::operation::list_contributor_insights::builders::ListContributorInsightsOutputBuilder::default();
|
98 + | /* ProtocolParserGenerator.kt:247 */
|
72 99 | output = crate::protocol_serde::shape_list_contributor_insights::de_list_contributor_insights(_response_body, output)
|
73 100 | .map_err(crate::operation::list_contributor_insights::ListContributorInsightsError::unhandled)?;
|
101 + | /* ClientBuilderInstantiator.kt:56 */
|
74 102 | output.build()
|
103 + | /* ProtocolParserGenerator.kt:77 */
|
75 104 | })
|
105 + | /* ProtocolParserGenerator.kt:71 */
|
76 106 | }
|
77 107 |
|
108 + | /* JsonSerializerGenerator.kt:287 */
|
78 109 | pub fn ser_list_contributor_insights_input(
|
79 110 | input: &crate::operation::list_contributor_insights::ListContributorInsightsInput,
|
80 111 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
112 + | /* JsonSerializerGenerator.kt:291 */
|
81 113 | let mut out = String::new();
|
114 + | /* JsonSerializerGenerator.kt:292 */
|
82 115 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
116 + | /* JsonSerializerGenerator.kt:375 */
|
83 117 | crate::protocol_serde::shape_list_contributor_insights_input::ser_list_contributor_insights_input_input(&mut object, input)?;
|
118 + | /* JsonSerializerGenerator.kt:295 */
|
84 119 | object.finish();
|
120 + | /* JsonSerializerGenerator.kt:296 */
|
85 121 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
122 + | /* JsonSerializerGenerator.kt:287 */
|
86 123 | }
|
87 124 |
|
125 + | /* JsonParserGenerator.kt:148 */
|
88 126 | pub(crate) fn de_list_contributor_insights(
|
89 127 | value: &[u8],
|
90 128 | mut builder: crate::operation::list_contributor_insights::builders::ListContributorInsightsOutputBuilder,
|
91 129 | ) -> ::std::result::Result<
|
92 130 | crate::operation::list_contributor_insights::builders::ListContributorInsightsOutputBuilder,
|
93 131 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
94 132 | > {
|
133 + | /* JsonParserGenerator.kt:153 */
|
95 134 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
96 135 | let tokens = &mut tokens_owned;
|
97 136 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
137 + | /* JsonParserGenerator.kt:684 */
|
98 138 | loop {
|
139 + | /* JsonParserGenerator.kt:685 */
|
99 140 | match tokens.next().transpose()? {
|
100 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
101 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
102 - | "ContributorInsightsSummaries" => {
|
103 - | builder = builder.set_contributor_insights_summaries(
|
104 - | crate::protocol_serde::shape_contributor_insights_summaries::de_contributor_insights_summaries(tokens)?,
|
105 - | );
|
141 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
142 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
143 + | /* JsonParserGenerator.kt:260 */
|
144 + | match key.to_unescaped()?.as_ref() {
|
145 + | /* JsonParserGenerator.kt:262 */
|
146 + | "ContributorInsightsSummaries" => {
|
147 + | /* JsonParserGenerator.kt:265 */
|
148 + | builder = builder.set_contributor_insights_summaries(
|
149 + | /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_contributor_insights_summaries::de_contributor_insights_summaries(tokens)?
|
150 + | /* JsonParserGenerator.kt:265 */);
|
151 + | /* JsonParserGenerator.kt:262 */
|
152 + | }
|
153 + | /* JsonParserGenerator.kt:262 */
|
154 + | "NextToken" => {
|
155 + | /* JsonParserGenerator.kt:265 */
|
156 + | builder = builder.set_next_token(
|
157 + | /* JsonParserGenerator.kt:354 */
|
158 + | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
159 + | .map(|s|
|
160 + | /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
|
161 + | /* JsonParserGenerator.kt:348 */u.into_owned()
|
162 + | /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
|
163 + | .transpose()?, /* JsonParserGenerator.kt:265 */
|
164 + | );
|
165 + | /* JsonParserGenerator.kt:262 */
|
166 + | }
|
167 + | /* JsonParserGenerator.kt:290 */
|
168 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
106 169 | }
|
107 - | "NextToken" => {
|
108 - | builder = builder.set_next_token(
|
109 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
110 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
111 - | .transpose()?,
|
112 - | );
|
113 - | }
|
114 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
115 - | },
|
170 + | /* JsonParserGenerator.kt:686 */
|
171 + | }
|
172 + | /* JsonParserGenerator.kt:695 */
|
116 173 | other => {
|
117 174 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
118 175 | "expected object key or end object, found: {:?}",
|
119 176 | other
|
120 177 | )))
|
121 - | }
|
178 + | } /* JsonParserGenerator.kt:685 */
|
122 179 | }
|
180 + | /* JsonParserGenerator.kt:684 */
|
123 181 | }
|
182 + | /* JsonParserGenerator.kt:250 */
|
124 183 | if tokens.next().is_some() {
|
184 + | /* JsonParserGenerator.kt:251 */
|
125 185 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
126 186 | "found more JSON tokens after completing parsing",
|
127 187 | ));
|
188 + | /* JsonParserGenerator.kt:250 */
|
128 189 | }
|
190 + | /* JsonParserGenerator.kt:163 */
|
129 191 | Ok(builder)
|
192 + | /* JsonParserGenerator.kt:148 */
|
130 193 | }
|