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

/// InformationSchemaResponse : Response body for GET /information_schema
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InformationSchemaResponse {
    /// Number of tables in this response, the same meaning `count` carries on the results and databases listings.  This is a page size, not a total for the whole filter. Page with `has_more` and `next_cursor`: an empty `tables` array on its own does not mean the listing is finished.
    #[serde(rename = "count")]
    pub count: i32,
    /// True when more tables follow this page. Pass `next_cursor` to fetch them.
    #[serde(rename = "has_more")]
    pub has_more: bool,
    /// The page size in effect for this response — the `limit` you asked for, clamped to the server's maximum, or the server default when you sent none.
    #[serde(rename = "limit")]
    pub limit: i32,
    /// Cursor for the next page, present only when `has_more` is `true`. Send it back as the `cursor` query parameter.
    #[serde(
        rename = "next_cursor",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub next_cursor: Option<Option<String>>,
    /// The tables on this page.
    #[serde(rename = "tables")]
    pub tables: Vec<models::TableInfo>,
}

impl InformationSchemaResponse {
    /// Response body for GET /information_schema
    pub fn new(
        count: i32,
        has_more: bool,
        limit: i32,
        tables: Vec<models::TableInfo>,
    ) -> InformationSchemaResponse {
        InformationSchemaResponse {
            count,
            has_more,
            limit,
            next_cursor: None,
            tables,
        }
    }
}