View Source Dnsimple.Client (dnsimple v4.0.0)

Summary

Functions

Issues a DELETE request to the given url.

Returns the representation of an empty body in a request.

Issues a GET request to the given url.

Initializes a new client from the application environment.

Issues a PATCH request to the given url.

Issues a POST request to the given url.

Issues a PUT request to the given url.

Prepends the correct API version to path.

Types

@type body() ::
  binary() | {:form, [{atom(), any()}]} | {:file, binary()} | Keyword.t()
@type headers() :: [{binary(), binary()}] | %{required(binary()) => binary()}
@type t() :: %Dnsimple.Client{
  access_token: String.t(),
  base_url: String.t(),
  user_agent: String.t()
}

Functions

Link to this function

delete(client, url, options \\ [])

View Source
@spec delete(t(), binary(), Keyword.t()) ::
  {:ok | :error, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}

Issues a DELETE request to the given url.

@spec empty_body() :: nil

Returns the representation of an empty body in a request.

Examples

iex> Dnsimple.Client.empty_body() nil

Link to this function

execute(client, method, url, body \\ "", all_options \\ [])

View Source
Link to this function

get(client, url, options \\ [])

View Source
@spec get(t(), binary(), Keyword.t()) ::
  {:ok | :error, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}

Issues a GET request to the given url.

@spec new_from_env() :: t()

Initializes a new client from the application environment.

Examples

client = Dnsimple.Client.new_from_env()
Link to this function

patch(client, url, body, options \\ [])

View Source
@spec patch(t(), binary(), body(), Keyword.t()) ::
  {:ok | :error, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}

Issues a PATCH request to the given url.

Link to this function

post(client, url, body, options \\ [])

View Source
@spec post(t(), binary(), body(), Keyword.t()) ::
  {:ok | :error, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}

Issues a POST request to the given url.

Link to this function

put(client, url, body, options \\ [])

View Source
@spec put(t(), binary(), nil | body(), Keyword.t()) ::
  {:ok | :error, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t()}

Issues a PUT request to the given url.

@spec versioned(String.t()) :: String.t()

Prepends the correct API version to path.

Examples

iex> Dnsimple.Client.versioned "/whoami"
"/v2/whoami"