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

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

/// DrainOptions is used to pass through node drain parameters
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct DrainOptions {
    /// DrainSpec contains the drain specification for the node. If non-nil,
    /// the node will be marked ineligible and begin/continue draining according
    /// to the provided drain spec.
    /// If nil, any existing drain operation will be canceled.
    #[serde(rename = "DrainSpec", skip_serializing_if = "Option::is_none")]
    pub drain_spec: Option<super::DrainSpec>,

    /// MarkEligible indicates whether the node should be marked as eligible when
    /// canceling a drain operation.
    #[serde(rename = "MarkEligible")]
    pub mark_eligible: bool,

    /// Meta is metadata that is persisted in Node.LastDrain about this
    /// drain update.
    #[serde(rename = "Meta")]
    pub meta: std::collections::HashMap<String, String>,
}
