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