aws-sdk-location 0.26.0

AWS SDK for Amazon Location Service
Documentation
// 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,
        }
    }
}