windmill_api/models/guest_usage.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.816.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// GuestUsage : Guests are free up to `free_allowance` distinct emails over the trailing `window_days`. Past that an Enterprise plan meters them (`metered`, four guests to one seat: `billable_guests`, `guest_seats`); every other plan and build admits no new email until the count drops. `instance_enabled` is the superadmin switch (`guest_access_disabled` global setting) every workspace switch sits under. `available` is whether this deployment can have guests at all: false on the shared cloud, where guest access requires a self-hosted or dedicated deployment, and every other field and switch is then moot.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GuestUsage {
17 #[serde(rename = "available")]
18 pub available: bool,
19 #[serde(rename = "instance_enabled")]
20 pub instance_enabled: bool,
21 #[serde(rename = "guest_count")]
22 pub guest_count: i64,
23 #[serde(rename = "window_days")]
24 pub window_days: i32,
25 #[serde(rename = "free_allowance")]
26 pub free_allowance: i64,
27 #[serde(rename = "metered")]
28 pub metered: bool,
29 #[serde(rename = "billable_guests")]
30 pub billable_guests: i64,
31 #[serde(rename = "guest_seats")]
32 pub guest_seats: i64,
33}
34
35impl GuestUsage {
36 /// Guests are free up to `free_allowance` distinct emails over the trailing `window_days`. Past that an Enterprise plan meters them (`metered`, four guests to one seat: `billable_guests`, `guest_seats`); every other plan and build admits no new email until the count drops. `instance_enabled` is the superadmin switch (`guest_access_disabled` global setting) every workspace switch sits under. `available` is whether this deployment can have guests at all: false on the shared cloud, where guest access requires a self-hosted or dedicated deployment, and every other field and switch is then moot.
37 pub fn new(available: bool, instance_enabled: bool, guest_count: i64, window_days: i32, free_allowance: i64, metered: bool, billable_guests: i64, guest_seats: i64) -> GuestUsage {
38 GuestUsage {
39 available,
40 instance_enabled,
41 guest_count,
42 window_days,
43 free_allowance,
44 metered,
45 billable_guests,
46 guest_seats,
47 }
48 }
49}
50