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

/// TemplateWithDependentsModel : Template model with optional tag dependency information.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TemplateWithDependentsModel {
    /// Name of template.
    #[serde(rename = "template_id")]
    pub template_id: String,
    /// Description of template.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Metadata tags for additional search/listing functionality for the template.
    #[serde(rename = "metatags", skip_serializing_if = "Option::is_none")]
    pub metatags: Option<Vec<String>>,
    /// If set, metadata message to give users of this template.
    #[serde(rename = "archive_message", skip_serializing_if = "Option::is_none")]
    pub archive_message: 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>>,
    #[serde(
        rename = "update_ts",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub update_ts: Option<Option<String>>,
    #[serde(
        rename = "tag_dependents",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tag_dependents: Option<Option<Vec<models::TemplateTagDependencyInfo>>>,
}

impl TemplateWithDependentsModel {
    /// Template model with optional tag dependency information.
    pub fn new(template_id: String) -> TemplateWithDependentsModel {
        TemplateWithDependentsModel {
            template_id,
            description: None,
            metatags: None,
            archive_message: None,
            creation_ts: None,
            update_ts: None,
            tag_dependents: None,
        }
    }
}
