1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_update_dev_environment_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<
|
8 - | crate::operation::update_dev_environment::UpdateDevEnvironmentOutput,
|
9 - | crate::operation::update_dev_environment::UpdateDevEnvironmentError,
|
10 - | > {
|
11 - | #[allow(unused_mut)]
|
12 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
14 - | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 - | let generic = generic_builder.build();
|
16 - | let error_code = match generic.code() {
|
17 - | Some(code) => code,
|
18 - | None => return Err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "AccessDeniedException" => crate::operation::update_dev_environment::UpdateDevEnvironmentError::AccessDeniedException({
|
24 - | #[allow(unused_mut)]
|
25 - | let mut tmp = {
|
26 - | #[allow(unused_mut)]
|
27 - | let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
|
28 - | output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
|
29 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
30 - | let output = output.meta(generic);
|
31 - | crate::serde_util::access_denied_exception_correct_errors(output)
|
32 - | .build()
|
33 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
34 - | };
|
35 - | tmp
|
36 - | }),
|
37 - | "ConflictException" => crate::operation::update_dev_environment::UpdateDevEnvironmentError::ConflictException({
|
38 - | #[allow(unused_mut)]
|
39 - | let mut tmp = {
|
40 - | #[allow(unused_mut)]
|
41 - | let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
|
42 - | output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
|
43 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
44 - | let output = output.meta(generic);
|
45 - | crate::serde_util::conflict_exception_correct_errors(output)
|
46 - | .build()
|
47 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
48 - | };
|
49 - | tmp
|
50 - | }),
|
51 - | "ResourceNotFoundException" => crate::operation::update_dev_environment::UpdateDevEnvironmentError::ResourceNotFoundException({
|
52 - | #[allow(unused_mut)]
|
53 - | let mut tmp = {
|
54 - | #[allow(unused_mut)]
|
55 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
56 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
57 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
58 - | let output = output.meta(generic);
|
59 - | crate::serde_util::resource_not_found_exception_correct_errors(output)
|
60 - | .build()
|
61 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
62 - | };
|
63 - | tmp
|
64 - | }),
|
65 - | "ServiceQuotaExceededException" => crate::operation::update_dev_environment::UpdateDevEnvironmentError::ServiceQuotaExceededException({
|
66 - | #[allow(unused_mut)]
|
67 - | let mut tmp = {
|
68 - | #[allow(unused_mut)]
|
69 - | let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
|
70 - | output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
|
71 - | _response_body,
|
72 - | output,
|
73 - | )
|
74 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
75 - | let output = output.meta(generic);
|
76 - | crate::serde_util::service_quota_exceeded_exception_correct_errors(output)
|
77 - | .build()
|
78 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
79 - | };
|
80 - | tmp
|
81 - | }),
|
82 - | "ThrottlingException" => crate::operation::update_dev_environment::UpdateDevEnvironmentError::ThrottlingException({
|
83 - | #[allow(unused_mut)]
|
84 - | let mut tmp = {
|
85 - | #[allow(unused_mut)]
|
86 - | let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
|
87 - | output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
|
88 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
89 - | let output = output.meta(generic);
|
90 - | crate::serde_util::throttling_exception_correct_errors(output)
|
91 - | .build()
|
92 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
93 - | };
|
94 - | tmp
|
95 - | }),
|
96 - | "ValidationException" => crate::operation::update_dev_environment::UpdateDevEnvironmentError::ValidationException({
|
97 - | #[allow(unused_mut)]
|
98 - | let mut tmp = {
|
99 - | #[allow(unused_mut)]
|
100 - | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
101 - | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
102 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
103 - | let output = output.meta(generic);
|
104 - | crate::serde_util::validation_exception_correct_errors(output)
|
105 - | .build()
|
106 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
107 - | };
|
108 - | tmp
|
109 - | }),
|
110 - | _ => crate::operation::update_dev_environment::UpdateDevEnvironmentError::generic(generic),
|
111 - | })
|
112 - | }
|
113 - |
|
114 - | #[allow(clippy::unnecessary_wraps)]
|
115 - | pub fn de_update_dev_environment_http_response(
|
116 - | _response_status: u16,
|
117 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
118 - | _response_body: &[u8],
|
119 - | ) -> std::result::Result<
|
120 - | crate::operation::update_dev_environment::UpdateDevEnvironmentOutput,
|
121 - | crate::operation::update_dev_environment::UpdateDevEnvironmentError,
|
122 - | > {
|
123 - | Ok({
|
124 - | #[allow(unused_mut)]
|
125 - | let mut output = crate::operation::update_dev_environment::builders::UpdateDevEnvironmentOutputBuilder::default();
|
126 - | output = crate::protocol_serde::shape_update_dev_environment::de_update_dev_environment(_response_body, output)
|
127 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?;
|
128 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
129 - | crate::serde_util::update_dev_environment_output_output_correct_errors(output)
|
130 - | .build()
|
131 - | .map_err(crate::operation::update_dev_environment::UpdateDevEnvironmentError::unhandled)?
|
132 - | })
|
133 - | }
|
134 - |
|
135 - | pub fn ser_update_dev_environment_input(
|
136 - | input: &crate::operation::update_dev_environment::UpdateDevEnvironmentInput,
|
137 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
138 - | let mut out = String::new();
|
139 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
140 - | crate::protocol_serde::shape_update_dev_environment_input::ser_update_dev_environment_input_input(&mut object, input)?;
|
141 - | object.finish();
|
142 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
143 - | }
|
144 - |
|
145 - | pub(crate) fn de_update_dev_environment(
|
146 - | _value: &[u8],
|
147 - | mut builder: crate::operation::update_dev_environment::builders::UpdateDevEnvironmentOutputBuilder,
|
148 - | ) -> ::std::result::Result<
|
149 - | crate::operation::update_dev_environment::builders::UpdateDevEnvironmentOutputBuilder,
|
150 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
151 - | > {
|
152 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
153 - | let tokens = &mut tokens_owned;
|
154 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
155 - | loop {
|
156 - | match tokens.next().transpose()? {
|
157 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
158 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
159 - | "alias" => {
|
160 - | builder = builder.set_alias(
|
161 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
162 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
163 - | .transpose()?,
|
164 - | );
|
165 - | }
|
166 - | "clientToken" => {
|
167 - | builder = builder.set_client_token(
|
168 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
169 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
170 - | .transpose()?,
|
171 - | );
|
172 - | }
|
173 - | "id" => {
|
174 - | builder = builder.set_id(
|
175 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
176 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
177 - | .transpose()?,
|
178 - | );
|
179 - | }
|
180 - | "ides" => {
|
181 - | builder = builder.set_ides(crate::protocol_serde::shape_ide_configuration_list::de_ide_configuration_list(
|
182 - | tokens, _value,
|
183 - | )?);
|
184 - | }
|
185 - | "inactivityTimeoutMinutes" => {
|
186 - | builder = builder.set_inactivity_timeout_minutes(
|
187 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
188 - | .map(i32::try_from)
|
189 - | .transpose()?,
|
190 - | );
|
191 - | }
|
192 - | "instanceType" => {
|
193 - | builder = builder.set_instance_type(
|
194 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
195 - | .map(|s| s.to_unescaped().map(|u| crate::types::InstanceType::from(u.as_ref())))
|
196 - | .transpose()?,
|
197 - | );
|
198 - | }
|
199 - | "projectName" => {
|
200 - | builder = builder.set_project_name(
|
201 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
202 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
203 - | .transpose()?,
|
204 - | );
|
205 - | }
|
206 - | "spaceName" => {
|
207 - | builder = builder.set_space_name(
|
208 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
209 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
210 - | .transpose()?,
|
211 - | );
|
212 - | }
|
213 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
214 - | },
|
215 - | other => {
|
216 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
217 - | "expected object key or end object, found: {other:?}"
|
218 - | )))
|
219 - | }
|
220 - | }
|
221 - | }
|
222 - | if tokens.next().is_some() {
|
223 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
224 - | "found more JSON tokens after completing parsing",
|
225 - | ));
|
226 - | }
|
227 - | Ok(builder)
|
228 - | }
|