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

/// SecretResponseModel : Response object for Secret class (no secret value returned).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SecretResponseModel {
    /// Name of the secret.
    #[serde(rename = "secret_id")]
    pub secret_id: String,
    /// Scope of secret: 'user' or 'pod'
    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,
    #[serde(
        rename = "pod_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub pod_id: Option<Option<String>>,
    /// Description of this secret.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// If True, secret value can be retrieved via GET /secrets/{id}/value. Pod injection always works regardless of this setting.
    #[serde(rename = "readable", skip_serializing_if = "Option::is_none")]
    pub readable: Option<bool>,
    /// If True, secret value can be updated via PUT or POST recreation. If False, secret is write-once.
    #[serde(rename = "writable", skip_serializing_if = "Option::is_none")]
    pub writable: Option<bool>,
    /// Full secret name used in SK (prefixed).
    #[serde(rename = "sk_secret_name", skip_serializing_if = "Option::is_none")]
    pub sk_secret_name: 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>>,
    /// User who added this secret.
    #[serde(rename = "added_by", skip_serializing_if = "Option::is_none")]
    pub added_by: Option<String>,
}

impl SecretResponseModel {
    /// Response object for Secret class (no secret value returned).
    pub fn new(secret_id: String) -> SecretResponseModel {
        SecretResponseModel {
            secret_id,
            scope: None,
            pod_id: None,
            description: None,
            readable: None,
            writable: None,
            sk_secret_name: None,
            creation_ts: None,
            added_by: None,
        }
    }
}
