#[non_exhaustive]pub struct LocalInventory {
pub place_id: String,
pub price_info: Option<PriceInfo>,
pub attributes: HashMap<String, CustomAttribute>,
pub fulfillment_types: Vec<String>,
/* private fields */
}Expand description
The inventory information at a place (e.g. a store) identified by a place ID.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.place_id: StringOptional. The place ID for the current set of inventory information.
price_info: Option<PriceInfo>Optional. Product price and cost information.
Google Merchant Center property price.
attributes: HashMap<String, CustomAttribute>Optional. Additional local inventory attributes, for example, store name, promotion tags, etc.
This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:
- At most 30 attributes are allowed.
- The key must be a UTF-8 encoded string with a length limit of 32 characters.
- The key must match the pattern:
[a-zA-Z0-9][a-zA-Z0-9_]*. For example, key0LikeThis or KEY_1_LIKE_THIS. - The attribute values must be of the same type (text or number).
- Only 1 value is allowed for each attribute.
- For text values, the length limit is 256 UTF-8 characters.
- The attribute does not support search. The
searchablefield should be unset or set to false. - The max summed total bytes of custom attribute keys and values per product is 5MiB.
fulfillment_types: Vec<String>Optional. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI.
Supported values:
- “pickup-in-store”
- “ship-to-store”
- “same-day-delivery”
- “next-day-delivery”
- “custom-type-1”
- “custom-type-2”
- “custom-type-3”
- “custom-type-4”
- “custom-type-5”
If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned.
All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.
Implementations§
Source§impl LocalInventory
impl LocalInventory
pub fn new() -> Self
Sourcepub fn set_place_id<T: Into<String>>(self, v: T) -> Self
pub fn set_place_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_price_info<T>(self, v: T) -> Self
pub fn set_price_info<T>(self, v: T) -> Self
Sets the value of price_info.
§Example
use google_cloud_retail_v2::model::PriceInfo;
let x = LocalInventory::new().set_price_info(PriceInfo::default()/* use setters */);Sourcepub fn set_or_clear_price_info<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_price_info<T>(self, v: Option<T>) -> Self
Sets or clears the value of price_info.
§Example
use google_cloud_retail_v2::model::PriceInfo;
let x = LocalInventory::new().set_or_clear_price_info(Some(PriceInfo::default()/* use setters */));
let x = LocalInventory::new().set_or_clear_price_info(None::<PriceInfo>);Sourcepub fn set_attributes<T, K, V>(self, v: T) -> Self
pub fn set_attributes<T, K, V>(self, v: T) -> Self
Sets the value of attributes.
§Example
use google_cloud_retail_v2::model::CustomAttribute;
let x = LocalInventory::new().set_attributes([
("key0", CustomAttribute::default()/* use setters */),
("key1", CustomAttribute::default()/* use (different) setters */),
]);Sourcepub fn set_fulfillment_types<T, V>(self, v: T) -> Self
pub fn set_fulfillment_types<T, V>(self, v: T) -> Self
Sets the value of fulfillment_types.
§Example
let x = LocalInventory::new().set_fulfillment_types(["a", "b", "c"]);Trait Implementations§
Source§impl Clone for LocalInventory
impl Clone for LocalInventory
Source§fn clone(&self) -> LocalInventory
fn clone(&self) -> LocalInventory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more