bitwarden_api_api/models/
cipher_with_id_request_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CipherWithIdRequestModel {
17    /// The Id of the user that encrypted the cipher. It should always represent a UserId.
18    #[serde(rename = "encryptedFor", skip_serializing_if = "Option::is_none")]
19    pub encrypted_for: Option<uuid::Uuid>,
20    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
21    pub r#type: Option<models::CipherType>,
22    #[serde(rename = "organizationId", skip_serializing_if = "Option::is_none")]
23    pub organization_id: Option<String>,
24    #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")]
25    pub folder_id: Option<String>,
26    #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")]
27    pub favorite: Option<bool>,
28    #[serde(rename = "reprompt", skip_serializing_if = "Option::is_none")]
29    pub reprompt: Option<models::CipherRepromptType>,
30    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
31    pub key: Option<String>,
32    #[serde(rename = "name")]
33    pub name: String,
34    #[serde(rename = "notes", skip_serializing_if = "Option::is_none")]
35    pub notes: Option<String>,
36    #[serde(rename = "fields", skip_serializing_if = "Option::is_none")]
37    pub fields: Option<Vec<models::CipherFieldModel>>,
38    #[serde(rename = "passwordHistory", skip_serializing_if = "Option::is_none")]
39    pub password_history: Option<Vec<models::CipherPasswordHistoryModel>>,
40    #[serde(rename = "attachments", skip_serializing_if = "Option::is_none")]
41    pub attachments: Option<std::collections::HashMap<String, String>>,
42    #[serde(rename = "attachments2", skip_serializing_if = "Option::is_none")]
43    pub attachments2: Option<std::collections::HashMap<String, models::CipherAttachmentModel>>,
44    #[serde(rename = "login", skip_serializing_if = "Option::is_none")]
45    pub login: Option<Box<models::CipherLoginModel>>,
46    #[serde(rename = "card", skip_serializing_if = "Option::is_none")]
47    pub card: Option<Box<models::CipherCardModel>>,
48    #[serde(rename = "identity", skip_serializing_if = "Option::is_none")]
49    pub identity: Option<Box<models::CipherIdentityModel>>,
50    #[serde(rename = "secureNote", skip_serializing_if = "Option::is_none")]
51    pub secure_note: Option<Box<models::CipherSecureNoteModel>>,
52    #[serde(rename = "sshKey", skip_serializing_if = "Option::is_none")]
53    pub ssh_key: Option<Box<models::CipherSshKeyModel>>,
54    #[serde(
55        rename = "lastKnownRevisionDate",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub last_known_revision_date: Option<String>,
59    #[serde(rename = "id")]
60    pub id: uuid::Uuid,
61}
62
63impl CipherWithIdRequestModel {
64    pub fn new(name: String, id: uuid::Uuid) -> CipherWithIdRequestModel {
65        CipherWithIdRequestModel {
66            encrypted_for: None,
67            r#type: None,
68            organization_id: None,
69            folder_id: None,
70            favorite: None,
71            reprompt: None,
72            key: None,
73            name,
74            notes: None,
75            fields: None,
76            password_history: None,
77            attachments: None,
78            attachments2: None,
79            login: None,
80            card: None,
81            identity: None,
82            secure_note: None,
83            ssh_key: None,
84            last_known_revision_date: None,
85            id,
86        }
87    }
88}