Enum google_api_proto::google::cloud::retail::v2alpha::product::Expiration
source · pub enum Expiration {
ExpireTime(Timestamp),
Ttl(Duration),
}
Variants§
ExpireTime(Timestamp)
The timestamp when this product becomes unavailable for [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search]. Note that this is only applicable to [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], and ignored for [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In general, we suggest the users to delete the stale products explicitly, instead of using this field to determine staleness.
If it is set, the [Product][google.cloud.retail.v2alpha.Product] is not available for [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] after [expire_time][google.cloud.retail.v2alpha.Product.expire_time]. However, the product can still be retrieved by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] and [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
[expire_time][google.cloud.retail.v2alpha.Product.expire_time] must be later than [available_time][google.cloud.retail.v2alpha.Product.available_time] and [publish_time][google.cloud.retail.v2alpha.Product.publish_time], otherwise an INVALID_ARGUMENT error is thrown.
Corresponding properties: Google Merchant Center property expiration_date.
Ttl(Duration)
Input only. The TTL (time to live) of the product. Note that this is only applicable to [Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] and [Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION], and ignored for [Type.VARIANT][google.cloud.retail.v2alpha.Product.Type.VARIANT]. In general, we suggest the users to delete the stale products explicitly, instead of using this field to determine staleness.
If it is set, it must be a non-negative value, and [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is set as current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl]. The derived [expire_time][google.cloud.retail.v2alpha.Product.expire_time] is returned in the output and [ttl][google.cloud.retail.v2alpha.Product.ttl] is left blank when retrieving the [Product][google.cloud.retail.v2alpha.Product].
If it is set, the product is not available for [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search] after current timestamp plus [ttl][google.cloud.retail.v2alpha.Product.ttl]. However, the product can still be retrieved by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] and [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Implementations§
source§impl Expiration
impl Expiration
sourcepub fn merge<B>(
field: &mut Option<Expiration>,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError>where
B: Buf,
pub fn merge<B>(
field: &mut Option<Expiration>,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError>where
B: Buf,
Decodes an instance of the message from a buffer, and merges it into self.
sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
source§impl Clone for Expiration
impl Clone for Expiration
source§fn clone(&self) -> Expiration
fn clone(&self) -> Expiration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Expiration
impl Debug for Expiration
source§impl PartialEq for Expiration
impl PartialEq for Expiration
source§fn eq(&self, other: &Expiration) -> bool
fn eq(&self, other: &Expiration) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for Expiration
Auto Trait Implementations§
impl Freeze for Expiration
impl RefUnwindSafe for Expiration
impl Send for Expiration
impl Sync for Expiration
impl Unpin for Expiration
impl UnwindSafe for Expiration
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request