Skip to main content

aws_sdk_location/operation/list_maps/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_maps::_list_maps_input::ListMapsInputBuilder;
3
4pub use crate::operation::list_maps::_list_maps_output::ListMapsOutputBuilder;
5
6impl crate::operation::list_maps::builders::ListMapsInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::list_maps::ListMapsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_maps::ListMapsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_maps();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListMaps`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend upgrading to the Maps API V2 unless you require <code>Grab</code> data.</p>
27/// <ul>
28/// <li>
29/// <p><code>ListMaps</code> is part of a previous Amazon Location Service Maps API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p></li>
30/// <li>
31/// <p>The Maps API version 2 has a simplified interface that can be used without creating or managing map resources.</p></li>
32/// <li>
33/// <p>If you are using an AWS SDK or the AWS CLI, note that the Maps API version 2 is found under <code>geo-maps</code> or <code>geo_maps</code>, not under <code>location</code>.</p></li>
34/// <li>
35/// <p>Since <code>Grab</code> is not yet fully supported in Maps API version 2, we recommend you continue using API version 1 when using <code>Grab</code>.</p></li>
36/// <li>
37/// <p>Start your version 2 API journey with the <a href="https://docs.aws.amazon.com/location/latest/APIReference/API_Operations_Amazon_Location_Service_Maps_V2.html">Maps V2 API Reference</a> or the <a href="https://docs.aws.amazon.com/location/latest/developerguide/maps.html">Developer Guide</a>.</p></li>
38/// </ul>
39/// </important>
40/// <p>Lists map resources in your Amazon Web Services account.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct ListMapsFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::list_maps::builders::ListMapsInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl crate::client::customize::internal::CustomizableSend<crate::operation::list_maps::ListMapsOutput, crate::operation::list_maps::ListMapsError>
48    for ListMapsFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<crate::operation::list_maps::ListMapsOutput, crate::operation::list_maps::ListMapsError>,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl ListMapsFluentBuilder {
60    /// Creates a new `ListMapsFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the ListMaps as a reference.
69    pub fn as_input(&self) -> &crate::operation::list_maps::builders::ListMapsInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::list_maps::ListMapsOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::list_maps::ListMapsError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::list_maps::ListMaps::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::list_maps::ListMaps::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<crate::operation::list_maps::ListMapsOutput, crate::operation::list_maps::ListMapsError, Self>
105    {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// Create a paginator for this request
118    ///
119    /// Paginators are used by calling [`send().await`](crate::operation::list_maps::paginator::ListMapsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120    pub fn into_paginator(self) -> crate::operation::list_maps::paginator::ListMapsPaginator {
121        crate::operation::list_maps::paginator::ListMapsPaginator::new(self.handle, self.inner)
122    }
123    /// <p>An optional limit for the number of resources returned in a single call.</p>
124    /// <p>Default value: <code>100</code></p>
125    pub fn max_results(mut self, input: i32) -> Self {
126        self.inner = self.inner.max_results(input);
127        self
128    }
129    /// <p>An optional limit for the number of resources returned in a single call.</p>
130    /// <p>Default value: <code>100</code></p>
131    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
132        self.inner = self.inner.set_max_results(input);
133        self
134    }
135    /// <p>An optional limit for the number of resources returned in a single call.</p>
136    /// <p>Default value: <code>100</code></p>
137    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
138        self.inner.get_max_results()
139    }
140    /// <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.</p>
141    /// <p>Default value: <code>null</code></p>
142    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.next_token(input.into());
144        self
145    }
146    /// <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.</p>
147    /// <p>Default value: <code>null</code></p>
148    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_next_token(input);
150        self
151    }
152    /// <p>The pagination token specifying which page of results to return in the response. If no token is provided, the default page is the first page.</p>
153    /// <p>Default value: <code>null</code></p>
154    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_next_token()
156    }
157}