View Source ExOAPI.Client (ex_oapi v0.1.5)

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

Link to this section Summary

Link to this section Types

@type middleware() :: {any(), any()}
@type 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,
  oapi_op: ExOAPI.Parser.V3.Context.Operation.t(),
  opts: Keyword.t(),
  outgoing_format: String.t(),
  path: nil | String.t(),
  query: Keyword.t(),
  replacements: [{String.t(), String.t()}],
  response_handler: function() | mfa(),
  strict_responses: boolean()
}

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
@spec 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
@spec add_base_url(t(), String.t(), nil | :exoapi_default) :: t()
Link to this function

add_header(client, header, value)

View Source
@spec 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
@spec 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
@spec 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
@spec add_query(t(), String.t() | atom(), String.t() | nil) :: t()

Adds a query param to the client.

Link to this function

check_url_in_servers(base_url, servers)

View Source
Link to this function

maybe_create_url_from_servers(client)

View Source
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
@spec set_adapter(
  t(),
  {any(), Keyword.t()}
) :: t()

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