pub struct ProductVariationCreateBuilder { /* private fields */ }

Implementations§

source§

impl ProductVariationCreateBuilder

source

pub fn description(&mut self, description: impl Into<String>) -> &mut Self

Variation description.

source

pub fn sku(&mut self, sku: impl Into<String>) -> &mut Self

Unique identifier.

source

pub fn regular_price(&mut self, regular_price: impl Into<String>) -> &mut Self

Variation regular price.

source

pub fn sale_price(&mut self, sale_price: impl Into<String>) -> &mut Self

Variation sale price.

source

pub fn date_on_sale_from( &mut self, year: i32, month: u32, day: u32 ) -> &mut Self

Start date of sale price, in the site’s timezone.

source

pub fn date_on_sale_to(&mut self, year: i32, month: u32, day: u32) -> &mut Self

End date of sale price, in the site’s timezone.

source

pub fn status(&mut self, status: ProductStatus) -> &mut Self

Variation status. Options: draft, pending, private and publish. Default is publish.

source

pub fn is_virtual(&mut self) -> &mut Self

If the variation is virtual. Default is false.

source

pub fn downloadable(&mut self) -> &mut Self

If the variation is downloadable. Default is false.

source

pub fn downloads(&mut self, file_src: impl Into<String>) -> &mut Self

List of downloadable files.

source

pub fn download_limit(&mut self, download_limit: i32) -> &mut Self

Number of times downloadable files can be downloaded after purchase. Default is -1.

source

pub fn download_expiry(&mut self, download_expiry: i32) -> &mut Self

Number of days until access to downloadable files expires. Default is -1.

source

pub fn tax_status(&mut self, tax_status: TaxStatus) -> &mut Self

Tax status. Options: taxable, shipping and none. Default is taxable.

source

pub fn tax_class(&mut self, tax_class: impl Into<String>) -> &mut Self

Tax class.

source

pub fn manage_stock(&mut self) -> &mut Self

Stock management at variation level. Default is false.

source

pub fn stock_quantity(&mut self, stock_quantity: i32) -> &mut Self

Stock quantity.

source

pub fn stock_status(&mut self, stock_status: StockStatus) -> &mut Self

Controls the stock status of the product. Options: instock, outofstock, onbackorder. Default is instock.

source

pub fn backorders(&mut self, backorders: BackordersStatus) -> &mut Self

If managing stock, this controls if backorders are allowed. Options: no, notify and yes. Default is no.

source

pub fn weight(&mut self, weight: impl Into<String>) -> &mut Self

Variation weight.

source

pub fn dimensions( &mut self, length: impl Into<String>, width: impl Into<String>, height: impl Into<String> ) -> &mut Self

Variation dimensions. See Product variation - Dimensions properties

source

pub fn shipping_class(&mut self, shipping_class: impl Into<String>) -> &mut Self

Shipping class slug.

source

pub fn image(&mut self, img_src: impl Into<String>) -> &mut Self

Variation image data.

source

pub fn attributes( &mut self, id: Option<i32>, name: impl Into<String>, option: impl Into<String> ) -> &mut Self

List of attributes.

source

pub fn menu_order(&mut self, menu_order: i32) -> &mut Self

Menu order, used to custom sort products.

source

pub fn meta_data( &mut self, key: impl Into<String>, value: impl Serialize ) -> &mut Self

Meta data.

source

pub fn build(&self) -> ProductVariationCreate

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more