aws_sdk_geoplaces/operation/get_place/
_get_place_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetPlaceInput {
6    /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
7    pub place_id: ::std::option::Option<::std::string::String>,
8    /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
9    pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::GetPlaceAdditionalFeature>>,
10    /// <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>
11    pub language: ::std::option::Option<::std::string::String>,
12    /// <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>
13    pub political_view: ::std::option::Option<::std::string::String>,
14    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
15    /// <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>
16    /// </note>
17    pub intended_use: ::std::option::Option<crate::types::GetPlaceIntendedUse>,
18    /// <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>
19    pub key: ::std::option::Option<::std::string::String>,
20}
21impl GetPlaceInput {
22    /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
23    pub fn place_id(&self) -> ::std::option::Option<&str> {
24        self.place_id.as_deref()
25    }
26    /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
27    ///
28    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.additional_features.is_none()`.
29    pub fn additional_features(&self) -> &[crate::types::GetPlaceAdditionalFeature] {
30        self.additional_features.as_deref().unwrap_or_default()
31    }
32    /// <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>
33    pub fn language(&self) -> ::std::option::Option<&str> {
34        self.language.as_deref()
35    }
36    /// <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>
37    pub fn political_view(&self) -> ::std::option::Option<&str> {
38        self.political_view.as_deref()
39    }
40    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
41    /// <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>
42    /// </note>
43    pub fn intended_use(&self) -> ::std::option::Option<&crate::types::GetPlaceIntendedUse> {
44        self.intended_use.as_ref()
45    }
46    /// <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>
47    pub fn key(&self) -> ::std::option::Option<&str> {
48        self.key.as_deref()
49    }
50}
51impl ::std::fmt::Debug for GetPlaceInput {
52    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
53        let mut formatter = f.debug_struct("GetPlaceInput");
54        formatter.field("place_id", &"*** Sensitive Data Redacted ***");
55        formatter.field("additional_features", &self.additional_features);
56        formatter.field("language", &self.language);
57        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
58        formatter.field("intended_use", &self.intended_use);
59        formatter.field("key", &"*** Sensitive Data Redacted ***");
60        formatter.finish()
61    }
62}
63impl GetPlaceInput {
64    /// Creates a new builder-style object to manufacture [`GetPlaceInput`](crate::operation::get_place::GetPlaceInput).
65    pub fn builder() -> crate::operation::get_place::builders::GetPlaceInputBuilder {
66        crate::operation::get_place::builders::GetPlaceInputBuilder::default()
67    }
68}
69
70/// A builder for [`GetPlaceInput`](crate::operation::get_place::GetPlaceInput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
72#[non_exhaustive]
73pub struct GetPlaceInputBuilder {
74    pub(crate) place_id: ::std::option::Option<::std::string::String>,
75    pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::GetPlaceAdditionalFeature>>,
76    pub(crate) language: ::std::option::Option<::std::string::String>,
77    pub(crate) political_view: ::std::option::Option<::std::string::String>,
78    pub(crate) intended_use: ::std::option::Option<crate::types::GetPlaceIntendedUse>,
79    pub(crate) key: ::std::option::Option<::std::string::String>,
80}
81impl GetPlaceInputBuilder {
82    /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
83    /// This field is required.
84    pub fn place_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.place_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
89    pub fn set_place_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.place_id = input;
91        self
92    }
93    /// <p>The <code>PlaceId</code> of the place you wish to receive the information for.</p>
94    pub fn get_place_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.place_id
96    }
97    /// Appends an item to `additional_features`.
98    ///
99    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
100    ///
101    /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
102    pub fn additional_features(mut self, input: crate::types::GetPlaceAdditionalFeature) -> Self {
103        let mut v = self.additional_features.unwrap_or_default();
104        v.push(input);
105        self.additional_features = ::std::option::Option::Some(v);
106        self
107    }
108    /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
109    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GetPlaceAdditionalFeature>>) -> Self {
110        self.additional_features = input;
111        self
112    }
113    /// <p>A list of optional additional parameters such as time zone that can be requested for each result.</p>
114    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GetPlaceAdditionalFeature>> {
115        &self.additional_features
116    }
117    /// <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>
118    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.language = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <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>
123    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.language = input;
125        self
126    }
127    /// <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>
128    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
129        &self.language
130    }
131    /// <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>
132    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.political_view = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <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>
137    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.political_view = input;
139        self
140    }
141    /// <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>
142    pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
143        &self.political_view
144    }
145    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
146    /// <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>
147    /// </note>
148    pub fn intended_use(mut self, input: crate::types::GetPlaceIntendedUse) -> Self {
149        self.intended_use = ::std::option::Option::Some(input);
150        self
151    }
152    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
153    /// <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>
154    /// </note>
155    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::GetPlaceIntendedUse>) -> Self {
156        self.intended_use = input;
157        self
158    }
159    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
160    /// <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>
161    /// </note>
162    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::GetPlaceIntendedUse> {
163        &self.intended_use
164    }
165    /// <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>
166    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.key = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <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>
171    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.key = input;
173        self
174    }
175    /// <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>
176    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
177        &self.key
178    }
179    /// Consumes the builder and constructs a [`GetPlaceInput`](crate::operation::get_place::GetPlaceInput).
180    pub fn build(self) -> ::std::result::Result<crate::operation::get_place::GetPlaceInput, ::aws_smithy_types::error::operation::BuildError> {
181        ::std::result::Result::Ok(crate::operation::get_place::GetPlaceInput {
182            place_id: self.place_id,
183            additional_features: self.additional_features,
184            language: self.language,
185            political_view: self.political_view,
186            intended_use: self.intended_use,
187            key: self.key,
188        })
189    }
190}
191impl ::std::fmt::Debug for GetPlaceInputBuilder {
192    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
193        let mut formatter = f.debug_struct("GetPlaceInputBuilder");
194        formatter.field("place_id", &"*** Sensitive Data Redacted ***");
195        formatter.field("additional_features", &self.additional_features);
196        formatter.field("language", &self.language);
197        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
198        formatter.field("intended_use", &self.intended_use);
199        formatter.field("key", &"*** Sensitive Data Redacted ***");
200        formatter.finish()
201    }
202}