/*
 * Tapis Pods Service
 *
 *  The Pods Service is a web service and distributed computing platform providing pods-as-a-service (PaaS). The service  implements a message broker and processor model that requests pods, alongside a health module to poll for pod data, including logs, status, and health. The primary use of this service is to have quick to deploy long-lived services based on Docker images that are exposed via HTTP or TCP endpoints listed by the API.  **The Pods service provides functionality for two types of pod solutions:**  * **Templated Pods** for run-as-is popular images. Neo4J is one example, the template manages TCP ports, user creation, and permissions.  * **Custom Pods** for arbitrary docker images with less functionality. In this case we will expose port 5000 and do nothing else.   The live-docs act as the most up-to-date API reference. Visit the [documentation for more information](https://tapis.readthedocs.io/en/latest/technical/pods.html).
 *
 * The version of the OpenAPI document: 26Q1.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 TemplateTag {
    /// template_id this tag is linked to
    #[serde(rename = "template_id")]
    pub template_id: String,
    /// Pod definition for this template.
    #[serde(rename = "pod_definition", skip_serializing_if = "Option::is_none")]
    pub pod_definition: Option<Box<models::TemplateTagPodDefinition>>,
    /// Commit message for this template tag.
    #[serde(rename = "commit_message", skip_serializing_if = "Option::is_none")]
    pub commit_message: Option<String>,
    /// Tag for this template. Default is 'latest'.
    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
    pub tag: Option<String>,
    /// Description of template tag.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// If set, metadata message to give users of this template tag.
    #[serde(rename = "archive_message", skip_serializing_if = "Option::is_none")]
    pub archive_message: Option<String>,
    /// tag@timestamp for this template tag.
    #[serde(rename = "tag_timestamp", skip_serializing_if = "Option::is_none")]
    pub tag_timestamp: Option<String>,
    /// User who added this template tag.
    #[serde(rename = "added_by", skip_serializing_if = "Option::is_none")]
    pub added_by: Option<String>,
    #[serde(
        rename = "creation_ts",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub creation_ts: Option<Option<String>>,
    /// Tapis tenant used during creation of this template tag.
    #[serde(rename = "tenant_id", skip_serializing_if = "Option::is_none")]
    pub tenant_id: Option<String>,
    /// Tapis site used during creation of this template tag.
    #[serde(rename = "site_id", skip_serializing_if = "Option::is_none")]
    pub site_id: Option<String>,
}

impl TemplateTag {
    pub fn new(template_id: String) -> TemplateTag {
        TemplateTag {
            template_id,
            pod_definition: None,
            commit_message: None,
            tag: None,
            description: None,
            archive_message: None,
            tag_timestamp: None,
            added_by: None,
            creation_ts: None,
            tenant_id: None,
            site_id: None,
        }
    }
}
