bitwarden_api_api/models/
account_keys_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 AccountKeysRequestModel {
17    #[serde(
18        rename = "userKeyEncryptedAccountPrivateKey",
19        alias = "UserKeyEncryptedAccountPrivateKey"
20    )]
21    pub user_key_encrypted_account_private_key: Option<String>,
22    #[serde(rename = "accountPublicKey", alias = "AccountPublicKey")]
23    pub account_public_key: Option<String>,
24    #[serde(
25        rename = "publicKeyEncryptionKeyPair",
26        alias = "PublicKeyEncryptionKeyPair",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub public_key_encryption_key_pair: Option<Box<models::PublicKeyEncryptionKeyPairRequestModel>>,
30    #[serde(
31        rename = "signatureKeyPair",
32        alias = "SignatureKeyPair",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub signature_key_pair: Option<Box<models::SignatureKeyPairRequestModel>>,
36    #[serde(
37        rename = "securityState",
38        alias = "SecurityState",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub security_state: Option<Box<models::SecurityStateModel>>,
42}
43
44impl AccountKeysRequestModel {
45    pub fn new(
46        user_key_encrypted_account_private_key: Option<String>,
47        account_public_key: Option<String>,
48    ) -> AccountKeysRequestModel {
49        AccountKeysRequestModel {
50            user_key_encrypted_account_private_key,
51            account_public_key,
52            public_key_encryption_key_pair: None,
53            signature_key_pair: None,
54            security_state: None,
55        }
56    }
57}