aws_sdk_location/operation/create_place_index/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_place_index::_create_place_index_output::CreatePlaceIndexOutputBuilder;
3
4pub use crate::operation::create_place_index::_create_place_index_input::CreatePlaceIndexInputBuilder;
5
6impl crate::operation::create_place_index::builders::CreatePlaceIndexInputBuilder {
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::create_place_index::CreatePlaceIndexOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_place_index::CreatePlaceIndexError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_place_index();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreatePlaceIndex`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the Places API V2 unless you require Grab data.</p>
27/// <ul>
28/// <li>
29/// <p><code>CreatePlaceIndex</code> is part of a previous Amazon Location Service Places API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p></li>
30/// <li>
31/// <p>The Places API version 2 has a simplified interface that can be used without creating or managing place index resources.</p></li>
32/// <li>
33/// <p>If you are using an Amazon Web Services SDK or the Amazon Web Services CLI, note that the Places API version 2 is found under <code>geo-places</code> or <code>geo_places</code>, not under <code>location</code>.</p></li>
34/// <li>
35/// <p>Since Grab is not yet fully supported in Places API version 2, we recommend you continue using API version 1 when using Grab.</p></li>
36/// <li>
37/// <p>Start your version 2 API journey with the Places V2 <a href="/location/latest/APIReference/API_Operations_Amazon_Location_Service_Places_V2.html">API Reference</a> or the <a href="/location/latest/developerguide/places.html">Developer Guide</a>.</p></li>
38/// </ul>
39/// </important>
40/// <p>Creates a place index resource in your Amazon Web Services account. Use a place index resource to geocode addresses and other text queries by using the <code>SearchPlaceIndexForText</code> operation, and reverse geocode coordinates by using the <code>SearchPlaceIndexForPosition</code> operation, and enable autosuggestions by using the <code>SearchPlaceIndexForSuggestions</code> operation.</p><note>
41/// <p>If your application is tracking or routing assets you use in your business, such as delivery vehicles or employees, you must not use Esri as your geolocation provider. See section 82 of the <a href="http://aws.amazon.com/service-terms">Amazon Web Services service terms</a> for more details.</p>
42/// </note>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct CreatePlaceIndexFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::create_place_index::builders::CreatePlaceIndexInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50    crate::client::customize::internal::CustomizableSend<
51        crate::operation::create_place_index::CreatePlaceIndexOutput,
52        crate::operation::create_place_index::CreatePlaceIndexError,
53    > for CreatePlaceIndexFluentBuilder
54{
55    fn send(
56        self,
57        config_override: crate::config::Builder,
58    ) -> crate::client::customize::internal::BoxFuture<
59        crate::client::customize::internal::SendResult<
60            crate::operation::create_place_index::CreatePlaceIndexOutput,
61            crate::operation::create_place_index::CreatePlaceIndexError,
62        >,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl CreatePlaceIndexFluentBuilder {
68    /// Creates a new `CreatePlaceIndexFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the CreatePlaceIndex as a reference.
77    pub fn as_input(&self) -> &crate::operation::create_place_index::builders::CreatePlaceIndexInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::create_place_index::CreatePlaceIndexOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::create_place_index::CreatePlaceIndexError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::create_place_index::CreatePlaceIndex::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::create_place_index::CreatePlaceIndex::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::create_place_index::CreatePlaceIndexOutput,
114        crate::operation::create_place_index::CreatePlaceIndexError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>The name of the place index resource.</p>
129    /// <p>Requirements:</p>
130    /// <ul>
131    /// <li>
132    /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
133    /// <li>
134    /// <p>Must be a unique place index resource name.</p></li>
135    /// <li>
136    /// <p>No spaces allowed. For example, <code>ExamplePlaceIndex</code>.</p></li>
137    /// </ul>
138    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.index_name(input.into());
140        self
141    }
142    /// <p>The name of the place index resource.</p>
143    /// <p>Requirements:</p>
144    /// <ul>
145    /// <li>
146    /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
147    /// <li>
148    /// <p>Must be a unique place index resource name.</p></li>
149    /// <li>
150    /// <p>No spaces allowed. For example, <code>ExamplePlaceIndex</code>.</p></li>
151    /// </ul>
152    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_index_name(input);
154        self
155    }
156    /// <p>The name of the place index resource.</p>
157    /// <p>Requirements:</p>
158    /// <ul>
159    /// <li>
160    /// <p>Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods (.), and underscores (_).</p></li>
161    /// <li>
162    /// <p>Must be a unique place index resource name.</p></li>
163    /// <li>
164    /// <p>No spaces allowed. For example, <code>ExamplePlaceIndex</code>.</p></li>
165    /// </ul>
166    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_index_name()
168    }
169    /// <p>Specifies the geospatial data provider for the new place index.</p><note>
170    /// <p>This field is case-sensitive. Enter the valid values as shown. For example, entering <code>HERE</code> returns an error.</p>
171    /// </note>
172    /// <p>Valid values include:</p>
173    /// <ul>
174    /// <li>
175    /// <p><code>Esri</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/esri.html">Esri</a>'s coverage in your region of interest, see <a href="https://developers.arcgis.com/rest/geocode/api-reference/geocode-coverage.htm">Esri details on geocoding coverage</a>.</p></li>
176    /// <li>
177    /// <p><code>Grab</code> – Grab provides place index functionality for Southeast Asia. For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a>' coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html#grab-coverage-area">GrabMaps countries and areas covered</a>.</p></li>
178    /// <li>
179    /// <p><code>Here</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/HERE.html">HERE Technologies</a>' coverage in your region of interest, see <a href="https://developer.here.com/documentation/geocoder/dev_guide/topics/coverage-geocoder.html">HERE details on goecoding coverage</a>.</p><important>
180    /// <p>If you specify HERE Technologies (<code>Here</code>) as the data provider, you may not <a href="https://docs.aws.amazon.com/location-places/latest/APIReference/API_DataSourceConfiguration.html">store results</a> for locations in Japan. For more information, see the <a href="http://aws.amazon.com/service-terms/">Amazon Web Services service terms</a> for Amazon Location Service.</p>
181    /// </important></li>
182    /// </ul>
183    /// <p>For additional information , see <a href="https://docs.aws.amazon.com/location/previous/developerguide/what-is-data-provider.html">Data providers</a> on the <i>Amazon Location Service developer guide</i>.</p>
184    pub fn data_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.data_source(input.into());
186        self
187    }
188    /// <p>Specifies the geospatial data provider for the new place index.</p><note>
189    /// <p>This field is case-sensitive. Enter the valid values as shown. For example, entering <code>HERE</code> returns an error.</p>
190    /// </note>
191    /// <p>Valid values include:</p>
192    /// <ul>
193    /// <li>
194    /// <p><code>Esri</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/esri.html">Esri</a>'s coverage in your region of interest, see <a href="https://developers.arcgis.com/rest/geocode/api-reference/geocode-coverage.htm">Esri details on geocoding coverage</a>.</p></li>
195    /// <li>
196    /// <p><code>Grab</code> – Grab provides place index functionality for Southeast Asia. For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a>' coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html#grab-coverage-area">GrabMaps countries and areas covered</a>.</p></li>
197    /// <li>
198    /// <p><code>Here</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/HERE.html">HERE Technologies</a>' coverage in your region of interest, see <a href="https://developer.here.com/documentation/geocoder/dev_guide/topics/coverage-geocoder.html">HERE details on goecoding coverage</a>.</p><important>
199    /// <p>If you specify HERE Technologies (<code>Here</code>) as the data provider, you may not <a href="https://docs.aws.amazon.com/location-places/latest/APIReference/API_DataSourceConfiguration.html">store results</a> for locations in Japan. For more information, see the <a href="http://aws.amazon.com/service-terms/">Amazon Web Services service terms</a> for Amazon Location Service.</p>
200    /// </important></li>
201    /// </ul>
202    /// <p>For additional information , see <a href="https://docs.aws.amazon.com/location/previous/developerguide/what-is-data-provider.html">Data providers</a> on the <i>Amazon Location Service developer guide</i>.</p>
203    pub fn set_data_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_data_source(input);
205        self
206    }
207    /// <p>Specifies the geospatial data provider for the new place index.</p><note>
208    /// <p>This field is case-sensitive. Enter the valid values as shown. For example, entering <code>HERE</code> returns an error.</p>
209    /// </note>
210    /// <p>Valid values include:</p>
211    /// <ul>
212    /// <li>
213    /// <p><code>Esri</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/esri.html">Esri</a>'s coverage in your region of interest, see <a href="https://developers.arcgis.com/rest/geocode/api-reference/geocode-coverage.htm">Esri details on geocoding coverage</a>.</p></li>
214    /// <li>
215    /// <p><code>Grab</code> – Grab provides place index functionality for Southeast Asia. For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html">GrabMaps</a>' coverage, see <a href="https://docs.aws.amazon.com/location/previous/developerguide/grab.html#grab-coverage-area">GrabMaps countries and areas covered</a>.</p></li>
216    /// <li>
217    /// <p><code>Here</code> – For additional information about <a href="https://docs.aws.amazon.com/location/previous/developerguide/HERE.html">HERE Technologies</a>' coverage in your region of interest, see <a href="https://developer.here.com/documentation/geocoder/dev_guide/topics/coverage-geocoder.html">HERE details on goecoding coverage</a>.</p><important>
218    /// <p>If you specify HERE Technologies (<code>Here</code>) as the data provider, you may not <a href="https://docs.aws.amazon.com/location-places/latest/APIReference/API_DataSourceConfiguration.html">store results</a> for locations in Japan. For more information, see the <a href="http://aws.amazon.com/service-terms/">Amazon Web Services service terms</a> for Amazon Location Service.</p>
219    /// </important></li>
220    /// </ul>
221    /// <p>For additional information , see <a href="https://docs.aws.amazon.com/location/previous/developerguide/what-is-data-provider.html">Data providers</a> on the <i>Amazon Location Service developer guide</i>.</p>
222    pub fn get_data_source(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_data_source()
224    }
225    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
226    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
227    pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
228        self.inner = self.inner.pricing_plan(input);
229        self
230    }
231    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
232    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
233    pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
234        self.inner = self.inner.set_pricing_plan(input);
235        self
236    }
237    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
238    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
239    pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
240        self.inner.get_pricing_plan()
241    }
242    /// <p>The optional description for the place index resource.</p>
243    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244        self.inner = self.inner.description(input.into());
245        self
246    }
247    /// <p>The optional description for the place index resource.</p>
248    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249        self.inner = self.inner.set_description(input);
250        self
251    }
252    /// <p>The optional description for the place index resource.</p>
253    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
254        self.inner.get_description()
255    }
256    /// <p>Specifies the data storage option requesting Places.</p>
257    pub fn data_source_configuration(mut self, input: crate::types::DataSourceConfiguration) -> Self {
258        self.inner = self.inner.data_source_configuration(input);
259        self
260    }
261    /// <p>Specifies the data storage option requesting Places.</p>
262    pub fn set_data_source_configuration(mut self, input: ::std::option::Option<crate::types::DataSourceConfiguration>) -> Self {
263        self.inner = self.inner.set_data_source_configuration(input);
264        self
265    }
266    /// <p>Specifies the data storage option requesting Places.</p>
267    pub fn get_data_source_configuration(&self) -> &::std::option::Option<crate::types::DataSourceConfiguration> {
268        self.inner.get_data_source_configuration()
269    }
270    ///
271    /// Adds a key-value pair to `Tags`.
272    ///
273    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
274    ///
275    /// <p>Applies one or more tags to the place index resource. A tag is a key-value pair that helps you manage, identify, search, and filter your resources.</p>
276    /// <p>Format: <code>"key" : "value"</code></p>
277    /// <p>Restrictions:</p>
278    /// <ul>
279    /// <li>
280    /// <p>Maximum 50 tags per resource.</p></li>
281    /// <li>
282    /// <p>Each tag key must be unique and must have exactly one associated value.</p></li>
283    /// <li>
284    /// <p>Maximum key length: 128 Unicode characters in UTF-8.</p></li>
285    /// <li>
286    /// <p>Maximum value length: 256 Unicode characters in UTF-8.</p></li>
287    /// <li>
288    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @</p></li>
289    /// <li>
290    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
291    /// </ul>
292    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
293        self.inner = self.inner.tags(k.into(), v.into());
294        self
295    }
296    /// <p>Applies one or more tags to the place index resource. A tag is a key-value pair that helps you manage, identify, search, and filter your resources.</p>
297    /// <p>Format: <code>"key" : "value"</code></p>
298    /// <p>Restrictions:</p>
299    /// <ul>
300    /// <li>
301    /// <p>Maximum 50 tags per resource.</p></li>
302    /// <li>
303    /// <p>Each tag key must be unique and must have exactly one associated value.</p></li>
304    /// <li>
305    /// <p>Maximum key length: 128 Unicode characters in UTF-8.</p></li>
306    /// <li>
307    /// <p>Maximum value length: 256 Unicode characters in UTF-8.</p></li>
308    /// <li>
309    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @</p></li>
310    /// <li>
311    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
312    /// </ul>
313    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
314        self.inner = self.inner.set_tags(input);
315        self
316    }
317    /// <p>Applies one or more tags to the place index resource. A tag is a key-value pair that helps you manage, identify, search, and filter your resources.</p>
318    /// <p>Format: <code>"key" : "value"</code></p>
319    /// <p>Restrictions:</p>
320    /// <ul>
321    /// <li>
322    /// <p>Maximum 50 tags per resource.</p></li>
323    /// <li>
324    /// <p>Each tag key must be unique and must have exactly one associated value.</p></li>
325    /// <li>
326    /// <p>Maximum key length: 128 Unicode characters in UTF-8.</p></li>
327    /// <li>
328    /// <p>Maximum value length: 256 Unicode characters in UTF-8.</p></li>
329    /// <li>
330    /// <p>Can use alphanumeric characters (A–Z, a–z, 0–9), and the following characters: + - = . _ : / @</p></li>
331    /// <li>
332    /// <p>Cannot use "aws:" as a prefix for a key.</p></li>
333    /// </ul>
334    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
335        self.inner.get_tags()
336    }
337}