defmodule Manganese.SerializationKit.Structs.UnityMaterialAsset do @moduledoc """ """ alias Manganese.SerializationKit.Structs alias Manganese.SerializationKit.Enumerations @typedoc """ """ @type t :: %Structs.UnityMaterialAsset{ path: String.t, id: Structs.UnityAsset.id, name: String.t, type: Enumerations.UnityAssetType.t } defstruct [ :path, :id, :name, type: :material ] # Deserialization @doc """ """ @spec from_map(t_external) :: t def from_map(%{ "path" => path, "id" => id, "name" => name }) do %Structs.UnityMaterialAsset{ path: path, id: id, name: name } end # Serialization @type t_external :: map @doc """ """ @spec to_map(t) :: t_external def to_map(%Structs.UnityMaterialAsset{ path: path, id: id, name: name, type: type }) do %{ "path" => path, "id" => id, "name" => name, "type" => Enumerations.UnityAssetType.to_integer(type) } end end