1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | /// Orchestration and serialization glue logic for `HttpEnumPayload2`.
|
2 + | /// Orchestration and serialization glue logic for `ContentTypeParameters`.
|
3 3 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4 4 | #[non_exhaustive]
|
5 - | pub struct HttpEnumPayload2;
|
6 - | impl HttpEnumPayload2 {
|
7 - | /// Creates a new `HttpEnumPayload2`
|
5 + | pub struct ContentTypeParameters;
|
6 + | impl ContentTypeParameters {
|
7 + | /// Creates a new `ContentTypeParameters`
|
8 8 | pub fn new() -> Self {
|
9 9 | Self
|
10 10 | }
|
11 11 | pub(crate) async fn orchestrate(
|
12 12 | runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
13 - | input: crate::operation::http_enum_payload2::HttpEnumPayload2Input,
|
13 + | input: crate::operation::content_type_parameters::ContentTypeParametersInput,
|
14 14 | ) -> ::std::result::Result<
|
15 - | crate::operation::http_enum_payload2::HttpEnumPayload2Output,
|
15 + | crate::operation::content_type_parameters::ContentTypeParametersOutput,
|
16 16 | ::aws_smithy_runtime_api::client::result::SdkError<
|
17 - | crate::operation::http_enum_payload2::HttpEnumPayload2Error,
|
17 + | crate::operation::content_type_parameters::ContentTypeParametersError,
|
18 18 | ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
19 19 | >,
|
20 20 | > {
|
21 21 | let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
|
22 22 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
23 23 | ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
24 24 | >| {
|
25 25 | err.map_service_error(|err| {
|
26 - | err.downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Error>()
|
26 + | err.downcast::<crate::operation::content_type_parameters::ContentTypeParametersError>()
|
27 27 | .expect("correct error type")
|
28 28 | })
|
29 29 | };
|
30 30 | let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
|
31 31 | .await
|
32 32 | .map_err(map_err)?;
|
33 33 | let output = context.finalize().map_err(map_err)?;
|
34 34 | ::std::result::Result::Ok(
|
35 35 | output
|
36 - | .downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Output>()
|
36 + | .downcast::<crate::operation::content_type_parameters::ContentTypeParametersOutput>()
|
37 37 | .expect("correct output type"),
|
38 38 | )
|
39 39 | }
|
40 40 |
|
41 41 | pub(crate) async fn orchestrate_with_stop_point(
|
42 42 | runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
43 - | input: crate::operation::http_enum_payload2::HttpEnumPayload2Input,
|
43 + | input: crate::operation::content_type_parameters::ContentTypeParametersInput,
|
44 44 | stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
|
45 45 | ) -> ::std::result::Result<
|
46 46 | ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
|
47 47 | ::aws_smithy_runtime_api::client::result::SdkError<
|
48 48 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
49 49 | ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
50 50 | >,
|
51 51 | > {
|
52 52 | let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
|
53 - | ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("restjsonprotocol", "HttpEnumPayload2", input, runtime_plugins, stop_point)
|
53 + | ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("jsonrpc10", "ContentTypeParameters", input, runtime_plugins, stop_point)
|
54 54 | .await
|
55 55 | }
|
56 56 |
|
57 57 | pub(crate) fn operation_runtime_plugins(
|
58 58 | client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
|
59 59 | client_config: &crate::config::Config,
|
60 60 | config_override: ::std::option::Option<crate::config::Builder>,
|
61 61 | ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
|
62 62 | let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
|
63 63 | runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
|
64 64 | ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
|
65 65 | ]));
|
66 66 | if let ::std::option::Option::Some(config_override) = config_override {
|
67 67 | for plugin in config_override.runtime_plugins.iter().cloned() {
|
68 68 | runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
|
69 69 | }
|
70 70 | runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
|
71 71 | config_override,
|
72 72 | client_config.config.clone(),
|
73 73 | &client_config.runtime_components,
|
74 74 | ));
|
75 75 | }
|
76 76 | runtime_plugins
|
77 77 | }
|
78 78 | }
|
79 - | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for HttpEnumPayload2 {
|
79 + | impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ContentTypeParameters {
|
80 80 | fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
|
81 - | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("HttpEnumPayload2");
|
81 + | let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ContentTypeParameters");
|
82 82 |
|
83 83 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
|
84 - | HttpEnumPayload2RequestSerializer,
|
84 + | ContentTypeParametersRequestSerializer,
|
85 85 | ));
|
86 86 | cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
|
87 - | HttpEnumPayload2ResponseDeserializer,
|
87 + | ContentTypeParametersResponseDeserializer,
|
88 88 | ));
|
89 89 |
|
90 90 | cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
|
91 91 | ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
|
92 92 | ));
|
93 93 |
|
94 94 | cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
|
95 - | "HttpEnumPayload2",
|
96 - | "restjsonprotocol",
|
95 + | "ContentTypeParameters",
|
96 + | "jsonrpc10",
|
97 97 | ));
|
98 98 |
|
99 99 | ::std::option::Option::Some(cfg.freeze())
|
100 100 | }
|
101 101 |
|
102 102 | fn runtime_components(
|
103 103 | &self,
|
104 104 | _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
|
105 105 | ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
|
106 106 | #[allow(unused_mut)]
|
107 - | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("HttpEnumPayload2")
|
107 + | let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ContentTypeParameters")
|
108 108 | .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
|
109 - | .with_interceptor(HttpEnumPayload2EndpointParamsInterceptor)
|
109 + | .with_interceptor(ContentTypeParametersEndpointParamsInterceptor)
|
110 110 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
|
111 - | crate::operation::http_enum_payload2::HttpEnumPayload2Error,
|
111 + | crate::operation::content_type_parameters::ContentTypeParametersError,
|
112 112 | >::new())
|
113 113 | .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
|
114 - | crate::operation::http_enum_payload2::HttpEnumPayload2Error,
|
114 + | crate::operation::content_type_parameters::ContentTypeParametersError,
|
115 115 | >::new());
|
116 116 |
|
117 117 | ::std::borrow::Cow::Owned(rcb)
|
118 118 | }
|
119 119 | }
|
120 120 |
|
121 121 | #[derive(Debug)]
|
122 - | struct HttpEnumPayload2ResponseDeserializer;
|
123 - | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for HttpEnumPayload2ResponseDeserializer {
|
122 + | struct ContentTypeParametersResponseDeserializer;
|
123 + | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ContentTypeParametersResponseDeserializer {
|
124 124 | fn deserialize_nonstreaming(
|
125 125 | &self,
|
126 126 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
127 127 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
128 128 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
129 129 | let headers = response.headers();
|
130 130 | let body = response.body().bytes().expect("body loaded");
|
131 131 | #[allow(unused_mut)]
|
132 132 | let mut force_error = false;
|
133 133 |
|
134 134 | let parse_result = if !success && status != 200 || force_error {
|
135 - | crate::protocol_serde::shape_http_enum_payload2::de_http_enum_payload2_http_error(status, headers, body)
|
135 + | crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_error(status, headers, body)
|
136 136 | } else {
|
137 - | crate::protocol_serde::shape_http_enum_payload2::de_http_enum_payload2_http_response(status, headers, body)
|
137 + | crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters_http_response(status, headers, body)
|
138 138 | };
|
139 139 | crate::protocol_serde::type_erase_result(parse_result)
|
140 140 | }
|
141 141 | }
|
142 142 | #[derive(Debug)]
|
143 - | struct HttpEnumPayload2RequestSerializer;
|
144 - | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for HttpEnumPayload2RequestSerializer {
|
143 + | struct ContentTypeParametersRequestSerializer;
|
144 + | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ContentTypeParametersRequestSerializer {
|
145 145 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
146 146 | fn serialize_input(
|
147 147 | &self,
|
148 148 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
149 149 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
150 150 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
151 151 | let input = input
|
152 - | .downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Input>()
|
152 + | .downcast::<crate::operation::content_type_parameters::ContentTypeParametersInput>()
|
153 153 | .expect("correct type");
|
154 154 | let _header_serialization_settings = _cfg
|
155 155 | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
156 156 | .cloned()
|
157 157 | .unwrap_or_default();
|
158 158 | let mut request_builder = {
|
159 159 | fn uri_base(
|
160 - | _input: &crate::operation::http_enum_payload2::HttpEnumPayload2Input,
|
160 + | _input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
|
161 161 | output: &mut ::std::string::String,
|
162 162 | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
163 163 | use ::std::fmt::Write as _;
|
164 - | ::std::write!(output, "/EnumPayload2").expect("formatting should succeed");
|
164 + | ::std::write!(output, "/").expect("formatting should succeed");
|
165 165 | ::std::result::Result::Ok(())
|
166 166 | }
|
167 167 | #[allow(clippy::unnecessary_wraps)]
|
168 168 | fn update_http_builder(
|
169 - | input: &crate::operation::http_enum_payload2::HttpEnumPayload2Input,
|
169 + | input: &crate::operation::content_type_parameters::ContentTypeParametersInput,
|
170 170 | builder: ::http::request::Builder,
|
171 171 | ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
172 172 | let mut uri = ::std::string::String::new();
|
173 173 | uri_base(input, &mut uri)?;
|
174 174 | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
175 175 | }
|
176 176 | let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
|
177 - | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "text/plain");
|
177 + | builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
178 + | builder = _header_serialization_settings.set_default_header(
|
179 + | builder,
|
180 + | ::http::header::HeaderName::from_static("x-amz-target"),
|
181 + | "JsonRpc10.ContentTypeParameters",
|
182 + | );
|
178 183 | builder
|
179 184 | };
|
180 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_http_enum_payload2_input::ser_payload_http_payload(
|
181 - | input.payload,
|
185 + | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_content_type_parameters::ser_content_type_parameters_input(
|
186 + | &input,
|
182 187 | )?);
|
183 188 | if let Some(content_length) = body.content_length() {
|
184 189 | let content_length = content_length.to_string();
|
185 190 | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
|
186 191 | }
|
187 192 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
188 193 | }
|
189 194 | }
|
190 195 | #[derive(Debug)]
|
191 - | struct HttpEnumPayload2EndpointParamsInterceptor;
|
196 + | struct ContentTypeParametersEndpointParamsInterceptor;
|
192 197 |
|
193 - | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for HttpEnumPayload2EndpointParamsInterceptor {
|
198 + | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ContentTypeParametersEndpointParamsInterceptor {
|
194 199 | fn name(&self) -> &'static str {
|
195 - | "HttpEnumPayload2EndpointParamsInterceptor"
|
200 + | "ContentTypeParametersEndpointParamsInterceptor"
|
196 201 | }
|
197 202 |
|
198 203 | fn read_before_execution(
|
199 204 | &self,
|
200 205 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
201 206 | '_,
|
202 207 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
203 208 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
204 209 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
205 210 | >,
|
206 211 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
207 212 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
208 213 | let _input = context
|
209 214 | .input()
|
210 - | .downcast_ref::<HttpEnumPayload2Input>()
|
211 - | .ok_or("failed to downcast to HttpEnumPayload2Input")?;
|
215 + | .downcast_ref::<ContentTypeParametersInput>()
|
216 + | .ok_or("failed to downcast to ContentTypeParametersInput")?;
|
212 217 |
|
213 218 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
214 219 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
215 220 | })?;
|
216 221 | cfg.interceptor_state()
|
217 222 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
218 223 | ::std::result::Result::Ok(())
|
219 224 | }
|
220 225 | }
|
221 - | #[allow(unreachable_code, unused_variables)]
|
222 - | #[cfg(test)]
|
223 - | mod http_enum_payload2_test {
|
224 226 |
|
225 - | /// Test ID: RestJsonEnumPayloadRequest2
|
226 - | #[::tokio::test]
|
227 - | #[::tracing_test::traced_test]
|
228 - | async fn rest_json_enum_payload_request2_request() {
|
229 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
230 - | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
231 - |
|
232 - | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
233 - | let result = client
|
234 - | .http_enum_payload2()
|
235 - | .set_payload(::std::option::Option::Some(
|
236 - | "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
|
237 - | ))
|
238 - | .send()
|
239 - | .await;
|
240 - | let _ = dbg!(result);
|
241 - | let http_request = request_receiver.expect_request();
|
242 - | let expected_headers = [("Content-Type", "text/plain")];
|
243 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
244 - | let body = http_request.body().bytes().expect("body should be strict");
|
245 - | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
246 - | body,
|
247 - | "enumvalue",
|
248 - | ::aws_smithy_protocol_test::MediaType::from("unknown"),
|
249 - | ));
|
250 - | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
251 - | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
252 - | ::pretty_assertions::assert_eq!(uri.path(), "/EnumPayload2", "path was incorrect");
|
253 - | }
|
254 - | /// Test ID: RestJsonEnumPayloadResponse2
|
255 - | #[::tokio::test]
|
256 - | #[::tracing_test::traced_test]
|
257 - | async fn rest_json_enum_payload_response2_response() {
|
258 - | let expected_output = crate::operation::http_enum_payload2::HttpEnumPayload2Output::builder()
|
259 - | .set_payload(::std::option::Option::Some(
|
260 - | "enumvalue".parse::<crate::types::StringEnum>().expect("static value validated to member"),
|
261 - | ))
|
262 - | .build();
|
263 - | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
264 - | ::http::response::Builder::new()
|
265 - | .header("Content-Type", "text/plain")
|
266 - | .status(200)
|
267 - | .body(::aws_smithy_types::body::SdkBody::from("enumvalue"))
|
268 - | .unwrap(),
|
269 - | )
|
270 - | .unwrap();
|
271 - | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
272 - | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
273 - |
|
274 - | let op = crate::operation::http_enum_payload2::HttpEnumPayload2::new();
|
275 - | let config = op.config().expect("the operation has config");
|
276 - | let de = config
|
277 - | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
278 - | .expect("the config must have a deserializer");
|
279 - |
|
280 - | let parsed = de.deserialize_streaming(&mut http_response);
|
281 - | let parsed = parsed.unwrap_or_else(|| {
|
282 - | let http_response =
|
283 - | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
284 - | de.deserialize_nonstreaming(&http_response)
|
285 - | });
|
286 - | let parsed = parsed
|
287 - | .expect("should be successful response")
|
288 - | .downcast::<crate::operation::http_enum_payload2::HttpEnumPayload2Output>()
|
289 - | .unwrap();
|
290 - | ::pretty_assertions::assert_eq!(parsed.payload, expected_output.payload, "Unexpected value for `payload`");
|
291 - | }
|
292 - | /// Upper case error modeled lower case
|
293 - | /// Test ID: ServiceLevelErrorClient
|
294 - | #[::tokio::test]
|
295 - | #[::tracing_test::traced_test]
|
296 - | async fn service_level_error_client_response() {
|
297 - | let expected_output = crate::types::error::ExtraError::builder().build();
|
298 - | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
299 - | ::http::response::Builder::new()
|
300 - | .header("X-Amzn-Errortype", "ExtraError")
|
301 - | .status(500)
|
302 - | .body(::aws_smithy_types::body::SdkBody::from(""))
|
303 - | .unwrap(),
|
304 - | )
|
305 - | .unwrap();
|
306 - | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
307 - | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
308 - |
|
309 - | let op = crate::operation::http_enum_payload2::HttpEnumPayload2::new();
|
310 - | let config = op.config().expect("the operation has config");
|
311 - | let de = config
|
312 - | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
313 - | .expect("the config must have a deserializer");
|
314 - |
|
315 - | let parsed = de.deserialize_streaming(&mut http_response);
|
316 - | let parsed = parsed.unwrap_or_else(|| {
|
317 - | let http_response =
|
318 - | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
319 - | de.deserialize_nonstreaming(&http_response)
|
320 - | });
|
321 - | let parsed = parsed.expect_err("should be error response");
|
322 - | let parsed: &crate::operation::http_enum_payload2::HttpEnumPayload2Error =
|
323 - | parsed.as_operation_error().expect("operation error").downcast_ref().unwrap();
|
324 - | if let crate::operation::http_enum_payload2::HttpEnumPayload2Error::ExtraError(parsed) = parsed {
|
325 - | ::pretty_assertions::assert_eq!(parsed.message, expected_output.message, "Unexpected value for `message`");
|
326 - | } else {
|
327 - | panic!("wrong variant: Got: {:?}. Expected: {:?}", parsed, expected_output);
|
328 - | }
|
329 - | }
|
330 - | }
|
331 - |
|
332 - | /// Error type for the `HttpEnumPayload2Error` operation.
|
227 + | /// Error type for the `ContentTypeParametersError` operation.
|
333 228 | #[non_exhaustive]
|
334 229 | #[derive(::std::fmt::Debug)]
|
335 - | pub enum HttpEnumPayload2Error {
|
336 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
337 - | ValidationError(crate::types::error::ValidationError),
|
338 - | #[allow(missing_docs)] // documentation missing in model
|
339 - | ExtraError(crate::types::error::ExtraError),
|
230 + | pub enum ContentTypeParametersError {
|
340 231 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
341 232 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
342 233 | variable wildcard pattern and check `.code()`:
|
343 234 | \
|
344 235 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
345 236 | \
|
346 - | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-HttpEnumPayload2Error) for what information is available for the error.")]
|
237 + | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ContentTypeParametersError) for what information is available for the error.")]
|
347 238 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
348 239 | }
|
349 - | impl HttpEnumPayload2Error {
|
350 - | /// Creates the `HttpEnumPayload2Error::Unhandled` variant from any error type.
|
240 + | impl ContentTypeParametersError {
|
241 + | /// Creates the `ContentTypeParametersError::Unhandled` variant from any error type.
|
351 242 | pub fn unhandled(
|
352 243 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
353 244 | ) -> Self {
|
354 245 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
355 246 | source: err.into(),
|
356 247 | meta: ::std::default::Default::default(),
|
357 248 | })
|
358 249 | }
|
359 250 |
|
360 - | /// Creates the `HttpEnumPayload2Error::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
251 + | /// Creates the `ContentTypeParametersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
|
361 252 | pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
362 253 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
363 254 | source: err.clone().into(),
|
364 255 | meta: err,
|
365 256 | })
|
366 257 | }
|
367 258 | ///
|
368 259 | /// Returns error metadata, which includes the error code, message,
|
369 260 | /// request ID, and potentially additional information.
|
370 261 | ///
|
371 262 | pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
372 263 | match self {
|
373 - | Self::ValidationError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
374 - | Self::ExtraError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
|
375 264 | Self::Unhandled(e) => &e.meta,
|
376 265 | }
|
377 266 | }
|
378 - | /// Returns `true` if the error kind is `HttpEnumPayload2Error::ValidationError`.
|
379 - | pub fn is_validation_error(&self) -> bool {
|
380 - | matches!(self, Self::ValidationError(_))
|
381 - | }
|
382 - | /// Returns `true` if the error kind is `HttpEnumPayload2Error::ExtraError`.
|
383 - | pub fn is_extra_error(&self) -> bool {
|
384 - | matches!(self, Self::ExtraError(_))
|
385 - | }
|
386 267 | }
|
387 - | impl ::std::error::Error for HttpEnumPayload2Error {
|
268 + | impl ::std::error::Error for ContentTypeParametersError {
|
388 269 | fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
389 270 | match self {
|
390 - | Self::ValidationError(_inner) => ::std::option::Option::Some(_inner),
|
391 - | Self::ExtraError(_inner) => ::std::option::Option::Some(_inner),
|
392 271 | Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
|
393 272 | }
|
394 273 | }
|
395 274 | }
|
396 - | impl ::std::fmt::Display for HttpEnumPayload2Error {
|
275 + | impl ::std::fmt::Display for ContentTypeParametersError {
|
397 276 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
398 277 | match self {
|
399 - | Self::ValidationError(_inner) => _inner.fmt(f),
|
400 - | Self::ExtraError(_inner) => _inner.fmt(f),
|
401 278 | Self::Unhandled(_inner) => {
|
402 279 | if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
|
403 280 | write!(f, "unhandled error ({code})")
|
404 281 | } else {
|
405 282 | f.write_str("unhandled error")
|
406 283 | }
|
407 284 | }
|
408 285 | }
|
409 286 | }
|
410 287 | }
|
411 - | impl ::aws_smithy_types::retry::ProvideErrorKind for HttpEnumPayload2Error {
|
288 + | impl ::aws_smithy_types::retry::ProvideErrorKind for ContentTypeParametersError {
|
412 289 | fn code(&self) -> ::std::option::Option<&str> {
|
413 290 | ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
|
414 291 | }
|
415 292 | fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
|
416 293 | ::std::option::Option::None
|
417 294 | }
|
418 295 | }
|
419 - | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for HttpEnumPayload2Error {
|
296 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ContentTypeParametersError {
|
420 297 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
421 298 | match self {
|
422 - | Self::ValidationError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
423 - | Self::ExtraError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
|
424 299 | Self::Unhandled(_inner) => &_inner.meta,
|
425 300 | }
|
426 301 | }
|
427 302 | }
|
428 - | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for HttpEnumPayload2Error {
|
303 + | impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ContentTypeParametersError {
|
429 304 | fn create_unhandled_error(
|
430 305 | source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
|
431 306 | meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
432 307 | ) -> Self {
|
433 308 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
434 309 | source,
|
435 310 | meta: meta.unwrap_or_default(),
|
436 311 | })
|
437 312 | }
|
438 313 | }
|
439 314 |
|
440 - | pub use crate::operation::http_enum_payload2::_http_enum_payload2_output::HttpEnumPayload2Output;
|
315 + | pub use crate::operation::content_type_parameters::_content_type_parameters_output::ContentTypeParametersOutput;
|
441 316 |
|
442 - | pub use crate::operation::http_enum_payload2::_http_enum_payload2_input::HttpEnumPayload2Input;
|
317 + | pub use crate::operation::content_type_parameters::_content_type_parameters_input::ContentTypeParametersInput;
|
443 318 |
|
444 - | mod _http_enum_payload2_input;
|
319 + | mod _content_type_parameters_input;
|
445 320 |
|
446 - | mod _http_enum_payload2_output;
|
321 + | mod _content_type_parameters_output;
|
447 322 |
|
448 323 | /// Builders
|
449 324 | pub mod builders;
|