diff --git a/tap_jotform/streams.py b/tap_jotform/streams.py index fee5ed1..9b0cafa 100644 --- a/tap_jotform/streams.py +++ b/tap_jotform/streams.py @@ -363,3 +363,32 @@ def post_process(self, row: dict, context: dict | None = None) -> dict: } row["forms"] = forms return row + + +class SubusersStream(JotformStream): + """Subusers stream.""" + + name = "subusers" + path = "/user/subusers" + primary_keys = ("username",) + + selected_by_default = False + + schema = th.PropertiesList( + th.Property("owner", th.StringType), + th.Property("status", th.StringType), + th.Property("email", th.EmailType), + th.Property("username", th.StringType), + CREATED_AT, + th.Property( + "permissions", + th.ArrayType( + th.ObjectType( + th.Property("type", th.StringType), + th.Property("resource_id", th.StringType), + th.Property("access_type", th.StringType), + th.Property("title", th.StringType), + ), + ), + ), + ).to_dict() diff --git a/tap_jotform/tap.py b/tap_jotform/tap.py index 9b0d23e..b07a9dd 100644 --- a/tap_jotform/tap.py +++ b/tap_jotform/tap.py @@ -95,4 +95,5 @@ def discover_streams(self) -> list[Stream]: streams.ReportsStream(self), streams.UserHistory(self), streams.FoldersStream(self), + streams.SubusersStream(self), ]