[][src]Struct stripe::CreateProduct

pub struct CreateProduct<'a> {
    pub active: Option<bool>,
    pub attributes: Option<Vec<String>>,
    pub caption: Option<&'a str>,
    pub deactivate_on: Option<Vec<String>>,
    pub description: Option<&'a str>,
    pub expand: &'a [&'a str],
    pub id: Option<&'a str>,
    pub images: Option<Vec<String>>,
    pub metadata: Option<Metadata>,
    pub name: &'a str,
    pub package_dimensions: Option<PackageDimensions>,
    pub shippable: Option<bool>,
    pub statement_descriptor: Option<&'a str>,
    pub type_: ProductType,
    pub unit_label: Option<&'a str>,
    pub url: Option<&'a str>,
}

The parameters for Product::create.

Fields

active: Option<bool>

Whether the product is currently available for purchase.

Defaults to true.

attributes: Option<Vec<String>>

A list of up to 5 alphanumeric attributes.

Applicable to both service and good types.

caption: Option<&'a str>

A short one-line description of the product, meant to be displayable to the customer.

May only be set if type=good.

deactivate_on: Option<Vec<String>>

An array of Connect application names or identifiers that should not be able to order the SKUs for this product.

May only be set if type=good.

description: Option<&'a str>

The product's description, meant to be displayable to the customer.

May only be set if type=good.

expand: &'a [&'a str]

Specifies which fields in the response should be expanded.

id: Option<&'a str>

An identifier will be randomly generated by Stripe.

You can optionally override this ID, but the ID must be unique across all products in your Stripe account. Applicable to both service and good types.

images: Option<Vec<String>>

A list of up to 8 URLs of images for this product, meant to be displayable to the customer.

May only be set if type=good.

metadata: Option<Metadata>

A set of key-value pairs that you can attach to a product object.

It can be useful for storing additional information about the product in a structured format. Applicable to both service and good types.

name: &'a str

The product's name, meant to be displayable to the customer.

Applicable to both service and good types.

package_dimensions: Option<PackageDimensions>

The dimensions of this product for shipping purposes.

A SKU associated with this product can override this value by having its own package_dimensions. May only be set if type=good.

shippable: Option<bool>

Whether this product is shipped (i.e., physical goods).

Defaults to true. May only be set if type=good.

statement_descriptor: Option<&'a str>

An arbitrary string to be displayed on your customer's credit card statement.

This may be up to 22 characters. The statement description may not include <>"' characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all. It must contain at least one letter. May only be set if type=service.

type_: ProductType

The type of the product.

The product is either of type service, which is eligible for use with Subscriptions and Plans or good, which is eligible for use with Orders and SKUs.

unit_label: Option<&'a str>

A label that represents units of this product, such as seat(s), in Stripe and on customers’ receipts and invoices.

Only available on products of type=service.

url: Option<&'a str>

A URL of a publicly-accessible webpage for this product.

May only be set if type=good.

Methods

impl<'a> CreateProduct<'a>[src]

pub fn new(name: &'a str, type_: ProductType) -> Self[src]

Trait Implementations

impl<'a> Clone for CreateProduct<'a>[src]

impl<'a> Debug for CreateProduct<'a>[src]

impl<'a> Serialize for CreateProduct<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for CreateProduct<'a>

impl<'a> Sync for CreateProduct<'a>

impl<'a> Send for CreateProduct<'a>

impl<'a> UnwindSafe for CreateProduct<'a>

impl<'a> RefUnwindSafe for CreateProduct<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self