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

/// CreateSavedQueryRequest : Request body for POST /v1/queries
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateSavedQueryRequest {
    #[serde(
        rename = "description",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub description: Option<Option<String>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "sql")]
    pub sql: String,
    #[serde(
        rename = "tags",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tags: Option<Option<Vec<String>>>,
}

impl CreateSavedQueryRequest {
    /// Request body for POST /v1/queries
    pub fn new(name: String, sql: String) -> CreateSavedQueryRequest {
        CreateSavedQueryRequest {
            description: None,
            name,
            sql,
            tags: None,
        }
    }
}
