square_api_client/models/
address.rs

1//! Model struct for Address type
2
3use serde::{Deserialize, Serialize};
4
5use super::enums::Country;
6
7/// Represents a postal address in a country.
8///
9/// For more information, see [Working with
10/// Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
11#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
12pub struct Address {
13    /// The first line of the address.
14    ///
15    /// Fields that start with `address_line` provide the address's most specific details, like
16    /// street number, street name, and building name. They do not provide less specific details
17    /// like city, state/province, or country (these details are provided in other fields).
18    pub address_line_1: Option<String>,
19    /// The second line of the address, if any.
20    pub address_line_2: Option<String>,
21    /// The third line of the address, if any.
22    pub address_line_3: Option<String>,
23    /// The city or town of the address. For a full list of field meanings by country, see [Working
24    /// with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
25    pub locality: Option<String>,
26    /// A civil region within the address's `locality`, if any.
27    pub sublocality: Option<String>,
28    /// A civil entity within the address's country. In the US, this is the state. For a full list
29    /// of field meanings by country, see [Working with
30    /// Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
31    pub administrative_district_level_1: Option<String>,
32    /// The address's postal code. For a full list of field meanings by country, see [Working with
33    /// Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses).
34    pub postal_code: Option<String>,
35    /// The address's country, in the two-letter format of ISO 3166. For example, `US` or `FR`.
36    pub country: Option<Country>,
37}