hotdata 0.1.2

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * 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};

/// CreateConnectionResponse : Response body for POST /connections
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateConnectionResponse {
    #[serde(
        rename = "discovery_error",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub discovery_error: Option<Option<String>>,
    #[serde(rename = "discovery_status")]
    pub discovery_status: models::DiscoveryStatus,
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "source_type")]
    pub source_type: String,
    #[serde(rename = "tables_discovered")]
    pub tables_discovered: i32,
}

impl CreateConnectionResponse {
    /// Response body for POST /connections
    pub fn new(
        discovery_status: models::DiscoveryStatus,
        id: String,
        name: String,
        source_type: String,
        tables_discovered: i32,
    ) -> CreateConnectionResponse {
        CreateConnectionResponse {
            discovery_error: None,
            discovery_status,
            id,
            name,
            source_type,
            tables_discovered,
        }
    }
}