antimatter_api 2.0.13

Interact with the Antimatter Cloud API
Documentation
/*
 * Antimatter Public API
 *
 * Interact with the Antimatter Cloud API
 *
 * The version of the OpenAPI document: 2.0.13
 * Contact: support@antimatter.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VariableDefinition {
    #[serde(rename = "variableName")]
    pub variable_name: String,
    #[serde(rename = "source")]
    pub source: Source,
    /// This should be a TagName but can contain variables
    #[serde(rename = "tagName", skip_serializing_if = "Option::is_none")]
    pub tag_name: Option<String>,
    /// This should be a CapabilityReference but can contain variables
    #[serde(rename = "capabilityName", skip_serializing_if = "Option::is_none")]
    pub capability_name: Option<String>,
    /// This should be the name of a read parameter but can contain variables
    #[serde(rename = "readParameterName", skip_serializing_if = "Option::is_none")]
    pub read_parameter_name: Option<String>,
    /// An identifier for a fact type that might be imported from a peer domain. If it is, it will bear an imported resource prefix (either a domain identifier or an alias, followed by ::) 
    #[serde(rename = "factType", skip_serializing_if = "Option::is_none")]
    pub fact_type: Option<String>,
    #[serde(rename = "factArguments", skip_serializing_if = "Option::is_none")]
    pub fact_arguments: Option<Vec<models::VariableDefinitionFactArgumentsInner>>,
    #[serde(rename = "variables", skip_serializing_if = "Option::is_none")]
    pub variables: Option<Vec<models::VariableDefinition>>,
}

impl VariableDefinition {
    pub fn new(variable_name: String, source: Source) -> VariableDefinition {
        VariableDefinition {
            variable_name,
            source,
            tag_name: None,
            capability_name: None,
            read_parameter_name: None,
            fact_type: None,
            fact_arguments: None,
            variables: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "TagValue")]
    TagValue,
    #[serde(rename = "FactArgument")]
    FactArgument,
    #[serde(rename = "CapabilityValue")]
    CapabilityValue,
    #[serde(rename = "ReadParamValue")]
    ReadParamValue,
}

impl Default for Source {
    fn default() -> Source {
        Self::TagValue
    }
}