aws_sdk_geoplaces/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_output::GetPlaceOutputBuilder;
3
4pub use crate::operation::get_place::_get_place_input::GetPlaceInputBuilder;
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/// <p><code>GetPlace</code> finds a place by its unique ID. A <code>PlaceId</code> is returned by other place operations.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetPlaceFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::get_place::builders::GetPlaceInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::get_place::GetPlaceOutput, crate::operation::get_place::GetPlaceError>
33 for GetPlaceFluentBuilder
34{
35 fn send(
36 self,
37 config_override: crate::config::Builder,
38 ) -> crate::client::customize::internal::BoxFuture<
39 crate::client::customize::internal::SendResult<crate::operation::get_place::GetPlaceOutput, crate::operation::get_place::GetPlaceError>,
40 > {
41 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42 }
43}
44impl GetPlaceFluentBuilder {
45 /// Creates a new `GetPlaceFluentBuilder`.
46 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47 Self {
48 handle,
49 inner: ::std::default::Default::default(),
50 config_override: ::std::option::Option::None,
51 }
52 }
53 /// Access the GetPlace as a reference.
54 pub fn as_input(&self) -> &crate::operation::get_place::builders::GetPlaceInputBuilder {
55 &self.inner
56 }
57 /// Sends the request and returns the response.
58 ///
59 /// If an error occurs, an `SdkError` will be returned with additional details that
60 /// can be matched against.
61 ///
62 /// By default, any retryable failures will be retried twice. Retry behavior
63 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64 /// set when configuring the client.
65 pub async fn send(
66 self,
67 ) -> ::std::result::Result<
68 crate::operation::get_place::GetPlaceOutput,
69 ::aws_smithy_runtime_api::client::result::SdkError<
70 crate::operation::get_place::GetPlaceError,
71 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72 >,
73 > {
74 let input = self
75 .inner
76 .build()
77 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78 let runtime_plugins = crate::operation::get_place::GetPlace::operation_runtime_plugins(
79 self.handle.runtime_plugins.clone(),
80 &self.handle.conf,
81 self.config_override,
82 );
83 crate::operation::get_place::GetPlace::orchestrate(&runtime_plugins, input).await
84 }
85
86 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87 pub fn customize(
88 self,
89 ) -> crate::client::customize::CustomizableOperation<crate::operation::get_place::GetPlaceOutput, crate::operation::get_place::GetPlaceError, Self>
90 {
91 crate::client::customize::CustomizableOperation::new(self)
92 }
93 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
94 self.set_config_override(::std::option::Option::Some(config_override.into()));
95 self
96 }
97
98 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
99 self.config_override = config_override;
100 self
101 }
102 /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
103 pub fn place_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.inner = self.inner.place_id(input.into());
105 self
106 }
107 /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
108 pub fn set_place_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.inner = self.inner.set_place_id(input);
110 self
111 }
112 /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
113 pub fn get_place_id(&self) -> &::std::option::Option<::std::string::String> {
114 self.inner.get_place_id()
115 }
116 ///
117 /// Appends an item to `AdditionalFeatures`.
118 ///
119 /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
120 ///
121 /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
122 pub fn additional_features(mut self, input: crate::types::GetPlaceAdditionalFeature) -> Self {
123 self.inner = self.inner.additional_features(input);
124 self
125 }
126 /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
127 pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GetPlaceAdditionalFeature>>) -> Self {
128 self.inner = self.inner.set_additional_features(input);
129 self
130 }
131 /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
132 pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GetPlaceAdditionalFeature>> {
133 self.inner.get_additional_features()
134 }
135 /// <p>A list of <a href="https://en.wikipedia.org/wiki/IETF_language_tag">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.</p>
136 pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.language(input.into());
138 self
139 }
140 /// <p>A list of <a href="https://en.wikipedia.org/wiki/IETF_language_tag">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.</p>
141 pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_language(input);
143 self
144 }
145 /// <p>A list of <a href="https://en.wikipedia.org/wiki/IETF_language_tag">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.</p>
146 pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_language()
148 }
149 /// <p>The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.</p>
150 pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.political_view(input.into());
152 self
153 }
154 /// <p>The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.</p>
155 pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.inner = self.inner.set_political_view(input);
157 self
158 }
159 /// <p>The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.</p>
160 pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
161 self.inner.get_political_view()
162 }
163 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
164 /// <p>Storing the response of an GetPlace query is required to comply with service terms, but charged at a higher cost per request. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p>
165 /// </note>
166 pub fn intended_use(mut self, input: crate::types::GetPlaceIntendedUse) -> Self {
167 self.inner = self.inner.intended_use(input);
168 self
169 }
170 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
171 /// <p>Storing the response of an GetPlace query is required to comply with service terms, but charged at a higher cost per request. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p>
172 /// </note>
173 pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::GetPlaceIntendedUse>) -> Self {
174 self.inner = self.inner.set_intended_use(input);
175 self
176 }
177 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
178 /// <p>Storing the response of an GetPlace query is required to comply with service terms, but charged at a higher cost per request. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p>
179 /// </note>
180 pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::GetPlaceIntendedUse> {
181 self.inner.get_intended_use()
182 }
183 /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a 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>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a 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>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
194 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
195 self.inner.get_key()
196 }
197}