View Source CozyOSS.ApiSpec (cozy_oss v0.1.3)

Describes the specification of an API.

Link to this section Summary

Types

Optional API body.

API headers.

API method.

API path.

API query.

t()

Link to this section Types

@type body() :: iodata() | nil

Optional API body.

@type config() :: %{
  method: method(),
  path: path(),
  query: query(),
  headers: headers(),
  body: body()
}
@type headers() :: %{
  optional(header_name :: String.t()) => header_value :: String.t()
}

API headers.

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

API method.

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

API path.

@type query() :: %{
  optional(query_name :: String.t()) =>
    query_value :: boolean() | number() | String.t()
}

API query.

@type t() :: %CozyOSS.ApiSpec{
  body: body(),
  bucket: term(),
  headers: headers(),
  method: method(),
  object: term(),
  path: path(),
  query: query(),
  sub_resources: term()
}

Link to this section Functions

@spec build!(config()) :: t()