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

/// V1CubeMetaCustomTimeFormat : Custom time format for time dimensions
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct V1CubeMetaCustomTimeFormat {
    /// Type of the format (must be 'custom-time')
    #[serde(rename = "type")]
    pub r#type: Type,
    /// POSIX strftime format string (IEEE Std 1003.1 / POSIX.1) with d3-time-format extensions (e.g., '%Y-%m-%d', '%d/%m/%Y %H:%M:%S'). See https://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html and https://d3js.org/d3-time-format
    #[serde(rename = "value")]
    pub value: String,
}

impl V1CubeMetaCustomTimeFormat {
    /// Custom time format for time dimensions
    pub fn new(r#type: Type, value: String) -> V1CubeMetaCustomTimeFormat {
        V1CubeMetaCustomTimeFormat { r#type, value }
    }
}
/// Type of the format (must be 'custom-time')
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "custom-time")]
    CustomTime,
}

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