lib/spatio/model/block.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.22.0 (https://openapi-generator.tech).
# Do not edit this file manually.

defmodule Spatio.Model.Block do
  @moduledoc """
  
  """

  @derive JSON.Encoder
  defstruct [
    :id,
    :noteId,
    :parentId,
    :type,
    :content,
    :properties,
    :position,
    :hasChildren,
    :createdAt,
    :updatedAt
  ]

  @type t :: %__MODULE__{
    :id => String.t,
    :noteId => String.t,
    :parentId => String.t | nil,
    :type => Spatio.Model.BlockType.t,
    :content => Spatio.Model.BlockContent.t,
    :properties => %{optional(String.t) => any()} | nil,
    :position => integer(),
    :hasChildren => boolean(),
    :createdAt => DateTime.t,
    :updatedAt => DateTime.t
  }

  alias Spatio.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:type, :struct, Spatio.Model.BlockType)
     |> Deserializer.deserialize(:content, :struct, Spatio.Model.BlockContent)
  end
end