bitwarden_api_api/models/collection.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/// Collection : A named grouping of vault items within an organization, used to share items with
16/// members and groups. Access is granted to individual members via Bit.Core.Entities.CollectionUser
17/// and to groups via Bit.Core.Entities.CollectionGroup.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct Collection {
20 /// A unique identifier for the collection.
21 #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
22 pub id: Option<uuid::Uuid>,
23 /// The ID of the Bit.Core.AdminConsole.Entities.Organization that owns this collection.
24 #[serde(
25 rename = "organizationId",
26 alias = "OrganizationId",
27 skip_serializing_if = "Option::is_none"
28 )]
29 pub organization_id: Option<uuid::Uuid>,
30 /// The name of the collection, stored encrypted.
31 #[serde(
32 rename = "name",
33 alias = "Name",
34 skip_serializing_if = "Option::is_none"
35 )]
36 pub name: Option<String>,
37 /// An ID used to associate this collection with a record in external services.
38 #[serde(
39 rename = "externalId",
40 alias = "ExternalId",
41 skip_serializing_if = "Option::is_none"
42 )]
43 pub external_id: Option<String>,
44 /// The date the collection was created.
45 #[serde(
46 rename = "creationDate",
47 alias = "CreationDate",
48 skip_serializing_if = "Option::is_none"
49 )]
50 pub creation_date: Option<String>,
51 /// The date the collection was last updated.
52 #[serde(
53 rename = "revisionDate",
54 alias = "RevisionDate",
55 skip_serializing_if = "Option::is_none"
56 )]
57 pub revision_date: Option<String>,
58 #[serde(
59 rename = "type",
60 alias = "R#type",
61 skip_serializing_if = "Option::is_none"
62 )]
63 pub r#type: Option<models::CollectionType>,
64 /// Used as the name for the collection if this is a
65 /// Bit.Core.Enums.CollectionType.DefaultUserCollection of a user who is no longer a member of
66 /// the organization. In this case, it stores the user's email address so that it is
67 /// identifiable by an admin (rather than being called \"My Items\" for an unknown user).
68 /// Unencrypted.
69 #[serde(
70 rename = "defaultUserCollectionEmail",
71 alias = "DefaultUserCollectionEmail",
72 skip_serializing_if = "Option::is_none"
73 )]
74 pub default_user_collection_email: Option<String>,
75 /// Reference to the `AccessRule` that gates PAM credential leasing for this collection. Null
76 /// means leasing is disabled for the collection.
77 #[serde(
78 rename = "accessRuleId",
79 alias = "AccessRuleId",
80 skip_serializing_if = "Option::is_none"
81 )]
82 pub access_rule_id: Option<uuid::Uuid>,
83}
84
85impl Collection {
86 /// A named grouping of vault items within an organization, used to share items with members and
87 /// groups. Access is granted to individual members via Bit.Core.Entities.CollectionUser and to
88 /// groups via Bit.Core.Entities.CollectionGroup.
89 pub fn new() -> Collection {
90 Collection {
91 id: None,
92 organization_id: None,
93 name: None,
94 external_id: None,
95 creation_date: None,
96 revision_date: None,
97 r#type: None,
98 default_user_collection_email: None,
99 access_rule_id: None,
100 }
101 }
102}