lib/responses/instruments/update.ex

defmodule Responses.Instruments.Update do
  @moduledoc false
  @derive Jason.Encoder

  @type t :: %__MODULE__{
          type: String.t(),
          fingerprint: String.t()
        }

  defstruct [:type, :fingerprint]

  def build(params) when is_map(params) do
    %__MODULE__{
      type: params["type"],
      fingerprint: params["fingerprint"]
    }
  end

  def build(_), do: nil
end