1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains details about addresses or points of interest that match the search criteria.</p>
/// <p>Not all details are included with all responses. Some details may only be returned by specific data partners.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Place {
/// <p>The full name and address of the point of interest such as a city, region, or country. For example, <code>123 Any Street, Any Town, USA</code>.</p>
#[doc(hidden)]
pub label: std::option::Option<std::string::String>,
/// <p>Places uses a point geometry to specify a location or a Place.</p>
#[doc(hidden)]
pub geometry: std::option::Option<crate::types::PlaceGeometry>,
/// <p>The numerical portion of an address, such as a building number. </p>
#[doc(hidden)]
pub address_number: std::option::Option<std::string::String>,
/// <p>The name for a street or a road to identify a location. For example, <code>Main Street</code>.</p>
#[doc(hidden)]
pub street: std::option::Option<std::string::String>,
/// <p>The name of a community district. For example, <code>Downtown</code>.</p>
#[doc(hidden)]
pub neighborhood: std::option::Option<std::string::String>,
/// <p>A name for a local area, such as a city or town name. For example, <code>Toronto</code>.</p>
#[doc(hidden)]
pub municipality: std::option::Option<std::string::String>,
/// <p>A county, or an area that's part of a larger region. For example, <code>Metro Vancouver</code>.</p>
#[doc(hidden)]
pub sub_region: std::option::Option<std::string::String>,
/// <p>A name for an area or geographical division, such as a province or state name. For example, <code>British Columbia</code>.</p>
#[doc(hidden)]
pub region: std::option::Option<std::string::String>,
/// <p>A country/region specified using <a href="https://www.iso.org/iso-3166-country-codes.html">ISO 3166</a> 3-digit country/region code. For example, <code>CAN</code>.</p>
#[doc(hidden)]
pub country: std::option::Option<std::string::String>,
/// <p>A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location. </p>
#[doc(hidden)]
pub postal_code: std::option::Option<std::string::String>,
/// <p> <code>True</code> if the result is interpolated from other known places.</p>
/// <p> <code>False</code> if the Place is a known place.</p>
/// <p>Not returned when the partner does not provide the information.</p>
/// <p>For example, returns <code>False</code> for an address location that is found in the partner data, but returns <code>True</code> if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses. </p>
#[doc(hidden)]
pub interpolated: std::option::Option<bool>,
/// <p>The time zone in which the <code>Place</code> is located. Returned only when using HERE as the selected partner.</p>
#[doc(hidden)]
pub time_zone: std::option::Option<crate::types::TimeZone>,
/// <p>For addresses with a <code>UnitNumber</code>, the type of unit. For example, <code>Apartment</code>.</p>
#[doc(hidden)]
pub unit_type: std::option::Option<std::string::String>,
/// <p>For addresses with multiple units, the unit identifier. Can include numbers and letters, for example <code>3B</code> or <code>Unit 123</code>.</p> <note>
/// <p>Returned only for a place index that uses Esri as a data provider. Is not returned for <code>SearchPlaceIndexForPosition</code>.</p>
/// </note>
#[doc(hidden)]
pub unit_number: std::option::Option<std::string::String>,
}
impl Place {
/// <p>The full name and address of the point of interest such as a city, region, or country. For example, <code>123 Any Street, Any Town, USA</code>.</p>
pub fn label(&self) -> std::option::Option<&str> {
self.label.as_deref()
}
/// <p>Places uses a point geometry to specify a location or a Place.</p>
pub fn geometry(&self) -> std::option::Option<&crate::types::PlaceGeometry> {
self.geometry.as_ref()
}
/// <p>The numerical portion of an address, such as a building number. </p>
pub fn address_number(&self) -> std::option::Option<&str> {
self.address_number.as_deref()
}
/// <p>The name for a street or a road to identify a location. For example, <code>Main Street</code>.</p>
pub fn street(&self) -> std::option::Option<&str> {
self.street.as_deref()
}
/// <p>The name of a community district. For example, <code>Downtown</code>.</p>
pub fn neighborhood(&self) -> std::option::Option<&str> {
self.neighborhood.as_deref()
}
/// <p>A name for a local area, such as a city or town name. For example, <code>Toronto</code>.</p>
pub fn municipality(&self) -> std::option::Option<&str> {
self.municipality.as_deref()
}
/// <p>A county, or an area that's part of a larger region. For example, <code>Metro Vancouver</code>.</p>
pub fn sub_region(&self) -> std::option::Option<&str> {
self.sub_region.as_deref()
}
/// <p>A name for an area or geographical division, such as a province or state name. For example, <code>British Columbia</code>.</p>
pub fn region(&self) -> std::option::Option<&str> {
self.region.as_deref()
}
/// <p>A country/region specified using <a href="https://www.iso.org/iso-3166-country-codes.html">ISO 3166</a> 3-digit country/region code. For example, <code>CAN</code>.</p>
pub fn country(&self) -> std::option::Option<&str> {
self.country.as_deref()
}
/// <p>A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location. </p>
pub fn postal_code(&self) -> std::option::Option<&str> {
self.postal_code.as_deref()
}
/// <p> <code>True</code> if the result is interpolated from other known places.</p>
/// <p> <code>False</code> if the Place is a known place.</p>
/// <p>Not returned when the partner does not provide the information.</p>
/// <p>For example, returns <code>False</code> for an address location that is found in the partner data, but returns <code>True</code> if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses. </p>
pub fn interpolated(&self) -> std::option::Option<bool> {
self.interpolated
}
/// <p>The time zone in which the <code>Place</code> is located. Returned only when using HERE as the selected partner.</p>
pub fn time_zone(&self) -> std::option::Option<&crate::types::TimeZone> {
self.time_zone.as_ref()
}
/// <p>For addresses with a <code>UnitNumber</code>, the type of unit. For example, <code>Apartment</code>.</p>
pub fn unit_type(&self) -> std::option::Option<&str> {
self.unit_type.as_deref()
}
/// <p>For addresses with multiple units, the unit identifier. Can include numbers and letters, for example <code>3B</code> or <code>Unit 123</code>.</p> <note>
/// <p>Returned only for a place index that uses Esri as a data provider. Is not returned for <code>SearchPlaceIndexForPosition</code>.</p>
/// </note>
pub fn unit_number(&self) -> std::option::Option<&str> {
self.unit_number.as_deref()
}
}
impl Place {
/// Creates a new builder-style object to manufacture [`Place`](crate::types::Place).
pub fn builder() -> crate::types::builders::PlaceBuilder {
crate::types::builders::PlaceBuilder::default()
}
}
/// A builder for [`Place`](crate::types::Place).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct PlaceBuilder {
pub(crate) label: std::option::Option<std::string::String>,
pub(crate) geometry: std::option::Option<crate::types::PlaceGeometry>,
pub(crate) address_number: std::option::Option<std::string::String>,
pub(crate) street: std::option::Option<std::string::String>,
pub(crate) neighborhood: std::option::Option<std::string::String>,
pub(crate) municipality: std::option::Option<std::string::String>,
pub(crate) sub_region: std::option::Option<std::string::String>,
pub(crate) region: std::option::Option<std::string::String>,
pub(crate) country: std::option::Option<std::string::String>,
pub(crate) postal_code: std::option::Option<std::string::String>,
pub(crate) interpolated: std::option::Option<bool>,
pub(crate) time_zone: std::option::Option<crate::types::TimeZone>,
pub(crate) unit_type: std::option::Option<std::string::String>,
pub(crate) unit_number: std::option::Option<std::string::String>,
}
impl PlaceBuilder {
/// <p>The full name and address of the point of interest such as a city, region, or country. For example, <code>123 Any Street, Any Town, USA</code>.</p>
pub fn label(mut self, input: impl Into<std::string::String>) -> Self {
self.label = Some(input.into());
self
}
/// <p>The full name and address of the point of interest such as a city, region, or country. For example, <code>123 Any Street, Any Town, USA</code>.</p>
pub fn set_label(mut self, input: std::option::Option<std::string::String>) -> Self {
self.label = input;
self
}
/// <p>Places uses a point geometry to specify a location or a Place.</p>
pub fn geometry(mut self, input: crate::types::PlaceGeometry) -> Self {
self.geometry = Some(input);
self
}
/// <p>Places uses a point geometry to specify a location or a Place.</p>
pub fn set_geometry(mut self, input: std::option::Option<crate::types::PlaceGeometry>) -> Self {
self.geometry = input;
self
}
/// <p>The numerical portion of an address, such as a building number. </p>
pub fn address_number(mut self, input: impl Into<std::string::String>) -> Self {
self.address_number = Some(input.into());
self
}
/// <p>The numerical portion of an address, such as a building number. </p>
pub fn set_address_number(mut self, input: std::option::Option<std::string::String>) -> Self {
self.address_number = input;
self
}
/// <p>The name for a street or a road to identify a location. For example, <code>Main Street</code>.</p>
pub fn street(mut self, input: impl Into<std::string::String>) -> Self {
self.street = Some(input.into());
self
}
/// <p>The name for a street or a road to identify a location. For example, <code>Main Street</code>.</p>
pub fn set_street(mut self, input: std::option::Option<std::string::String>) -> Self {
self.street = input;
self
}
/// <p>The name of a community district. For example, <code>Downtown</code>.</p>
pub fn neighborhood(mut self, input: impl Into<std::string::String>) -> Self {
self.neighborhood = Some(input.into());
self
}
/// <p>The name of a community district. For example, <code>Downtown</code>.</p>
pub fn set_neighborhood(mut self, input: std::option::Option<std::string::String>) -> Self {
self.neighborhood = input;
self
}
/// <p>A name for a local area, such as a city or town name. For example, <code>Toronto</code>.</p>
pub fn municipality(mut self, input: impl Into<std::string::String>) -> Self {
self.municipality = Some(input.into());
self
}
/// <p>A name for a local area, such as a city or town name. For example, <code>Toronto</code>.</p>
pub fn set_municipality(mut self, input: std::option::Option<std::string::String>) -> Self {
self.municipality = input;
self
}
/// <p>A county, or an area that's part of a larger region. For example, <code>Metro Vancouver</code>.</p>
pub fn sub_region(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_region = Some(input.into());
self
}
/// <p>A county, or an area that's part of a larger region. For example, <code>Metro Vancouver</code>.</p>
pub fn set_sub_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sub_region = input;
self
}
/// <p>A name for an area or geographical division, such as a province or state name. For example, <code>British Columbia</code>.</p>
pub fn region(mut self, input: impl Into<std::string::String>) -> Self {
self.region = Some(input.into());
self
}
/// <p>A name for an area or geographical division, such as a province or state name. For example, <code>British Columbia</code>.</p>
pub fn set_region(mut self, input: std::option::Option<std::string::String>) -> Self {
self.region = input;
self
}
/// <p>A country/region specified using <a href="https://www.iso.org/iso-3166-country-codes.html">ISO 3166</a> 3-digit country/region code. For example, <code>CAN</code>.</p>
pub fn country(mut self, input: impl Into<std::string::String>) -> Self {
self.country = Some(input.into());
self
}
/// <p>A country/region specified using <a href="https://www.iso.org/iso-3166-country-codes.html">ISO 3166</a> 3-digit country/region code. For example, <code>CAN</code>.</p>
pub fn set_country(mut self, input: std::option::Option<std::string::String>) -> Self {
self.country = input;
self
}
/// <p>A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location. </p>
pub fn postal_code(mut self, input: impl Into<std::string::String>) -> Self {
self.postal_code = Some(input.into());
self
}
/// <p>A group of numbers and letters in a country-specific format, which accompanies the address for the purpose of identifying a location. </p>
pub fn set_postal_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.postal_code = input;
self
}
/// <p> <code>True</code> if the result is interpolated from other known places.</p>
/// <p> <code>False</code> if the Place is a known place.</p>
/// <p>Not returned when the partner does not provide the information.</p>
/// <p>For example, returns <code>False</code> for an address location that is found in the partner data, but returns <code>True</code> if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses. </p>
pub fn interpolated(mut self, input: bool) -> Self {
self.interpolated = Some(input);
self
}
/// <p> <code>True</code> if the result is interpolated from other known places.</p>
/// <p> <code>False</code> if the Place is a known place.</p>
/// <p>Not returned when the partner does not provide the information.</p>
/// <p>For example, returns <code>False</code> for an address location that is found in the partner data, but returns <code>True</code> if an address does not exist in the partner data and its location is calculated by interpolating between other known addresses. </p>
pub fn set_interpolated(mut self, input: std::option::Option<bool>) -> Self {
self.interpolated = input;
self
}
/// <p>The time zone in which the <code>Place</code> is located. Returned only when using HERE as the selected partner.</p>
pub fn time_zone(mut self, input: crate::types::TimeZone) -> Self {
self.time_zone = Some(input);
self
}
/// <p>The time zone in which the <code>Place</code> is located. Returned only when using HERE as the selected partner.</p>
pub fn set_time_zone(mut self, input: std::option::Option<crate::types::TimeZone>) -> Self {
self.time_zone = input;
self
}
/// <p>For addresses with a <code>UnitNumber</code>, the type of unit. For example, <code>Apartment</code>.</p>
pub fn unit_type(mut self, input: impl Into<std::string::String>) -> Self {
self.unit_type = Some(input.into());
self
}
/// <p>For addresses with a <code>UnitNumber</code>, the type of unit. For example, <code>Apartment</code>.</p>
pub fn set_unit_type(mut self, input: std::option::Option<std::string::String>) -> Self {
self.unit_type = input;
self
}
/// <p>For addresses with multiple units, the unit identifier. Can include numbers and letters, for example <code>3B</code> or <code>Unit 123</code>.</p> <note>
/// <p>Returned only for a place index that uses Esri as a data provider. Is not returned for <code>SearchPlaceIndexForPosition</code>.</p>
/// </note>
pub fn unit_number(mut self, input: impl Into<std::string::String>) -> Self {
self.unit_number = Some(input.into());
self
}
/// <p>For addresses with multiple units, the unit identifier. Can include numbers and letters, for example <code>3B</code> or <code>Unit 123</code>.</p> <note>
/// <p>Returned only for a place index that uses Esri as a data provider. Is not returned for <code>SearchPlaceIndexForPosition</code>.</p>
/// </note>
pub fn set_unit_number(mut self, input: std::option::Option<std::string::String>) -> Self {
self.unit_number = input;
self
}
/// Consumes the builder and constructs a [`Place`](crate::types::Place).
pub fn build(self) -> crate::types::Place {
crate::types::Place {
label: self.label,
geometry: self.geometry,
address_number: self.address_number,
street: self.street,
neighborhood: self.neighborhood,
municipality: self.municipality,
sub_region: self.sub_region,
region: self.region,
country: self.country,
postal_code: self.postal_code,
interpolated: self.interpolated,
time_zone: self.time_zone,
unit_type: self.unit_type,
unit_number: self.unit_number,
}
}
}