Skip to content

Commit

Permalink
feat: ei-3539 - Updated the list connections call to support the allo…
Browse files Browse the repository at this point in the history
…w_upload flag.
  • Loading branch information
jmayne-iotics committed Dec 9, 2024
1 parent bdb7d4e commit 5159391
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nyx_client/nyx_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,14 +937,19 @@ def delete_circle(self, circle: Circle):
"""
self.delete_circle_by_name(circle.name)

def get_connections(self) -> list[Connection]:
def get_connections(self, allow_upload: bool | None = None) -> list[Connection]:
"""Lists all connections.
Args:
allow_upload: Filter the connections by allow_upload, defaults to show all.
Returns:
A list of `Connection` objects
Raises:
requests.HTTPError: if the API request fails.
"""
connections = self._nyx_get(NYX_CONNECTIONS_ENDPOINT)
params = {"allow_upload": allow_upload} if allow_upload is not None else None
connections = self._nyx_get(NYX_CONNECTIONS_ENDPOINT, params=params)

return [Connection.from_dict(c) for c in connections]

0 comments on commit 5159391

Please sign in to comment.