pub struct CreateSubscriptionInput {
pub external_customer_id: String,
pub plan_code: String,
pub name: Option<String>,
pub external_id: Option<String>,
pub billing_time: Option<SubscriptionBillingTime>,
pub subscription_at: Option<String>,
pub ending_at: Option<String>,
pub plan_overrides: Option<SubscriptionPlanOverrides>,
}Expand description
Input data for creating a subscription.
Fields§
§external_customer_id: StringExternal unique identifier for the customer.
plan_code: StringCode of the plan to assign to the subscription.
name: Option<String>Optional display name for the subscription.
external_id: Option<String>Optional external unique identifier for the subscription.
billing_time: Option<SubscriptionBillingTime>Billing time determines when recurring billing cycles occur.
subscription_at: Option<String>The subscription start date (ISO 8601 format).
ending_at: Option<String>The subscription end date (ISO 8601 format).
plan_overrides: Option<SubscriptionPlanOverrides>Plan overrides to customize the plan for this subscription.
Implementations§
Source§impl CreateSubscriptionInput
impl CreateSubscriptionInput
Sourcepub fn new(external_customer_id: String, plan_code: String) -> Self
pub fn new(external_customer_id: String, plan_code: String) -> Self
Creates a new subscription input with required fields.
Sourcepub fn with_external_id(self, external_id: String) -> Self
pub fn with_external_id(self, external_id: String) -> Self
Sets the external ID.
Sourcepub fn with_billing_time(self, billing_time: SubscriptionBillingTime) -> Self
pub fn with_billing_time(self, billing_time: SubscriptionBillingTime) -> Self
Sets the billing time.
Sourcepub fn with_subscription_at(self, subscription_at: String) -> Self
pub fn with_subscription_at(self, subscription_at: String) -> Self
Sets the subscription start date.
Sourcepub fn with_ending_at(self, ending_at: String) -> Self
pub fn with_ending_at(self, ending_at: String) -> Self
Sets the subscription end date.
Sourcepub fn with_plan_overrides(
self,
plan_overrides: SubscriptionPlanOverrides,
) -> Self
pub fn with_plan_overrides( self, plan_overrides: SubscriptionPlanOverrides, ) -> Self
Sets plan overrides.
Trait Implementations§
Source§impl Clone for CreateSubscriptionInput
impl Clone for CreateSubscriptionInput
Source§fn clone(&self) -> CreateSubscriptionInput
fn clone(&self) -> CreateSubscriptionInput
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 CreateSubscriptionInput
impl Debug for CreateSubscriptionInput
Source§impl<'de> Deserialize<'de> for CreateSubscriptionInput
impl<'de> Deserialize<'de> for CreateSubscriptionInput
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 CreateSubscriptionInput
impl RefUnwindSafe for CreateSubscriptionInput
impl Send for CreateSubscriptionInput
impl Sync for CreateSubscriptionInput
impl Unpin for CreateSubscriptionInput
impl UnwindSafe for CreateSubscriptionInput
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