Skip to content

Commit 00ff40b

Browse files
Update stream service to include the include_non_discoverable parameter
1 parent e183736 commit 00ff40b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

symphony/bdk/core/service/stream/stream_service.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,31 +136,35 @@ async def list_streams_one_page(skip, limit):
136136

137137
@retry
138138
async def search_rooms(self, query: V2RoomSearchCriteria, skip: int = 0,
139-
limit: int = 50) -> V3RoomSearchResults:
139+
limit: int = 50, include_non_discoverable=False) -> V3RoomSearchResults:
140140
"""Search for rooms according to the specified criteria.
141141
Wraps the `Search Rooms V3 <https://developers.symphony.com/restapi/reference/search-rooms-v3>`_ endpoint.
142142
143143
:param query: the search criteria.
144144
:param skip: number of rooms to skip, defaults to 0.
145145
:param limit: number of maximum rooms to return. Must be a positive integer that does not exceed 100.
146+
:param include_non_discoverable: set to `True` to include rooms not publicly searchable, false by default.
146147
:return: the rooms matching search criteria.
147148
"""
148149
return await self._streams_api.v3_room_search_post(query=query, skip=skip, limit=limit,
150+
include_non_discoverable=include_non_discoverable,
149151
session_token=await self._auth_session.session_token)
150152

151153
async def search_all_rooms(self, query: V2RoomSearchCriteria, chunk_size: int = 50,
152-
max_number: int = None) -> AsyncGenerator[V3RoomDetail, None]:
154+
max_number: int = None, include_non_discoverable : bool = False)\
155+
-> AsyncGenerator[V3RoomDetail, None]:
153156
"""Search for rooms according to the specified criteria.
154157
Wraps the `Search Rooms V3 <https://developers.symphony.com/restapi/reference/search-rooms-v3>`_ endpoint.
155158
156159
:param query: the search criteria.
157160
:param chunk_size: the maximum number of elements to retrieve in one underlying HTTP call.
158161
:param max_number: the total maximum number of elements to retrieve.
162+
:param include_non_discoverable: set to `True` to include rooms not publicly searchable, false by default.
159163
:return: an asynchronous generator of the rooms matching the search criteria.
160164
"""
161165

162166
async def search_rooms_one_page(skip, limit):
163-
result = await self.search_rooms(query, skip, limit)
167+
result = await self.search_rooms(query, skip, limit, include_non_discoverable)
164168
return result.rooms if result.rooms else None
165169

166170
return offset_based_pagination(search_rooms_one_page, chunk_size, max_number)

0 commit comments

Comments
 (0)