/*
 * 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};

/// DatabaseAttachmentInfo : One attached catalog inside a database.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatabaseAttachmentInfo {
    /// Alias under which this catalog is reachable inside the database. When `None`, the catalog is reachable by its original connection name.
    #[serde(
        rename = "alias",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub alias: Option<Option<String>>,
    #[serde(rename = "connection_id")]
    pub connection_id: String,
}

impl DatabaseAttachmentInfo {
    /// One attached catalog inside a database.
    pub fn new(connection_id: String) -> DatabaseAttachmentInfo {
        DatabaseAttachmentInfo {
            alias: None,
            connection_id,
        }
    }
}
