Skip to main content

bitwarden_api_api/models/
cipher_mini_response_model.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/// CipherMiniResponseModel : The shape shared by every cipher response. Abstract because a response
16/// has to say which data it carries: a `Partial*` subclass emits the reduced
17/// Bit.Api.Vault.Models.Response.CipherMiniResponseModel.PartialData envelope for a leasing-gated
18/// cipher, and a `Full*` subclass emits the secret
19/// Bit.Api.Vault.Models.Response.CipherMiniResponseModel.Data blob and can only be constructed with
20/// a Bit.Core.Vault.Authorization.FullCipherAccess witness. Both properties are declared here so
21/// either shape serializes to the same contract.
22#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
23pub struct CipherMiniResponseModel {
24    #[serde(
25        rename = "object",
26        alias = "Object",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub object: Option<String>,
30    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
31    pub id: Option<uuid::Uuid>,
32    #[serde(
33        rename = "organizationId",
34        alias = "OrganizationId",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub organization_id: Option<uuid::Uuid>,
38    #[serde(
39        rename = "type",
40        alias = "R#type",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub r#type: Option<models::CipherType>,
44    #[serde(
45        rename = "data",
46        alias = "Data",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub data: Option<String>,
50    /// The reduced data blob returned in place of
51    /// Bit.Api.Vault.Models.Response.CipherMiniResponseModel.Data when the caller can only reach
52    /// this cipher through leasing-enabled collections (PAM credential leasing). Contains the
53    /// encrypted title and, for logins, the encrypted URIs — never the dropped secrets. Null for
54    /// full responses.
55    #[serde(
56        rename = "partialData",
57        alias = "PartialData",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub partial_data: Option<String>,
61    #[serde(
62        rename = "name",
63        alias = "Name",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub name: Option<String>,
67    #[serde(
68        rename = "notes",
69        alias = "Notes",
70        skip_serializing_if = "Option::is_none"
71    )]
72    pub notes: Option<String>,
73    #[serde(
74        rename = "login",
75        alias = "Login",
76        skip_serializing_if = "Option::is_none"
77    )]
78    pub login: Option<Box<models::CipherLoginModel>>,
79    #[serde(
80        rename = "card",
81        alias = "Card",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub card: Option<Box<models::CipherCardModel>>,
85    #[serde(
86        rename = "identity",
87        alias = "Identity",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub identity: Option<Box<models::CipherIdentityModel>>,
91    #[serde(
92        rename = "secureNote",
93        alias = "SecureNote",
94        skip_serializing_if = "Option::is_none"
95    )]
96    pub secure_note: Option<Box<models::CipherSecureNoteModel>>,
97    #[serde(
98        rename = "sshKey",
99        alias = "SshKey",
100        skip_serializing_if = "Option::is_none"
101    )]
102    pub ssh_key: Option<Box<models::CipherSshKeyModel>>,
103    #[serde(
104        rename = "bankAccount",
105        alias = "BankAccount",
106        skip_serializing_if = "Option::is_none"
107    )]
108    pub bank_account: Option<Box<models::CipherBankAccountModel>>,
109    #[serde(
110        rename = "driversLicense",
111        alias = "DriversLicense",
112        skip_serializing_if = "Option::is_none"
113    )]
114    pub drivers_license: Option<Box<models::CipherDriversLicenseModel>>,
115    #[serde(
116        rename = "passport",
117        alias = "Passport",
118        skip_serializing_if = "Option::is_none"
119    )]
120    pub passport: Option<Box<models::CipherPassportModel>>,
121    #[serde(
122        rename = "fields",
123        alias = "Fields",
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub fields: Option<Vec<models::CipherFieldModel>>,
127    #[serde(
128        rename = "passwordHistory",
129        alias = "PasswordHistory",
130        skip_serializing_if = "Option::is_none"
131    )]
132    pub password_history: Option<Vec<models::CipherPasswordHistoryModel>>,
133    #[serde(
134        rename = "attachments",
135        alias = "Attachments",
136        skip_serializing_if = "Option::is_none"
137    )]
138    pub attachments: Option<Vec<models::AttachmentResponseModel>>,
139    #[serde(
140        rename = "organizationUseTotp",
141        alias = "OrganizationUseTotp",
142        skip_serializing_if = "Option::is_none"
143    )]
144    pub organization_use_totp: Option<bool>,
145    #[serde(
146        rename = "revisionDate",
147        alias = "RevisionDate",
148        skip_serializing_if = "Option::is_none"
149    )]
150    pub revision_date: Option<String>,
151    #[serde(
152        rename = "creationDate",
153        alias = "CreationDate",
154        skip_serializing_if = "Option::is_none"
155    )]
156    pub creation_date: Option<String>,
157    #[serde(
158        rename = "deletedDate",
159        alias = "DeletedDate",
160        skip_serializing_if = "Option::is_none"
161    )]
162    pub deleted_date: Option<String>,
163    #[serde(
164        rename = "reprompt",
165        alias = "Reprompt",
166        skip_serializing_if = "Option::is_none"
167    )]
168    pub reprompt: Option<models::CipherRepromptType>,
169    #[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
170    pub key: Option<String>,
171}
172
173impl CipherMiniResponseModel {
174    /// The shape shared by every cipher response. Abstract because a response has to say which data
175    /// it carries: a `Partial*` subclass emits the reduced
176    /// Bit.Api.Vault.Models.Response.CipherMiniResponseModel.PartialData envelope for a
177    /// leasing-gated cipher, and a `Full*` subclass emits the secret
178    /// Bit.Api.Vault.Models.Response.CipherMiniResponseModel.Data blob and can only be constructed
179    /// with a Bit.Core.Vault.Authorization.FullCipherAccess witness. Both properties are declared
180    /// here so either shape serializes to the same contract.
181    pub fn new() -> CipherMiniResponseModel {
182        CipherMiniResponseModel {
183            object: None,
184            id: None,
185            organization_id: None,
186            r#type: None,
187            data: None,
188            partial_data: None,
189            name: None,
190            notes: None,
191            login: None,
192            card: None,
193            identity: None,
194            secure_note: None,
195            ssh_key: None,
196            bank_account: None,
197            drivers_license: None,
198            passport: None,
199            fields: None,
200            password_history: None,
201            attachments: None,
202            organization_use_totp: None,
203            revision_date: None,
204            creation_date: None,
205            deleted_date: None,
206            reprompt: None,
207            key: None,
208        }
209    }
210}