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

/// ListQueryRunsResponse : Response body for GET /query-runs
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ListQueryRunsResponse {
    #[serde(rename = "count")]
    pub count: i32,
    #[serde(rename = "has_more")]
    pub has_more: bool,
    #[serde(rename = "limit")]
    pub limit: i32,
    #[serde(
        rename = "next_cursor",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub next_cursor: Option<Option<String>>,
    #[serde(rename = "query_runs")]
    pub query_runs: Vec<models::QueryRunInfo>,
}

impl ListQueryRunsResponse {
    /// Response body for GET /query-runs
    pub fn new(
        count: i32,
        has_more: bool,
        limit: i32,
        query_runs: Vec<models::QueryRunInfo>,
    ) -> ListQueryRunsResponse {
        ListQueryRunsResponse {
            count,
            has_more,
            limit,
            next_cursor: None,
            query_runs,
        }
    }
}
