pub struct CreatePlanInput {Show 14 fields
pub name: String,
pub code: String,
pub interval: PlanInterval,
pub amount_cents: i64,
pub amount_currency: String,
pub invoice_display_name: Option<String>,
pub description: Option<String>,
pub trial_period: Option<f64>,
pub pay_in_advance: Option<bool>,
pub bill_charges_monthly: Option<bool>,
pub tax_codes: Option<Vec<String>>,
pub charges: Option<Vec<CreatePlanChargeInput>>,
pub minimum_commitment: Option<CreateMinimumCommitmentInput>,
pub usage_thresholds: Option<Vec<CreateUsageThresholdInput>>,
}Expand description
Input data for creating a plan.
Fields§
§name: StringName of the plan.
code: StringUnique code for the plan.
interval: PlanIntervalBilling interval.
amount_cents: i64Base amount in cents.
amount_currency: StringCurrency for the amount.
invoice_display_name: Option<String>Display name for invoices.
description: Option<String>Description of the plan.
trial_period: Option<f64>Trial period in days.
pay_in_advance: Option<bool>Whether the plan is billed in advance.
bill_charges_monthly: Option<bool>Whether charges are billed monthly for yearly plans.
tax_codes: Option<Vec<String>>Tax codes for this plan.
charges: Option<Vec<CreatePlanChargeInput>>Charges for this plan.
minimum_commitment: Option<CreateMinimumCommitmentInput>Minimum commitment for this plan.
usage_thresholds: Option<Vec<CreateUsageThresholdInput>>Usage thresholds for progressive billing.
Implementations§
Source§impl CreatePlanInput
impl CreatePlanInput
Sourcepub fn new(
name: String,
code: String,
interval: PlanInterval,
amount_cents: i64,
amount_currency: String,
) -> Self
pub fn new( name: String, code: String, interval: PlanInterval, amount_cents: i64, amount_currency: String, ) -> Self
Creates a new plan input with required fields.
Sourcepub fn with_invoice_display_name(self, name: String) -> Self
pub fn with_invoice_display_name(self, name: String) -> Self
Sets the invoice display name.
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
Sets the description.
Sourcepub fn with_trial_period(self, days: f64) -> Self
pub fn with_trial_period(self, days: f64) -> Self
Sets the trial period in days.
Sourcepub fn with_pay_in_advance(self, pay_in_advance: bool) -> Self
pub fn with_pay_in_advance(self, pay_in_advance: bool) -> Self
Sets whether the plan is billed in advance.
Sourcepub fn with_bill_charges_monthly(self, bill_charges_monthly: bool) -> Self
pub fn with_bill_charges_monthly(self, bill_charges_monthly: bool) -> Self
Sets whether charges are billed monthly.
Sourcepub fn with_tax_codes(self, tax_codes: Vec<String>) -> Self
pub fn with_tax_codes(self, tax_codes: Vec<String>) -> Self
Sets the tax codes.
Sourcepub fn with_charges(self, charges: Vec<CreatePlanChargeInput>) -> Self
pub fn with_charges(self, charges: Vec<CreatePlanChargeInput>) -> Self
Sets the charges.
Sourcepub fn with_minimum_commitment(
self,
minimum_commitment: CreateMinimumCommitmentInput,
) -> Self
pub fn with_minimum_commitment( self, minimum_commitment: CreateMinimumCommitmentInput, ) -> Self
Sets the minimum commitment.
Sourcepub fn with_usage_thresholds(
self,
usage_thresholds: Vec<CreateUsageThresholdInput>,
) -> Self
pub fn with_usage_thresholds( self, usage_thresholds: Vec<CreateUsageThresholdInput>, ) -> Self
Sets the usage thresholds.
Trait Implementations§
Source§impl Clone for CreatePlanInput
impl Clone for CreatePlanInput
Source§fn clone(&self) -> CreatePlanInput
fn clone(&self) -> CreatePlanInput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CreatePlanInput
impl Debug for CreatePlanInput
Source§impl<'de> Deserialize<'de> for CreatePlanInput
impl<'de> Deserialize<'de> for CreatePlanInput
Source§fn 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 Freeze for CreatePlanInput
impl RefUnwindSafe for CreatePlanInput
impl Send for CreatePlanInput
impl Sync for CreatePlanInput
impl Unpin for CreatePlanInput
impl UnwindSafe for CreatePlanInput
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