/*
 * 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 V1LoadRequestQuery {
    #[serde(rename = "measures", skip_serializing_if = "Option::is_none")]
    pub measures: Option<Vec<String>>,
    #[serde(rename = "dimensions", skip_serializing_if = "Option::is_none")]
    pub dimensions: Option<Vec<String>>,
    #[serde(rename = "segments", skip_serializing_if = "Option::is_none")]
    pub segments: Option<Vec<String>>,
    #[serde(rename = "timeDimensions", skip_serializing_if = "Option::is_none")]
    pub time_dimensions: Option<Vec<models::V1LoadRequestQueryTimeDimension>>,
    #[serde(rename = "order", skip_serializing_if = "Option::is_none")]
    pub order: Option<Vec<Vec<String>>>,
    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
    pub limit: Option<i32>,
    #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
    pub offset: Option<i32>,
    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<models::V1LoadRequestQueryFilterItem>>,
    #[serde(rename = "ungrouped", skip_serializing_if = "Option::is_none")]
    pub ungrouped: Option<bool>,
    #[serde(rename = "subqueryJoins", skip_serializing_if = "Option::is_none")]
    pub subquery_joins: Option<Vec<models::V1LoadRequestQueryJoinSubquery>>,
    #[serde(rename = "joinHints", skip_serializing_if = "Option::is_none")]
    pub join_hints: Option<Vec<Vec<String>>>,
    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
    pub timezone: Option<String>,
    /// Output format of the result `data` payload. `default` returns row-oriented data (`V1LoadResultDataRow`); `compact` returns a `{ members, dataset }` object with rows of primitive arrays (`V1LoadResultDataCompact`); `columnar` returns a `{ members, columns }` object with one primitive array per member (`V1LoadResultDataColumnar`).
    #[serde(rename = "responseFormat", skip_serializing_if = "Option::is_none")]
    pub response_format: Option<ResponseFormat>,
}

impl V1LoadRequestQuery {
    pub fn new() -> V1LoadRequestQuery {
        V1LoadRequestQuery {
            measures: None,
            dimensions: None,
            segments: None,
            time_dimensions: None,
            order: None,
            limit: None,
            offset: None,
            filters: None,
            ungrouped: None,
            subquery_joins: None,
            join_hints: None,
            timezone: None,
            response_format: None,
        }
    }
}
/// Output format of the result `data` payload. `default` returns row-oriented data (`V1LoadResultDataRow`); `compact` returns a `{ members, dataset }` object with rows of primitive arrays (`V1LoadResultDataCompact`); `columnar` returns a `{ members, columns }` object with one primitive array per member (`V1LoadResultDataColumnar`).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ResponseFormat {
    #[serde(rename = "default")]
    Default,
    #[serde(rename = "compact")]
    Compact,
    #[serde(rename = "columnar")]
    Columnar,
}

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