defmodule Pollin.Resource.Callback do @moduledoc """ Callback Resource """ @derive [Poison.Encoder] defstruct [:id, :request, :phase, :created_at] @type t :: %__MODULE__{ id: charlist, request: any, # Note: Keep it any to allow all types instead of Request strt phase: charlist, created_at: integer } @doc """ Generates new callback """ def new(request) do %__MODULE__{ id: SecureRandom.uuid, request: request, phase: "", created_at: :os.system_time } end end