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;

/// ReadContextDetails : Details about a read context 
#[serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReadContextDetails {
    /// A human readable name for a read context
    #[serde(rename = "name")]
    pub name: String,
    /// A short, single sentence description of this read context
    #[serde(rename = "summary")]
    pub summary: String,
    /// A longer form description of this read context
    #[serde(rename = "description")]
    pub description: String,
    /// If true, skip creation of audit log events on read
    #[serde(rename = "disableReadLogging")]
    pub disable_read_logging: bool,
    /// Number of seconds for which cached encryption keys will be considered valid by the client 
    #[serde(rename = "keyCacheTTL")]
    pub key_cache_ttl: i32,
    #[serde(rename = "requiredHooks", skip_serializing_if = "Option::is_none")]
    pub required_hooks: Option<Vec<models::ReadContextRequiredHook>>,
    #[serde(rename = "readParameters")]
    pub read_parameters: Vec<models::ReadContextParameter>,
    #[serde(rename = "attachedPolicies", skip_serializing_if = "Option::is_none")]
    pub attached_policies: Option<Vec<models::ReadContextDetailsAttachedPoliciesInner>>,
    /// true if this read context is imported
    #[serde(rename = "imported")]
    pub imported: bool,
    /// A globally unique identifier for a domain
    #[serde(rename = "sourceDomainID", skip_serializing_if = "Option::is_none")]
    pub source_domain_id: Option<String>,
    #[serde(rename = "sourceDomainName", skip_serializing_if = "Option::is_none")]
    pub source_domain_name: Option<String>,
    /// a WASM bundle version of the policy associated with this read context 
    #[serde_as(as = "Option<serde_with::base64::Base64>")]
    #[serde(rename = "policyAssembly", skip_serializing_if = "Option::is_none")]
    pub policy_assembly: Option<Vec<u8>>,
}

impl ReadContextDetails {
    /// Details about a read context 
    pub fn new(name: String, summary: String, description: String, disable_read_logging: bool, key_cache_ttl: i32, read_parameters: Vec<models::ReadContextParameter>, imported: bool) -> ReadContextDetails {
        ReadContextDetails {
            name,
            summary,
            description,
            disable_read_logging,
            key_cache_ttl,
            required_hooks: None,
            read_parameters,
            attached_policies: None,
            imported,
            source_domain_id: None,
            source_domain_name: None,
            policy_assembly: None,
        }
    }
}