Skip to main content

aws_sdk_location/operation/get_place/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_place::_get_place_input::GetPlaceInputBuilder;
3
4pub use crate::operation::get_place::_get_place_output::GetPlaceOutputBuilder;
5
6impl crate::operation::get_place::builders::GetPlaceInputBuilder {
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::get_place::GetPlaceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_place::GetPlaceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_place();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetPlace`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the <a href="/location/latest/APIReference/API_geoplaces_GetPlace.html">V2 <code>GetPlace</code> </a> operation unless you require Grab data.</p>
27/// <ul>
28/// <li>
29/// <p>This version of <code>GetPlace</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>Version 2 of the <code>GetPlace</code> operation interoperates with the rest of the Places V2 API, while this version does not.</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>Finds a place by its unique ID. A <code>PlaceId</code> is returned by other search operations.</p><note>
41/// <p>A PlaceId is valid only if all of the following are the same in the original search request and the call to <code>GetPlace</code>.</p>
42/// <ul>
43/// <li>
44/// <p>Customer Amazon Web Services account</p></li>
45/// <li>
46/// <p>Amazon Web Services Region</p></li>
47/// <li>
48/// <p>Data provider specified in the place index resource</p></li>
49/// </ul>
50/// </note> <note>
51/// <p>If your Place index resource is configured with Grab as your geolocation provider and Storage as Intended use, the GetPlace operation is unavailable. For more information, see <a href="http://aws.amazon.com/service-terms">AWS service terms</a>.</p>
52/// </note>
53#[derive(::std::clone::Clone, ::std::fmt::Debug)]
54pub struct GetPlaceFluentBuilder {
55    handle: ::std::sync::Arc<crate::client::Handle>,
56    inner: crate::operation::get_place::builders::GetPlaceInputBuilder,
57    config_override: ::std::option::Option<crate::config::Builder>,
58}
59impl crate::client::customize::internal::CustomizableSend<crate::operation::get_place::GetPlaceOutput, crate::operation::get_place::GetPlaceError>
60    for GetPlaceFluentBuilder
61{
62    fn send(
63        self,
64        config_override: crate::config::Builder,
65    ) -> crate::client::customize::internal::BoxFuture<
66        crate::client::customize::internal::SendResult<crate::operation::get_place::GetPlaceOutput, crate::operation::get_place::GetPlaceError>,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl GetPlaceFluentBuilder {
72    /// Creates a new `GetPlaceFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the GetPlace as a reference.
81    pub fn as_input(&self) -> &crate::operation::get_place::builders::GetPlaceInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::get_place::GetPlaceOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::get_place::GetPlaceError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::get_place::GetPlace::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::get_place::GetPlace::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_place::GetPlaceOutput, crate::operation::get_place::GetPlaceError, Self>
117    {
118        crate::client::customize::CustomizableOperation::new(self)
119    }
120    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121        self.set_config_override(::std::option::Option::Some(config_override.into()));
122        self
123    }
124
125    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126        self.config_override = config_override;
127        self
128    }
129    /// <p>The name of the place index resource that you want to use for the search.</p>
130    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.index_name(input.into());
132        self
133    }
134    /// <p>The name of the place index resource that you want to use for the search.</p>
135    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_index_name(input);
137        self
138    }
139    /// <p>The name of the place index resource that you want to use for the search.</p>
140    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_index_name()
142    }
143    /// <p>The identifier of the place to find.</p>
144    pub fn place_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.place_id(input.into());
146        self
147    }
148    /// <p>The identifier of the place to find.</p>
149    pub fn set_place_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_place_id(input);
151        self
152    }
153    /// <p>The identifier of the place to find.</p>
154    pub fn get_place_id(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_place_id()
156    }
157    /// <p>The preferred language used to return results. The value must be a valid <a href="https://tools.ietf.org/search/bcp47">BCP 47</a> language tag, for example, <code>en</code> for English.</p>
158    /// <p>This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.</p>
159    /// <p>For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the <code>language</code> parameter set to <code>en</code>. The <code>city</code> in the results will most likely be returned as <code>Athens</code>.</p>
160    /// <p>If you set the <code>language</code> parameter to <code>el</code>, for Greek, then the <code>city</code> in the results will more likely be returned as <code>Αθήνα</code>.</p>
161    /// <p>If the data provider does not have a value for Greek, the result will be in a language that the provider does support.</p>
162    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.language(input.into());
164        self
165    }
166    /// <p>The preferred language used to return results. The value must be a valid <a href="https://tools.ietf.org/search/bcp47">BCP 47</a> language tag, for example, <code>en</code> for English.</p>
167    /// <p>This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.</p>
168    /// <p>For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the <code>language</code> parameter set to <code>en</code>. The <code>city</code> in the results will most likely be returned as <code>Athens</code>.</p>
169    /// <p>If you set the <code>language</code> parameter to <code>el</code>, for Greek, then the <code>city</code> in the results will more likely be returned as <code>Αθήνα</code>.</p>
170    /// <p>If the data provider does not have a value for Greek, the result will be in a language that the provider does support.</p>
171    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_language(input);
173        self
174    }
175    /// <p>The preferred language used to return results. The value must be a valid <a href="https://tools.ietf.org/search/bcp47">BCP 47</a> language tag, for example, <code>en</code> for English.</p>
176    /// <p>This setting affects the languages used in the results, but not the results themselves. If no language is specified, or not supported for a particular result, the partner automatically chooses a language for the result.</p>
177    /// <p>For an example, we'll use the Greek language. You search for a location around Athens, Greece, with the <code>language</code> parameter set to <code>en</code>. The <code>city</code> in the results will most likely be returned as <code>Athens</code>.</p>
178    /// <p>If you set the <code>language</code> parameter to <code>el</code>, for Greek, then the <code>city</code> in the results will more likely be returned as <code>Αθήνα</code>.</p>
179    /// <p>If the data provider does not have a value for Greek, the result will be in a language that the provider does support.</p>
180    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_language()
182    }
183    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
184    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.key(input.into());
186        self
187    }
188    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
189    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_key(input);
191        self
192    }
193    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
194    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_key()
196    }
197}