/*
 * Hotdata API
 *
 * Powerful data platform API for datasets, 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};

/// AddManagedSchemaRequest : Request body for adding a schema to an existing managed catalog: `POST /v1/connections/{id}/schemas` and `POST /v1/databases/{id}/schemas`. `tables` is optional — omit it to declare an empty schema and add tables later.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AddManagedSchemaRequest {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "tables", skip_serializing_if = "Option::is_none")]
    pub tables: Option<Vec<models::AddManagedTableDecl>>,
}

impl AddManagedSchemaRequest {
    /// Request body for adding a schema to an existing managed catalog: `POST /v1/connections/{id}/schemas` and `POST /v1/databases/{id}/schemas`. `tables` is optional — omit it to declare an empty schema and add tables later.
    pub fn new(name: String) -> AddManagedSchemaRequest {
        AddManagedSchemaRequest { name, tables: None }
    }
}
