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;

/// CacheKeyPolicy : Message containing what to include in the cache key for a request for Cloud CDN.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CacheKeyPolicy {
    /// If true, requests to different hosts will be cached separately.
    #[serde(rename = "includeHost", skip_serializing_if = "Option::is_none")]
    pub include_host: Option<bool>,
    /// Allows HTTP request headers (by name) to be used in the cache key.
    #[serde(rename = "includeHttpHeaders", skip_serializing_if = "Option::is_none")]
    pub include_http_headers: Option<Vec<String>>,
    /// Allows HTTP cookies (by name) to be used in the cache key. The name=value pair will be used in the cache key Cloud CDN generates.
    #[serde(
        rename = "includeNamedCookies",
        skip_serializing_if = "Option::is_none"
    )]
    pub include_named_cookies: Option<Vec<String>>,
    /// If true, http and https requests will be cached separately.
    #[serde(rename = "includeProtocol", skip_serializing_if = "Option::is_none")]
    pub include_protocol: Option<bool>,
    /// If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely.
    #[serde(rename = "includeQueryString", skip_serializing_if = "Option::is_none")]
    pub include_query_string: Option<bool>,
    /// Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.
    #[serde(
        rename = "queryStringBlacklist",
        skip_serializing_if = "Option::is_none"
    )]
    pub query_string_blacklist: Option<Vec<String>>,
    /// Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters.
    #[serde(
        rename = "queryStringWhitelist",
        skip_serializing_if = "Option::is_none"
    )]
    pub query_string_whitelist: Option<Vec<String>>,
}

impl CacheKeyPolicy {
    /// Message containing what to include in the cache key for a request for Cloud CDN.
    pub fn new() -> CacheKeyPolicy {
        CacheKeyPolicy {
            include_host: None,
            include_http_headers: None,
            include_named_cookies: None,
            include_protocol: None,
            include_query_string: None,
            query_string_blacklist: None,
            query_string_whitelist: None,
        }
    }
}
