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

/// RefreshWarning : Non-fatal warning that occurred during a refresh operation. Used to report issues like failed deletion scheduling that don't prevent the refresh from succeeding.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RefreshWarning {
    #[serde(rename = "message")]
    pub message: String,
    #[serde(
        rename = "schema_name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub schema_name: Option<Option<String>>,
    #[serde(
        rename = "table_name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub table_name: Option<Option<String>>,
}

impl RefreshWarning {
    /// Non-fatal warning that occurred during a refresh operation. Used to report issues like failed deletion scheduling that don't prevent the refresh from succeeding.
    pub fn new(message: String) -> RefreshWarning {
        RefreshWarning {
            message,
            schema_name: None,
            table_name: None,
        }
    }
}
