Skip to main content

windmill_api/models/
data_table_tables.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.817.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 DataTableTables {
16    #[serde(rename = "datatable_name")]
17    pub datatable_name: String,
18    /// Hierarchical metadata: schema_name -> table_names
19    #[serde(rename = "schemas")]
20    pub schemas: std::collections::HashMap<String, Vec<String>>,
21    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
22    pub error: Option<String>,
23    /// on the instance database, the only kind that can be under roles or have its access edited
24    #[serde(rename = "instance")]
25    pub instance: bool,
26    #[serde(rename = "permissioned")]
27    pub permissioned: bool,
28    /// the roles the caller may connect as, by name; empty when not under roles
29    #[serde(rename = "usable_roles")]
30    pub usable_roles: Vec<String>,
31    #[serde(rename = "default_role")]
32    pub default_role: String,
33    /// whether the role the listing connected as may create schemas
34    #[serde(rename = "can_create_schema")]
35    pub can_create_schema: bool,
36    /// the schemas the role the listing connected as may create in
37    #[serde(rename = "creatable_schemas")]
38    pub creatable_schemas: Vec<String>,
39}
40
41impl DataTableTables {
42    pub fn new(datatable_name: String, schemas: std::collections::HashMap<String, Vec<String>>, instance: bool, permissioned: bool, usable_roles: Vec<String>, default_role: String, can_create_schema: bool, creatable_schemas: Vec<String>) -> DataTableTables {
43        DataTableTables {
44            datatable_name,
45            schemas,
46            error: None,
47            instance,
48            permissioned,
49            usable_roles,
50            default_role,
51            can_create_schema,
52            creatable_schemas,
53        }
54    }
55}
56