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;

/// CapsuleOpenResponse : Contains key material for a capsule 
#[serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CapsuleOpenResponse {
    /// a CBOR encoded decryption key for the capsule
    #[serde_as(as = "serde_with::base64::Base64")]
    #[serde(rename = "decryptionKey")]
    pub decryption_key: Vec<u8>,
    #[serde(rename = "readContextConfiguration")]
    pub read_context_configuration: Box<models::CapsuleOpenResponseReadContextConfiguration>,
    /// A token used to tie requests together when creating and reading capsules.
    #[serde(rename = "openToken")]
    pub open_token: String,
    /// the tags for this capsule
    #[serde(rename = "capsuleTags")]
    pub capsule_tags: Vec<models::Tag>,
}

impl CapsuleOpenResponse {
    /// Contains key material for a capsule 
    pub fn new(decryption_key: Vec<u8>, read_context_configuration: models::CapsuleOpenResponseReadContextConfiguration, open_token: String, capsule_tags: Vec<models::Tag>) -> CapsuleOpenResponse {
        CapsuleOpenResponse {
            decryption_key,
            read_context_configuration: Box::new(read_context_configuration),
            open_token,
            capsule_tags,
        }
    }
}