hermes_ebay_sell_inventory/models/address.rs
1/*
2 * Inventory API
3 *
4 * The Inventory API is used to create and manage inventory, and then to publish and manage this inventory on an eBay marketplace. There are also methods in this API that will convert eligible, active eBay listings into the Inventory API model.
5 *
6 * The version of the OpenAPI document: 1.18.4
7 * Contact: your-email@example.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Address : This type is used to define the physical address of an inventory location.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Address {
17 /// The first line of a street address. This field is required for store and fulfillment center locations. A street address is not required for warehouse locations.<br><br>This field will be returned if defined for an inventory location. <br><br><b>Max length</b>: 128
18 #[serde(rename = "addressLine1", skip_serializing_if = "Option::is_none")]
19 pub address_line1: Option<String>,
20 /// The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. <br><br>This field will be returned if defined for an inventory location. <br><br><b>Max length</b>: 128
21 #[serde(rename = "addressLine2", skip_serializing_if = "Option::is_none")]
22 pub address_line2: Option<String>,
23 /// The city in which the inventory location resides. This field is required for store and fulfillment center locations. For warehouse locations, this field is conditionally required as part of a <strong>city</strong> and <strong>stateOrProvince</strong> pair if a <strong>postalCode</strong> is not provided. If a <strong>postalCode</strong> is provided, the city is derived from the provided postal code and this field is technically optional.<br><br>This field is returned if defined for an inventory location. <br><br><b>Max length</b>: 128
24 #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
25 pub city: Option<String>,
26 /// The country in which the address resides, represented as two-letter <a href=\"https://www.iso.org/iso-3166-country-codes.html \" title=\"https://www.iso.org \" target=\"_blank\">ISO 3166</a> country code. For example, <code>US</code> represents the United States, and <code>DE</code> represents Germany. For implementation help, refer to <a href='https://developer.ebay.com/api-docs/sell/inventory/types/ba:CountryCodeEnum'>eBay API documentation</a>
27 #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
28 pub country: Option<String>,
29 /// The county in which the address resides.<br><br>This field is returned if defined for an inventory location.
30 #[serde(rename = "county", skip_serializing_if = "Option::is_none")]
31 pub county: Option<String>,
32 /// The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also uses postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. This field is required for store and fulfillment center locations. <br><br>For warehouse locations, this field is conditionally required if a <strong>city</strong> and <strong>stateOrProvince</strong> pair is not provided.<br><br><span class=\"tablenote\"> <strong>Note:</strong> For warehouse locations, <strong>city</strong> and <strong>stateOrProvince</strong> pair can be used instead of a <strong>postalCode</strong> value, and then the postal code is just derived from the city and state/province.</span><br><br>This field is returned if defined for an inventory location. <br><br><b>Max length</b>: 16
33 #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
34 pub postal_code: Option<String>,
35 /// The state/province in which the inventory location resides. This field is required for store and fulfillment center locations. For warehouse locations, this field is conditionally required as part of a <strong>city</strong> and <strong>stateOrProvince</strong> pair if a <strong>postalCode</strong> is not provided. If a <strong>postalCode</strong> is provided, the state or province is derived from the provided zip code and this field is technically optional.<br><br><b>Max length</b>: 128
36 #[serde(rename = "stateOrProvince", skip_serializing_if = "Option::is_none")]
37 pub state_or_province: Option<String>,
38}
39
40impl Address {
41 /// This type is used to define the physical address of an inventory location.
42 pub fn new() -> Address {
43 Address {
44 address_line1: None,
45 address_line2: None,
46 city: None,
47 country: None,
48 county: None,
49 postal_code: None,
50 state_or_province: None,
51 }
52 }
53}
54