Current section

Files

Jump to
ex_oanda lib models response streaming pricing heartbeat.ex
Raw

lib/models/response/streaming/pricing/heartbeat.ex

defmodule ExOanda.Response.PricingHeartbeat do
@moduledoc """
Schema for Oanda pricing heartbeat response.
[Oanda Docs](https://developer.oanda.com/rest-live-v20/pricing-ep/)
"""
use TypedEctoSchema
import Ecto.Changeset
alias ExOanda.Type.Atom
@primary_key false
typed_embedded_schema do
field(:time, :utc_datetime_usec)
field(:type, Atom, default: :HEARTBEAT)
end
@doc false
def changeset(struct, params) do
struct
|> cast(params, [:time, :type])
end
end