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

/// UrlDatasetSource : Create dataset from an external HTTP URL
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UrlDatasetSource {
    /// Optional explicit column definitions. Keys are column names, values are type specs.
    #[serde(rename = "columns", skip_serializing_if = "Option::is_none")]
    pub columns: Option<std::collections::HashMap<String, String>>,
    #[serde(
        rename = "format",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub format: Option<Option<String>>,
    #[serde(rename = "url")]
    pub url: String,
}

impl UrlDatasetSource {
    /// Create dataset from an external HTTP URL
    pub fn new(url: String) -> UrlDatasetSource {
        UrlDatasetSource {
            columns: None,
            format: None,
            url,
        }
    }
}
