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

/// V1CubeMetaFormat : Format of measure or dimension - can be a simple string format, a link configuration, a custom time format, or a custom numeric format
/// Format of measure or dimension - can be a simple string format, a link configuration, a custom time format, or a custom numeric format
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V1CubeMetaFormat {
    V1CubeMetaSimpleFormat(models::V1CubeMetaSimpleFormat),
    V1CubeMetaLinkFormat(Box<models::V1CubeMetaLinkFormat>),
    V1CubeMetaCustomTimeFormat(Box<models::V1CubeMetaCustomTimeFormat>),
    V1CubeMetaCustomNumericFormat(Box<models::V1CubeMetaCustomNumericFormat>),
}

impl Default for V1CubeMetaFormat {
    fn default() -> Self {
        Self::V1CubeMetaSimpleFormat(Default::default())
    }
}
/// Type of the format (must be 'link')
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "link")]
    Link,
    #[serde(rename = "custom-time")]
    CustomTime,
    #[serde(rename = "custom-numeric")]
    CustomNumeric,
}

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