Skip to content

Commit 7d7dbeb

Browse files
authored
Merge pull request #63 from GetStream/frame-rec
[VID-228] Call frame recording
2 parents 5a14e51 + 0edbb9c commit 7d7dbeb

File tree

6 files changed

+712
-223
lines changed

6 files changed

+712
-223
lines changed

getstream/chat/rest_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ def send_reaction(
963963

964964
def delete_reaction(
965965
self, id: str, type: str, user_id: Optional[str] = None
966-
) -> StreamResponse[ReactionRemovalResponse]:
966+
) -> StreamResponse[DeleteReactionResponse]:
967967
query_params = build_query_param(user_id=user_id)
968968
path_params = {
969969
"id": id,
@@ -972,7 +972,7 @@ def delete_reaction(
972972

973973
return self.delete(
974974
"/api/v2/chat/messages/{id}/reaction/{type}",
975-
ReactionRemovalResponse,
975+
DeleteReactionResponse,
976976
query_params=query_params,
977977
path_params=path_params,
978978
)
@@ -1418,6 +1418,15 @@ def query_poll_votes(
14181418
json=json,
14191419
)
14201420

1421+
def update_push_notification_preferences(
1422+
self, preferences: List[PushPreferenceInput]
1423+
) -> StreamResponse[UpsertPushPreferencesResponse]:
1424+
json = build_body_dict(preferences=preferences)
1425+
1426+
return self.post(
1427+
"/api/v2/chat/push_preferences", UpsertPushPreferencesResponse, json=json
1428+
)
1429+
14211430
def query_banned_users(
14221431
self, payload: Optional[QueryBannedUsersPayload] = None
14231432
) -> StreamResponse[QueryBannedUsersResponse]:

getstream/common/rest_client.py

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,44 +116,69 @@ def update_app(
116116

117117
return self.patch("/api/v2/app", Response, json=json)
118118

119-
def list_block_lists(self) -> StreamResponse[ListBlockListResponse]:
120-
return self.get("/api/v2/blocklists", ListBlockListResponse)
119+
def list_block_lists(
120+
self, team: Optional[str] = None
121+
) -> StreamResponse[ListBlockListResponse]:
122+
query_params = build_query_param(team=team)
123+
124+
return self.get(
125+
"/api/v2/blocklists", ListBlockListResponse, query_params=query_params
126+
)
121127

122128
def create_block_list(
123-
self, name: str, words: List[str], type: Optional[str] = None
124-
) -> StreamResponse[Response]:
125-
json = build_body_dict(name=name, words=words, type=type)
129+
self,
130+
name: str,
131+
words: List[str],
132+
team: Optional[str] = None,
133+
type: Optional[str] = None,
134+
) -> StreamResponse[CreateBlockListResponse]:
135+
json = build_body_dict(name=name, words=words, team=team, type=type)
126136

127-
return self.post("/api/v2/blocklists", Response, json=json)
137+
return self.post("/api/v2/blocklists", CreateBlockListResponse, json=json)
128138

129-
def delete_block_list(self, name: str) -> StreamResponse[Response]:
139+
def delete_block_list(
140+
self, name: str, team: Optional[str] = None
141+
) -> StreamResponse[Response]:
142+
query_params = build_query_param(team=team)
130143
path_params = {
131144
"name": name,
132145
}
133146

134147
return self.delete(
135-
"/api/v2/blocklists/{name}", Response, path_params=path_params
148+
"/api/v2/blocklists/{name}",
149+
Response,
150+
query_params=query_params,
151+
path_params=path_params,
136152
)
137153

138-
def get_block_list(self, name: str) -> StreamResponse[GetBlockListResponse]:
154+
def get_block_list(
155+
self, name: str, team: Optional[str] = None
156+
) -> StreamResponse[GetBlockListResponse]:
157+
query_params = build_query_param(team=team)
139158
path_params = {
140159
"name": name,
141160
}
142161

143162
return self.get(
144-
"/api/v2/blocklists/{name}", GetBlockListResponse, path_params=path_params
163+
"/api/v2/blocklists/{name}",
164+
GetBlockListResponse,
165+
query_params=query_params,
166+
path_params=path_params,
145167
)
146168

147169
def update_block_list(
148-
self, name: str, words: Optional[List[str]] = None
149-
) -> StreamResponse[Response]:
170+
self, name: str, team: Optional[str] = None, words: Optional[List[str]] = None
171+
) -> StreamResponse[UpdateBlockListResponse]:
150172
path_params = {
151173
"name": name,
152174
}
153-
json = build_body_dict(words=words)
175+
json = build_body_dict(team=team, words=words)
154176

155177
return self.put(
156-
"/api/v2/blocklists/{name}", Response, path_params=path_params, json=json
178+
"/api/v2/blocklists/{name}",
179+
UpdateBlockListResponse,
180+
path_params=path_params,
181+
json=json,
157182
)
158183

159184
def check_push(

0 commit comments

Comments
 (0)