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
                                      */

/// RouterNatLogConfig : Configuration of logging on a NAT.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct RouterNatLogConfig {
    /// Indicates whether or not to export logs. This is false by default.
    #[serde(rename = "enable", skip_serializing_if = "Option::is_none")]
    pub enable: Option<bool>,
    /// Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful.
    #[serde(rename = "filter", skip_serializing_if = "Option::is_none")]
    pub filter: Option<Filter>,
}

impl RouterNatLogConfig {
    /// Configuration of logging on a NAT.
    pub fn new() -> RouterNatLogConfig {
        RouterNatLogConfig {
            enable: None,
            filter: None,
        }
    }
}

/// Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: - ERRORS_ONLY: Export logs only for connection failures. - TRANSLATIONS_ONLY: Export logs only for successful connections. - ALL: Export logs for all connections, successful and unsuccessful.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Filter {
    #[serde(rename = "ALL")]
    All,
    #[serde(rename = "ERRORS_ONLY")]
    ErrorsOnly,
    #[serde(rename = "TRANSLATIONS_ONLY")]
    TranslationsOnly,
}

impl Default for Filter {
    fn default() -> Filter {
        Self::All
    }
}
