1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
 * Nomad
 *
 * Nomad OpenApi specification
 *
 * The version of the OpenAPI document: 0.11.0
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Allocation {
    #[serde(rename = "ID", skip_serializing_if = "Option::is_none")]
    pub ID: Option<String>,
    #[serde(rename = "Namespace", skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    #[serde(rename = "EvalID", skip_serializing_if = "Option::is_none")]
    pub eval_id: Option<String>,
    #[serde(rename = "Name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "NodeID", skip_serializing_if = "Option::is_none")]
    pub node_id: Option<String>,
    #[serde(rename = "NodeName", skip_serializing_if = "Option::is_none")]
    pub node_name: Option<String>,
    #[serde(rename = "JobID", skip_serializing_if = "Option::is_none")]
    pub job_id: Option<String>,
    #[serde(rename = "Job", skip_serializing_if = "Option::is_none")]
    pub job: Option<Box<crate::models::Job>>,
    #[serde(rename = "TaskGroup", skip_serializing_if = "Option::is_none")]
    pub task_group: Option<String>,
    #[serde(rename = "Resources", skip_serializing_if = "Option::is_none")]
    pub resources: Option<Box<crate::models::Resources>>,
    #[serde(rename = "TaskResources", skip_serializing_if = "Option::is_none")]
    pub task_resources: Option<::std::collections::HashMap<String, crate::models::Resources>>,
    #[serde(rename = "AllocatedResources", skip_serializing_if = "Option::is_none")]
    pub allocated_resources: Option<Box<crate::models::AllocatedResources>>,
    #[serde(rename = "Services", skip_serializing_if = "Option::is_none")]
    pub services: Option<::std::collections::HashMap<String, String>>,
    #[serde(rename = "Metrics", skip_serializing_if = "Option::is_none")]
    pub metrics: Option<Box<crate::models::AllocationMetric>>,
    #[serde(rename = "DesiredStatus", skip_serializing_if = "Option::is_none")]
    pub desired_status: Option<String>,
    #[serde(rename = "DesiredDescription", skip_serializing_if = "Option::is_none")]
    pub desired_description: Option<String>,
    #[serde(rename = "DesiredTransition", skip_serializing_if = "Option::is_none")]
    pub desired_transition: Option<Box<crate::models::DesiredTransition>>,
    #[serde(rename = "ClientStatus", skip_serializing_if = "Option::is_none")]
    pub client_status: Option<String>,
    #[serde(rename = "ClientDescription", skip_serializing_if = "Option::is_none")]
    pub client_description: Option<String>,
    #[serde(rename = "TaskStates", skip_serializing_if = "Option::is_none")]
    pub task_states: Option<::std::collections::HashMap<String, crate::models::TaskState>>,
    #[serde(rename = "DeploymentID", skip_serializing_if = "Option::is_none")]
    pub deployment_id: Option<String>,
    #[serde(rename = "DeploymentStatus", skip_serializing_if = "Option::is_none")]
    pub deployment_status: Option<Box<crate::models::AllocDeploymentStatus>>,
    #[serde(rename = "FollowupEvalID", skip_serializing_if = "Option::is_none")]
    pub followup_eval_id: Option<String>,
    #[serde(rename = "PreviousAllocation", skip_serializing_if = "Option::is_none")]
    pub previous_allocation: Option<String>,
    #[serde(rename = "NextAllocation", skip_serializing_if = "Option::is_none")]
    pub next_allocation: Option<String>,
    #[serde(rename = "RescheduleTracker", skip_serializing_if = "Option::is_none")]
    pub reschedule_tracker: Option<Box<crate::models::RescheduleTracker>>,
    #[serde(rename = "PreemptedAllocations", skip_serializing_if = "Option::is_none")]
    pub preempted_allocations: Option<Vec<String>>,
    #[serde(rename = "PreemptedByAllocation", skip_serializing_if = "Option::is_none")]
    pub preempted_by_allocation: Option<String>,
    #[serde(rename = "CreateIndex", skip_serializing_if = "Option::is_none")]
    pub create_index: Option<i32>,
    #[serde(rename = "ModifyIndex", skip_serializing_if = "Option::is_none")]
    pub modify_index: Option<i32>,
    #[serde(rename = "AllocModifyIndex", skip_serializing_if = "Option::is_none")]
    pub alloc_modify_index: Option<i32>,
    #[serde(rename = "CreateTime", skip_serializing_if = "Option::is_none")]
    pub create_time: Option<i64>,
    #[serde(rename = "ModifyTime", skip_serializing_if = "Option::is_none")]
    pub modify_time: Option<i64>,
}

impl Allocation {
    pub fn new() -> Allocation {
        Allocation {
            ID: None,
            namespace: None,
            eval_id: None,
            name: None,
            node_id: None,
            node_name: None,
            job_id: None,
            job: None,
            task_group: None,
            resources: None,
            task_resources: None,
            allocated_resources: None,
            services: None,
            metrics: None,
            desired_status: None,
            desired_description: None,
            desired_transition: None,
            client_status: None,
            client_description: None,
            task_states: None,
            deployment_id: None,
            deployment_status: None,
            followup_eval_id: None,
            previous_allocation: None,
            next_allocation: None,
            reschedule_tracker: None,
            preempted_allocations: None,
            preempted_by_allocation: None,
            create_index: None,
            modify_index: None,
            alloc_modify_index: None,
            create_time: None,
            modify_time: None,
        }
    }
}