lib/spatio/model/note.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.Note do
  @moduledoc """
  A markdown note. Notes belong to exactly one connected account (`accountId` + `provider`). The native provider stores notes in the Spatio database; external providers (Notion, Google Keep, etc.) store them upstream and round-trip through Spatio. 
  """

  @derive JSON.Encoder
  defstruct [
    :id,
    :provider,
    :accountId,
    :ownerUserId,
    :title,
    :content,
    :icon,
    :coverImage,
    :parentId,
    :properties,
    :archived,
    :createdAt,
    :updatedAt,
    :lastEditedBy
  ]

  @type t :: %__MODULE__{
    :id => String.t,
    :provider => String.t | nil,
    :accountId => String.t | nil,
    :ownerUserId => String.t | nil,
    :title => String.t,
    :content => String.t,
    :icon => String.t | nil,
    :coverImage => Uri | nil,
    :parentId => String.t | nil,
    :properties => %{optional(String.t) => any()} | nil,
    :archived => boolean(),
    :createdAt => DateTime.t,
    :updatedAt => DateTime.t,
    :lastEditedBy => String.t | nil
  }

  alias Spatio.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:coverImage, :struct, Spatio.Model.Uri)
  end
end