vapi_client/models/
subscription.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Subscription {
16    /// This is the unique identifier for the subscription.
17    #[serde(rename = "id")]
18    pub id: String,
19    /// This is the timestamp when the subscription was created.
20    #[serde(rename = "createdAt")]
21    pub created_at: String,
22    /// This is the timestamp when the subscription was last updated.
23    #[serde(rename = "updatedAt")]
24    pub updated_at: String,
25    /// This is the type / tier of the subscription.
26    #[serde(rename = "type")]
27    pub r#type: Type,
28    /// This is the status of the subscription. Past due subscriptions are subscriptions with past due payments.
29    #[serde(rename = "status")]
30    pub status: Status,
31    /// This is the number of credits the subscription currently has.  Note: This is a string to avoid floating point precision issues.
32    #[serde(rename = "credits")]
33    pub credits: String,
34    /// This is the total number of active calls (concurrency) across all orgs under this subscription.
35    #[serde(rename = "concurrencyCounter")]
36    pub concurrency_counter: f64,
37    /// This is the default concurrency limit for the subscription.
38    #[serde(rename = "concurrencyLimitIncluded")]
39    pub concurrency_limit_included: f64,
40    /// This is the number of free phone numbers the subscription has
41    #[serde(rename = "phoneNumbersCounter", skip_serializing_if = "Option::is_none")]
42    pub phone_numbers_counter: Option<f64>,
43    /// This is the maximum number of free phone numbers the subscription can have
44    #[serde(rename = "phoneNumbersIncluded", skip_serializing_if = "Option::is_none")]
45    pub phone_numbers_included: Option<f64>,
46    /// This is the purchased add-on concurrency limit for the subscription.
47    #[serde(rename = "concurrencyLimitPurchased")]
48    pub concurrency_limit_purchased: f64,
49    /// This is the ID of the monthly job that charges for subscription add ons and phone numbers.
50    #[serde(rename = "monthlyChargeScheduleId", skip_serializing_if = "Option::is_none")]
51    pub monthly_charge_schedule_id: Option<f64>,
52    /// This is the ID of the monthly job that checks whether the credit balance of the subscription is sufficient for the monthly charge.
53    #[serde(rename = "monthlyCreditCheckScheduleId", skip_serializing_if = "Option::is_none")]
54    pub monthly_credit_check_schedule_id: Option<f64>,
55    /// This is the Stripe customer ID.
56    #[serde(rename = "stripeCustomerId", skip_serializing_if = "Option::is_none")]
57    pub stripe_customer_id: Option<String>,
58    /// This is the Stripe payment ID.
59    #[serde(rename = "stripePaymentMethodId", skip_serializing_if = "Option::is_none")]
60    pub stripe_payment_method_id: Option<String>,
61    /// If this flag is true, then the user has purchased slack support.
62    #[serde(rename = "slackSupportEnabled", skip_serializing_if = "Option::is_none")]
63    pub slack_support_enabled: Option<bool>,
64    /// If this subscription has a slack support subscription, the slack channel's ID will be stored here.
65    #[serde(rename = "slackChannelId", skip_serializing_if = "Option::is_none")]
66    pub slack_channel_id: Option<String>,
67    /// This is the HIPAA enabled flag for the subscription. It determines whether orgs under this subscription have the option to enable HIPAA compliance.
68    #[serde(rename = "hipaaEnabled", skip_serializing_if = "Option::is_none")]
69    pub hipaa_enabled: Option<bool>,
70    /// This is the ID for the Common Paper agreement outlining the HIPAA contract.
71    #[serde(rename = "hipaaCommonPaperAgreementId", skip_serializing_if = "Option::is_none")]
72    pub hipaa_common_paper_agreement_id: Option<String>,
73    /// This is the Stripe fingerprint of the payment method (card). It allows us to detect users who try to abuse our system through multiple sign-ups.
74    #[serde(rename = "stripePaymentMethodFingerprint", skip_serializing_if = "Option::is_none")]
75    pub stripe_payment_method_fingerprint: Option<String>,
76    /// This is the customer's email on Stripe.
77    #[serde(rename = "stripeCustomerEmail", skip_serializing_if = "Option::is_none")]
78    pub stripe_customer_email: Option<String>,
79    /// This is the email of the referrer for the subscription.
80    #[serde(rename = "referredByEmail", skip_serializing_if = "Option::is_none")]
81    pub referred_by_email: Option<String>,
82    /// This is the auto reload plan configured for the subscription.
83    #[serde(rename = "autoReloadPlan", skip_serializing_if = "Option::is_none")]
84    pub auto_reload_plan: Option<Box<models::AutoReloadPlan>>,
85    /// The number of minutes included in the subscription.
86    #[serde(rename = "minutesIncluded", skip_serializing_if = "Option::is_none")]
87    pub minutes_included: Option<f64>,
88    /// The number of minutes used in the subscription.
89    #[serde(rename = "minutesUsed", skip_serializing_if = "Option::is_none")]
90    pub minutes_used: Option<f64>,
91    /// This is the timestamp at which the number of monthly free minutes is scheduled to reset at.
92    #[serde(rename = "minutesUsedNextResetAt", skip_serializing_if = "Option::is_none")]
93    pub minutes_used_next_reset_at: Option<String>,
94    /// The per minute charge on minutes that exceed the included minutes. Enterprise only.
95    #[serde(rename = "minutesOverageCost", skip_serializing_if = "Option::is_none")]
96    pub minutes_overage_cost: Option<f64>,
97    /// The list of providers included in the subscription. Enterprise only.
98    #[serde(rename = "providersIncluded", skip_serializing_if = "Option::is_none")]
99    pub providers_included: Option<Vec<String>>,
100    /// The maximum number of outbound calls this subscription may make in a day. Resets every night.
101    #[serde(rename = "outboundCallsDailyLimit", skip_serializing_if = "Option::is_none")]
102    pub outbound_calls_daily_limit: Option<f64>,
103    /// The current number of outbound calls the subscription has made in the current day.
104    #[serde(rename = "outboundCallsCounter", skip_serializing_if = "Option::is_none")]
105    pub outbound_calls_counter: Option<f64>,
106    /// This is the timestamp at which the outbound calls counter is scheduled to reset at.
107    #[serde(rename = "outboundCallsCounterNextResetAt", skip_serializing_if = "Option::is_none")]
108    pub outbound_calls_counter_next_reset_at: Option<String>,
109    /// This is the IDs of the coupons applicable to this subscription.
110    #[serde(rename = "couponIds", skip_serializing_if = "Option::is_none")]
111    pub coupon_ids: Option<Vec<String>>,
112    /// This is the number of credits left obtained from a coupon.
113    #[serde(rename = "couponUsageLeft", skip_serializing_if = "Option::is_none")]
114    pub coupon_usage_left: Option<String>,
115    /// This is the invoice plan for the subscription.
116    #[serde(rename = "invoicePlan", skip_serializing_if = "Option::is_none")]
117    pub invoice_plan: Option<Box<models::InvoicePlan>>,
118}
119
120impl Subscription {
121    pub fn new(id: String, created_at: String, updated_at: String, r#type: Type, status: Status, credits: String, concurrency_counter: f64, concurrency_limit_included: f64, concurrency_limit_purchased: f64) -> Subscription {
122        Subscription {
123            id,
124            created_at,
125            updated_at,
126            r#type,
127            status,
128            credits,
129            concurrency_counter,
130            concurrency_limit_included,
131            phone_numbers_counter: None,
132            phone_numbers_included: None,
133            concurrency_limit_purchased,
134            monthly_charge_schedule_id: None,
135            monthly_credit_check_schedule_id: None,
136            stripe_customer_id: None,
137            stripe_payment_method_id: None,
138            slack_support_enabled: None,
139            slack_channel_id: None,
140            hipaa_enabled: None,
141            hipaa_common_paper_agreement_id: None,
142            stripe_payment_method_fingerprint: None,
143            stripe_customer_email: None,
144            referred_by_email: None,
145            auto_reload_plan: None,
146            minutes_included: None,
147            minutes_used: None,
148            minutes_used_next_reset_at: None,
149            minutes_overage_cost: None,
150            providers_included: None,
151            outbound_calls_daily_limit: None,
152            outbound_calls_counter: None,
153            outbound_calls_counter_next_reset_at: None,
154            coupon_ids: None,
155            coupon_usage_left: None,
156            invoice_plan: None,
157        }
158    }
159}
160/// This is the type / tier of the subscription.
161#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
162pub enum Type {
163    #[serde(rename = "trial")]
164    Trial,
165    #[serde(rename = "pay-as-you-go")]
166    PayAsYouGo,
167    #[serde(rename = "enterprise")]
168    Enterprise,
169}
170
171impl Default for Type {
172    fn default() -> Type {
173        Self::Trial
174    }
175}
176/// This is the status of the subscription. Past due subscriptions are subscriptions with past due payments.
177#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
178pub enum Status {
179    #[serde(rename = "active")]
180    Active,
181    #[serde(rename = "frozen")]
182    Frozen,
183}
184
185impl Default for Status {
186    fn default() -> Status {
187        Self::Active
188    }
189}
190