Packages

Elixir Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at.

Current section

Files

Jump to
flagsmith_elixir_sdk lib flagsmith sdk schemas feature.ex
Raw

lib/flagsmith/sdk/schemas/feature.ex

defmodule Flagsmith.API.Feature do
use TypedEctoSchema
import Ecto.Changeset
@primary_key false
typed_embedded_schema do
field(:created_date, :utc_datetime)
field(:default_enabled, :boolean)
field(:description, :string)
field(:id, :integer)
field(:initial_value, :string)
field(:name, :string)
field(:type, :string)
end
def changeset(struct \\ %__MODULE__{}, params) do
struct
|> cast(params, [
:type,
:name,
:initial_value,
:id,
:description,
:default_enabled,
:created_date
])
|> validate_required([:name])
end
end