antimatter_api 2.0.13

Interact with the Antimatter Cloud API
Documentation
/*
 * Antimatter Public API
 *
 * Interact with the Antimatter Cloud API
 *
 * The version of the OpenAPI document: 2.0.13
 * Contact: support@antimatter.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

use serde_with::serde_as;

/// CapsuleOpenRequest : A request to open (decrypt) a capsule 
#[serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CapsuleOpenRequest {
    /// a CBOR encoded encrypted decryption key for the capsule
    #[serde_as(as = "serde_with::base64::Base64")]
    #[serde(rename = "encryptedDek")]
    pub encrypted_dek: Vec<u8>,
    /// Encryption key ID
    #[serde(rename = "keyID")]
    pub key_id: i64,
    #[serde(rename = "readParameters", skip_serializing_if = "Option::is_none")]
    pub read_parameters: Option<Vec<models::ReadParameter>>,
}

impl CapsuleOpenRequest {
    /// A request to open (decrypt) a capsule 
    pub fn new(encrypted_dek: Vec<u8>, key_id: i64) -> CapsuleOpenRequest {
        CapsuleOpenRequest {
            encrypted_dek,
            key_id,
            read_parameters: None,
        }
    }
}