ExOAPI.Client (ex_oapi v0.1.0) View Source

The client module used to provide an api for generating requests programatically inside the generated SDK functions.

Link to this section Summary

Functions

Sets the :base_url to be used as the API endpoint.

Adds an header to the client.

Adds middleware to the client that will be passed on to the Tesla request.

Adds options to be passed to the tesla adapter.

Adds a query param to the client.

Sets the adapter options that will be passed on to the Tesla request.

Link to this section Types

Specs

middleware() :: {any(), any()}

Specs

t() :: %ExOAPI.Client{
  adapter: {any(), Keyword.t()},
  base_url: nil | String.t(),
  body: any(),
  errors: [any()],
  headers: [{String.t(), String.t()}],
  method: nil | ExOAPI.EctoTypes.HTTPMethods.t(),
  middleware: middleware(),
  module: module() | nil,
  opts: Keyword.t(),
  outgoing_format: String.t(),
  path: nil | String.t(),
  query: Keyword.t(),
  replacements: [{String.t(), String.t()}],
  response_handler: function() | mfa()
}

Link to this section Functions

Link to this function

add_arg_opts(client, type, in_type, opts, args)

View Source
Link to this function

add_arg_to_client(client, type, name, prepared_value)

View Source
Link to this function

add_base_url(client, url)

View Source

Specs

add_base_url(t(), String.t()) :: t()

Sets the :base_url to be used as the API endpoint.

Link to this function

add_base_url(client, url, arg3)

View Source

Specs

add_base_url(t(), String.t(), nil | :exoapi_default) :: t()
Link to this function

add_header(client, header, value)

View Source

Specs

add_header(t(), String.t(), String.t() | nil) :: t()

Adds an header to the client.

Link to this function

add_middleware(client, middleware)

View Source

Specs

add_middleware(t(), [middleware()] | middleware() | module()) :: t()

Adds middleware to the client that will be passed on to the Tesla request.

Link to this function

add_options(client, opts)

View Source

Specs

add_options(t(), Keyword.t() | {atom(), any()}) :: t()

Adds options to be passed to the tesla adapter.

Link to this function

add_query(client, param, value)

View Source

Specs

add_query(t(), String.t() | atom(), String.t() | nil) :: t()

Adds a query param to the client.

Link to this function

replace_path_fragments(replacements, url)

View Source
Link to this function

response_handler(response, client)

View Source
Link to this function

response_handler(response, client, fun)

View Source
Link to this function

set_adapter(client, adapter)

View Source

Specs

set_adapter(t(), {any(), Keyword.t()}) :: t()

Sets the adapter options that will be passed on to the Tesla request.