/*
 * 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 V1CubeMeta {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    #[serde(rename = "type")]
    pub r#type: models::V1CubeMetaType,
    #[serde(rename = "meta", skip_serializing_if = "Option::is_none")]
    pub meta: Option<serde_json::Value>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "measures")]
    pub measures: Vec<models::V1CubeMetaMeasure>,
    #[serde(rename = "dimensions")]
    pub dimensions: Vec<models::V1CubeMetaDimension>,
    #[serde(rename = "segments")]
    pub segments: Vec<models::V1CubeMetaSegment>,
    #[serde(rename = "joins", skip_serializing_if = "Option::is_none")]
    pub joins: Option<Vec<models::V1CubeMetaJoin>>,
    #[serde(rename = "folders", skip_serializing_if = "Option::is_none")]
    pub folders: Option<Vec<models::V1CubeMetaFolder>>,
    #[serde(rename = "nestedFolders", skip_serializing_if = "Option::is_none")]
    pub nested_folders: Option<Vec<models::V1CubeMetaNestedFolder>>,
    #[serde(rename = "hierarchies", skip_serializing_if = "Option::is_none")]
    pub hierarchies: Option<Vec<models::V1CubeMetaHierarchy>>,
}

impl V1CubeMeta {
    pub fn new(
        name: String,
        r#type: models::V1CubeMetaType,
        measures: Vec<models::V1CubeMetaMeasure>,
        dimensions: Vec<models::V1CubeMetaDimension>,
        segments: Vec<models::V1CubeMetaSegment>,
    ) -> V1CubeMeta {
        V1CubeMeta {
            name,
            title: None,
            r#type,
            meta: None,
            description: None,
            measures,
            dimensions,
            segments,
            joins: None,
            folders: None,
            nested_folders: None,
            hierarchies: None,
        }
    }
}
