/*
 * Cube.js
 *
 * Cube.js Swagger Schema
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct V1LoadRequest {
    #[serde(rename = "queryType", skip_serializing_if = "Option::is_none")]
    pub query_type: Option<String>,
    #[serde(rename = "cache", skip_serializing_if = "Option::is_none")]
    pub cache: Option<Cache>,
    #[serde(rename = "query", skip_serializing_if = "Option::is_none")]
    pub query: Option<Box<models::V1LoadRequestQuery>>,
}

impl V1LoadRequest {
    pub fn new() -> V1LoadRequest {
        V1LoadRequest {
            query_type: None,
            cache: None,
            query: None,
        }
    }
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Cache {
    #[serde(rename = "stale-if-slow")]
    StaleIfSlow,
    #[serde(rename = "stale-while-revalidate")]
    StaleWhileRevalidate,
    #[serde(rename = "must-revalidate")]
    MustRevalidate,
    #[serde(rename = "no-cache")]
    NoCache,
}

impl Default for Cache {
    fn default() -> Cache {
        Self::StaleIfSlow
    }
}
