1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Tapis PgREST API
*
* The Tapis PgREST API provides a RESTful interface to a managed SQL-db-as-a-service.
*
* The version of the OpenAPI document: 1.0.0
* Contact: cicsupport@tacc.utexas.edu
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewTable {
/// The name to be used for the table.
#[serde(rename = "table_name")]
pub table_name: String,
/// The url path to use for the root_url associated with the records in the table.
#[serde(rename = "root_url")]
pub root_url: String,
#[serde(rename = "columns")]
pub columns: models::TableColumns,
/// Text area to describe table. Returned when calling manage endpoints.
#[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
pub comments: Option<String>,
#[serde(rename = "constraints", skip_serializing_if = "Option::is_none")]
pub constraints: Option<Box<models::TableConstraints>>,
/// Definition for enum to create. {enum_name\":\" [enum_val_1, ...]}
#[serde(rename = "enums", skip_serializing_if = "Option::is_none")]
pub enums: Option<serde_json::Value>,
/// Whether the \"created\" endpoint (HTTP verb \"POST\") for creating new rows is available.
#[serde(rename = "create", skip_serializing_if = "Option::is_none")]
pub create: Option<bool>,
/// Whether the \"delete\" endpoint (HTTP verb \"delete\") for deleting a specific row is available.
#[serde(rename = "delete", skip_serializing_if = "Option::is_none")]
pub delete: Option<bool>,
/// Whether the \"list all\" endpoint (HTTP verb \"GET\") for listing all rows in the table is available.
#[serde(rename = "list_all", skip_serializing_if = "Option::is_none")]
pub list_all: Option<bool>,
/// Whether the \"get row\" endpoint (HTTP verb \"GET\") for retrieving a specifc row in the table is available.
#[serde(rename = "list_single", skip_serializing_if = "Option::is_none")]
pub list_single: Option<bool>,
/// Whether the \"update\" endpoint (HTTP verb \"PUT\") for updating a specific row is available.
#[serde(rename = "update", skip_serializing_if = "Option::is_none")]
pub update: Option<bool>,
}
impl NewTable {
pub fn new(table_name: String, root_url: String, columns: models::TableColumns) -> NewTable {
NewTable {
table_name,
root_url,
columns,
comments: None,
constraints: None,
enums: None,
create: None,
delete: None,
list_all: None,
list_single: None,
update: None,
}
}
}