Struct google_api_proto::google::cloud::retail::v2beta::SetInventoryRequest
source · pub struct SetInventoryRequest {
pub inventory: Option<Product>,
pub set_mask: Option<FieldMask>,
pub set_time: Option<Timestamp>,
pub allow_missing: bool,
}
Expand description
Request message for [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory] method.
Fields§
§inventory: Option<Product>
Required. The inventory information to update. The allowable fields to update are:
- [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
- [Product.availability][google.cloud.retail.v2beta.Product.availability]
- [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
- [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info] The updated inventory fields must be specified in [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask].
If [SetInventoryRequest.inventory.name][google.cloud.retail.v2beta.Product.name] is empty or invalid, an INVALID_ARGUMENT error is returned.
If the caller does not have permission to update the [Product][google.cloud.retail.v2beta.Product] named in [Product.name][google.cloud.retail.v2beta.Product.name], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the [Product][google.cloud.retail.v2beta.Product] to update does not have existing inventory information, the provided inventory information will be inserted.
If the [Product][google.cloud.retail.v2beta.Product] to update has existing inventory information, the provided inventory information will be merged while respecting the last update time for each inventory field, using the provided or default value for [SetInventoryRequest.set_time][google.cloud.retail.v2beta.SetInventoryRequest.set_time].
The caller can replace place IDs for a subset of fulfillment types in the following ways:
- Adds “fulfillment_info” in [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
- Specifies only the desired fulfillment types and corresponding place IDs to update in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
The caller can clear all place IDs from a subset of fulfillment types in the following ways:
- Adds “fulfillment_info” in [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask]
- Specifies only the desired fulfillment types to clear in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
- Checks that only the desired fulfillment info types have empty [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]
The last update time is recorded for the following inventory fields:
- [Product.price_info][google.cloud.retail.v2beta.Product.price_info]
- [Product.availability][google.cloud.retail.v2beta.Product.availability]
- [Product.available_quantity][google.cloud.retail.v2beta.Product.available_quantity]
- [Product.fulfillment_info][google.cloud.retail.v2beta.Product.fulfillment_info]
If a full overwrite of inventory information while ignoring timestamps is needed, [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] should be invoked instead.
set_mask: Option<FieldMask>
Indicates which inventory fields in the provided [Product][google.cloud.retail.v2beta.Product] to update.
At least one field must be provided.
If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned and the entire update will be ignored.
set_time: Option<Timestamp>
The time when the request is issued, used to prevent out-of-order updates on inventory fields with the last update time recorded. If not provided, the internal system time will be used.
allow_missing: bool
If set to true, and the [Product][google.cloud.retail.v2beta.Product] with name [Product.name][google.cloud.retail.v2beta.Product.name] is not found, the inventory update will still be processed and retained for at most 1 day until the [Product][google.cloud.retail.v2beta.Product] is created. If set to false, a NOT_FOUND error is returned if the [Product][google.cloud.retail.v2beta.Product] is not found.
Trait Implementations§
source§impl Clone for SetInventoryRequest
impl Clone for SetInventoryRequest
source§fn clone(&self) -> SetInventoryRequest
fn clone(&self) -> SetInventoryRequest
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SetInventoryRequest
impl Debug for SetInventoryRequest
source§impl Default for SetInventoryRequest
impl Default for SetInventoryRequest
source§impl Message for SetInventoryRequest
impl Message for SetInventoryRequest
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for SetInventoryRequest
impl PartialEq for SetInventoryRequest
source§fn eq(&self, other: &SetInventoryRequest) -> bool
fn eq(&self, other: &SetInventoryRequest) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for SetInventoryRequest
Auto Trait Implementations§
impl Freeze for SetInventoryRequest
impl RefUnwindSafe for SetInventoryRequest
impl Send for SetInventoryRequest
impl Sync for SetInventoryRequest
impl Unpin for SetInventoryRequest
impl UnwindSafe for SetInventoryRequest
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