#[non_exhaustive]pub struct Tile {
pub representative_product_id: String,
pub product_attribute: Option<ProductAttribute>,
/* private fields */
}Expand description
This field specifies the tile information including an attribute key, attribute value. More fields will be added in the future, eg: product id or product counts, etc.
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.representative_product_id: StringThe representative product id for this tile.
product_attribute: Option<ProductAttribute>The attribute key and value for the tile.
Implementations§
Source§impl Tile
impl Tile
pub fn new() -> Self
Sourcepub fn set_representative_product_id<T: Into<String>>(self, v: T) -> Self
pub fn set_representative_product_id<T: Into<String>>(self, v: T) -> Self
Sets the value of representative_product_id.
§Example
let x = Tile::new().set_representative_product_id("example");Sourcepub fn set_product_attribute<T: Into<Option<ProductAttribute>>>(
self,
v: T,
) -> Self
pub fn set_product_attribute<T: Into<Option<ProductAttribute>>>( self, v: T, ) -> Self
Sets the value of product_attribute.
Note that all the setters affecting product_attribute are mutually
exclusive.
§Example
use google_cloud_retail_v2::model::ProductAttributeValue;
let x = Tile::new().set_product_attribute(Some(
google_cloud_retail_v2::model::tile::ProductAttribute::ProductAttributeValue(ProductAttributeValue::default().into())));Sourcepub fn product_attribute_value(&self) -> Option<&Box<ProductAttributeValue>>
pub fn product_attribute_value(&self) -> Option<&Box<ProductAttributeValue>>
The value of product_attribute
if it holds a ProductAttributeValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_product_attribute_value<T: Into<Box<ProductAttributeValue>>>(
self,
v: T,
) -> Self
pub fn set_product_attribute_value<T: Into<Box<ProductAttributeValue>>>( self, v: T, ) -> Self
Sets the value of product_attribute
to hold a ProductAttributeValue.
Note that all the setters affecting product_attribute are
mutually exclusive.
§Example
use google_cloud_retail_v2::model::ProductAttributeValue;
let x = Tile::new().set_product_attribute_value(ProductAttributeValue::default()/* use setters */);
assert!(x.product_attribute_value().is_some());
assert!(x.product_attribute_interval().is_none());Sourcepub fn product_attribute_interval(
&self,
) -> Option<&Box<ProductAttributeInterval>>
pub fn product_attribute_interval( &self, ) -> Option<&Box<ProductAttributeInterval>>
The value of product_attribute
if it holds a ProductAttributeInterval, None if the field is not set or
holds a different branch.
Sourcepub fn set_product_attribute_interval<T: Into<Box<ProductAttributeInterval>>>(
self,
v: T,
) -> Self
pub fn set_product_attribute_interval<T: Into<Box<ProductAttributeInterval>>>( self, v: T, ) -> Self
Sets the value of product_attribute
to hold a ProductAttributeInterval.
Note that all the setters affecting product_attribute are
mutually exclusive.
§Example
use google_cloud_retail_v2::model::ProductAttributeInterval;
let x = Tile::new().set_product_attribute_interval(ProductAttributeInterval::default()/* use setters */);
assert!(x.product_attribute_interval().is_some());
assert!(x.product_attribute_value().is_none());