apiGroup method
Declares an API group and attaches the supplied endpoints to it.
Implementation
ApiGroupDeclaration apiGroup(
String name, {
required String baseUrl,
Map<String, String>? headers,
List<Endpoint>? endpoints,
}) {
_ensureUnique(_apiGroupNames, name, 'api group');
for (final endpoint in endpoints ?? const <Endpoint>[]) {
endpoint.attachToGroup(name);
}
final declaration = ApiGroupDeclaration(
name: name,
baseUrl: baseUrl,
headers: headers,
endpoints: endpoints,
);
_apiGroups.add(declaration);
return declaration;
}