From a62344885d0695f86f3b9c86bb8ed48682aea569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Mon, 4 Dec 2023 22:11:43 -0600 Subject: [PATCH] docs: Document valid participant attributes --- docker-compose.yml | 2 ++ src/citric/client.py | 2 +- src/citric/types.py | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 30444401..fd4b81b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,8 @@ services: POSTGRES_PASSWORD: secret volumes: - "limedb:/var/lib/postgresql/data" + ports: + - 5432:5432 healthcheck: test: ["CMD", "pg_isready", "-U", "limesurvey"] interval: 30s diff --git a/src/citric/client.py b/src/citric/client.py index 942076c7..cf800742 100644 --- a/src/citric/client.py +++ b/src/citric/client.py @@ -1326,7 +1326,7 @@ def list_participants( start: int = 0, limit: int = 10, unused: bool = False, - attributes: t.Sequence[str] | bool = False, + attributes: t.Sequence[types.ParticipantAttribute | str] | bool = False, conditions: t.Mapping[str, t.Any] | None = None, ) -> list[dict[str, t.Any]]: """Get participants in a survey. diff --git a/src/citric/types.py b/src/citric/types.py index 67c0930e..931d492b 100644 --- a/src/citric/types.py +++ b/src/citric/types.py @@ -516,3 +516,23 @@ class SurveyUserActivationSettings(t.TypedDict, total=False): ipanonymize: bool refurl: bool savetimings: bool + + +ParticipantAttribute = t.Literal[ + "tid", + "partcipant_id", + "firstname", + "lastname", + "email", + "emailstatus", + "token", + "language", + "blacklisted", + "sent", + "remindersent", + "remindercount", + "completed", + "usesleft", + "validfrom", + "validuntil", +]