# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). # https://openapi-generator.tech # Do not edit the class manually. defmodule Nomad.Model.Allocation do @moduledoc """ """ @derive [Poison.Encoder] defstruct [ :ID, :Namespace, :EvalID, :Name, :NodeID, :NodeName, :JobID, :Job, :TaskGroup, :Resources, :TaskResources, :AllocatedResources, :Services, :Metrics, :DesiredStatus, :DesiredDescription, :DesiredTransition, :ClientStatus, :ClientDescription, :TaskStates, :DeploymentID, :DeploymentStatus, :FollowupEvalID, :PreviousAllocation, :NextAllocation, :RescheduleTracker, :PreemptedAllocations, :PreemptedByAllocation, :CreateIndex, :ModifyIndex, :AllocModifyIndex, :CreateTime, :ModifyTime ] @type t :: %__MODULE__{ :ID => String.t() | nil, :Namespace => String.t() | nil, :EvalID => String.t() | nil, :Name => String.t() | nil, :NodeID => String.t() | nil, :NodeName => String.t() | nil, :JobID => String.t() | nil, :Job => Nomad.Model.Job.t() | nil, :TaskGroup => String.t() | nil, :Resources => Nomad.Model.Resources.t() | nil, :TaskResources => %{optional(String.t()) => Nomad.Model.Resources.t()} | nil, :AllocatedResources => Nomad.Model.AllocatedResources.t() | nil, :Services => %{optional(String.t()) => String.t()} | nil, :Metrics => Nomad.Model.AllocationMetric.t() | nil, :DesiredStatus => String.t() | nil, :DesiredDescription => String.t() | nil, :DesiredTransition => Nomad.Model.DesiredTransition.t() | nil, :ClientStatus => String.t() | nil, :ClientDescription => String.t() | nil, :TaskStates => %{optional(String.t()) => Nomad.Model.TaskState.t()} | nil, :DeploymentID => String.t() | nil, :DeploymentStatus => Nomad.Model.AllocDeploymentStatus.t() | nil, :FollowupEvalID => String.t() | nil, :PreviousAllocation => String.t() | nil, :NextAllocation => String.t() | nil, :RescheduleTracker => Nomad.Model.RescheduleTracker.t() | nil, :PreemptedAllocations => [String.t()] | nil, :PreemptedByAllocation => String.t() | nil, :CreateIndex => integer() | nil, :ModifyIndex => integer() | nil, :AllocModifyIndex => integer() | nil, :CreateTime => integer() | nil, :ModifyTime => integer() | nil } end defimpl Poison.Decoder, for: Nomad.Model.Allocation do import Nomad.Deserializer def decode(value, options) do value |> deserialize(:Job, :struct, Nomad.Model.Job, options) |> deserialize(:Resources, :struct, Nomad.Model.Resources, options) |> deserialize(:TaskResources, :map, Nomad.Model.Resources, options) |> deserialize(:AllocatedResources, :struct, Nomad.Model.AllocatedResources, options) |> deserialize(:Metrics, :struct, Nomad.Model.AllocationMetric, options) |> deserialize(:DesiredTransition, :struct, Nomad.Model.DesiredTransition, options) |> deserialize(:TaskStates, :map, Nomad.Model.TaskState, options) |> deserialize(:DeploymentStatus, :struct, Nomad.Model.AllocDeploymentStatus, options) |> deserialize(:RescheduleTracker, :struct, Nomad.Model.RescheduleTracker, options) end end