Struct stripe::ShippingRate
source · [−]pub struct ShippingRate {
pub id: ShippingRateId,
pub active: bool,
pub created: Timestamp,
pub delivery_estimate: Option<ShippingRateDeliveryEstimate>,
pub display_name: Option<String>,
pub fixed_amount: Option<ShippingRateFixedAmount>,
pub livemode: bool,
pub metadata: Metadata,
pub tax_behavior: Option<ShippingRateTaxBehavior>,
pub tax_code: Option<Expandable<TaxCode>>,
pub type_: ShippingRateType,
}
Expand description
The resource representing a Stripe “ShippingRate”.
For more details see https://stripe.com/docs/api/shipping_rates/object
Fields
id: ShippingRateId
Unique identifier for the object.
active: bool
Whether the shipping rate can be used for new purchases.
Defaults to true
.
created: Timestamp
Time at which the object was created.
Measured in seconds since the Unix epoch.
delivery_estimate: Option<ShippingRateDeliveryEstimate>
The estimated range for how long shipping will take, meant to be displayable to the customer.
This will appear on CheckoutSessions.
display_name: Option<String>
The name of the shipping rate, meant to be displayable to the customer.
This will appear on CheckoutSessions.
fixed_amount: Option<ShippingRateFixedAmount>
livemode: bool
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
metadata: Metadata
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
tax_behavior: Option<ShippingRateTaxBehavior>
Specifies whether the rate is considered inclusive of taxes or exclusive of taxes.
One of inclusive
, exclusive
, or unspecified
.
tax_code: Option<Expandable<TaxCode>>
A tax code ID.
The Shipping tax code is txcd_92010001
.
type_: ShippingRateType
The type of calculation to use on the shipping rate.
Can only be fixed_amount
for now.
Implementations
sourceimpl ShippingRate
impl ShippingRate
sourcepub fn list(
client: &Client,
params: &ListShippingRates<'_>
) -> Response<List<ShippingRate>>
pub fn list(
client: &Client,
params: &ListShippingRates<'_>
) -> Response<List<ShippingRate>>
Returns a list of your shipping rates.
sourcepub fn create(
client: &Client,
params: CreateShippingRate<'_>
) -> Response<ShippingRate>
pub fn create(
client: &Client,
params: CreateShippingRate<'_>
) -> Response<ShippingRate>
Creates a new shipping rate object.
sourcepub fn retrieve(
client: &Client,
id: &ShippingRateId,
expand: &[&str]
) -> Response<ShippingRate>
pub fn retrieve(
client: &Client,
id: &ShippingRateId,
expand: &[&str]
) -> Response<ShippingRate>
Returns the shipping rate object with the given ID.
sourcepub fn update(
client: &Client,
id: &ShippingRateId,
params: UpdateShippingRate<'_>
) -> Response<ShippingRate>
pub fn update(
client: &Client,
id: &ShippingRateId,
params: UpdateShippingRate<'_>
) -> Response<ShippingRate>
Updates an existing shipping rate object.
Trait Implementations
sourceimpl Clone for ShippingRate
impl Clone for ShippingRate
sourcefn clone(&self) -> ShippingRate
fn clone(&self) -> ShippingRate
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ShippingRate
impl Debug for ShippingRate
sourceimpl Default for ShippingRate
impl Default for ShippingRate
sourcefn default() -> ShippingRate
fn default() -> ShippingRate
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for ShippingRate
impl<'de> Deserialize<'de> for ShippingRate
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
sourceimpl Object for ShippingRate
impl Object for ShippingRate
sourceimpl Serialize for ShippingRate
impl Serialize for ShippingRate
Auto Trait Implementations
impl RefUnwindSafe for ShippingRate
impl Send for ShippingRate
impl Sync for ShippingRate
impl Unpin for ShippingRate
impl UnwindSafe for ShippingRate
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