windmill_api/models/
data_table_schema.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.599.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct DataTableSchema {
16    #[serde(rename = "datatable_name")]
17    pub datatable_name: String,
18    /// Hierarchical schema: schema_name -> table_name -> column_name -> compact_type (e.g. 'int4', 'text?', 'int4?=0')
19    #[serde(rename = "schemas")]
20    pub schemas: std::collections::HashMap<String, std::collections::HashMap<String, std::collections::HashMap<String, String>>>,
21    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
22    pub error: Option<String>,
23}
24
25impl DataTableSchema {
26    pub fn new(datatable_name: String, schemas: std::collections::HashMap<String, std::collections::HashMap<String, std::collections::HashMap<String, String>>>) -> DataTableSchema {
27        DataTableSchema {
28            datatable_name,
29            schemas,
30            error: None,
31        }
32    }
33}
34