1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_update_global_table_settings_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_global_table_settings::UpdateGlobalTableSettingsOutput,
|
9 - | crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
|
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_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
14 - | let generic = generic_builder.build();
|
15 - | let error_code = match generic.code() {
|
16 - | Some(code) => code,
|
17 - | None => {
|
18 - | return Err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled(
|
19 - | generic,
|
20 - | ))
|
21 - | }
|
22 - | };
|
23 - |
|
24 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
25 - | Err(match error_code {
|
26 - | "GlobalTableNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::GlobalTableNotFoundError({
|
27 - | #[allow(unused_mut)]
|
28 - | let mut tmp = {
|
29 - | #[allow(unused_mut)]
|
30 - | let mut output = crate::types::error::builders::GlobalTableNotFoundErrorBuilder::default();
|
31 - | output = crate::protocol_serde::shape_global_table_not_found_exception::de_global_table_not_found_exception_json_err(
|
32 - | _response_body,
|
33 - | output,
|
34 - | )
|
35 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
36 - | let output = output.meta(generic);
|
37 - | output.build()
|
38 - | };
|
39 - | if tmp.message.is_none() {
|
40 - | tmp.message = _error_message;
|
41 - | }
|
42 - | tmp
|
43 - | }),
|
44 - | "IndexNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::IndexNotFoundError({
|
45 - | #[allow(unused_mut)]
|
46 - | let mut tmp = {
|
47 - | #[allow(unused_mut)]
|
48 - | let mut output = crate::types::error::builders::IndexNotFoundErrorBuilder::default();
|
49 - | output = crate::protocol_serde::shape_index_not_found_exception::de_index_not_found_exception_json_err(_response_body, output)
|
50 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
51 - | let output = output.meta(generic);
|
52 - | output.build()
|
53 - | };
|
54 - | if tmp.message.is_none() {
|
55 - | tmp.message = _error_message;
|
56 - | }
|
57 - | tmp
|
58 - | }),
|
59 - | "InternalServerError" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::InternalServerError({
|
60 - | #[allow(unused_mut)]
|
61 - | let mut tmp = {
|
62 - | #[allow(unused_mut)]
|
63 - | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
64 - | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
65 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
66 - | let output = output.meta(generic);
|
67 - | output.build()
|
68 - | };
|
69 - | if tmp.message.is_none() {
|
70 - | tmp.message = _error_message;
|
71 - | }
|
72 - | tmp
|
73 - | }),
|
74 - | "InvalidEndpointException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::InvalidEndpointError({
|
75 - | #[allow(unused_mut)]
|
76 - | let mut tmp = {
|
77 - | #[allow(unused_mut)]
|
78 - | let mut output = crate::types::error::builders::InvalidEndpointErrorBuilder::default();
|
79 - | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
80 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
81 - | let output = output.meta(generic);
|
82 - | output.build()
|
83 - | };
|
84 - | if tmp.message.is_none() {
|
85 - | tmp.message = _error_message;
|
86 - | }
|
87 - | tmp
|
88 - | }),
|
89 - | "LimitExceededException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::LimitExceededError({
|
90 - | #[allow(unused_mut)]
|
91 - | let mut tmp = {
|
92 - | #[allow(unused_mut)]
|
93 - | let mut output = crate::types::error::builders::LimitExceededErrorBuilder::default();
|
94 - | output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
|
95 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
96 - | let output = output.meta(generic);
|
97 - | output.build()
|
98 - | };
|
99 - | if tmp.message.is_none() {
|
100 - | tmp.message = _error_message;
|
101 - | }
|
102 - | tmp
|
103 - | }),
|
104 - | "ReplicaNotFoundException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::ReplicaNotFoundError({
|
105 - | #[allow(unused_mut)]
|
106 - | let mut tmp = {
|
107 - | #[allow(unused_mut)]
|
108 - | let mut output = crate::types::error::builders::ReplicaNotFoundErrorBuilder::default();
|
109 - | output = crate::protocol_serde::shape_replica_not_found_exception::de_replica_not_found_exception_json_err(_response_body, output)
|
110 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
111 - | let output = output.meta(generic);
|
112 - | output.build()
|
113 - | };
|
114 - | if tmp.message.is_none() {
|
115 - | tmp.message = _error_message;
|
116 - | }
|
117 - | tmp
|
118 - | }),
|
119 - | "ResourceInUseException" => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::ResourceInUseError({
|
120 - | #[allow(unused_mut)]
|
121 - | let mut tmp = {
|
122 - | #[allow(unused_mut)]
|
123 - | let mut output = crate::types::error::builders::ResourceInUseErrorBuilder::default();
|
124 - | output = crate::protocol_serde::shape_resource_in_use_exception::de_resource_in_use_exception_json_err(_response_body, output)
|
125 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
126 - | let output = output.meta(generic);
|
127 - | output.build()
|
128 - | };
|
129 - | if tmp.message.is_none() {
|
130 - | tmp.message = _error_message;
|
131 - | }
|
132 - | tmp
|
133 - | }),
|
134 - | _ => crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::generic(generic),
|
135 - | })
|
136 - | }
|
137 - |
|
138 - | #[allow(clippy::unnecessary_wraps)]
|
139 - | pub fn de_update_global_table_settings_http_response(
|
140 - | _response_status: u16,
|
141 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
142 - | _response_body: &[u8],
|
143 - | ) -> std::result::Result<
|
144 - | crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
|
145 - | crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
|
146 - | > {
|
147 - | Ok({
|
148 - | #[allow(unused_mut)]
|
149 - | let mut output = crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder::default();
|
150 - | output = crate::protocol_serde::shape_update_global_table_settings::de_update_global_table_settings(_response_body, output)
|
151 - | .map_err(crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError::unhandled)?;
|
152 - | output.build()
|
153 - | })
|
154 - | }
|
155 - |
|
156 - | pub fn ser_update_global_table_settings_input(
|
157 - | input: &crate::operation::update_global_table_settings::UpdateGlobalTableSettingsInput,
|
158 - | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
159 - | let mut out = String::new();
|
160 - | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
161 - | crate::protocol_serde::shape_update_global_table_settings_input::ser_update_global_table_settings_input_input(&mut object, input)?;
|
162 - | object.finish();
|
163 - | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
164 - | }
|
165 - |
|
166 - | pub(crate) fn de_update_global_table_settings(
|
167 - | _value: &[u8],
|
168 - | mut builder: crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder,
|
169 - | ) -> ::std::result::Result<
|
170 - | crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsOutputBuilder,
|
171 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
172 - | > {
|
173 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
174 - | let tokens = &mut tokens_owned;
|
175 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
176 - | loop {
|
177 - | match tokens.next().transpose()? {
|
178 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
179 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
180 - | "GlobalTableName" => {
|
181 - | builder = builder.set_global_table_name(
|
182 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
183 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
184 - | .transpose()?,
|
185 - | );
|
186 - | }
|
187 - | "ReplicaSettings" => {
|
188 - | builder = builder.set_replica_settings(
|
189 - | crate::protocol_serde::shape_replica_settings_description_list::de_replica_settings_description_list(tokens, _value)?,
|
190 - | );
|
191 - | }
|
192 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
193 - | },
|
194 - | other => {
|
195 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
196 - | "expected object key or end object, found: {other:?}"
|
197 - | )))
|
198 - | }
|
199 - | }
|
200 - | }
|
201 - | if tokens.next().is_some() {
|
202 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
203 - | "found more JSON tokens after completing parsing",
|
204 - | ));
|
205 - | }
|
206 - | Ok(builder)
|
207 - | }
|