diff --git a/getstream/moderation/client.py b/getstream/moderation/client.py new file mode 100644 index 00000000..06f4ede7 --- /dev/null +++ b/getstream/moderation/client.py @@ -0,0 +1,9 @@ +from getstream.moderation.rest_client import ModerationRestClient + + +class ModerationClient(ModerationRestClient): + def __init__(self, api_key: str, base_url, token, timeout, stream): + super().__init__( + api_key=api_key, base_url=base_url, token=token, timeout=timeout + ) + self.stream = stream diff --git a/getstream/stream.py b/getstream/stream.py index 85f0fd65..0d66ceaa 100644 --- a/getstream/stream.py +++ b/getstream/stream.py @@ -8,6 +8,7 @@ from getstream.models import UserRequest from getstream.utils import validate_and_clean_url from getstream.video.client import VideoClient +from getstream.moderation.client import ModerationClient BASE_URL = "https://chat.stream-io-api.com/" @@ -69,6 +70,20 @@ def chat(self): timeout=self.timeout, stream=self, ) + + @cached_property + def moderation(self): + """ + Moderation stream client. + + """ + return ModerationClient( + api_key=self.api_key, + base_url=self.base_url, + token=self.token, + timeout=self.timeout, + stream=self, + ) def upsert_users(self, *users: UserRequest): """