FoPost.Labels (FoPost v0.1.0)

Copy Markdown View Source

Labels — the campaign tags posts are grouped and reported by.

Summary

Functions

Adds a label to a workspace.

Removes a label and unlinks it from every post carrying it.

One label.

Same as get/2, but raises FoPost.Error.

The labels the key can reach, optionally narrowed with :workspace_id.

Renames or recolors a label. Both :name and :color are required.

Functions

create(client, opts)

@spec create(
  FoPost.Client.t(),
  keyword()
) :: {:ok, FoPost.Label.t()} | {:error, FoPost.Error.t()}

Adds a label to a workspace.

Required: :workspace_id, :name, :color. :color is a hex value, e.g. "#2563eb".

create!(client, opts)

Same as create/2, but raises FoPost.Error.

delete(client, id)

@spec delete(FoPost.Client.t(), String.t()) ::
  {:ok, FoPost.Message.t()} | {:error, FoPost.Error.t()}

Removes a label and unlinks it from every post carrying it.

delete!(client, id)

Same as delete/2, but raises FoPost.Error.

get(client, id)

@spec get(FoPost.Client.t(), String.t()) ::
  {:ok, FoPost.Label.t()} | {:error, FoPost.Error.t()}

One label.

get!(client, id)

Same as get/2, but raises FoPost.Error.

list(client, opts \\ [])

@spec list(
  FoPost.Client.t(),
  keyword()
) :: {:ok, [FoPost.Label.t()]} | {:error, FoPost.Error.t()}

The labels the key can reach, optionally narrowed with :workspace_id.

list!(client, opts \\ [])

Same as list/2, but raises FoPost.Error.

update(client, id, opts)

@spec update(FoPost.Client.t(), String.t(), keyword()) ::
  {:ok, FoPost.Label.t()} | {:error, FoPost.Error.t()}

Renames or recolors a label. Both :name and :color are required.

update!(client, id, opts)

Same as update/3, but raises FoPost.Error.