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<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<models::InvoicePlan>,
118    /// This is the PCI enabled flag for the subscription. It determines whether orgs under this subscription have the option to enable PCI compliance.
119    #[serde(rename = "pciEnabled", skip_serializing_if = "Option::is_none")]
120    pub pci_enabled: Option<bool>,
121    /// This is the ID for the Common Paper agreement outlining the PCI contract.
122    #[serde(rename = "pciCommonPaperAgreementId", skip_serializing_if = "Option::is_none")]
123    pub pci_common_paper_agreement_id: Option<String>,
124}
125
126impl Subscription {
127    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 {
128        Subscription {
129            id,
130            created_at,
131            updated_at,
132            r#type,
133            status,
134            credits,
135            concurrency_counter,
136            concurrency_limit_included,
137            phone_numbers_counter: None,
138            phone_numbers_included: None,
139            concurrency_limit_purchased,
140            monthly_charge_schedule_id: None,
141            monthly_credit_check_schedule_id: None,
142            stripe_customer_id: None,
143            stripe_payment_method_id: None,
144            slack_support_enabled: None,
145            slack_channel_id: None,
146            hipaa_enabled: None,
147            hipaa_common_paper_agreement_id: None,
148            stripe_payment_method_fingerprint: None,
149            stripe_customer_email: None,
150            referred_by_email: None,
151            auto_reload_plan: None,
152            minutes_included: None,
153            minutes_used: None,
154            minutes_used_next_reset_at: None,
155            minutes_overage_cost: None,
156            providers_included: None,
157            outbound_calls_daily_limit: None,
158            outbound_calls_counter: None,
159            outbound_calls_counter_next_reset_at: None,
160            coupon_ids: None,
161            coupon_usage_left: None,
162            invoice_plan: None,
163            pci_enabled: None,
164            pci_common_paper_agreement_id: None,
165        }
166    }
167}
168/// This is the type / tier of the subscription.
169#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
170pub enum Type {
171    #[serde(rename = "trial")]
172    Trial,
173    #[serde(rename = "pay-as-you-go")]
174    PayAsYouGo,
175    #[serde(rename = "enterprise")]
176    Enterprise,
177}
178
179impl Default for Type {
180    fn default() -> Type {
181        Self::Trial
182    }
183}
184/// This is the status of the subscription. Past due subscriptions are subscriptions with past due payments.
185#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
186pub enum Status {
187    #[serde(rename = "active")]
188    Active,
189    #[serde(rename = "frozen")]
190    Frozen,
191}
192
193impl Default for Status {
194    fn default() -> Status {
195        Self::Active
196    }
197}
198