Skip to content

Commit

Permalink
Fixed LGTM warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Kharude, Sachin <sachin.kharude@here.com>
  • Loading branch information
Kharude, Sachin authored and sackh committed Aug 12, 2020
1 parent da63c6d commit 34c7100
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions xyzspaces/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,35 +436,44 @@ def __init__(

# Undocumented endpoints

def get_hub(self, params: dict = {}) -> dict:
def get_hub(self, params: dict = None) -> dict:
"""Get basic information about the XYZ Hub.
:param params: A dict holding the HTTP query parameters.
:return: A JSON object with hub information.
"""
params.update({"clientId": _CLIENT_ID})
if params is None:
params = {"clientId": _CLIENT_ID}
else:
params.update({"clientId": _CLIENT_ID})
return self.get(path="/hub", params=params).json()

# Read Spaces

def get_spaces(self, params: dict = {}) -> dict:
def get_spaces(self, params: dict = None) -> dict:
"""Get Spaces information.
:param params: A dict holding the HTTP query parameters.
:return: A JSON object with list of spaces.
"""
params.update({"clientId": _CLIENT_ID})
if params is None:
params = {"clientId": _CLIENT_ID}
else:
params.update({"clientId": _CLIENT_ID})
return self.get(path="/hub/spaces", params=params).json()

def get_space(self, space_id: str, params: dict = {}) -> dict:
def get_space(self, space_id: str, params: dict = None) -> dict:
"""Get a space by ID.
:param space_id: The desired space ID.
:param params: A dict for query params.
:return: A JSON object with information about the space_id.
"""
path = f"/hub/spaces/{space_id}"
params.update({"clientId": _CLIENT_ID})
if params is None:
params = {"clientId": _CLIENT_ID}
else:
params.update({"clientId": _CLIENT_ID})
return self.get(path=path, params=params).json()

# Edit Spaces
Expand Down

0 comments on commit 34c7100

Please sign in to comment.