Skip to content

Commit

Permalink
user management more methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Oct 24, 2023
1 parent 61c743b commit 04d5a43
Show file tree
Hide file tree
Showing 11 changed files with 483 additions and 72 deletions.
5 changes: 3 additions & 2 deletions getstream/chat/models/ban_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
@dataclass_json
@dataclass
class BanResponse:
created_at: datetime = field(
created_at: Optional[datetime] = field(
metadata=config(
field_name="created_at",
encoder=lambda d: d.isoformat(),
decoder=parse,
mm_field=fields.DateTime(format="iso"),
)
),
default=None,
)
user: Optional[UserObject] = field(metadata=config(field_name="user"), default=None)
banned_by: Optional[UserObject] = field(
Expand Down
2 changes: 1 addition & 1 deletion getstream/chat/models/channel_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ChannelResponse:
metadata=config(field_name="members"), default=None
)
muted: Optional[bool] = field(metadata=config(field_name="muted"), default=None)
config: Optional[ChannelConfigWithInfo] = field(
config_: Optional[ChannelConfigWithInfo] = field(
metadata=config(field_name="config"), default=None
)
created_at: Optional[datetime] = field(
Expand Down
3 changes: 2 additions & 1 deletion getstream/chat/models/message.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# THIS FILE IS GENERATED FROM github.com/GetStream/protocol/tree/main/openapi-gen/templates/python/type.tmpl
from __future__ import annotations
# TODO: fix generator to handle self-referencing types add ^ the above line
from dataclasses import dataclass, field
from dataclasses_json import config, dataclass_json

from typing import List, Dict, Optional
from datetime import datetime
from dateutil.parser import parse
from marshmallow import fields
from getstream.chat.models.message import Message
from getstream.chat.models.attachment import Attachment
from getstream.chat.models.user_object import UserObject
from getstream.chat.models.reaction import Reaction
Expand Down
1 change: 0 additions & 1 deletion getstream/models/own_capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ def from_str(cls, value: str) -> "OwnCapability":
except ValueError:
raise ValueError(f"'{value}' is not a valid OwnCapability")

@classmethod
def to_str(self) -> str:
return self.value
3 changes: 2 additions & 1 deletion getstream/models/user_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
@dataclass
class UserResponse:
role: str = field(metadata=config(field_name="role"))
teams: List[str] = field(metadata=config(field_name="teams"))
updated_at: datetime = field(
metadata=config(
field_name="updated_at",
Expand All @@ -31,6 +30,8 @@ class UserResponse:
mm_field=fields.DateTime(format="iso"),
)
)
teams: Optional[List[str]] = field(metadata=config(field_name="teams"), default=None)

deleted_at: Optional[datetime] = field(
metadata=config(
field_name="deleted_at",
Expand Down
2 changes: 1 addition & 1 deletion getstream/sync/stream.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from getstream import BaseStream
from getstream.users.client import UsersClient
from getstream.users.sync.client import UsersClient

# from getstream.chat.sync import ChatClient

Expand Down
44 changes: 0 additions & 44 deletions getstream/users/client.py

This file was deleted.

Loading

0 comments on commit 04d5a43

Please sign in to comment.