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