/*
 * Hotdata API
 *
 * Powerful data platform API for datasets, queries, and analytics.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: developers@hotdata.dev
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatasetSourceOneOf1 {
    #[serde(rename = "saved_query_id")]
    pub saved_query_id: String,
    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
    pub version: Option<i32>,
    #[serde(rename = "type")]
    pub r#type: Type,
}

impl DatasetSourceOneOf1 {
    pub fn new(saved_query_id: String, r#type: Type) -> DatasetSourceOneOf1 {
        DatasetSourceOneOf1 {
            saved_query_id,
            version: None,
            r#type,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "saved_query")]
    SavedQuery,
}

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