Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/dispatch/plugins/dispatch_google/groups/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,16 @@ def remove(self, email: str, participants: List[str]):
for p in participants:
remove_member(client, email, p)

def list(self, email: str):
def list(self, email: str) -> list[str]:
"""Lists members from an existing Google Group."""
client = get_service(self.configuration, "admin", "directory_v1", self.scopes)
members = list_members(client, email)
return [m["email"] for m in members.get("members", [])]
try:
members = list_members(client, email)
return [m["email"] for m in members.get("members", [])]
except HttpError as e:
if e.resp.status == 404:
log.warning(f"Group does not exist. GroupKey={email} Trying to list members.")
return []

def delete(self, email: str):
"""Deletes an existing Google group."""
Expand Down
Loading