View Source Glific.Flows.FlowLabel (Glific v5.1.6)

The flow label object

Link to this section Summary

Functions

Glific.Flows.FlowLabel.list_flow_label() Standard changeset pattern we use for all data types

Return the count of flow labels, using the same filter as list_flow_labels

Creates a flow_label.

Given a organization id, retrieve all the flow labels for organization

Try to first get the flow label, if not present, create it. We dont use the upsert function, since it consumes id's for every failure. we expect a lot more gets, than inserts

Return the count of flow labels, using the same filter as list_flow_labels

Link to this section Types

@type t() :: %Glific.Flows.FlowLabel{
  __meta__: Ecto.Schema.Metadata.t(),
  id: non_neg_integer() | nil,
  inserted_at: :utc_datetime | nil,
  name: String.t() | nil,
  organization:
    Glific.Partners.Organization.t() | Ecto.Association.NotLoaded.t() | nil,
  organization_id: non_neg_integer() | nil,
  updated_at: :utc_datetime | nil,
  uuid: Ecto.UUID.t() | nil
}

Link to this section Functions

Link to this function

changeset(flow_label, attrs)

View Source
@spec changeset(any(), map()) :: Ecto.Changeset.t()

Glific.Flows.FlowLabel.list_flow_label() Standard changeset pattern we use for all data types

@spec count_flow_labels(map()) :: integer()

Return the count of flow labels, using the same filter as list_flow_labels

Link to this function

create_flow_label(attrs)

View Source
@spec create_flow_label(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Creates a flow_label.

examples

Examples

iex> create_flow_label(%{field: value})
{:ok, %FlowLabel{}}

iex> create_flow_label(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

get_all_flowlabel(organization_id)

View Source
@spec get_all_flowlabel(non_neg_integer()) :: [t()]

Given a organization id, retrieve all the flow labels for organization

Link to this function

get_or_create_flow_label(attrs)

View Source
@spec get_or_create_flow_label(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Try to first get the flow label, if not present, create it. We dont use the upsert function, since it consumes id's for every failure. we expect a lot more gets, than inserts

@spec list_flow_labels(map()) :: list()

Return the count of flow labels, using the same filter as list_flow_labels