Lettermint.Operations (Lettermint v2.0.0)

Copy Markdown View Source

Every operation of the Sending and Team APIs, keyed by "<METHOD> <path>".

Each entry is a map with these keys:

  • :operation_id, :summary, :method (an atom such as :get) and :path
  • :auth: :sending, :team or :either, by the tokens the operation accepts
  • :surfaces, :path_params, :headers
  • :query: the query type module, or nil
  • :request: %{type: module, content_type: String.t(), required: boolean()} or nil
  • :response: %{status: [integer()], content_type: String.t() | nil, type: module | :text | :empty}

  • :errors: each error status with the type modules its body may have (:text for a text body)
  • :pagination: %{items: module, cursor_param: String.t(), size_param: String.t() | nil} or nil

  • :deprecated

The table is data, not a client: the SDK's functions read it.

Summary

Types

An operation key, such as "GET /domains".

Functions

Every operation, keyed by "<METHOD> <path>".

Returns the operation, or :error when the key is unknown.

Returns the operation; raises KeyError when the key is unknown.

The operation keys, sorted.

Types

key()

@type key() :: String.t()

An operation key, such as "GET /domains".

Functions

all()

@spec all() :: %{required(key()) => map()}

Every operation, keyed by "<METHOD> <path>".

fetch(key)

@spec fetch(key()) :: {:ok, map()} | :error

Returns the operation, or :error when the key is unknown.

fetch!(key)

@spec fetch!(key()) :: map()

Returns the operation; raises KeyError when the key is unknown.

keys()

@spec keys() :: [key()]

The operation keys, sorted.