lib/spatio/model/note_list_envelope.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.NoteListEnvelope do
  @moduledoc """
  Standard fan-out response for `GET /v1/notes`. Items aggregate notes across every connected account that contributed to the call; each contributing account contributes one `accounts[]` entry — including failed accounts, so the client can render which providers contributed and which errored without the call itself failing. 
  """

  @derive JSON.Encoder
  defstruct [
    :items,
    :accounts
  ]

  @type t :: %__MODULE__{
    :items => [Spatio.Model.Note.t],
    :accounts => [Spatio.Model.AccountStatus.t]
  }

  alias Spatio.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:items, :list, Spatio.Model.Note)
     |> Deserializer.deserialize(:accounts, :list, Spatio.Model.AccountStatus)
  end
end