pub struct Discount {
pub id: DiscountId,
pub checkout_session: Option<String>,
pub coupon: Coupon,
pub customer: Option<Expandable<Customer>>,
pub deleted: bool,
pub end: Option<Timestamp>,
pub invoice: Option<String>,
pub invoice_item: Option<String>,
pub promotion_code: Option<Expandable<PromotionCode>>,
pub start: Timestamp,
pub subscription: Option<String>,
}
Expand description
The resource representing a Stripe “Discount”.
For more details see https://stripe.com/docs/api/discounts/object
Fields
id: DiscountId
The ID of the discount object.
Discounts cannot be fetched by ID.
Use expand[]=discounts
in API calls to expand discount IDs in an array.
checkout_session: Option<String>
The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode.
Will not be present for subscription mode.
coupon: Coupon
customer: Option<Expandable<Customer>>
The ID of the customer associated with this discount.
deleted: bool
end: Option<Timestamp>
If the coupon has a duration of repeating
, the date that this discount will end.
If the coupon has a duration of once
or forever
, this attribute will be null.
invoice: Option<String>
The invoice that the discount’s coupon was applied to, if it was applied directly to a particular invoice.
invoice_item: Option<String>
The invoice item id
(or invoice line item id
for invoice line items of type=‘subscription’) that the discount’s coupon was applied to, if it was applied directly to a particular invoice item or invoice line item.
promotion_code: Option<Expandable<PromotionCode>>
The promotion code applied to create this discount.
start: Timestamp
Date that the coupon was applied.
subscription: Option<String>
The subscription that this coupon is applied to, if it is applied to a particular subscription.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Discount
impl<'de> Deserialize<'de> for Discount
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Discount
impl Send for Discount
impl Sync for Discount
impl Unpin for Discount
impl UnwindSafe for Discount
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more