lib/nomad_client/model/plan_annotations.ex

# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.

defmodule NomadClient.Model.PlanAnnotations do
  @moduledoc """

  """

  @derive [Poison.Encoder]
  defstruct [
    :DesiredTgUpdates,
    :PreemptedAllocs
  ]

  @type t :: %__MODULE__{
          :DesiredTgUpdates =>
            %{optional(String.t()) => NomadClient.Model.DesiredUpdates.t()} | nil,
          :PreemptedAllocs => [NomadClient.Model.AllocationListStub.t()] | nil
        }
end

defimpl Poison.Decoder, for: NomadClient.Model.PlanAnnotations do
  import NomadClient.Deserializer

  def decode(value, options) do
    value
    |> deserialize(:DesiredTgUpdates, :map, NomadClient.Model.DesiredUpdates, options)
    |> deserialize(:PreemptedAllocs, :list, NomadClient.Model.AllocationListStub, options)
  end
end