pub struct CreateProduct {
pub name: String,
pub slug: Option<String>,
pub description: Option<String>,
pub product_type: Option<ProductType>,
pub attributes: Option<Vec<ProductAttribute>>,
pub seo: Option<SeoMetadata>,
pub variants: Option<Vec<CreateProductVariant>>,
}Expand description
Input for creating a product
Fields§
§name: String§slug: Option<String>§description: Option<String>§product_type: Option<ProductType>§attributes: Option<Vec<ProductAttribute>>§seo: Option<SeoMetadata>§variants: Option<Vec<CreateProductVariant>>Trait Implementations§
Source§impl Clone for CreateProduct
impl Clone for CreateProduct
Source§fn clone(&self) -> CreateProduct
fn clone(&self) -> CreateProduct
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreateProduct
impl Debug for CreateProduct
Source§impl Default for CreateProduct
impl Default for CreateProduct
Source§fn default() -> CreateProduct
fn default() -> CreateProduct
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CreateProduct
impl<'de> Deserialize<'de> for CreateProduct
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateProduct, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateProduct, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for CreateProduct
impl Serialize for CreateProduct
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Validate for CreateProduct
impl Validate for CreateProduct
Source§fn validate(&self) -> Result<(), CommerceError>
fn validate(&self) -> Result<(), CommerceError>
Validate a product create request.
Requires a non-empty product name and validates each supplied variant (valid SKU, non-negative price/cost). A product may be created without variants, which are commonly added afterward.
Auto Trait Implementations§
impl Freeze for CreateProduct
impl RefUnwindSafe for CreateProduct
impl Send for CreateProduct
impl Sync for CreateProduct
impl Unpin for CreateProduct
impl UnsafeUnpin for CreateProduct
impl UnwindSafe for CreateProduct
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
Mutably borrows from an owned value. Read more