pub struct PriceUpdate<'a> { /* private fields */ }
Expand description
Request builder for updating a price in Paddle API.
Implementations§
Source§impl<'a> PriceUpdate<'a>
impl<'a> PriceUpdate<'a>
pub fn new(client: &'a Paddle, price_id: impl Into<PriceID>) -> Self
Sourcepub fn description(&mut self, description: impl Into<String>) -> &mut Self
pub fn description(&mut self, description: impl Into<String>) -> &mut Self
Update the price description.
Sourcepub fn catalog_type(&mut self, catalog_type: CatalogType) -> &mut Self
pub fn catalog_type(&mut self, catalog_type: CatalogType) -> &mut Self
Update the price type.
Sourcepub fn name(&mut self, name: impl Into<String>) -> &mut Self
pub fn name(&mut self, name: impl Into<String>) -> &mut Self
Update the price name. Name is shown to customers at checkout and on invoices. Typically describes how often the related product bills.
Sourcepub fn billing_cycle(&mut self, frequency: u64, interval: Interval) -> &mut Self
pub fn billing_cycle(&mut self, frequency: u64, interval: Interval) -> &mut Self
Update how often this price should be charged.
Sourcepub fn trial_period(&mut self, frequency: u64, interval: Interval) -> &mut Self
pub fn trial_period(&mut self, frequency: u64, interval: Interval) -> &mut Self
Update the trial period for the product related to this price.
Sourcepub fn tax_mode(&mut self, tax_mode: TaxMode) -> &mut Self
pub fn tax_mode(&mut self, tax_mode: TaxMode) -> &mut Self
Update how tax is calculated for this price.
Sourcepub fn unit_price(&mut self, amount: u64, currency: CurrencyCode) -> &mut Self
pub fn unit_price(&mut self, amount: u64, currency: CurrencyCode) -> &mut Self
Update the base price. This price applies to all customers, except for customers located in countries where you have unit_price_overrides.
Sourcepub fn add_unit_price_override(
&mut self,
country_codes: impl IntoIterator<Item = CountryCodeSupported>,
amount: u64,
currency: CurrencyCode,
) -> &mut Self
pub fn add_unit_price_override( &mut self, country_codes: impl IntoIterator<Item = CountryCodeSupported>, amount: u64, currency: CurrencyCode, ) -> &mut Self
Use to override the base price with a custom price and currency for a country or group of countries.
Sourcepub fn set_unit_price_overrides(
&mut self,
overrides: Vec<UnitPriceOverride>,
) -> &mut Self
pub fn set_unit_price_overrides( &mut self, overrides: Vec<UnitPriceOverride>, ) -> &mut Self
Use to override the base price with a custom price and currency for a country or group of countries.
Sourcepub fn quantity(&mut self, range: Range<u64>) -> &mut Self
pub fn quantity(&mut self, range: Range<u64>) -> &mut Self
Update how many times the related product can be purchased at this price.
Sourcepub fn status(&mut self, status: Status) -> &mut Self
pub fn status(&mut self, status: Status) -> &mut Self
Update whether this entity can be used in Paddle.
Sourcepub fn custom_data(&mut self, custom_data: HashMap<String, String>) -> &mut Self
pub fn custom_data(&mut self, custom_data: HashMap<String, String>) -> &mut Self
Set custom data for the price.