bitwarden-api-api 3.0.0

Api bindings for the Bitwarden API.
Documentation
/*
 * Bitwarden Internal API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: latest
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::{Deserialize, Serialize};

use crate::models;

/// PrivateKeysResponseModel : This response model is used to return the asymmetric encryption keys,
/// and signature keys of an entity. This includes the private keys of the key pairs, (private key,
/// signing key), and the public keys of the key pairs (unsigned public key, signed public key,
/// verification key).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PrivateKeysResponseModel {
    #[serde(
        rename = "object",
        alias = "Object",
        skip_serializing_if = "Option::is_none"
    )]
    pub object: Option<String>,
    #[serde(
        rename = "signatureKeyPair",
        alias = "SignatureKeyPair",
        skip_serializing_if = "Option::is_none"
    )]
    pub signature_key_pair: Option<Box<models::SignatureKeyPairResponseModel>>,
    #[serde(
        rename = "publicKeyEncryptionKeyPair",
        alias = "PublicKeyEncryptionKeyPair"
    )]
    pub public_key_encryption_key_pair: Box<models::PublicKeyEncryptionKeyPairResponseModel>,
    #[serde(
        rename = "securityState",
        alias = "SecurityState",
        skip_serializing_if = "Option::is_none"
    )]
    pub security_state: Option<Box<models::SecurityStateModel>>,
}

impl PrivateKeysResponseModel {
    /// This response model is used to return the asymmetric encryption keys, and signature keys of
    /// an entity. This includes the private keys of the key pairs, (private key, signing key), and
    /// the public keys of the key pairs (unsigned public key, signed public key, verification key).
    pub fn new(
        public_key_encryption_key_pair: models::PublicKeyEncryptionKeyPairResponseModel,
    ) -> PrivateKeysResponseModel {
        PrivateKeysResponseModel {
            object: None,
            signature_key_pair: None,
            public_key_encryption_key_pair: Box::new(public_key_encryption_key_pair),
            security_state: None,
        }
    }
}