/*
 * This is an auto-generated file.
 * Any manual changes may be overwritten without notice!
 */

use derive_builder::Builder;
use serde::{Deserialize, Serialize};

/// RaftServer has information about a server in the Raft configuration.
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct RaftServer {
    /// RaftProtocol is the version of the Raft protocol spoken by this server.
    #[serde(rename = "RaftProtocol")]
    pub raft_protocol: String,

    /// ID is the unique ID for the server. These are currently the same
    /// as the address, but they will be changed to a real GUID in a future
    /// release of Nomad.
    #[serde(rename = "ID")]
    pub id: String,

    /// Node is the node name of the server, as known by Nomad, or this
    /// will be set to "(unknown)" otherwise.
    #[serde(rename = "Node")]
    pub node: String,

    /// Address is the IP:port of the server, used for Raft communications.
    #[serde(rename = "Address")]
    pub address: String,

    /// Leader is true if this server is the current cluster leader.
    #[serde(rename = "Leader")]
    pub leader: bool,

    /// Voter is true if this server has a vote in the cluster. This might
    /// be false if the server is staging and still coming online, or if
    /// it's a non-voting server, which will be added in a future release of
    /// Nomad.
    #[serde(rename = "Voter")]
    pub voter: bool,
}
