Current section
Files
Jump to
Current section
Files
lib/tehama_client/objects/site.ex
defmodule TehamaClient.Site do
@moduledoc """
A tehama site.
"""
use TypedStruct
typedstruct do
@typedoc "A typed Site struct"
field(:access_code, String.t())
field(:node_type, String.t())
field(:name, String.t())
field(:property_id, String.t())
end
def new(data) when is_map(data) do
%__MODULE__{
access_code: data["access_code"],
property_id: data["property_id"],
name: data["name"],
node_type: data["nodeType"]
}
end
def new(_) do
nil
end
end