Skip to content

Commit

Permalink
feat: added methods get_setting and set_setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Oct 19, 2023
1 parent 99c597b commit 858672d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions aw_client/client.py
Expand Up @@ -339,6 +339,20 @@ def query(
response = self._post(endpoint, data, params=params)
return response.json()

#
# Settings
#

def get_setting(self, key=None) -> dict:
# TODO: explicitly fetch key from server, instead of fetching all settings
settings = self._get("settings").json()
if key:
return settings.get(key, None)
return settings

def set_setting(self, key: str, value: str) -> None:
self._post(f"settings/{key}", value)

#
# Connect and disconnect
#
Expand Down

0 comments on commit 858672d

Please sign in to comment.