FoPost.Workspaces (FoPost v0.1.0)

Copy Markdown View Source

Workspaces — the tenant boundary every other resource is scoped to.

A key bound to a single workspace only ever sees that one.

Summary

Functions

A workspace's follower and post totals.

Adds a workspace.

Removes a workspace and everything scoped to it.

One workspace, with its connected accounts.

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

Every workspace the key can reach.

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

Edits a workspace. Only the keys you pass are sent.

Functions

analytics(client, id)

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

A workspace's follower and post totals.

analytics!(client, id)

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

create(client, opts)

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

Adds a workspace.

Required: :name, :slug. Optional: :type, :logo, :website, :timezone, :country, :description, :language.

Plans cap how many workspaces an account may have, so this answers 402 once the limit is reached.

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 workspace and everything scoped to it.

delete!(client, id)

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

get(client, id)

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

One workspace, with its connected accounts.

get!(client, id)

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

list(client)

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

Every workspace the key can reach.

list!(client)

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

update(client, id, opts)

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

Edits a workspace. Only the keys you pass are sent.

Beyond the create fields: :require_approval, :ai_alt_text_enabled, :brand_color.

update!(client, id, opts)

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