use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

/// NodeTemplate : Represent a sole-tenant Node Template resource. You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct NodeTemplate {
    #[serde(rename = "accelerators", skip_serializing_if = "Option::is_none")]
    pub accelerators: Option<Vec<crate::google_rest_apis::compute_v1::models::AcceleratorConfig>>,
    /// CPU overcommit.
    #[serde(rename = "cpuOvercommitType", skip_serializing_if = "Option::is_none")]
    pub cpu_overcommit_type: Option<CpuOvercommitType>,
    /// [Output Only] Creation timestamp in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    /// An optional description of this resource. Provide this property when you create the resource.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "disks", skip_serializing_if = "Option::is_none")]
    pub disks: Option<Vec<crate::google_rest_apis::compute_v1::models::LocalDisk>>,
    /// [Output Only] The unique identifier for the resource. This identifier is defined by the server.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Labels to use for node affinity, which will be used in instance scheduling.
    #[serde(rename = "nodeAffinityLabels", skip_serializing_if = "Option::is_none")]
    pub node_affinity_labels: Option<::std::collections::HashMap<String, String>>,
    /// The node type to use for nodes group that are created from this template.
    #[serde(rename = "nodeType", skip_serializing_if = "Option::is_none")]
    pub node_type: Option<String>,
    #[serde(
        rename = "nodeTypeFlexibility",
        skip_serializing_if = "Option::is_none"
    )]
    pub node_type_flexibility:
        Option<Box<crate::google_rest_apis::compute_v1::models::NodeTemplateNodeTypeFlexibility>>,
    /// [Output Only] The name of the region where the node template resides, such as us-central1.
    #[serde(rename = "region", skip_serializing_if = "Option::is_none")]
    pub region: Option<String>,
    /// [Output Only] Server-defined URL for the resource.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    #[serde(rename = "serverBinding", skip_serializing_if = "Option::is_none")]
    pub server_binding: Option<Box<crate::google_rest_apis::compute_v1::models::ServerBinding>>,
    /// [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// [Output Only] An optional, human-readable explanation of the status.
    #[serde(rename = "statusMessage", skip_serializing_if = "Option::is_none")]
    pub status_message: Option<String>,
}

impl NodeTemplate {
    /// Represent a sole-tenant Node Template resource. You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances.
    pub fn new() -> NodeTemplate {
        NodeTemplate {
            accelerators: None,
            cpu_overcommit_type: None,
            creation_timestamp: None,
            description: None,
            disks: None,
            id: None,
            kind: None,
            name: None,
            node_affinity_labels: None,
            node_type: None,
            node_type_flexibility: None,
            region: None,
            self_link: None,
            server_binding: None,
            status: None,
            status_message: None,
        }
    }
}

/// CPU overcommit.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CpuOvercommitType {
    #[serde(rename = "CPU_OVERCOMMIT_TYPE_UNSPECIFIED")]
    CpuOvercommitTypeUnspecified,
    #[serde(rename = "ENABLED")]
    Enabled,
    #[serde(rename = "NONE")]
    None,
}

impl Default for CpuOvercommitType {
    fn default() -> CpuOvercommitType {
        Self::CpuOvercommitTypeUnspecified
    }
}
/// [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "CREATING")]
    Creating,
    #[serde(rename = "DELETING")]
    Deleting,
    #[serde(rename = "INVALID")]
    Invalid,
    #[serde(rename = "READY")]
    Ready,
}

impl Default for Status {
    fn default() -> Status {
        Self::Creating
    }
}
