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 Tag {
    /// the full name of this tag
    #[serde(rename = "name")]
    pub name: String,
    /// the value of this tag, or the empty string if the tag is of type \"unary\". For a number type tag, numbers of the form \"3.14\" are supported (no exponential notation). For a boolean, \"true\" or \"false\" are supported. For a date, RFC3339 form must be used, but it can      be truncated to end before the \"T\" if no time is required. 
    #[serde(rename = "value")]
    pub value: String,
    #[serde(rename = "type")]
    pub r#type: models::TagTypeField,
    /// where this tag came from. If it came from a hook, this will be of the form \"hooks/the_hookname\". Otherwise, this will be \"create\" indicating it was given by the user at the time the capsule was created, or it will be \"manual\" indicating it was added later. 
    #[serde(rename = "source")]
    pub source: String,
    /// if this tag came from a hook, which version of that hook emitted the tag 
    #[serde(rename = "hook_version", skip_serializing_if = "Option::is_none")]
    pub hook_version: Option<String>,
}

impl Tag {
    pub fn new(name: String, value: String, r#type: models::TagTypeField, source: String) -> Tag {
        Tag {
            name,
            value,
            r#type,
            source,
            hook_version: None,
        }
    }
}