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 JSON blob of the organization's two-factor authentication provider configurations. Use
300    /// M:Bit.Core.AdminConsole.Entities.Organization.GetTwoFactorProviders and
301    /// M:Bit.Core.AdminConsole.Entities.Organization.SetTwoFactorProviders(System.Collections.
302    /// Generic.Dictionary{Bit.Core.Auth.Enums.TwoFactorProviderType,Bit.Core.Auth.Models.
303    /// TwoFactorProvider}) to read and write this field.
304    #[serde(
305        rename = "twoFactorProviders",
306        alias = "TwoFactorProviders",
307        skip_serializing_if = "Option::is_none"
308    )]
309    pub two_factor_providers: Option<String>,
310    /// The date the organization's license expires. NULL if the license does not expire.
311    #[serde(
312        rename = "expirationDate",
313        alias = "ExpirationDate",
314        skip_serializing_if = "Option::is_none"
315    )]
316    pub expiration_date: Option<String>,
317    /// The date the organization was created.
318    #[serde(
319        rename = "creationDate",
320        alias = "CreationDate",
321        skip_serializing_if = "Option::is_none"
322    )]
323    pub creation_date: Option<String>,
324    /// The date the organization was last updated.
325    #[serde(
326        rename = "revisionDate",
327        alias = "RevisionDate",
328        skip_serializing_if = "Option::is_none"
329    )]
330    pub revision_date: Option<String>,
331    /// The maximum number of seats the organization can autoscale to. NULL if autoscaling is not
332    /// limited.
333    #[serde(
334        rename = "maxAutoscaleSeats",
335        alias = "MaxAutoscaleSeats",
336        skip_serializing_if = "Option::is_none"
337    )]
338    pub max_autoscale_seats: Option<i32>,
339    /// The date the organization's owners were last notified that the organization had autoscaled.
340    /// NULL if owners have not been notified.
341    #[serde(
342        rename = "ownersNotifiedOfAutoscaling",
343        alias = "OwnersNotifiedOfAutoscaling",
344        skip_serializing_if = "Option::is_none"
345    )]
346    pub owners_notified_of_autoscaling: Option<String>,
347    #[serde(
348        rename = "status",
349        alias = "Status",
350        skip_serializing_if = "Option::is_none"
351    )]
352    pub status: Option<models::OrganizationStatusType>,
353    /// If true, the organization has access to the Password Manager product. This is intended for
354    /// future use if we separate Password Manager from Secrets Manager (and other products). For
355    /// now, all organizations and users implicitly have access to Password Manager.
356    #[serde(
357        rename = "usePasswordManager",
358        alias = "UsePasswordManager",
359        skip_serializing_if = "Option::is_none"
360    )]
361    pub use_password_manager: Option<bool>,
362    /// The number of Secrets Manager seats included in the organization's subscription. NULL if
363    /// the organization does not have access to Secrets Manager.
364    #[serde(
365        rename = "smSeats",
366        alias = "SmSeats",
367        skip_serializing_if = "Option::is_none"
368    )]
369    pub sm_seats: Option<i32>,
370    /// The number of Secrets Manager machine accounts (service accounts) included in the
371    /// organization's subscription. NULL if the organization does not have access to Secrets
372    /// Manager.
373    #[serde(
374        rename = "smServiceAccounts",
375        alias = "SmServiceAccounts",
376        skip_serializing_if = "Option::is_none"
377    )]
378    pub sm_service_accounts: Option<i32>,
379    /// The maximum number of Secrets Manager seats the organization can autoscale to. NULL if
380    /// autoscaling is not limited.
381    #[serde(
382        rename = "maxAutoscaleSmSeats",
383        alias = "MaxAutoscaleSmSeats",
384        skip_serializing_if = "Option::is_none"
385    )]
386    pub max_autoscale_sm_seats: Option<i32>,
387    /// The maximum number of Secrets Manager machine accounts the organization can autoscale to.
388    /// NULL if autoscaling is not limited.
389    #[serde(
390        rename = "maxAutoscaleSmServiceAccounts",
391        alias = "MaxAutoscaleSmServiceAccounts",
392        skip_serializing_if = "Option::is_none"
393    )]
394    pub max_autoscale_sm_service_accounts: Option<i32>,
395    /// If set to true, only owners, admins, and some custom users can create and delete
396    /// collections. If set to false, any organization member can create a collection, and any
397    /// member can delete a collection that they have Can Manage permissions for.
398    #[serde(
399        rename = "limitCollectionCreation",
400        alias = "LimitCollectionCreation",
401        skip_serializing_if = "Option::is_none"
402    )]
403    pub limit_collection_creation: Option<bool>,
404    /// If set to true, only owners, admins, and some custom users can delete collections. If set
405    /// to false, any member can delete a collection that they have Can Manage permissions for.
406    #[serde(
407        rename = "limitCollectionDeletion",
408        alias = "LimitCollectionDeletion",
409        skip_serializing_if = "Option::is_none"
410    )]
411    pub limit_collection_deletion: Option<bool>,
412    /// If set to true, admins, owners, and some custom users can read/write all collections and
413    /// items in the Admin Console. If set to false, users generally need collection-level
414    /// permissions to read/write a collection or its items.
415    #[serde(
416        rename = "allowAdminAccessToAllCollectionItems",
417        alias = "AllowAdminAccessToAllCollectionItems",
418        skip_serializing_if = "Option::is_none"
419    )]
420    pub allow_admin_access_to_all_collection_items: Option<bool>,
421    /// If set to true, members can only delete items when they have a Can Manage permission over
422    /// the collection. If set to false, members can delete items when they have a Can Manage OR
423    /// Can Edit permission over the collection.
424    #[serde(
425        rename = "limitItemDeletion",
426        alias = "LimitItemDeletion",
427        skip_serializing_if = "Option::is_none"
428    )]
429    pub limit_item_deletion: Option<bool>,
430    /// If true, the organization can use the Risk Insights feature. This is a reporting feature
431    /// that provides insights into the security of an organization.
432    #[serde(
433        rename = "useRiskInsights",
434        alias = "UseRiskInsights",
435        skip_serializing_if = "Option::is_none"
436    )]
437    pub use_risk_insights: Option<bool>,
438    /// If true, the organization can claim domains, which unlocks additional enterprise features.
439    #[serde(
440        rename = "useOrganizationDomains",
441        alias = "UseOrganizationDomains",
442        skip_serializing_if = "Option::is_none"
443    )]
444    pub use_organization_domains: Option<bool>,
445    /// If set to true, admins can initiate organization-issued sponsorships.
446    #[serde(
447        rename = "useAdminSponsoredFamilies",
448        alias = "UseAdminSponsoredFamilies",
449        skip_serializing_if = "Option::is_none"
450    )]
451    pub use_admin_sponsored_families: Option<bool>,
452    /// If set to true, organization needs their seat count synced with their subscription.
453    #[serde(
454        rename = "syncSeats",
455        alias = "SyncSeats",
456        skip_serializing_if = "Option::is_none"
457    )]
458    pub sync_seats: Option<bool>,
459    /// If set to true, the organization can use the automatic user confirmation feature. This
460    /// automatically confirms users in the Accepted state without requiring manual admin
461    /// intervention. There are significant security risks to this and access is manually
462    /// controlled by our internal teams.
463    #[serde(
464        rename = "useAutomaticUserConfirmation",
465        alias = "UseAutomaticUserConfirmation",
466        skip_serializing_if = "Option::is_none"
467    )]
468    pub use_automatic_user_confirmation: Option<bool>,
469    /// If set to true, disables Secrets Manager ads for users in the organization
470    #[serde(
471        rename = "useDisableSmAdsForUsers",
472        alias = "UseDisableSmAdsForUsers",
473        skip_serializing_if = "Option::is_none"
474    )]
475    pub use_disable_sm_ads_for_users: Option<bool>,
476    /// If set to true, the organization can use the phishing blocker feature.
477    #[serde(
478        rename = "usePhishingBlocker",
479        alias = "UsePhishingBlocker",
480        skip_serializing_if = "Option::is_none"
481    )]
482    pub use_phishing_blocker: Option<bool>,
483    /// If set to true, My Items collections will be created automatically when the Organization
484    /// Data Ownership policy is enabled.
485    #[serde(
486        rename = "useMyItems",
487        alias = "UseMyItems",
488        skip_serializing_if = "Option::is_none"
489    )]
490    pub use_my_items: Option<bool>,
491    /// If set to true, the organization can generate reusable sharable invite links to invite
492    /// users to the organization.
493    #[serde(
494        rename = "useInviteLinks",
495        alias = "UseInviteLinks",
496        skip_serializing_if = "Option::is_none"
497    )]
498    pub use_invite_links: Option<bool>,
499    /// When set to true, the organization is excluded from automated billing lifecycle operations
500    /// such as subscription cancellation and disabling for non-payment.
501    #[serde(
502        rename = "exemptFromBillingAutomation",
503        alias = "ExemptFromBillingAutomation",
504        skip_serializing_if = "Option::is_none"
505    )]
506    pub exempt_from_billing_automation: Option<bool>,
507}
508
509impl Organization {
510    /// An organization is an entity that allows users to share vault items and manage billing,
511    /// access control, and other enterprise features depending on the plan.
512    pub fn new() -> Organization {
513        Organization {
514            id: None,
515            identifier: None,
516            name: None,
517            business_name: None,
518            business_address1: None,
519            business_address2: None,
520            business_address3: None,
521            business_country: None,
522            business_tax_number: None,
523            billing_email: None,
524            plan: None,
525            plan_type: None,
526            seats: None,
527            max_collections: None,
528            use_policies: None,
529            use_sso: None,
530            use_key_connector: None,
531            use_scim: None,
532            use_groups: None,
533            use_directory: None,
534            use_events: None,
535            use_totp: None,
536            use2fa: None,
537            use_api: None,
538            use_reset_password: None,
539            use_secrets_manager: None,
540            self_host: None,
541            users_get_premium: None,
542            use_custom_permissions: None,
543            storage: None,
544            max_storage_gb: None,
545            gateway: None,
546            gateway_customer_id: None,
547            gateway_subscription_id: None,
548            reference_data: None,
549            enabled: None,
550            license_key: None,
551            public_key: None,
552            private_key: None,
553            two_factor_providers: None,
554            expiration_date: None,
555            creation_date: None,
556            revision_date: None,
557            max_autoscale_seats: None,
558            owners_notified_of_autoscaling: None,
559            status: None,
560            use_password_manager: None,
561            sm_seats: None,
562            sm_service_accounts: None,
563            max_autoscale_sm_seats: None,
564            max_autoscale_sm_service_accounts: None,
565            limit_collection_creation: None,
566            limit_collection_deletion: None,
567            allow_admin_access_to_all_collection_items: None,
568            limit_item_deletion: None,
569            use_risk_insights: None,
570            use_organization_domains: None,
571            use_admin_sponsored_families: None,
572            sync_seats: None,
573            use_automatic_user_confirmation: None,
574            use_disable_sm_ads_for_users: None,
575            use_phishing_blocker: None,
576            use_my_items: None,
577            use_invite_links: None,
578            exempt_from_billing_automation: None,
579        }
580    }
581}