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

/// ResultInfo : Summary of a persisted query result for listing
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResultInfo {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(
        rename = "error_message",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub error_message: Option<Option<String>>,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "status")]
    pub status: String,
}

impl ResultInfo {
    /// Summary of a persisted query result for listing
    pub fn new(created_at: String, id: String, status: String) -> ResultInfo {
        ResultInfo {
            created_at,
            error_message: None,
            id,
            status,
        }
    }
}
