View Source CozyLark.ServerSideAPI.Spec (cozy_lark v0.4.1)

Describes the specification of a server-side API.

Link to this section Summary

Types

The type of access token which is used by current API.

The optional API body.

The API headers.

The API method.

The API path.

The API query.

t()

Functions

Builds an spec from a give map.

Link to this section Types

@type access_token_type() ::
  :tenant_access_token | :app_access_token | :user_access_token | nil

The type of access token which is used by current API.

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

The optional API body.

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

The API headers.

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

The API method.

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

The API path.

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

The API query.

@type t() :: %CozyLark.ServerSideAPI.Spec{
  access_token_type: nil,
  body: body(),
  headers: headers(),
  method: method(),
  path: path(),
  query: query()
}

Link to this section Functions

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

Builds an spec from a give map.