square_api_client/models/
subscription_phase.rs

1//! Model struct for SubscriptionPhase type.
2
3use serde::{Deserialize, Serialize};
4
5use super::{enums::SubscriptionCadence, Money};
6
7/// Describes a phase in a subscription plan.
8///
9/// For more information, see [Set Up and Manage a Subscription
10/// Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan).
11#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
12pub struct SubscriptionPhase {
13    /// The Square-assigned ID of the subscription phase. This field cannot be changed after a
14    /// `SubscriptionPhase` is created.
15    pub uid: Option<String>,
16    /// The billing cadence of the phase. For example, weekly or monthly. This field cannot be
17    /// changed after a `SubscriptionPhase` is created.
18    pub cadence: SubscriptionCadence,
19    /// The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last
20    /// phase can be indefinite. This field cannot be changed after a `SubscriptionPhase` is
21    /// created.
22    pub periods: Option<i32>,
23    /// The amount to bill for each `cadence`.
24    pub recurring_price_money: Money,
25    /// The position this phase appears in the sequence of phases defined for the plan, indexed from
26    /// 0. This field cannot be changed after a `SubscriptionPhase` is created.
27    pub ordinal: Option<i64>,
28}