tapis-pgrest 0.3.0

The Tapis PgREST API provides a RESTful interface to a managed SQL-db-as-a-service.
Documentation
/*
 * 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 NewView {
    /// The name of the view to create.
    #[serde(rename = "view_name")]
    pub view_name: String,
    /// Query to run on 'from_table' to create a view from.
    #[serde(rename = "select_query", skip_serializing_if = "Option::is_none")]
    pub select_query: Option<String>,
    /// Table to run select query on and create view from.
    #[serde(rename = "from_table", skip_serializing_if = "Option::is_none")]
    pub from_table: Option<String>,
    /// Text area to describe view. Returned when calling manage endpoints.
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    /// Roles users who access this view must have in security kernel to have permission to see this view.
    #[serde(rename = "permission_rules", skip_serializing_if = "Option::is_none")]
    pub permission_rules: Option<Vec<String>>,
    /// Admin only. Full support of SQL when creating complex views.
    #[serde(rename = "raw_sql", skip_serializing_if = "Option::is_none")]
    pub raw_sql: Option<String>,
    /// Admin only. Full support of SQL when creating complex materialized views.
    #[serde(
        rename = "materialized_view_raw_sql",
        skip_serializing_if = "Option::is_none"
    )]
    pub materialized_view_raw_sql: Option<String>,
}

impl NewView {
    pub fn new(view_name: String) -> NewView {
        NewView {
            view_name,
            select_query: None,
            from_table: None,
            comments: None,
            permission_rules: None,
            raw_sql: None,
            materialized_view_raw_sql: None,
        }
    }
}