Astarte.Core.InterfaceDescriptor (astarte_core v1.3.0)

Copy Markdown View Source

Summary

Functions

Deserializes an %InterfaceDescriptor{} from db_result. db_result can be a keyword list or a map.

Deserializes an %InterfaceDescriptor{} from db_result. db_result can be a keyword list or a map.

Builds an %InterfaceDescriptor{} starting from an %Interface{}

Types

t()

@type t() :: %Astarte.Core.InterfaceDescriptor{
  aggregation: Astarte.Core.Interface.Aggregation.t() | nil,
  automaton: {%{}, %{}} | nil,
  interface_id: :binary | nil,
  major_version: non_neg_integer(),
  minor_version: non_neg_integer(),
  name: String.t(),
  ownership: Astarte.Core.Interface.Ownership.t() | nil,
  storage: String.t() | nil,
  storage_type: Astarte.Core.StorageType.t() | nil,
  type: Astarte.Core.Interface.Type.t() | nil
}

Functions

from_db_result(db_result)

Deserializes an %InterfaceDescriptor{} from db_result. db_result can be a keyword list or a map.

Returns the {:ok, %InterfaceDescriptor{}} on success, {:error, :invalid_interface_descriptor_data} on failure.

from_db_result!(db_result)

Deserializes an %InterfaceDescriptor{} from db_result. db_result can be a keyword list or a map.

Returns the %InterfaceDescriptor{} on success, raises on failure

from_interface(interface)

Builds an %InterfaceDescriptor{} starting from an %Interface{}

Returns the %InterfaceDescriptor{}