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

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

/// ACLRoleListStub is the stub object returned when performing a listing of ACL
/// roles. While it might not currently be different to the full response
/// object, it allows us to future-proof the RPC in the event the ACLRole object
/// grows over time.
///
/// This struct was generated based on the Go types of the official Nomad API.
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize, Builder)]
pub struct AclRoleListStub {
    /// Description is a human-readable, operator set description that can
    /// provide additional context about the role. This is an operational field.
    #[serde(rename = "Description")]
    pub description: String,

    /// Policies is an array of ACL policy links. Although currently policies
    /// can only be linked using their name, in the future we will want to add
    /// IDs also and thus allow operators to specify either a name, an ID, or
    /// both.
    #[serde(
        rename = "Policies",
        deserialize_with = "crate::deserialize_null_as_default"
    )]
    pub policies: Vec<super::AclRolePolicyLink>,

    #[serde(rename = "CreateIndex")]
    pub create_index: u64,

    #[serde(rename = "ModifyIndex")]
    pub modify_index: u64,

    /// ID is an internally generated UUID for this role and is controlled by
    /// Nomad.
    #[serde(rename = "ID")]
    pub id: String,

    /// Name is unique across the entire set of federated clusters and is
    /// supplied by the operator on role creation. The name can be modified by
    /// updating the role and including the Nomad generated ID. This update will
    /// not affect tokens created and linked to this role. This is a required
    /// field.
    #[serde(rename = "Name")]
    pub name: String,
}
