/*
 * Streams API
 *
 * Manage Tapis Streams API.
 *
 * The version of the OpenAPI document: 1
 * 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 NewVariable {
    /// User provided, unique identifier within in the Instrument name space. will be used as the chords shortname
    #[serde(rename = "var_id")]
    pub var_id: String,
    /// Variable name.
    #[serde(rename = "var_name")]
    pub var_name: String,
    /// Unit name
    #[serde(rename = "units", skip_serializing_if = "Option::is_none")]
    pub units: Option<String>,
    /// Id of the Property measured by the variable type
    #[serde(
        rename = "measured_property_id",
        skip_serializing_if = "Option::is_none"
    )]
    pub measured_property_id: Option<f64>,
    /// User entered metadata for the variable
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
    /// User entered short name
    #[serde(rename = "shortname", skip_serializing_if = "Option::is_none")]
    pub shortname: Option<String>,
}

impl NewVariable {
    pub fn new(var_id: String, var_name: String) -> NewVariable {
        NewVariable {
            var_id,
            var_name,
            units: None,
            measured_property_id: None,
            metadata: None,
            shortname: None,
        }
    }
}
