Operations for managing webhook targets in Plain.
Summary
Functions
Creates a new webhook target.
Deletes a webhook target.
Fetches a webhook target by its Plain ID.
Returns {:ok, nil} if not found.
Returns a paginated list of webhook targets.
Updates a webhook target.
Functions
@spec create(ExPlain.Client.t(), map()) :: {:ok, ExPlain.Webhooks.WebhookTarget.t()} | {:error, ExPlain.Error.t()}
Creates a new webhook target.
The input map must include :url and :event_subscriptions (list of
%{event_type: "..."} maps). Optional: :description, :is_enabled.
@spec delete(ExPlain.Client.t(), String.t()) :: {:ok, :deleted} | {:error, ExPlain.Error.t()}
Deletes a webhook target.
@spec get_by_id(ExPlain.Client.t(), String.t()) :: {:ok, ExPlain.Webhooks.WebhookTarget.t() | nil} | {:error, ExPlain.Error.t()}
Fetches a webhook target by its Plain ID.
Returns {:ok, nil} if not found.
@spec list( ExPlain.Client.t(), keyword() ) :: {:ok, %{ nodes: [ExPlain.Webhooks.WebhookTarget.t()], page_info: ExPlain.PageInfo.t() }} | {:error, ExPlain.Error.t()}
Returns a paginated list of webhook targets.
@spec update(ExPlain.Client.t(), map()) :: {:ok, ExPlain.Webhooks.WebhookTarget.t()} | {:error, ExPlain.Error.t()}
Updates a webhook target.