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: TypeTrue,
28    /// This is the status of the subscription. Past due subscriptions are subscriptions with past due payments.
29    #[serde(rename = "status")]
30    pub status: StatusTrue,
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(
42        rename = "phoneNumbersCounter",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub phone_numbers_counter: Option<f64>,
46    /// This is the maximum number of free phone numbers the subscription can have
47    #[serde(
48        rename = "phoneNumbersIncluded",
49        skip_serializing_if = "Option::is_none"
50    )]
51    pub phone_numbers_included: Option<f64>,
52    /// This is the purchased add-on concurrency limit for the subscription.
53    #[serde(rename = "concurrencyLimitPurchased")]
54    pub concurrency_limit_purchased: f64,
55    /// This is the ID of the monthly job that charges for subscription add ons and phone numbers.
56    #[serde(
57        rename = "monthlyChargeScheduleId",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub monthly_charge_schedule_id: Option<f64>,
61    /// This is the ID of the monthly job that checks whether the credit balance of the subscription is sufficient for the monthly charge.
62    #[serde(
63        rename = "monthlyCreditCheckScheduleId",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub monthly_credit_check_schedule_id: Option<f64>,
67    /// This is the Stripe customer ID.
68    #[serde(rename = "stripeCustomerId", skip_serializing_if = "Option::is_none")]
69    pub stripe_customer_id: Option<String>,
70    /// This is the Stripe payment ID.
71    #[serde(
72        rename = "stripePaymentMethodId",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub stripe_payment_method_id: Option<String>,
76    /// If this flag is true, then the user has purchased slack support.
77    #[serde(
78        rename = "slackSupportEnabled",
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub slack_support_enabled: Option<bool>,
82    /// If this subscription has a slack support subscription, the slack channel's ID will be stored here.
83    #[serde(rename = "slackChannelId", skip_serializing_if = "Option::is_none")]
84    pub slack_channel_id: Option<String>,
85    /// This is the HIPAA enabled flag for the subscription. It determines whether orgs under this subscription have the option to enable HIPAA compliance.
86    #[serde(rename = "hipaaEnabled", skip_serializing_if = "Option::is_none")]
87    pub hipaa_enabled: Option<bool>,
88    /// This is the ID for the Common Paper agreement outlining the HIPAA contract.
89    #[serde(
90        rename = "hipaaCommonPaperAgreementId",
91        skip_serializing_if = "Option::is_none"
92    )]
93    pub hipaa_common_paper_agreement_id: Option<String>,
94    /// 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.
95    #[serde(
96        rename = "stripePaymentMethodFingerprint",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub stripe_payment_method_fingerprint: Option<String>,
100    /// This is the customer's email on Stripe.
101    #[serde(
102        rename = "stripeCustomerEmail",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub stripe_customer_email: Option<String>,
106    /// This is the email of the referrer for the subscription.
107    #[serde(rename = "referredByEmail", skip_serializing_if = "Option::is_none")]
108    pub referred_by_email: Option<String>,
109    /// This is the auto reload plan configured for the subscription.
110    #[serde(rename = "autoReloadPlan", skip_serializing_if = "Option::is_none")]
111    pub auto_reload_plan: Option<models::AutoReloadPlan>,
112    /// The number of minutes included in the subscription.
113    #[serde(rename = "minutesIncluded", skip_serializing_if = "Option::is_none")]
114    pub minutes_included: Option<f64>,
115    /// The number of minutes used in the subscription.
116    #[serde(rename = "minutesUsed", skip_serializing_if = "Option::is_none")]
117    pub minutes_used: Option<f64>,
118    /// This is the timestamp at which the number of monthly free minutes is scheduled to reset at.
119    #[serde(
120        rename = "minutesUsedNextResetAt",
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub minutes_used_next_reset_at: Option<String>,
124    /// The per minute charge on minutes that exceed the included minutes. Enterprise only.
125    #[serde(rename = "minutesOverageCost", skip_serializing_if = "Option::is_none")]
126    pub minutes_overage_cost: Option<f64>,
127    /// The list of providers included in the subscription. Enterprise only.
128    #[serde(rename = "providersIncluded", skip_serializing_if = "Option::is_none")]
129    pub providers_included: Option<Vec<String>>,
130    /// The maximum number of outbound calls this subscription may make in a day. Resets every night.
131    #[serde(
132        rename = "outboundCallsDailyLimit",
133        skip_serializing_if = "Option::is_none"
134    )]
135    pub outbound_calls_daily_limit: Option<f64>,
136    /// The current number of outbound calls the subscription has made in the current day.
137    #[serde(
138        rename = "outboundCallsCounter",
139        skip_serializing_if = "Option::is_none"
140    )]
141    pub outbound_calls_counter: Option<f64>,
142    /// This is the timestamp at which the outbound calls counter is scheduled to reset at.
143    #[serde(
144        rename = "outboundCallsCounterNextResetAt",
145        skip_serializing_if = "Option::is_none"
146    )]
147    pub outbound_calls_counter_next_reset_at: Option<String>,
148    /// This is the IDs of the coupons applicable to this subscription.
149    #[serde(rename = "couponIds", skip_serializing_if = "Option::is_none")]
150    pub coupon_ids: Option<Vec<String>>,
151    /// This is the number of credits left obtained from a coupon.
152    #[serde(rename = "couponUsageLeft", skip_serializing_if = "Option::is_none")]
153    pub coupon_usage_left: Option<String>,
154    /// This is the invoice plan for the subscription.
155    #[serde(rename = "invoicePlan", skip_serializing_if = "Option::is_none")]
156    pub invoice_plan: Option<models::InvoicePlan>,
157    /// This is the PCI enabled flag for the subscription. It determines whether orgs under this subscription have the option to enable PCI compliance.
158    #[serde(rename = "pciEnabled", skip_serializing_if = "Option::is_none")]
159    pub pci_enabled: Option<bool>,
160    /// This is the ID for the Common Paper agreement outlining the PCI contract.
161    #[serde(
162        rename = "pciCommonPaperAgreementId",
163        skip_serializing_if = "Option::is_none"
164    )]
165    pub pci_common_paper_agreement_id: Option<String>,
166}
167
168impl Subscription {
169    pub fn new(
170        id: String,
171        created_at: String,
172        updated_at: String,
173        r#type: TypeTrue,
174        status: StatusTrue,
175        credits: String,
176        concurrency_counter: f64,
177        concurrency_limit_included: f64,
178        concurrency_limit_purchased: f64,
179    ) -> Subscription {
180        Subscription {
181            id,
182            created_at,
183            updated_at,
184            r#type,
185            status,
186            credits,
187            concurrency_counter,
188            concurrency_limit_included,
189            phone_numbers_counter: None,
190            phone_numbers_included: None,
191            concurrency_limit_purchased,
192            monthly_charge_schedule_id: None,
193            monthly_credit_check_schedule_id: None,
194            stripe_customer_id: None,
195            stripe_payment_method_id: None,
196            slack_support_enabled: None,
197            slack_channel_id: None,
198            hipaa_enabled: None,
199            hipaa_common_paper_agreement_id: None,
200            stripe_payment_method_fingerprint: None,
201            stripe_customer_email: None,
202            referred_by_email: None,
203            auto_reload_plan: None,
204            minutes_included: None,
205            minutes_used: None,
206            minutes_used_next_reset_at: None,
207            minutes_overage_cost: None,
208            providers_included: None,
209            outbound_calls_daily_limit: None,
210            outbound_calls_counter: None,
211            outbound_calls_counter_next_reset_at: None,
212            coupon_ids: None,
213            coupon_usage_left: None,
214            invoice_plan: None,
215            pci_enabled: None,
216            pci_common_paper_agreement_id: None,
217        }
218    }
219}
220/// This is the type / tier of the subscription.
221#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
222pub enum TypeTrue {
223    #[serde(rename = "trial")]
224    Trial,
225    #[serde(rename = "pay-as-you-go")]
226    PayAsYouGo,
227    #[serde(rename = "enterprise")]
228    Enterprise,
229    #[serde(rename = "agency")]
230    Agency,
231    #[serde(rename = "startup")]
232    Startup,
233    #[serde(rename = "growth")]
234    Growth,
235    #[serde(rename = "scale")]
236    Scale,
237}
238
239impl Default for TypeTrue {
240    fn default() -> TypeTrue {
241        Self::Trial
242    }
243}
244/// This is the status of the subscription. Past due subscriptions are subscriptions with past due payments.
245#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
246pub enum StatusTrue {
247    #[serde(rename = "active")]
248    Active,
249    #[serde(rename = "frozen")]
250    Frozen,
251}
252
253impl Default for StatusTrue {
254    fn default() -> StatusTrue {
255        Self::Active
256    }
257}