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

/// BackendBucket : Represents a Cloud Storage Bucket resource. This Cloud Storage bucket resource is referenced by a URL map of a load balancer. For more information, read Backend Buckets.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct BackendBucket {
    /// Cloud Storage bucket name.
    #[serde(rename = "bucketName", skip_serializing_if = "Option::is_none")]
    pub bucket_name: Option<String>,
    #[serde(rename = "cdnPolicy", skip_serializing_if = "Option::is_none")]
    pub cdn_policy:
        Option<Box<crate::google_rest_apis::compute_v1::models::BackendBucketCdnPolicy>>,
    /// Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header.
    #[serde(rename = "compressionMode", skip_serializing_if = "Option::is_none")]
    pub compression_mode: Option<CompressionMode>,
    /// [Output Only] Creation timestamp in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    /// Headers that the Application Load Balancer should add to proxied responses.
    #[serde(
        rename = "customResponseHeaders",
        skip_serializing_if = "Option::is_none"
    )]
    pub custom_response_headers: Option<Vec<String>>,
    /// An optional textual description of the resource; provided by the client when the resource is created.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// [Output Only] The resource URL for the edge security policy associated with this backend bucket.
    #[serde(rename = "edgeSecurityPolicy", skip_serializing_if = "Option::is_none")]
    pub edge_security_policy: Option<String>,
    /// If true, enable Cloud CDN for this BackendBucket.
    #[serde(rename = "enableCdn", skip_serializing_if = "Option::is_none")]
    pub enable_cdn: Option<bool>,
    /// [Output Only] Unique identifier for the resource; defined by the server.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Type of the resource.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Name of the resource. Provided by the client when the resource is created. 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>,
    /// [Output Only] Server-defined URL for the resource.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
}

impl BackendBucket {
    /// Represents a Cloud Storage Bucket resource. This Cloud Storage bucket resource is referenced by a URL map of a load balancer. For more information, read Backend Buckets.
    pub fn new() -> BackendBucket {
        BackendBucket {
            bucket_name: None,
            cdn_policy: None,
            compression_mode: None,
            creation_timestamp: None,
            custom_response_headers: None,
            description: None,
            edge_security_policy: None,
            enable_cdn: None,
            id: None,
            kind: None,
            name: None,
            self_link: None,
        }
    }
}

/// Compress text responses using Brotli or gzip compression, based on the client's Accept-Encoding header.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CompressionMode {
    #[serde(rename = "AUTOMATIC")]
    Automatic,
    #[serde(rename = "DISABLED")]
    Disabled,
}

impl Default for CompressionMode {
    fn default() -> CompressionMode {
        Self::Automatic
    }
}
