clerk_rs/models/
organization_settings.rs1#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct OrganizationSettings {
13 #[serde(rename = "object")]
15 pub object: Object,
16 #[serde(rename = "enabled")]
17 pub enabled: bool,
18 #[serde(rename = "max_allowed_memberships")]
19 pub max_allowed_memberships: i64,
20 #[serde(rename = "max_allowed_roles", skip_serializing_if = "Option::is_none")]
21 pub max_allowed_roles: Option<i64>,
22 #[serde(rename = "max_allowed_permissions", skip_serializing_if = "Option::is_none")]
23 pub max_allowed_permissions: Option<i64>,
24 #[serde(rename = "creator_role")]
26 pub creator_role: String,
27 #[serde(rename = "admin_delete_enabled")]
29 pub admin_delete_enabled: bool,
30 #[serde(rename = "domains_enabled")]
31 pub domains_enabled: bool,
32 #[serde(rename = "domains_enrollment_modes")]
33 pub domains_enrollment_modes: Vec<DomainsEnrollmentModes>,
34 #[serde(rename = "domains_default_role")]
36 pub domains_default_role: String,
37}
38
39impl OrganizationSettings {
40 pub fn new(
41 object: Object,
42 enabled: bool,
43 max_allowed_memberships: i64,
44 creator_role: String,
45 admin_delete_enabled: bool,
46 domains_enabled: bool,
47 domains_enrollment_modes: Vec<DomainsEnrollmentModes>,
48 domains_default_role: String,
49 ) -> OrganizationSettings {
50 OrganizationSettings {
51 object,
52 enabled,
53 max_allowed_memberships,
54 max_allowed_roles: None,
55 max_allowed_permissions: None,
56 creator_role,
57 admin_delete_enabled,
58 domains_enabled,
59 domains_enrollment_modes,
60 domains_default_role,
61 }
62 }
63}
64
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum Object {
68 #[serde(rename = "organization_settings")]
69 OrganizationSettings,
70}
71
72impl Default for Object {
73 fn default() -> Object {
74 Self::OrganizationSettings
75 }
76}
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
79pub enum DomainsEnrollmentModes {
80 #[serde(rename = "manual_invitation")]
81 ManualInvitation,
82 #[serde(rename = "automatic_invitation")]
83 AutomaticInvitation,
84 #[serde(rename = "automatic_suggestion")]
85 AutomaticSuggestion,
86}
87
88impl Default for DomainsEnrollmentModes {
89 fn default() -> DomainsEnrollmentModes {
90 Self::ManualInvitation
91 }
92}