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

/// SslPolicy : Represents an SSL Policy resource. Use SSL policies to control the SSL features, such as versions and cipher suites, offered by an HTTPS or SSL Proxy load balancer. For more information, read SSL Policy Concepts.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SslPolicy {
    /// [Output Only] Creation timestamp in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    /// A list of features enabled when the selected profile is CUSTOM. The method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM.
    #[serde(rename = "customFeatures", skip_serializing_if = "Option::is_none")]
    pub custom_features: Option<Vec<String>>,
    /// An optional description of this resource. Provide this property when you create the resource.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// [Output Only] The list of features enabled in the SSL policy.
    #[serde(rename = "enabledFeatures", skip_serializing_if = "Option::is_none")]
    pub enabled_features: Option<Vec<String>>,
    /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an SslPolicy.
    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
    pub fingerprint: Option<String>,
    /// [Output Only] The unique identifier for the resource. This identifier is defined by the server.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2.
    #[serde(rename = "minTlsVersion", skip_serializing_if = "Option::is_none")]
    pub min_tls_version: Option<MinTlsVersion>,
    /// Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field.
    #[serde(rename = "profile", skip_serializing_if = "Option::is_none")]
    pub profile: Option<Profile>,
    /// [Output Only] URL of the region where the regional SSL policy resides. This field is not applicable to global SSL policies.
    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
    pub region: Option<String>,
    /// [Output Only] Server-defined URL for the resource.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    /// [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages.
    #[serde(rename = "warnings", skip_serializing_if = "Option::is_none")]
    pub warnings: Option<Vec<crate::google_rest_apis::compute_v1::models::OperationWarningsInner>>,
}

impl SslPolicy {
    /// Represents an SSL Policy resource. Use SSL policies to control the SSL features, such as versions and cipher suites, offered by an HTTPS or SSL Proxy load balancer. For more information, read SSL Policy Concepts.
    pub fn new() -> SslPolicy {
        SslPolicy {
            creation_timestamp: None,
            custom_features: None,
            description: None,
            enabled_features: None,
            fingerprint: None,
            id: None,
            kind: None,
            min_tls_version: None,
            name: None,
            profile: None,
            region: None,
            self_link: None,
            warnings: None,
        }
    }
}

/// The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MinTlsVersion {
    #[serde(rename = "TLS_1_0")]
    Variant0,
    #[serde(rename = "TLS_1_1")]
    Variant1,
    #[serde(rename = "TLS_1_2")]
    Variant2,
}

impl Default for MinTlsVersion {
    fn default() -> MinTlsVersion {
        Self::Variant0
    }
}
/// Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Profile {
    #[serde(rename = "COMPATIBLE")]
    Compatible,
    #[serde(rename = "CUSTOM")]
    Custom,
    #[serde(rename = "MODERN")]
    Modern,
    #[serde(rename = "RESTRICTED")]
    Restricted,
}

impl Default for Profile {
    fn default() -> Profile {
        Self::Compatible
    }
}
