GitHub

API reference for group.

Groups of HTTP API endpoints (Effect's HttpApiGroup).

A group is a class whose attributes are its endpoints::

class Users(HttpApiGroup, identifier="users"):
    get_user = endpoint.get("getUser", "/users/:id", params=..., success=User)

class Admin(HttpApiGroup[Authorization], identifier="admin"):
    ...  # every endpoint is wrapped by the Authorization middleware

A group is also the tag of its handlers: HttpApiBuilder.group(api, Users, ...) is a Layer[Users]. Read on a client's group (get_group(client, Users)) an endpoint attribute is its client method. top_level=True puts a group's methods on the client itself in OpenAPI-style tools; a Python client always reads them through the group.

prefix, add, annotate and the other class methods give a new group class (a subclass, the tag of the same handlers).

Values

AttributeTypeDescription
RESERVED_NAMESfrozenset[str]

What a group's endpoint attribute can't be called: the group's own members.

Types

TypeDefinitionDescription
AnyGrouptype AnyGroup = type[HttpApiGroup[Any]]

Classes