lib/nomad_client/model/job_summary.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.JobSummary do
  @moduledoc """

  """

  @derive [Poison.Encoder]
  defstruct [
    :JobID,
    :Namespace,
    :Summary,
    :Children,
    :CreateIndex,
    :ModifyIndex
  ]

  @type t :: %__MODULE__{
          :JobID => String.t() | nil,
          :Namespace => String.t() | nil,
          :Summary => %{optional(String.t()) => NomadClient.Model.TaskGroupSummary.t()} | nil,
          :Children => NomadClient.Model.JobChildrenSummary.t() | nil,
          :CreateIndex => integer() | nil,
          :ModifyIndex => integer() | nil
        }
end

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

  def decode(value, options) do
    value
    |> deserialize(:Summary, :map, NomadClient.Model.TaskGroupSummary, options)
    |> deserialize(:Children, :struct, NomadClient.Model.JobChildrenSummary, options)
  end
end