CompaniesHouse.Client behaviour (CompaniesHouse v0.2.0)

View Source

Documentation for CompaniesHouse.Client.

Summary

Types

t()

@type t() :: %CompaniesHouse.Client{environment: environment()}

Callbacks

delete(path, client)

@callback delete(path :: nonempty_binary(), client :: t()) :: CompaniesHouse.Response.t()

get(path, client)

@callback get(path :: nonempty_binary(), client :: t()) :: CompaniesHouse.Response.t()

get(nonempty_binary, keyword, t)

@callback get(nonempty_binary(), keyword(), t()) :: CompaniesHouse.Response.t()

post(nonempty_binary, keyword, t)

@callback post(nonempty_binary(), keyword(), t()) :: CompaniesHouse.Response.t()

put(nonempty_binary, keyword, t)

@callback put(nonempty_binary(), keyword(), t()) :: CompaniesHouse.Response.t()

Functions

delete(path, client \\ %__MODULE__{})

See CompaniesHouse.Client.Req.delete/2.

from_config()

@spec from_config() :: t()

Creates a new client using application configuration.

get(path, client)

See CompaniesHouse.Client.Req.get/2.

get(path, params, client)

See CompaniesHouse.Client.Req.get/3.

new()

@spec new() :: t()

Creates a new client with default environment (:sandbox).

new(environment)

@spec new(environment()) :: t()

Creates a new client with specified environment. Raises ArgumentError if environment is invalid.

post(path, params \\ [], client \\ %__MODULE__{})

See CompaniesHouse.Client.Req.post/3.

put(path, params \\ [], client \\ %__MODULE__{})

See CompaniesHouse.Client.Req.put/3.