Sites already has get_by_name(site_name) -> SiteItem. Three other endpoints have server-enforced unique names and would benefit from the same shape:
- Users — usernames unique per site.
- Groups — group names unique per site.
- Schedules — server throws ScheduleNameExistsException on duplicate name.
Proposal:
# UsersEndpoint
def get_by_name(self, username: str) -> UserItem | None:
matches = list(self.filter(name=username))
return matches[0] if matches else None
This formalizes a naming pattern across the API surface:
- get_by_* returns a single item (or None/raises when not found). Use when the lookup key is unique on the server.
- filter(...) returns a lazy QuerySet[T] for chaining or when multiplicity is possible.
Callers with unique-name types get a natural T | None shape. Callers with multi-name endpoints (workbooks/datasources/views/flows/projects) continue to use .filter(name=name).
🤖 Generated with Claude Code
Reactions are currently unavailable
Sites already has get_by_name(site_name) -> SiteItem. Three other endpoints have server-enforced unique names and would benefit from the same shape:
Proposal:
This formalizes a naming pattern across the API surface:
Callers with unique-name types get a natural T | None shape. Callers with multi-name endpoints (workbooks/datasources/views/flows/projects) continue to use .filter(name=name).
🤖 Generated with Claude Code