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

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

/// Spread is used to serialize task group allocation spread preferences
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct Spread {
    #[serde(
        rename = "SpreadTarget",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub spread_target: Vec<super::SpreadTarget>,

    #[serde(rename = "Attribute")]
    pub attribute: String,

    #[serde(rename = "Weight", skip_serializing_if = "Option::is_none")]
    pub weight: Option<i8>,
}
