1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GetTile;
6impl GetTile {
7 pub fn new() -> Self {
9 Self
10 }
11 pub(crate) async fn orchestrate(
12 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13 input: crate::operation::get_tile::GetTileInput,
14 ) -> ::std::result::Result<
15 crate::operation::get_tile::GetTileOutput,
16 ::aws_smithy_runtime_api::client::result::SdkError<
17 crate::operation::get_tile::GetTileError,
18 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19 >,
20 > {
21 let map_err =
22 |err: ::aws_smithy_runtime_api::client::result::SdkError<
23 ::aws_smithy_runtime_api::client::interceptors::context::Error,
24 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25 >| { err.map_service_error(|err| err.downcast::<crate::operation::get_tile::GetTileError>().expect("correct error type")) };
26 let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
27 .await
28 .map_err(map_err)?;
29 let output = context.finalize().map_err(map_err)?;
30 ::std::result::Result::Ok(
31 output
32 .downcast::<crate::operation::get_tile::GetTileOutput>()
33 .expect("correct output type"),
34 )
35 }
36
37 pub(crate) async fn orchestrate_with_stop_point(
38 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
39 input: crate::operation::get_tile::GetTileInput,
40 stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
41 ) -> ::std::result::Result<
42 ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
43 ::aws_smithy_runtime_api::client::result::SdkError<
44 ::aws_smithy_runtime_api::client::interceptors::context::Error,
45 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
46 >,
47 > {
48 let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
49 use ::tracing::Instrument;
50 ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("Geo Maps", "GetTile", input, runtime_plugins, stop_point)
51 .instrument(::tracing::debug_span!(
54 "Geo Maps.GetTile",
55 "rpc.service" = "Geo Maps",
56 "rpc.method" = "GetTile",
57 "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
58 "rpc.system" = "aws-api",
59 ))
60 .await
61 }
62
63 pub(crate) fn operation_runtime_plugins(
64 client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
65 client_config: &crate::config::Config,
66 config_override: ::std::option::Option<crate::config::Builder>,
67 ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
68 let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
69
70 if let ::std::option::Option::Some(config_override) = config_override {
71 for plugin in config_override.runtime_plugins.iter().cloned() {
72 runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
73 }
74 runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
75 config_override,
76 client_config.config.clone(),
77 &client_config.runtime_components,
78 ));
79 }
80 runtime_plugins
81 }
82}
83impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetTile {
84 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
85 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetTile");
86
87 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
88 GetTileRequestSerializer,
89 ));
90 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
91 GetTileResponseDeserializer,
92 ));
93
94 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
95 crate::config::auth::Params::builder()
96 .operation_name("GetTile")
97 .build()
98 .expect("required fields set"),
99 ));
100
101 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetTile", "Geo Maps"));
102 let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
103 signing_options.double_uri_encode = true;
104 signing_options.content_sha256_header = false;
105 signing_options.normalize_uri_path = true;
106 signing_options.payload_override = None;
107
108 cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
109 signing_options,
110 ..::std::default::Default::default()
111 });
112
113 ::std::option::Option::Some(cfg.freeze())
114 }
115
116 fn runtime_components(
117 &self,
118 _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
119 ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
120 #[allow(unused_mut)]
121 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetTile")
122 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
123 GetTileTelemetryInputCaptureInterceptor,
124 ))
125 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
126 ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
127 ))
128 .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
129 GetTileEndpointParamsInterceptor,
130 ))
131 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
132 crate::operation::get_tile::GetTileError,
133 >::new())
134 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
135 crate::operation::get_tile::GetTileError,
136 >::new())
137 .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
138 crate::operation::get_tile::GetTileError,
139 >::new());
140
141 ::std::borrow::Cow::Owned(rcb)
142 }
143}
144
145#[derive(Debug)]
146struct GetTileTelemetryInputCaptureInterceptor;
147
148#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
149impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetTileTelemetryInputCaptureInterceptor {
150 fn name(&self) -> &'static str {
151 "GetTileTelemetryInputCaptureInterceptor"
152 }
153
154 fn read_before_execution(
155 &self,
156 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
157 '_,
158 ::aws_smithy_runtime_api::client::interceptors::context::Input,
159 ::aws_smithy_runtime_api::client::interceptors::context::Output,
160 ::aws_smithy_runtime_api::client::interceptors::context::Error,
161 >,
162 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
163 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
164 let ::std::option::Option::Some(requested) = cfg
166 .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
167 .filter(|r| !r.is_empty())
168 else {
169 return ::std::result::Result::Ok(());
170 };
171
172 let ::std::option::Option::Some(input) = context.input().downcast_ref::<GetTileInput>() else {
173 return ::std::result::Result::Ok(());
175 };
176
177 let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
178 if requested.should_capture("Tileset") {
179 if let ::std::option::Option::Some(value) = input.tileset.as_deref() {
180 captured.insert("Tileset", value);
181 }
182 }
183
184 cfg.interceptor_state().store_put(captured);
185 ::std::result::Result::Ok(())
186 }
187}
188#[derive(Debug)]
189struct GetTileResponseDeserializer;
190impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetTileResponseDeserializer {
191 fn deserialize_nonstreaming_with_config(
192 &self,
193 response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
194 _cfg: &::aws_smithy_types::config_bag::ConfigBag,
195 ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
196 let (success, status) = (response.status().is_success(), response.status().as_u16());
197 let headers = response.headers();
198 let body = response.body().bytes().expect("body loaded");
199 #[allow(unused_mut)]
200 let mut force_error = false;
201 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
202 let parse_result = if !success && status != 200 || force_error {
203 crate::protocol_serde::shape_get_tile::de_get_tile_http_error(status, headers, body)
204 } else {
205 crate::protocol_serde::shape_get_tile::de_get_tile_http_response(status, headers, body)
206 };
207 crate::protocol_serde::type_erase_result(parse_result)
208 }
209}
210#[derive(Debug)]
211struct GetTileRequestSerializer;
212impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetTileRequestSerializer {
213 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
214 fn serialize_input(
215 &self,
216 input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
217 _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
218 ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
219 let input = input.downcast::<crate::operation::get_tile::GetTileInput>().expect("correct type");
220 let _header_serialization_settings = _cfg
221 .load::<crate::serialization_settings::HeaderSerializationSettings>()
222 .cloned()
223 .unwrap_or_default();
224 let mut request_builder = {
225 #[allow(clippy::uninlined_format_args)]
226 fn uri_base(
227 _input: &crate::operation::get_tile::GetTileInput,
228 output: &mut ::std::string::String,
229 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
230 use ::std::fmt::Write as _;
231 let input_1 = &_input.tileset;
232 let input_1 = input_1
233 .as_ref()
234 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("tileset", "cannot be empty or unset"))?;
235 let tileset = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
236 if tileset.is_empty() {
237 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
238 "tileset",
239 "cannot be empty or unset",
240 ));
241 }
242 let input_2 = &_input.z;
243 let input_2 = input_2
244 .as_ref()
245 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("z", "cannot be empty or unset"))?;
246 let z = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default);
247 if z.is_empty() {
248 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
249 "z",
250 "cannot be empty or unset",
251 ));
252 }
253 let input_3 = &_input.x;
254 let input_3 = input_3
255 .as_ref()
256 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("x", "cannot be empty or unset"))?;
257 let x = ::aws_smithy_http::label::fmt_string(input_3, ::aws_smithy_http::label::EncodingStrategy::Default);
258 if x.is_empty() {
259 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
260 "x",
261 "cannot be empty or unset",
262 ));
263 }
264 let input_4 = &_input.y;
265 let input_4 = input_4
266 .as_ref()
267 .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("y", "cannot be empty or unset"))?;
268 let y = ::aws_smithy_http::label::fmt_string(input_4, ::aws_smithy_http::label::EncodingStrategy::Default);
269 if y.is_empty() {
270 return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
271 "y",
272 "cannot be empty or unset",
273 ));
274 }
275 ::std::write!(output, "/v2/tiles/{Tileset}/{Z}/{X}/{Y}", Tileset = tileset, Z = z, X = x, Y = y).expect("formatting should succeed");
276 ::std::result::Result::Ok(())
277 }
278 fn uri_query(
279 _input: &crate::operation::get_tile::GetTileInput,
280 mut output: &mut ::std::string::String,
281 ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
282 let mut query = ::aws_smithy_http::query::Writer::new(output);
283 if let ::std::option::Option::Some(inner_5) = &_input.additional_features {
284 {
285 for inner_6 in inner_5 {
286 query.push_kv("additional-features", &::aws_smithy_http::query::fmt_string(inner_6.as_str()));
287 }
288 }
289 }
290 if let ::std::option::Option::Some(inner_7) = &_input.key {
291 {
292 query.push_kv("key", &::aws_smithy_http::query::fmt_string(inner_7));
293 }
294 }
295 ::std::result::Result::Ok(())
296 }
297 #[allow(clippy::unnecessary_wraps)]
298 fn update_http_builder(
299 input: &crate::operation::get_tile::GetTileInput,
300 builder: ::http_1x::request::Builder,
301 ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
302 let mut uri = ::std::string::String::new();
303 uri_base(input, &mut uri)?;
304 uri_query(input, &mut uri)?;
305 ::std::result::Result::Ok(builder.method("GET").uri(uri))
306 }
307 let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
308 builder
309 };
310 let body = ::aws_smithy_types::body::SdkBody::from("");
311
312 ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
313 }
314}
315#[derive(Debug)]
316struct GetTileEndpointParamsInterceptor;
317
318#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
319impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetTileEndpointParamsInterceptor {
320 fn name(&self) -> &'static str {
321 "GetTileEndpointParamsInterceptor"
322 }
323
324 fn read_before_execution(
325 &self,
326 context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
327 '_,
328 ::aws_smithy_runtime_api::client::interceptors::context::Input,
329 ::aws_smithy_runtime_api::client::interceptors::context::Output,
330 ::aws_smithy_runtime_api::client::interceptors::context::Error,
331 >,
332 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
333 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
334 let _input = context
335 .input()
336 .downcast_ref::<GetTileInput>()
337 .ok_or("failed to downcast to GetTileInput")?;
338
339 let params = crate::config::endpoint::Params::builder()
340 .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
341 .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
342 .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
343 .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
344 .build()
345 .map_err(|err| {
346 ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
347 })?;
348 cfg.interceptor_state()
349 .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
350 ::std::result::Result::Ok(())
351 }
352}
353
354#[non_exhaustive]
359#[derive(::std::fmt::Debug)]
360pub enum GetTileError {
361 AccessDeniedException(crate::types::error::AccessDeniedException),
363 InternalServerException(crate::types::error::InternalServerException),
365 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
367 ThrottlingException(crate::types::error::ThrottlingException),
369 ValidationException(crate::types::error::ValidationException),
371 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
373 variable wildcard pattern and check `.code()`:
374 \
375 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
376 \
377 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetTileError) for what information is available for the error.")]
378 Unhandled(crate::error::sealed_unhandled::Unhandled),
379}
380impl GetTileError {
381 pub fn unhandled(
383 err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
384 ) -> Self {
385 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
386 source: err.into(),
387 meta: ::std::default::Default::default(),
388 })
389 }
390
391 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
393 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
394 source: err.clone().into(),
395 meta: err,
396 })
397 }
398 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
403 match self {
404 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
405 Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
406 Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
407 Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
408 Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
409 Self::Unhandled(e) => &e.meta,
410 }
411 }
412 pub fn is_access_denied_exception(&self) -> bool {
414 matches!(self, Self::AccessDeniedException(_))
415 }
416 pub fn is_internal_server_exception(&self) -> bool {
418 matches!(self, Self::InternalServerException(_))
419 }
420 pub fn is_resource_not_found_exception(&self) -> bool {
422 matches!(self, Self::ResourceNotFoundException(_))
423 }
424 pub fn is_throttling_exception(&self) -> bool {
426 matches!(self, Self::ThrottlingException(_))
427 }
428 pub fn is_validation_exception(&self) -> bool {
430 matches!(self, Self::ValidationException(_))
431 }
432}
433impl ::std::error::Error for GetTileError {
434 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
435 match self {
436 Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
437 Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
438 Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
439 Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
440 Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
441 Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
442 }
443 }
444}
445impl ::std::fmt::Display for GetTileError {
446 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
447 match self {
448 Self::AccessDeniedException(_inner) => _inner.fmt(f),
449 Self::InternalServerException(_inner) => _inner.fmt(f),
450 Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
451 Self::ThrottlingException(_inner) => _inner.fmt(f),
452 Self::ValidationException(_inner) => _inner.fmt(f),
453 Self::Unhandled(_inner) => {
454 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
455 write!(f, "unhandled error ({code})")
456 } else {
457 f.write_str("unhandled error")
458 }
459 }
460 }
461 }
462}
463impl ::aws_smithy_types::retry::ProvideErrorKind for GetTileError {
464 fn code(&self) -> ::std::option::Option<&str> {
465 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
466 }
467 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
468 match self {
469 Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
470 Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
471 _ => ::std::option::Option::None,
472 }
473 }
474}
475impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetTileError {
476 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
477 match self {
478 Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
479 Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
480 Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
481 Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
482 Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
483 Self::Unhandled(_inner) => &_inner.meta,
484 }
485 }
486}
487impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetTileError {
488 fn create_unhandled_error(
489 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
490 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
491 ) -> Self {
492 Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
493 source,
494 meta: meta.unwrap_or_default(),
495 })
496 }
497}
498impl ::aws_types::request_id::RequestId for crate::operation::get_tile::GetTileError {
499 fn request_id(&self) -> Option<&str> {
500 self.meta().request_id()
501 }
502}
503
504pub use crate::operation::get_tile::_get_tile_input::GetTileInput;
505
506pub use crate::operation::get_tile::_get_tile_output::GetTileOutput;
507
508mod _get_tile_input;
509
510mod _get_tile_output;
511
512pub mod builders;