1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ActivityPub.ObjectValidators.CreateNoteValidator do
8 alias Pleroma.Web.ActivityPub.ObjectValidators.Types
9 alias Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator
16 field(:id, :string, primary_key: true)
17 field(:actor, Types.ObjectID)
19 field(:to, {:array, :string})
20 field(:cc, {:array, :string})
21 field(:bto, {:array, :string}, default: [])
22 field(:bcc, {:array, :string}, default: [])
24 embeds_one(:object, NoteValidator)
27 def cast_data(data) do
29 |> cast(data, __schema__(:fields))