integrationos_domain/domain/user/
mod.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4#[serde(rename_all = "camelCase")]
5pub struct UserClient {
6    #[serde(rename = "_id")]
7    pub id: String,
8    #[serde(rename = "buildableId")]
9    pub buildable_id: String,
10    pub name: String,
11    pub author: Author,
12    pub containers: Vec<Container>,
13    pub billing: Option<Billing>,
14}
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct Author {
18    #[serde(rename = "_id")]
19    pub id: String,
20}
21
22#[derive(Debug, Clone, Serialize, Deserialize)]
23pub struct Container {
24    #[serde(rename = "_id")]
25    pub id: String,
26    pub subscription: Subscription,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct Subscription {
31    pub tier: String,
32}
33
34#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct Billing {
36    #[serde(default = "default_throughput")]
37    pub throughput: u64,
38    pub provider: Option<String>,
39    #[serde(rename = "customerId")]
40    pub customer_id: String,
41    pub subscription: BillingSubscription,
42}
43
44fn default_throughput() -> u64 {
45    500
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
49pub struct BillingSubscription {
50    pub id: String,
51    #[serde(rename = "endDate")]
52    pub end_date: i64,
53    pub valid: bool,
54    pub key: String,
55    pub reason: Option<String>,
56}