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;

/// GcpServiceAccountKeyInfo : The GCP service account information and details required to use the  provided GCP hosted encryption key for cryptographic operations. 
#[serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GcpServiceAccountKeyInfo {
    /// The Google service account contents as a base64 encoded  JSON string. 
    #[serde_as(as = "serde_with::base64::Base64")]
    #[serde(rename = "serviceAccountCredentials")]
    pub service_account_credentials: Vec<u8>,
    /// The Google project ID.
    #[serde(rename = "projectID")]
    pub project_id: String,
    /// Location of Google keyring.
    #[serde(rename = "location")]
    pub location: String,
    /// The Google keyring's ID at location.
    #[serde(rename = "keyringID")]
    pub keyring_id: String,
    /// The key ID that should be used in the Google keyring.
    #[serde(rename = "keyID")]
    pub key_id: String,
    #[serde(rename = "providerName", skip_serializing_if = "Option::is_none")]
    pub provider_name: Option<ProviderName>,
}

impl GcpServiceAccountKeyInfo {
    /// The GCP service account information and details required to use the  provided GCP hosted encryption key for cryptographic operations. 
    pub fn new(service_account_credentials: Vec<u8>, project_id: String, location: String, keyring_id: String, key_id: String) -> GcpServiceAccountKeyInfo {
        GcpServiceAccountKeyInfo {
            service_account_credentials,
            project_id,
            location,
            keyring_id,
            key_id,
            provider_name: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProviderName {
    #[serde(rename = "gcp_sa")]
    GcpSa,
}

impl Default for ProviderName {
    fn default() -> ProviderName {
        Self::GcpSa
    }
}