#[non_exhaustive]pub struct UpdateProductRequest {
pub product: Option<Product>,
pub update_mask: Option<FieldMask>,
pub allow_missing: bool,
/* private fields */
}Expand description
Request message for ProductService.UpdateProduct method.
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.product: Option<Product>Required. The product to update/create.
If the caller does not have permission to update the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the Product to update does not exist and allow_missing is not set, a NOT_FOUND error is returned.
update_mask: Option<FieldMask>Indicates which fields in the provided Product to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated.
If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.
The attribute key can be updated by setting the mask path as “attributes.${key_name}”. If a key name is present in the mask but not in the patching product from the request, this key will be deleted after the update.
allow_missing: boolIf set to true, and the Product is not
found, a new Product will be created. In
this situation, update_mask is ignored.
Implementations§
Source§impl UpdateProductRequest
impl UpdateProductRequest
Sourcepub fn set_product<T>(self, v: T) -> Self
pub fn set_product<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_product<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_product<T>(self, v: Option<T>) -> Self
Sourcepub fn set_update_mask<T>(self, v: T) -> Self
pub fn set_update_mask<T>(self, v: T) -> Self
Sets the value of update_mask.
§Example
use wkt::FieldMask;
let x = UpdateProductRequest::new().set_update_mask(FieldMask::default()/* use setters */);Sourcepub fn set_or_clear_update_mask<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_mask<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_mask.
§Example
use wkt::FieldMask;
let x = UpdateProductRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
let x = UpdateProductRequest::new().set_or_clear_update_mask(None::<FieldMask>);Sourcepub fn set_allow_missing<T: Into<bool>>(self, v: T) -> Self
pub fn set_allow_missing<T: Into<bool>>(self, v: T) -> Self
Sets the value of allow_missing.
§Example
let x = UpdateProductRequest::new().set_allow_missing(true);Trait Implementations§
Source§impl Clone for UpdateProductRequest
impl Clone for UpdateProductRequest
Source§fn clone(&self) -> UpdateProductRequest
fn clone(&self) -> UpdateProductRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more