hotdata 0.15.0

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * Hotdata API
 *
 * Powerful data platform API for instant databases, 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};

/// GetResultResponse : Response body for GET /results/{id} Returns status and optionally the result data
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetResultResponse {
    #[serde(
        rename = "columns",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub columns: Option<Option<Vec<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 = "nullable",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub nullable: Option<Option<Vec<bool>>>,
    #[serde(rename = "result_id")]
    pub result_id: String,
    #[serde(
        rename = "row_count",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub row_count: Option<Option<i64>>,
    /// Array of rows, where each row is an array of column values.
    #[serde(
        rename = "rows",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub rows: Option<Option<Vec<Vec<serde_json::Value>>>>,
    #[serde(rename = "status")]
    pub status: String,
    /// Grand total rows in the full result, ignoring `offset` and `limit`. Present whenever the result is `ready`, and carrying the same value as the `X-Total-Row-Count` response header.  Compare it against `row_count` to tell whether this body is the whole result: `row_count < total_row_count` means the rest is still there, one page further on. Without it a windowed fetch cannot tell a full result from a truncated one from the body alone.
    #[serde(
        rename = "total_row_count",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub total_row_count: Option<Option<i64>>,
}

impl GetResultResponse {
    /// Response body for GET /results/{id} Returns status and optionally the result data
    pub fn new(result_id: String, status: String) -> GetResultResponse {
        GetResultResponse {
            columns: None,
            error_message: None,
            nullable: None,
            result_id,
            row_count: None,
            rows: None,
            status,
            total_row_count: None,
        }
    }
}