use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::compute_v1::models;

/// AuditLogConfig : Provides the configuration for logging a type of permissions. Example: { \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AuditLogConfig {
    /// Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members.
    #[serde(rename = "exemptedMembers", skip_serializing_if = "Option::is_none")]
    pub exempted_members: Option<Vec<String>>,
    /// This is deprecated and has no effect. Do not use.
    #[serde(
        rename = "ignoreChildExemptions",
        skip_serializing_if = "Option::is_none"
    )]
    pub ignore_child_exemptions: Option<bool>,
    /// The log type that this config enables.
    #[serde(rename = "logType", skip_serializing_if = "Option::is_none")]
    pub log_type: Option<LogType>,
}

impl AuditLogConfig {
    /// Provides the configuration for logging a type of permissions. Example: { \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
    pub fn new() -> AuditLogConfig {
        AuditLogConfig {
            exempted_members: None,
            ignore_child_exemptions: None,
            log_type: None,
        }
    }
}
/// The log type that this config enables.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LogType {
    #[serde(rename = "ADMIN_READ")]
    AdminRead,
    #[serde(rename = "DATA_READ")]
    DataRead,
    #[serde(rename = "DATA_WRITE")]
    DataWrite,
    #[serde(rename = "LOG_TYPE_UNSPECIFIED")]
    LogTypeUnspecified,
}

impl Default for LogType {
    fn default() -> LogType {
        Self::AdminRead
    }
}
