square_api_client/models/location.rs
1//! Model struct for Location type
2
3use serde::{Deserialize, Serialize};
4
5use super::{
6 enums::{
7 Country, Currency, Language, LocationCapability, LocationStatus, LocationType, Timezone,
8 },
9 Address, BusinessHours, Coordinates, DateTime, TaxIds,
10};
11
12/// Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api).
13#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
14pub struct Location {
15 /// **Read only** A short generated string of letters and numbers that uniquely identifies this
16 /// location instance.
17 ///
18 /// Max Length 32
19 pub id: Option<String>,
20 /// The name of the location. This information appears in the Seller Dashboard as the nickname.
21 /// A location name must be unique within a seller account.
22 ///
23 /// Max Length 255
24 pub name: Option<String>,
25 /// The physical address of the location.
26 pub address: Option<Address>,
27 /// The [IANA time zone](https://www.iana.org/time-zones) identifier for the time zone of the
28 /// location. For example, `America/Los_Angeles`.
29 pub timezone: Option<Timezone>,
30 /// **Read only** The Square features that are enabled for the location.
31 pub capabilities: Option<Vec<LocationCapability>>,
32 /// The status of the location.
33 pub status: Option<LocationStatus>,
34 /// **Read only** The time when the location was created, in RFC 3339 format. For more
35 /// information, see
36 /// [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).
37 pub created_at: Option<DateTime>,
38 /// **Read only** The ID of the merchant that owns the location.
39 ///
40 /// Max Length 32
41 pub merchant_id: Option<String>,
42 /// **Read only** The country of the location, in the two-letter format of ISO 3166. For
43 /// example, `US` or `JP`.
44 pub country: Option<Country>,
45 /// The language associated with the location, in [BCP 47
46 /// format](https://tools.ietf.org/html/bcp47#appendix-A).
47 /// For more information, see [Location language
48 /// code](https://developer.squareup.com/docs/build-basics/general-considerations/language-preferences).
49 pub language_code: Option<Language>,
50 /// **Read only** The currency used for all transactions at this location, in ISO 4217 format.
51 /// For example, the currency code for US dollars is `USD`.
52 pub currency: Option<Currency>,
53 /// The phone number of the location. For example, `+1 855-700-6000`.
54 ///
55 /// Max Length 17
56 pub phone_number: Option<String>,
57 /// The name of the location's overall business. This name is present on receipts and other
58 /// customer-facing branding.
59 ///
60 /// Max Length 255
61 pub business_name: Option<String>,
62 /// The type of the location.
63 pub r#type: Option<LocationType>,
64 /// The website URL of the location. For example, `https://squareup.com`.
65 ///
66 /// Max Length 255
67 pub website_url: Option<String>,
68 /// The hours of operation for the location.
69 pub business_hours: Option<BusinessHours>,
70 /// The email address of the location. This can be unique to the location and is not always the
71 /// email address for the business owner or administrator.
72 ///
73 /// Max Length 255
74 pub business_email: Option<String>,
75 /// The description of the location. For example, `Main Street location`.
76 ///
77 /// Max Length 1024
78 pub description: Option<String>,
79 /// The Twitter username of the location without the '@' symbol. For example, `Square`.
80 ///
81 /// Min Length 1 Max Length 15
82 pub twitter_username: Option<String>,
83 /// The Instagram username of the location without the '@' symbol. For example, `square`.
84 ///
85 /// Min Length 1 Max Length 30
86 pub instagram_username: Option<String>,
87 /// The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For
88 /// example, `https://www.facebook.com/square`.
89 ///
90 /// Max Length 255
91 pub facebook_url: Option<String>,
92 /// The physical coordinates (latitude and longitude) of the location.
93 pub coordinates: Option<Coordinates>,
94 /// **Read only** The URL of the logo image for the location. When configured in the Seller
95 /// Dashboard (Receipts section), the logo appears on transactions (such as receipts and
96 /// invoices) that Square generates on behalf of the seller. This image should have a roughly
97 /// square (1:1) aspect ratio and should be at least 200x200 pixels.
98 ///
99 /// Max Length 255
100 pub logo_url: Option<String>,
101 /// **Read only** The URL of the Point of Sale background image for the location.
102 ///
103 /// Max Length 255
104 pub pos_background_url: Option<String>,
105 /// A four-digit number that describes the kind of goods or services sold at the location. The
106 /// [merchant category code
107 /// (MCC)](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code)
108 /// of the location as standardized by ISO 18245. For example, `5045`, for a location that sells
109 /// computer goods and software.
110 ///
111 /// Min Length 4 Max Length 4
112 pub mcc: Option<String>,
113 /// **Read only** The URL of a full-format logo image for the location. When configured in the
114 /// Seller Dashboard (Receipts section), the logo appears on transactions (such as receipts and
115 /// invoices) that Square generates on behalf of the seller. This image can be wider than it is
116 /// tall and should be at least 1280x648 pixels.
117 pub full_format_logo_url: Option<String>,
118 /// The tax IDs for this location.
119 pub tax_ids: Option<TaxIds>,
120}