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

/// UpdateSavedQueryRequest : Request body for PUT /v1/queries/{id}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateSavedQueryRequest {
    /// Override the auto-detected category. Send `null` to clear (revert to auto).
    #[serde(
        rename = "category_override",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub category_override: Option<Option<String>>,
    #[serde(
        rename = "description",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub description: Option<Option<String>>,
    /// Optional new name. When omitted the existing name is preserved.
    #[serde(
        rename = "name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub name: Option<Option<String>>,
    /// Optional new SQL. When omitted the existing SQL is preserved.
    #[serde(
        rename = "sql",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sql: Option<Option<String>>,
    /// User annotation for table size. Send `null` to clear.
    #[serde(
        rename = "table_size_override",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub table_size_override: Option<Option<String>>,
    #[serde(
        rename = "tags",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tags: Option<Option<Vec<String>>>,
}

impl UpdateSavedQueryRequest {
    /// Request body for PUT /v1/queries/{id}
    pub fn new() -> UpdateSavedQueryRequest {
        UpdateSavedQueryRequest {
            category_override: None,
            description: None,
            name: None,
            sql: None,
            table_size_override: None,
            tags: None,
        }
    }
}
