View Source Resend.Client behaviour (resend v0.4.4)

Resend API client.

Summary

Types

@type response(type) :: {:ok, type} | {:error, Resend.Error.t() | :client_error}
@type t() :: %Resend.Client{
  api_key: String.t(),
  base_url: String.t() | nil,
  client: module() | nil
}

Callbacks

@callback request(t(), Keyword.t()) ::
  {:ok, %{body: map(), status: pos_integer()}} | {:error, any()}

Functions

Link to this function

delete(client, castable_module, path, body \\ %{}, opts \\ [])

View Source
@spec delete(t(), Resend.Castable.impl(), String.t(), map(), Keyword.t()) ::
  response(any())
Link to this function

get(client, castable_module, path, opts \\ [])

View Source
@spec get(t(), Resend.Castable.impl(), String.t(), Keyword.t()) :: response(any())
@spec new(Resend.config()) :: t()

Creates a new Resend client struct given a keyword list of config opts.

Link to this function

post(client, castable_module, path, body \\ %{}, opts \\ [])

View Source
@spec post(t(), Resend.Castable.impl(), String.t(), map(), Keyword.t()) ::
  response(any())