Miosa.Channels (Miosa v1.0.0)

Copy Markdown View Source

Notification channels — Slack, Discord, email, and per-channel enable/disable.

Example

client = Miosa.client(System.fetch_env!("MIOSA_API_KEY"))

{:ok, channels} = Miosa.Channels.list(client)
{:ok, channel} = Miosa.Channels.create(client, %{type: "slack", webhook_url: "https://..."})
{:ok, _} = Miosa.Channels.enable(client, channel["id"])

Summary

Functions

Create a new notification channel.

Delete a channel by ID.

Disable a channel by ID.

Enable a channel by ID.

Get a single channel by ID.

List all channels for the tenant.

Get notification preferences across all channels.

Update a channel by ID.

Update notification preferences.

Functions

create(client, attrs)

@spec create(Miosa.Client.t(), map()) :: Miosa.Client.result(map())

Create a new notification channel.

delete(client, channel_id)

@spec delete(Miosa.Client.t(), String.t()) :: Miosa.Client.result(map())

Delete a channel by ID.

disable(client, channel_id)

@spec disable(Miosa.Client.t(), String.t()) :: Miosa.Client.result(map())

Disable a channel by ID.

enable(client, channel_id)

@spec enable(Miosa.Client.t(), String.t()) :: Miosa.Client.result(map())

Enable a channel by ID.

get(client, channel_id)

Get a single channel by ID.

list(client, filters \\ [])

@spec list(Miosa.Client.t(), keyword() | map()) :: Miosa.Client.result(map())

List all channels for the tenant.

Accepts optional filters as a keyword list or map.

list_notifications(client)

@spec list_notifications(Miosa.Client.t()) :: Miosa.Client.result(map())

Get notification preferences across all channels.

update(client, channel_id, attrs)

@spec update(Miosa.Client.t(), String.t(), map()) :: Miosa.Client.result(map())

Update a channel by ID.

update_notifications(client, prefs)

@spec update_notifications(Miosa.Client.t(), map()) :: Miosa.Client.result(map())

Update notification preferences.