pub struct AdjustmentCreate<'a> { /* private fields */ }
Expand description
Request builder for creating an adjustment in Paddle.
Implementations§
Source§impl<'a> AdjustmentCreate<'a>
impl<'a> AdjustmentCreate<'a>
pub fn new( client: &'a Paddle, transaction_id: impl Into<TransactionID>, action: AdjustmentAction, reason: impl Into<String>, ) -> Self
Sourcepub fn type(&mut self, adjustment_type: AdjustmentType) -> &mut Self
pub fn type(&mut self, adjustment_type: AdjustmentType) -> &mut Self
Type of adjustment. Use full
to adjust the grand total for the related transaction. Include an items
array when creating a partial
adjustment. If omitted, defaults to partial
.
Sourcepub fn items(
&mut self,
items: impl IntoIterator<Item = AdjustmentItemInput>,
) -> &mut Self
pub fn items( &mut self, items: impl IntoIterator<Item = AdjustmentItemInput>, ) -> &mut Self
List of transaction items to adjust. Required if type
is not populated or set to partial
.
Sourcepub fn tax_mode(&mut self, mode: TaxMode) -> &mut Self
pub fn tax_mode(&mut self, mode: TaxMode) -> &mut Self
Whether the amounts to be adjusted are inclusive or exclusive of tax. If internal
, adjusted amounts are considered to be inclusive of tax. If external
, Paddle calculates the tax and adds it to the amounts provided.
Only valid for adjustments where the type
is partial
.
If omitted, defaults to internal
.
Sourcepub async fn send(&self) -> Result<SuccessResponse<Adjustment>, Error>
pub async fn send(&self) -> Result<SuccessResponse<Adjustment>, Error>
Send the request to Paddle and return the response.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for AdjustmentCreate<'a>
impl<'a> RefUnwindSafe for AdjustmentCreate<'a>
impl<'a> Send for AdjustmentCreate<'a>
impl<'a> Sync for AdjustmentCreate<'a>
impl<'a> Unpin for AdjustmentCreate<'a>
impl<'a> UnwindSafe for AdjustmentCreate<'a>
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