pub struct CreateSubscriptionSchedule { /* private fields */ }
Expand description
Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
Implementations§
Source§impl CreateSubscriptionSchedule
impl CreateSubscriptionSchedule
Sourcepub fn billing_mode(
self,
billing_mode: impl Into<CreateSubscriptionScheduleBillingMode>,
) -> Self
pub fn billing_mode( self, billing_mode: impl Into<CreateSubscriptionScheduleBillingMode>, ) -> Self
Controls how prorations and invoices for subscriptions are calculated and orchestrated.
Sourcepub fn customer(self, customer: impl Into<String>) -> Self
pub fn customer(self, customer: impl Into<String>) -> Self
The identifier of the customer to create the subscription schedule for.
Sourcepub fn default_settings(
self,
default_settings: impl Into<CreateSubscriptionScheduleDefaultSettings>,
) -> Self
pub fn default_settings( self, default_settings: impl Into<CreateSubscriptionScheduleDefaultSettings>, ) -> Self
Object representing the subscription schedule’s default settings.
Sourcepub fn end_behavior(
self,
end_behavior: impl Into<SubscriptionScheduleEndBehavior>,
) -> Self
pub fn end_behavior( self, end_behavior: impl Into<SubscriptionScheduleEndBehavior>, ) -> Self
Behavior of the subscription schedule and underlying subscription when it ends.
Possible values are release
or cancel
with the default being release
.
release
will end the subscription schedule and keep the underlying subscription running.
cancel
will end the subscription schedule and cancel the underlying subscription.
Sourcepub fn expand(self, expand: impl Into<Vec<String>>) -> Self
pub fn expand(self, expand: impl Into<Vec<String>>) -> Self
Specifies which fields in the response should be expanded.
Sourcepub fn from_subscription(self, from_subscription: impl Into<String>) -> Self
pub fn from_subscription(self, from_subscription: impl Into<String>) -> Self
Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription’s item(s), set to auto-renew using the subscription’s interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls.
Sourcepub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
Set of key-value pairs that you can attach to an object.
This can be useful for storing additional information about the object in a structured format.
Individual keys can be unset by posting an empty value to them.
All keys can be unset by posting an empty value to metadata
.
Sourcepub fn phases(
self,
phases: impl Into<Vec<CreateSubscriptionSchedulePhases>>,
) -> Self
pub fn phases( self, phases: impl Into<Vec<CreateSubscriptionSchedulePhases>>, ) -> Self
List representing phases of the subscription schedule.
Each phase can be customized to have different durations, plans, and coupons.
If there are multiple phases, the end_date
of one phase will always equal the start_date
of the next phase.
Sourcepub fn start_date(
self,
start_date: impl Into<CreateSubscriptionScheduleStartDate>,
) -> Self
pub fn start_date( self, start_date: impl Into<CreateSubscriptionScheduleStartDate>, ) -> Self
When the subscription schedule starts.
We recommend using now
so that it starts the subscription immediately.
You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on.
Source§impl CreateSubscriptionSchedule
impl CreateSubscriptionSchedule
Sourcepub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response.
Sourcepub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub fn send_blocking<C: StripeBlockingClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response, blocking until completion.
Trait Implementations§
Source§impl Clone for CreateSubscriptionSchedule
impl Clone for CreateSubscriptionSchedule
Source§fn clone(&self) -> CreateSubscriptionSchedule
fn clone(&self) -> CreateSubscriptionSchedule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more