pub struct DiscountsList<'a> { /* private fields */ }
Expand description
Request builder for fetching discounts from Paddle API.
Implementations§
Source§impl<'a> DiscountsList<'a>
impl<'a> DiscountsList<'a>
pub fn new(client: &'a Paddle) -> Self
Sourcepub fn after(&mut self, discount_id: impl Into<DiscountID>) -> &mut Self
pub fn after(&mut self, discount_id: impl Into<DiscountID>) -> &mut Self
Return entities after the specified Paddle ID when working with paginated endpoints. Used in the meta.pagination.next
URL in responses for list operations.
Sourcepub fn codes(
&mut self,
codes: impl IntoIterator<Item = impl AsRef<str>>,
) -> &mut Self
pub fn codes( &mut self, codes: impl IntoIterator<Item = impl AsRef<str>>, ) -> &mut Self
Return only entities that match the discount codes provided
Sourcepub fn ids(
&mut self,
discount_ids: impl IntoIterator<Item = impl Into<DiscountID>>,
) -> &mut Self
pub fn ids( &mut self, discount_ids: impl IntoIterator<Item = impl Into<DiscountID>>, ) -> &mut Self
Return only the IDs specified.
Sourcepub fn order_by_asc(&mut self, field: &str) -> &mut Self
pub fn order_by_asc(&mut self, field: &str) -> &mut Self
Order returned entities by the specified field. Valid fields for ordering: created_at and id
Sourcepub fn order_by_desc(&mut self, field: &str) -> &mut Self
pub fn order_by_desc(&mut self, field: &str) -> &mut Self
Order returned entities by the specified field. Valid fields for ordering: created_at and id
Sourcepub fn per_page(&mut self, entities_per_page: usize) -> &mut Self
pub fn per_page(&mut self, entities_per_page: usize) -> &mut Self
Set how many entities are returned per page. Paddle returns the maximum number of results if a number greater than the maximum is requested.
Check meta.pagination.per_page
in the response to see how many were returned.
Default: 50
; Maximum: 200
.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DiscountsList<'a>
impl<'a> RefUnwindSafe for DiscountsList<'a>
impl<'a> Send for DiscountsList<'a>
impl<'a> Sync for DiscountsList<'a>
impl<'a> Unpin for DiscountsList<'a>
impl<'a> UnwindSafe for DiscountsList<'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