Skip to main content

bitwarden_api_api/models/
organization.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15/// Organization : An organization is an entity that allows users to share vault items and manage
16/// billing, access control, and other enterprise features depending on the plan.
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct Organization {
19    /// A unique identifier for the organization.
20    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
21    pub id: Option<uuid::Uuid>,
22    /// A unique, human-readable identifier used to specify the organization during SSO login.
23    #[serde(
24        rename = "identifier",
25        alias = "Identifier",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub identifier: Option<String>,
29    /// This value is HTML encoded. For display purposes use the method DisplayName() instead.
30    #[serde(
31        rename = "name",
32        alias = "Name",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub name: Option<String>,
36    /// This value is HTML encoded. For display purposes use the method DisplayBusinessName()
37    /// instead.
38    #[serde(
39        rename = "businessName",
40        alias = "BusinessName",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub business_name: Option<String>,
44    /// The first line of the organization's business address.
45    #[serde(
46        rename = "businessAddress1",
47        alias = "BusinessAddress1",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub business_address1: Option<String>,
51    /// The second line of the organization's business address.
52    #[serde(
53        rename = "businessAddress2",
54        alias = "BusinessAddress2",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub business_address2: Option<String>,
58    /// The third line of the organization's business address.
59    #[serde(
60        rename = "businessAddress3",
61        alias = "BusinessAddress3",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub business_address3: Option<String>,
65    /// The two-letter ISO country code of the organization's business address.
66    #[serde(
67        rename = "businessCountry",
68        alias = "BusinessCountry",
69        skip_serializing_if = "Option::is_none"
70    )]
71    pub business_country: Option<String>,
72    /// The organization's tax identification number.
73    #[serde(
74        rename = "businessTaxNumber",
75        alias = "BusinessTaxNumber",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub business_tax_number: Option<String>,
79    /// The billing email address for the organization.
80    #[serde(
81        rename = "billingEmail",
82        alias = "BillingEmail",
83        skip_serializing_if = "Option::is_none"
84    )]
85    pub billing_email: Option<String>,
86    /// The name of the plan the organization is subscribed to. It is unclear why this is stored
87    /// and what it is used for - do not use it. Use the
88    /// Bit.Core.AdminConsole.Entities.Organization.PlanType instead.
89    #[serde(
90        rename = "plan",
91        alias = "Plan",
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub plan: Option<String>,
95    #[serde(
96        rename = "planType",
97        alias = "PlanType",
98        skip_serializing_if = "Option::is_none"
99    )]
100    pub plan_type: Option<models::PlanType>,
101    /// The number of user seats included in the organization's subscription. NULL if the plan has
102    /// no seat limit.
103    #[serde(
104        rename = "seats",
105        alias = "Seats",
106        skip_serializing_if = "Option::is_none"
107    )]
108    pub seats: Option<i32>,
109    /// The maximum number of collections the organization can create. NULL if the plan has no
110    /// collection limit.
111    #[serde(
112        rename = "maxCollections",
113        alias = "MaxCollections",
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub max_collections: Option<i32>,
117    /// If true, the organization has access to the Policies feature.
118    #[serde(
119        rename = "usePolicies",
120        alias = "UsePolicies",
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub use_policies: Option<bool>,
124    /// If true, the organization has access to the SSO (Single Sign-On) feature.
125    #[serde(
126        rename = "useSso",
127        alias = "UseSso",
128        skip_serializing_if = "Option::is_none"
129    )]
130    pub use_sso: Option<bool>,
131    /// If true, the organization has access to the Key Connector feature, which allows SSO without
132    /// master passwords.
133    #[serde(
134        rename = "useKeyConnector",
135        alias = "UseKeyConnector",
136        skip_serializing_if = "Option::is_none"
137    )]
138    pub use_key_connector: Option<bool>,
139    /// If true, the organization has access to the SCIM (System for Cross-domain Identity
140    /// Management) feature. This is used for automatic user provisioning.
141    #[serde(
142        rename = "useScim",
143        alias = "UseScim",
144        skip_serializing_if = "Option::is_none"
145    )]
146    pub use_scim: Option<bool>,
147    /// If true, the organization has access to the Groups feature.
148    #[serde(
149        rename = "useGroups",
150        alias = "UseGroups",
151        skip_serializing_if = "Option::is_none"
152    )]
153    pub use_groups: Option<bool>,
154    /// If true, the organization can use Directory Connector. This is a standalone app used for
155    /// automatic user provisioning.
156    #[serde(
157        rename = "useDirectory",
158        alias = "UseDirectory",
159        skip_serializing_if = "Option::is_none"
160    )]
161    pub use_directory: Option<bool>,
162    /// If true, the organization has access to the event logs feature.
163    #[serde(
164        rename = "useEvents",
165        alias = "UseEvents",
166        skip_serializing_if = "Option::is_none"
167    )]
168    pub use_events: Option<bool>,
169    /// If true, the organization has access to the TOTP feature for vault items.
170    #[serde(
171        rename = "useTotp",
172        alias = "UseTotp",
173        skip_serializing_if = "Option::is_none"
174    )]
175    pub use_totp: Option<bool>,
176    /// If true, the organization has access to organization-level two-factor authentication.
177    #[serde(
178        rename = "use2fa",
179        alias = "Use2fa",
180        skip_serializing_if = "Option::is_none"
181    )]
182    pub use2fa: Option<bool>,
183    /// If true, the organization has access to the public API.
184    #[serde(
185        rename = "useApi",
186        alias = "UseApi",
187        skip_serializing_if = "Option::is_none"
188    )]
189    pub use_api: Option<bool>,
190    /// If true, the organization has access to the account recovery (admin password reset)
191    /// feature.
192    #[serde(
193        rename = "useResetPassword",
194        alias = "UseResetPassword",
195        skip_serializing_if = "Option::is_none"
196    )]
197    pub use_reset_password: Option<bool>,
198    /// If true, the organization is subscribed to the Secrets Manager product.
199    #[serde(
200        rename = "useSecretsManager",
201        alias = "UseSecretsManager",
202        skip_serializing_if = "Option::is_none"
203    )]
204    pub use_secrets_manager: Option<bool>,
205    /// If true, the organization can export a license file which is used to create the
206    /// organization on a self-hosted instance. It does not indicate whether this organization is
207    /// self-hosted.
208    #[serde(
209        rename = "selfHost",
210        alias = "SelfHost",
211        skip_serializing_if = "Option::is_none"
212    )]
213    pub self_host: Option<bool>,
214    /// If true, all members of the organization are granted premium features.
215    #[serde(
216        rename = "usersGetPremium",
217        alias = "UsersGetPremium",
218        skip_serializing_if = "Option::is_none"
219    )]
220    pub users_get_premium: Option<bool>,
221    /// If true, the organization has access to custom user roles with fine-grained permissions.
222    #[serde(
223        rename = "useCustomPermissions",
224        alias = "UseCustomPermissions",
225        skip_serializing_if = "Option::is_none"
226    )]
227    pub use_custom_permissions: Option<bool>,
228    /// The number of bytes of file attachment storage the organization has used.
229    #[serde(
230        rename = "storage",
231        alias = "Storage",
232        skip_serializing_if = "Option::is_none"
233    )]
234    pub storage: Option<i64>,
235    /// The maximum number of gigabytes of file attachment storage available to the organization.
236    #[serde(
237        rename = "maxStorageGb",
238        alias = "MaxStorageGb",
239        skip_serializing_if = "Option::is_none"
240    )]
241    pub max_storage_gb: Option<i32>,
242    #[serde(
243        rename = "gateway",
244        alias = "Gateway",
245        skip_serializing_if = "Option::is_none"
246    )]
247    pub gateway: Option<models::GatewayType>,
248    /// The organization's customer ID in the payment gateway.
249    #[serde(
250        rename = "gatewayCustomerId",
251        alias = "GatewayCustomerId",
252        skip_serializing_if = "Option::is_none"
253    )]
254    pub gateway_customer_id: Option<String>,
255    /// The organization's subscription ID in the payment gateway.
256    #[serde(
257        rename = "gatewaySubscriptionId",
258        alias = "GatewaySubscriptionId",
259        skip_serializing_if = "Option::is_none"
260    )]
261    pub gateway_subscription_id: Option<String>,
262    /// A JSON blob of reference data, e.g. the signup source.
263    #[serde(
264        rename = "referenceData",
265        alias = "ReferenceData",
266        skip_serializing_if = "Option::is_none"
267    )]
268    pub reference_data: Option<String>,
269    /// If true, the organization is active. If false, the organization is disabled and access to
270    /// its vault and features are restricted.
271    #[serde(
272        rename = "enabled",
273        alias = "Enabled",
274        skip_serializing_if = "Option::is_none"
275    )]
276    pub enabled: Option<bool>,
277    /// The license key for the organization. Used by self-hosted instances to validate the
278    /// license.
279    #[serde(
280        rename = "licenseKey",
281        alias = "LicenseKey",
282        skip_serializing_if = "Option::is_none"
283    )]
284    pub license_key: Option<String>,
285    /// The organization's asymmetric public key, used to enrol members in account recovery.
286    #[serde(
287        rename = "publicKey",
288        alias = "PublicKey",
289        skip_serializing_if = "Option::is_none"
290    )]
291    pub public_key: Option<String>,
292    /// The organization's asymmetric private key, encrypted with the organization's symmetric key.
293    #[serde(
294        rename = "privateKey",
295        alias = "PrivateKey",
296        skip_serializing_if = "Option::is_none"
297    )]
298    pub private_key: Option<String>,
299    /// A hex-encoded key id of the organization's current symmetric organization key.  Each
300    /// organization key has a unique key id. It is not set for existing organizations until a
301    /// client reports it.
302    #[serde(
303        rename = "organizationKeyId",
304        alias = "OrganizationKeyId",
305        skip_serializing_if = "Option::is_none"
306    )]
307    pub organization_key_id: Option<String>,
308    /// A JSON blob of the organization's two-factor authentication provider configurations. Use
309    /// M:Bit.Core.AdminConsole.Entities.Organization.GetTwoFactorProviders and
310    /// M:Bit.Core.AdminConsole.Entities.Organization.SetTwoFactorProviders(System.Collections.
311    /// Generic.Dictionary{Bit.Core.Auth.Enums.TwoFactorProviderType,Bit.Core.Auth.Models.
312    /// TwoFactorProvider}) to read and write this field.
313    #[serde(
314        rename = "twoFactorProviders",
315        alias = "TwoFactorProviders",
316        skip_serializing_if = "Option::is_none"
317    )]
318    pub two_factor_providers: Option<String>,
319    /// The date the organization's license expires. NULL if the license does not expire.
320    #[serde(
321        rename = "expirationDate",
322        alias = "ExpirationDate",
323        skip_serializing_if = "Option::is_none"
324    )]
325    pub expiration_date: Option<String>,
326    /// The date the organization was created.
327    #[serde(
328        rename = "creationDate",
329        alias = "CreationDate",
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub creation_date: Option<String>,
333    /// The date the organization was last updated.
334    #[serde(
335        rename = "revisionDate",
336        alias = "RevisionDate",
337        skip_serializing_if = "Option::is_none"
338    )]
339    pub revision_date: Option<String>,
340    /// The maximum number of seats the organization can autoscale to. NULL if autoscaling is not
341    /// limited.
342    #[serde(
343        rename = "maxAutoscaleSeats",
344        alias = "MaxAutoscaleSeats",
345        skip_serializing_if = "Option::is_none"
346    )]
347    pub max_autoscale_seats: Option<i32>,
348    /// The date the organization's owners were last notified that the organization had autoscaled.
349    /// NULL if owners have not been notified.
350    #[serde(
351        rename = "ownersNotifiedOfAutoscaling",
352        alias = "OwnersNotifiedOfAutoscaling",
353        skip_serializing_if = "Option::is_none"
354    )]
355    pub owners_notified_of_autoscaling: Option<String>,
356    #[serde(
357        rename = "status",
358        alias = "Status",
359        skip_serializing_if = "Option::is_none"
360    )]
361    pub status: Option<models::OrganizationStatusType>,
362    /// If true, the organization has access to the Password Manager product. This is intended for
363    /// future use if we separate Password Manager from Secrets Manager (and other products). For
364    /// now, all organizations and users implicitly have access to Password Manager.
365    #[serde(
366        rename = "usePasswordManager",
367        alias = "UsePasswordManager",
368        skip_serializing_if = "Option::is_none"
369    )]
370    pub use_password_manager: Option<bool>,
371    /// The number of Secrets Manager seats included in the organization's subscription. NULL if
372    /// the organization does not have access to Secrets Manager.
373    #[serde(
374        rename = "smSeats",
375        alias = "SmSeats",
376        skip_serializing_if = "Option::is_none"
377    )]
378    pub sm_seats: Option<i32>,
379    /// The number of Secrets Manager machine accounts (service accounts) included in the
380    /// organization's subscription. NULL if the organization does not have access to Secrets
381    /// Manager.
382    #[serde(
383        rename = "smServiceAccounts",
384        alias = "SmServiceAccounts",
385        skip_serializing_if = "Option::is_none"
386    )]
387    pub sm_service_accounts: Option<i32>,
388    /// The maximum number of Secrets Manager seats the organization can autoscale to. NULL if
389    /// autoscaling is not limited.
390    #[serde(
391        rename = "maxAutoscaleSmSeats",
392        alias = "MaxAutoscaleSmSeats",
393        skip_serializing_if = "Option::is_none"
394    )]
395    pub max_autoscale_sm_seats: Option<i32>,
396    /// The maximum number of Secrets Manager machine accounts the organization can autoscale to.
397    /// NULL if autoscaling is not limited.
398    #[serde(
399        rename = "maxAutoscaleSmServiceAccounts",
400        alias = "MaxAutoscaleSmServiceAccounts",
401        skip_serializing_if = "Option::is_none"
402    )]
403    pub max_autoscale_sm_service_accounts: Option<i32>,
404    /// The number of Privileged Access Management seats included in the organization's
405    /// subscription. NULL if the organization does not have access to Privileged Access
406    /// Management. Also NULL on a self-hosted instance whose license predates the seat count. A
407    /// NULL value is treated as no seat limit until a license carrying the count is applied.
408    #[serde(
409        rename = "pamSeats",
410        alias = "PamSeats",
411        skip_serializing_if = "Option::is_none"
412    )]
413    pub pam_seats: Option<i32>,
414    /// The maximum number of Privileged Access Management seats the organization can autoscale to.
415    /// NULL if autoscaling is not limited.
416    #[serde(
417        rename = "maxAutoscalePamSeats",
418        alias = "MaxAutoscalePamSeats",
419        skip_serializing_if = "Option::is_none"
420    )]
421    pub max_autoscale_pam_seats: Option<i32>,
422    /// The minimum number of Privileged Access Management seats the organization's subscription
423    /// must retain. NULL if the organization has never purchased Privileged Access Management.
424    #[serde(
425        rename = "pamSeatMinimum",
426        alias = "PamSeatMinimum",
427        skip_serializing_if = "Option::is_none"
428    )]
429    pub pam_seat_minimum: Option<i32>,
430    /// If set to true, only owners, admins, and some custom users can create and delete
431    /// collections. If set to false, any organization member can create a collection, and any
432    /// member can delete a collection that they have Can Manage permissions for.
433    #[serde(
434        rename = "limitCollectionCreation",
435        alias = "LimitCollectionCreation",
436        skip_serializing_if = "Option::is_none"
437    )]
438    pub limit_collection_creation: Option<bool>,
439    /// If set to true, only owners, admins, and some custom users can delete collections. If set
440    /// to false, any member can delete a collection that they have Can Manage permissions for.
441    #[serde(
442        rename = "limitCollectionDeletion",
443        alias = "LimitCollectionDeletion",
444        skip_serializing_if = "Option::is_none"
445    )]
446    pub limit_collection_deletion: Option<bool>,
447    /// If set to true, admins, owners, and some custom users can read/write all collections and
448    /// items in the Admin Console. If set to false, users generally need collection-level
449    /// permissions to read/write a collection or its items.
450    #[serde(
451        rename = "allowAdminAccessToAllCollectionItems",
452        alias = "AllowAdminAccessToAllCollectionItems",
453        skip_serializing_if = "Option::is_none"
454    )]
455    pub allow_admin_access_to_all_collection_items: Option<bool>,
456    /// If set to true, members can only delete items when they have a Can Manage permission over
457    /// the collection. If set to false, members can delete items when they have a Can Manage OR
458    /// Can Edit permission over the collection.
459    #[serde(
460        rename = "limitItemDeletion",
461        alias = "LimitItemDeletion",
462        skip_serializing_if = "Option::is_none"
463    )]
464    pub limit_item_deletion: Option<bool>,
465    /// If true, the organization can use the Risk Insights feature. This is a reporting feature
466    /// that provides insights into the security of an organization.
467    #[serde(
468        rename = "useRiskInsights",
469        alias = "UseRiskInsights",
470        skip_serializing_if = "Option::is_none"
471    )]
472    pub use_risk_insights: Option<bool>,
473    /// If true, the organization can claim domains, which unlocks additional enterprise features.
474    #[serde(
475        rename = "useOrganizationDomains",
476        alias = "UseOrganizationDomains",
477        skip_serializing_if = "Option::is_none"
478    )]
479    pub use_organization_domains: Option<bool>,
480    /// If set to true, admins can initiate organization-issued sponsorships.
481    #[serde(
482        rename = "useAdminSponsoredFamilies",
483        alias = "UseAdminSponsoredFamilies",
484        skip_serializing_if = "Option::is_none"
485    )]
486    pub use_admin_sponsored_families: Option<bool>,
487    /// If set to true, organization needs their seat count synced with their subscription.
488    #[serde(
489        rename = "syncSeats",
490        alias = "SyncSeats",
491        skip_serializing_if = "Option::is_none"
492    )]
493    pub sync_seats: Option<bool>,
494    /// If set to true, the organization can use the automatic user confirmation feature. This
495    /// automatically confirms users in the Accepted state without requiring manual admin
496    /// intervention. There are significant security risks to this and access is manually
497    /// controlled by our internal teams.
498    #[serde(
499        rename = "useAutomaticUserConfirmation",
500        alias = "UseAutomaticUserConfirmation",
501        skip_serializing_if = "Option::is_none"
502    )]
503    pub use_automatic_user_confirmation: Option<bool>,
504    /// If set to true, disables Secrets Manager ads for users in the organization
505    #[serde(
506        rename = "useDisableSmAdsForUsers",
507        alias = "UseDisableSmAdsForUsers",
508        skip_serializing_if = "Option::is_none"
509    )]
510    pub use_disable_sm_ads_for_users: Option<bool>,
511    /// If set to true, the organization can use the phishing blocker feature.
512    #[serde(
513        rename = "usePhishingBlocker",
514        alias = "UsePhishingBlocker",
515        skip_serializing_if = "Option::is_none"
516    )]
517    pub use_phishing_blocker: Option<bool>,
518    /// If set to true, My Items collections will be created automatically when the Organization
519    /// Data Ownership policy is enabled.
520    #[serde(
521        rename = "useMyItems",
522        alias = "UseMyItems",
523        skip_serializing_if = "Option::is_none"
524    )]
525    pub use_my_items: Option<bool>,
526    /// If set to true, the organization can generate reusable sharable invite links to invite
527    /// users to the organization.
528    #[serde(
529        rename = "useInviteLinks",
530        alias = "UseInviteLinks",
531        skip_serializing_if = "Option::is_none"
532    )]
533    pub use_invite_links: Option<bool>,
534    /// If true, the organization is subscribed to the Privileged Access Management (PAM) product.
535    #[serde(
536        rename = "usePam",
537        alias = "UsePam",
538        skip_serializing_if = "Option::is_none"
539    )]
540    pub use_pam: Option<bool>,
541    /// When set to true, the organization is excluded from automated billing lifecycle operations
542    /// such as subscription cancellation and disabling for non-payment.
543    #[serde(
544        rename = "exemptFromBillingAutomation",
545        alias = "ExemptFromBillingAutomation",
546        skip_serializing_if = "Option::is_none"
547    )]
548    pub exempt_from_billing_automation: Option<bool>,
549}
550
551impl Organization {
552    /// An organization is an entity that allows users to share vault items and manage billing,
553    /// access control, and other enterprise features depending on the plan.
554    pub fn new() -> Organization {
555        Organization {
556            id: None,
557            identifier: None,
558            name: None,
559            business_name: None,
560            business_address1: None,
561            business_address2: None,
562            business_address3: None,
563            business_country: None,
564            business_tax_number: None,
565            billing_email: None,
566            plan: None,
567            plan_type: None,
568            seats: None,
569            max_collections: None,
570            use_policies: None,
571            use_sso: None,
572            use_key_connector: None,
573            use_scim: None,
574            use_groups: None,
575            use_directory: None,
576            use_events: None,
577            use_totp: None,
578            use2fa: None,
579            use_api: None,
580            use_reset_password: None,
581            use_secrets_manager: None,
582            self_host: None,
583            users_get_premium: None,
584            use_custom_permissions: None,
585            storage: None,
586            max_storage_gb: None,
587            gateway: None,
588            gateway_customer_id: None,
589            gateway_subscription_id: None,
590            reference_data: None,
591            enabled: None,
592            license_key: None,
593            public_key: None,
594            private_key: None,
595            organization_key_id: None,
596            two_factor_providers: None,
597            expiration_date: None,
598            creation_date: None,
599            revision_date: None,
600            max_autoscale_seats: None,
601            owners_notified_of_autoscaling: None,
602            status: None,
603            use_password_manager: None,
604            sm_seats: None,
605            sm_service_accounts: None,
606            max_autoscale_sm_seats: None,
607            max_autoscale_sm_service_accounts: None,
608            pam_seats: None,
609            max_autoscale_pam_seats: None,
610            pam_seat_minimum: None,
611            limit_collection_creation: None,
612            limit_collection_deletion: None,
613            allow_admin_access_to_all_collection_items: None,
614            limit_item_deletion: None,
615            use_risk_insights: None,
616            use_organization_domains: None,
617            use_admin_sponsored_families: None,
618            sync_seats: None,
619            use_automatic_user_confirmation: None,
620            use_disable_sm_ads_for_users: None,
621            use_phishing_blocker: None,
622            use_my_items: None,
623            use_invite_links: None,
624            use_pam: None,
625            exempt_from_billing_automation: None,
626        }
627    }
628}