DripDrop.AdapterPools (DripDrop v0.1.0)

Copy Markdown View Source

Context for authoring outbound adapter pools and memberships.

Summary

Functions

Adds a channel adapter to a pool.

Creates an adapter pool in an explicit tenant scope.

Deletes an adapter pool unless active outbound enrollments still use it.

Lists adapter pools in an explicit tenant scope.

Lists members for a pool in an explicit tenant scope.

Removes one adapter from a pool without mutating existing enrollment pins.

Updates an adapter pool after verifying the caller's tenant scope.

Types

tenant_filters()

@type tenant_filters() :: %{tenant_key: binary() | nil}

Functions

add_pool_member(pool_or_id, attrs)

@spec add_pool_member(Ecto.Schema.t() | Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Adds a channel adapter to a pool.

create_adapter_pool(attrs)

@spec create_adapter_pool(map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Creates an adapter pool in an explicit tenant scope.

delete_adapter_pool(pool_or_id, opts)

@spec delete_adapter_pool(Ecto.Schema.t() | Ecto.UUID.t(), map() | keyword()) ::
  {:ok, Ecto.Schema.t()} | {:error, map()}

Deletes an adapter pool unless active outbound enrollments still use it.

list_adapter_pools(filters)

@spec list_adapter_pools(tenant_filters()) :: [Ecto.Schema.t()]

Lists adapter pools in an explicit tenant scope.

list_pool_members(pool)

@spec list_pool_members(Ecto.Schema.t() | Ecto.UUID.t() | map()) :: [Ecto.Schema.t()]

Lists members for a pool in an explicit tenant scope.

remove_pool_member(pool_or_id, map)

@spec remove_pool_member(Ecto.Schema.t() | Ecto.UUID.t(), Ecto.UUID.t() | map()) ::
  {:ok, Ecto.Schema.t()} | {:error, :not_found}

Removes one adapter from a pool without mutating existing enrollment pins.

update_adapter_pool(pool_or_id, attrs)

@spec update_adapter_pool(Ecto.Schema.t() | Ecto.UUID.t(), map()) ::
  {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Updates an adapter pool after verifying the caller's tenant scope.